FFMpeg doesn't generate thumbs for video

mamouneyya

Joined: 2009-11-02
Posts: 337
Posted: Fri, 2010-03-12 21:46

I don't know what is the problem. FFMpeg is installed on my server, and its path is correctly set in the advanced settings. However, no thumbs are generated for my uploaded videos. I have tried with more than ten videos (from the both formats .flv & .mp4).

Any help is greatly appreciated.
Thanks in advanced.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 6136
Posted: Sat, 2010-03-13 13:09

Is ffmpeg executable by the webserver?
Does it work from commandline?

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
mamouneyya

Joined: 2009-11-02
Posts: 337
Posted: Sat, 2010-03-13 13:18

Could you please give me a command to test that?

By the way, the uploaded videos have different dimensions. Is that enough to make sure that it works?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 6136
Posted: Sat, 2010-03-13 13:48

ffmpeg -i inputfile.flv -ss 1.00 -f mjpeg -vframes 1 -y -s 350x150 outputfile.jpg

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
mamouneyya

Joined: 2009-11-02
Posts: 337
Posted: Sat, 2010-03-13 13:59
*****@*****.com [~/public_html/gallery/var/albums]# ls
./
../
.htaccess
french-noword-song.flv
test-1238434342/

*****@*****.com [~/public_html/gallery/var/albums]# ffmpeg -i french-noword-song.flv -ss 1.00 -f mjpeg -vframes 1 -y -s 350x150 test_thumb.jpg
-jailshell: ffmpeg: command not found

..?! Does that mean it is non-executable?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 6136
Posted: Sat, 2010-03-13 14:05
Quote:
Jailshell is a very limited shell that allows clients to logon to your server via SSH. It limits them to their home directories, keeping the rest of your files on your server from being viewed. Still use caution when giving users shell accounts on your server, as it's likely possible to breakout of the jailshell.

try using the full system path to ffmpeg in your command

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
mamouneyya

Joined: 2009-11-02
Posts: 337
Posted: Sat, 2010-03-13 14:24

I couldn't get it to work. Looks like it's because the Jailshell limitations:

*****@*****.com [~/public_html/gallery/var/albums]# whereis ffmpeg
ffmpeg: /usr/bin/ffmpeg /usr/local/bin/ffmpeg

*****@***** [~/public_html/gallery/var/albums]# /usr/local/bin/ffmpeg -i french-noword-song.flv -ss 1.00 -f mjpeg -vframes 1 -y -s 350x150 test_thumb.jpg
-jailshell: /usr/local/bin/ffmpeg: No such file or directory
*****@*****.com [~/public_html/gallery/var/albums]# /usr/bin/ffmpeg -i french-noword-song.flv -ss 1.00 -f mjpeg -vframes 1 -y -s 350x150 test_thumb.jpg
-jailshell: /usr/bin/ffmpeg: No such file or directory

FFMpeg is there, when I press 'tab' the command line completes the mentioned path components itself.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 6136
Posted: Sat, 2010-03-13 14:41

just because you believe the binary is there, does not mean gallery can execute it.
could be an open_basedir limitation or the binary and supporting libraries may not be 755
G2 2.3 tightened restrictions w/ open_basedir G3 may also respect the limits.
Ask your host.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
mamouneyya

Joined: 2009-11-02
Posts: 337
Posted: Sat, 2010-03-13 15:17

I've tried now using the FFMpeg test functionality of my Gallery 2, and I see it successfully passes the test:

FFMPEG binary test results

Binary Name	 Pass/Fail
ffmpeg	
Passed
Supported MIME Types

The FFMPEG module can decode files of the following MIME types

video/x-ms-asf
video/x-msvideo
video/x-flv
video/quicktime
video/mp4
video/mpeg
The FFMPEG module can encode files to the following MIME types

video/x-flv

Missing required audio codec, encoded videos will not contain sound.
Version Information

FFmpeg version SVN-r14473, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --prefix=/usr/local/cpffmpeg --enable-shared --enable-nonfree --enable-gpl --enable-pthreads --enable-liba52 --enable-libamr-nb --enable-libamr-wb --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --extra-cflags=-I/usr/local/cpffmpeg/include/ --extra-ldflags=-L/usr/local/cpffmpeg/lib --enable-cross-compile
libavutil version: 49.7.0
libavcodec version: 51.62.0
libavformat version: 52.18.0
libavdevice version: 52.0.0
built on Nov 26 2009 01:47:18, gcc: 4.1.2 20080704 (Red Hat 4.1.2-46)

I've also tried using a pre-compiled package you mentioned in another thread, but I got the same results. It passes the test of Gallery 2, doesn't generate thumbs on Gallery 3.

About open_basedir, to what it should be set? I see 'no value' now in my phpinfo.

Thanks.

 
mamouneyya

Joined: 2009-11-02
Posts: 337
Posted: Sat, 2010-03-13 15:30

OK. My Gallery 2 installation was empty, just for testing.. but I've tried now to upload one of the videos that FFMpeg on my Gallery 3 fails to generate a thumb for it, and it worked with no problem. So, we can make sure now it isn't a problem with FFMpeg package it-self as I think(?).

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 6136
Posted: Sat, 2010-03-13 15:55

