Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

DataObjectManager Module

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

ffmpeg


Go to End
Reply

28 Posts   2941 Views

Avatar
dacar

15 October 2010 at 12:03am Community Member, 168 Posts

Hi i am using DOM to Upload Videos to my server. ffmpeg ist installed properly:

ffmpeg_log.txt:

[2010-10-14 12:08:15] /usr/local/bin/ffmpeg
[2010-10-14 12:08:15] FFmpeg version 0.6, Copyright (c) 2000-2010 the FFmpeg developers
built on Oct 13 2010 14:32:14 with gcc 4.2.1 20070719 [FreeBSD]
configuration: --prefix=/usr/local --mandir=/usr/local/man --enable-shared --enable-gpl --enable-postproc --enable-avfilter --enable-avfilter-lavf --enable-pthreads --enable-x11grab --enable-memalign-hack --cc=cc --extra-cflags=-msse -I/usr/local/include --extra-ldflags=-L/usr/local/lib --extra-libs=-pthread --disable-debug --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libdirac --disable-libfaac --disable-libfaad --disable-ffserver --disable-libgsm --disable-libmp3lame --disable-libopenjpeg --disable-libschroedinger --disable-ffplay --disable-libspeex --disable-libtheora --disable-libvorbis --disable-libvpx --disable-libx264 --disable-libxvid
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.19. 0 / 1.19. 0
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0
Use -h to get full help or, even better, run 'man ffmpeg'
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

But everytime i upload anvideo, FileDataObjectManager.php doesnt change the ClassName
Every time "File" is saved to file.ClassName.

         // Provide an "upgrade" to File subclasses
         if($file->class == "File") {
            $ext = strtolower($file->Extension);
            if(in_array($ext, MP3::$allowed_file_types) && FileDataObjectManager::$upgrade_audio)
               $file = $file->newClassInstance("MP3");
            else if(in_array($ext, array('jpg','jpeg','gif','png')) && FileDataObjectManager::$upgrade_image)
               $file = $file->newClassInstance("Image");
            else if(in_array($ext, FLV::$allowed_file_types) && FileDataObjectManager::$upgrade_video)
               $file = $file->newClassInstance("FLV");
         }

Can anybody help to debug this?

Avatar
UncleCheese

15 October 2010 at 2:35am 4085 Posts

I would just cast that relationship as "FLV" instead of file. That way you don't have to worry about the automatic update.

--------------------
SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com

Avatar
dacar

15 October 2010 at 10:29pm (Last edited: 15 October 2010 10:43pm), Community Member, 168 Posts

thanks for your reply. But casting the relationship does not help. after uploading Logos.mpg the data was written correctely into DB: ClassName = FLV. But FileName is still: assets/Uploads/Logos.mpg. And because of this the play does not find the movie to play it. The player is looking for: assets/Uploads/Logos.flv.

Shouldn't the player except the following filetypes:

   public static $allowed_file_types = array(
      'flv','avi','mov','mpeg','mpg','m4a'
   );

Hope you can show me how to use this coole feature.

Greetings, Carsten.

EDIT: On your youtube video it seems to work aout of the box ([url]http://www.youtube.com/watch?v=12iZM1IZ8Ec&feature=player_embedded[/url])?

Avatar
dacar

18 October 2010 at 11:07pm Community Member, 168 Posts

hi, it is still frustrating. I have asked my provider to run the following by shell: ffmpeg -i Logos3.mpg -f flv -y test.flv
And the Logos3.mpg has been transformed to test.flv. So i can be sure FFMPEG is running. But why are my uploads not transformed to .flv? What do i have to do that the right ClassName ist being used automatically? As i mentioned above: Just casting the relatinonship as FLV doesn't make the trick!

Please, isn't there anybody out there who can help?

Greetings, Carsten.

Avatar
UncleCheese

19 October 2010 at 2:03am 4085 Posts

Are you using Uploadify or SWFUpload?

Avatar
dacar

19 October 2010 at 4:09am Community Member, 168 Posts

hi, it is uploadify.

Avatar
dacar

19 October 2010 at 8:37pm Community Member, 168 Posts

Hi uncle cheese,

i think the usage of the new uploadify module [url][/url] is forcing the "className" problem.
The ClassName is rewritten in handleswfupload() Line 688 of dataobject_manager/Code/FileDataObjectManager.php

// Provide an "upgrade" to File subclasses
         if($file->class == "File") {
            $ext = strtolower($file->Extension);
            if(in_array($ext, MP3::$allowed_file_types) && FileDataObjectManager::$upgrade_audio)
               $file = $file->newClassInstance("MP3");
            else if(in_array($ext, array('jpg','jpeg','gif','png')) && FileDataObjectManager::$upgrade_image)
               $file = $file->newClassInstance("Image");
            else if(in_array($ext, FLV::$allowed_file_types) && FileDataObjectManager::$upgrade_video)
               $file = $file->newClassInstance("FLV");
         }


But there is no function for uploadify. I think there must be a similar function in uploadify/code/MultipleFileUploadField.php.
Probably within the Files() function Lines 135+

Greetings from Germany, Carsten.

Avatar
UncleCheese

20 October 2010 at 2:57am 4085 Posts

Hi, Carsten,

Could you please post the code you're using? I suspect you don't have the model set up right, because I'm not able to replicate this issue...

--------------------
SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com

Go to Top