Yup sounds like a G3 issue, but not sure what.
any signs in var/log?

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
mamouneyya

Joined: 2009-11-02
Posts: 337
Posted: Sat, 2010-03-13 16:12

Nothing related to the fail of thumb generation process it-self. All errors that I can see are something like:

2010-03-13 07:41:03 -08:00 --- error: Kohana_404_Exception [ 43 ]: The page you requested, file_proxy/[album directory name]/[movie name].jpg, could not be found.
/home/saran/public_html/gallery/modules/gallery/controllers/file_proxy.php [ 89 ]
#0 [internal function]: File_Proxy_Controller->__call('[album directory name]', Array)
#1 /home/saran/public_html/gallery/system/core/Kohana.php(331): ReflectionMethod->invokeArgs(Object(File_Proxy_Controller), Array)
#2 [internal function]: Kohana_Core::instance(NULL)
#3 /home/saran/public_html/gallery/system/core/Event.php(208): call_user_func_array(Array, Array)
#4 /home/saran/public_html/gallery/application/Bootstrap.php(67): Event_Core::run('system.execute')
#5 /home/saran/public_html/gallery/index.php(91): require('/home/*****/pub...')
#6 {main}

which says, as I understand, that Gallery couldn't find the thumb.. (so it wasn't generated(?).)

Also I see this error:

2010-03-13 07:52:28 -08:00 --- error: Kohana_404_Exception [ 43 ]: The page you requested, rss/feed/gallery/album/1, could not be found.
/home/saran/public_html/gallery/modules/gallery/helpers/access.php [ 123 ]
#0 /home/saran/public_html/gallery/modules/gallery/helpers/gallery_rss.php(49): access_Core::required('view', Object(Item_Model))
#1 [internal function]: gallery_rss_Core::feed('album', 0, 20, '1')
#2 /home/saran/public_html/gallery/modules/rss/controllers/rss.php(38): call_user_func(Array, 'album', 0, 20, '1')
#3 [internal function]: Rss_Controller->feed('gallery', 'album', '1')
#4 /home/saran/public_html/gallery/system/core/Kohana.php(331): ReflectionMethod->invokeArgs(Object(Rss_Controller), Array)
#5 [internal function]: Kohana_Core::instance(NULL)
#6 /home/saran/public_html/gallery/system/core/Event.php(208): call_user_func_array(Array, Array)
#7 /home/saran/public_html/gallery/application/Bootstrap.php(67): Event_Core::run('system.execute')
#8 /home/saran/public_html/gallery/index.php(91): require('/home/*****/pub...')
#9 {main}

but it doesn't seem to be related to my problem.

I didn't find anything related in Server Error Log, too.

 
mamouneyya

Joined: 2009-11-02
Posts: 337
Posted: Sat, 2010-03-13 16:21

Oh! I've just tried to give the guests a 'view' permission, and all video thumbnails have been shown!
Looks like it's a bug in Gallery 3. I will report it now..

Thanks for your help :)

 
mamouneyya

Joined: 2009-11-02
Posts: 337
Posted: Sat, 2010-03-13 16:28
 
Verre

Joined: 2010-03-02
Posts: 20
Posted: Mon, 2010-03-15 16:16

I have problem also. My thumb gets generated correctly and I can hear voice on the video but I can see it. Any ideas?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 6136
Posted: Mon, 2010-03-15 16:36
 
Verre

Joined: 2010-03-02
Posts: 20
Posted: Mon, 2010-03-15 17:10

Yeah I forgot to mention. The video file is .mp4.
I tried serveradd and enabling module videodimensions.
Video won't still show. FFmpeg is installed and as I said it generates thumb normally.
And I can hear the voice but don't see video.
And my gallery is Gallery3 rc1 with latest updates from git

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 6136
Posted: Mon, 2010-03-15 18:50

did you not read the comment I referred above?
the part about the video codec needing to be H.264
plain vanilla mp4 will not play in flash players.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
mamouneyya

Joined: 2009-11-02
Posts: 337
Posted: Mon, 2010-03-15 18:59

I am wondering why the developers don't use FFMpeg capabilities to convert any unsupported video, instead of making Gallery supports a very limited types. Isn't that easy with FFMpeg?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 6136
Posted: Mon, 2010-03-15 19:15

Not that many hosts offer ffmpeg especially these cheap hosts.
And then even fewer ffmpeg binaries will have the capabilities to transcode leading to more support requests.

I maintain the current working transcode module for G2

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
mamouneyya

Joined: 2009-11-02
Posts: 337
Posted: Mon, 2010-03-15 19:27

Isn't it easy as that who don't have FFMpeg cannot use this, and who have it can? If so why you let those who have FFmpeg on their host loose such useful functionality?

 
Verre

Joined: 2010-03-02
Posts: 20
Posted: Tue, 2010-03-16 10:47

I agree with mamouneyya. I have my own server and would love to use what I already have instead of having to convert all my hundreds of videos
to a specific codec or completely other format