Kaltura utilizes both ffmpeg and mencoder?!

3 replies [Last post]
Joined: 06/29/2009
Points: 93

Reference:
http://www.kaltura.org/how-enable-h264-kaltura-ce

I am editing the conversion params in the DB. under conversion params table in the custom_data col with this:a:7:{s:20:"commercialTranscoder";s:1:"0";s:12:"ffmpegParams";s:26:"-s svga -pass 1 -threads 0";s:14:"mencoderParams";s:0:"";s:10:"flixParams";s:0:"";s:9:"framerate";s:5:"29.97";s:13:"audioChannels";i:2;s:17:"audioSamplingRate";i:22050;}

The Issue:
If I leave the custom_data as is and convert a video it only use's FFMPEG for conversion
(
[ffmpeg] :
-r 25 -b 400k -g 100 -ar 22050 -ac 2 -y
[ffmpeg] :
-r 25 -b 400k -g 5 -ar 22050 -ac 2 -y
)...

However, when custom FFMPEG params are added it utillizes both FFMPEG and mencoder:
(
[ffmpeg] :
-r 29.97 -b 400k -g 100 -ar 22050 -ac 2 -s svga -pass 1 -threads 0 -y
[mencoder] :
-of lavf -ofps 29.97 -oac mp3lame -srate 22050 -ovc lavc -lavcopts
vcodec=flv:vbitrate=400:mbd=2:mv0:trell:v4mv:cbp:last_pred=3:keyint=100
[mencoder] :
-of lavf -ofps 29.97 -oac mp3lame -srate 22050 -ovc lavc -lavcopts
vcodec=flv:vbitrate=400:mbd=2:mv0:trell:v4mv:cbp:last_pred=3:keyint=5
)...

Any ideas?

Joined: 08/12/2009
Points: 40

Since ffmpeg may fail on some conversions (unknown codec, bad settings, etc.), mencoder is there as a fail-safe. If the conversion fails with ffmpeg, Kaltura tries once again with mencoder.

So I guess there's something wrong about your ffmpeg configuration. Can you check your logs and see what happened?

Joined: 06/29/2009
Points: 93

Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
/var/www/frameworks/kalturaCE/kaltura/alpha/../bin/ffmpeg/ffmpeg: line 5: 5870 Segmentation fault LD_LIBRARY_PATH=$KALTURA_BIN_FFMPEG $KALTURA_BIN_FFMPEG/ffmpeg "$@"

Maybe recompile FFMPEG using gcc >= 4.2. ?

Conversion custom params:

a:7:{s:20:"commercialTranscoder";s:1:"0";s:12:"ffmpegParams";s:10:"-threads 0";s:14:"mencoderParams";s:0:"";s:10:"flixParams";s:0:"";s:9:"framerate";s:5:"29.97";s:13:"audioChannels";i:2;s:17:"audioSamplingRate";i:22050;}

If I leave the params like so:
a:7:{s:20:"commercialTranscoder";s:1:"0";s:12:"ffmpegParams";s:0:"";s:14:"mencoderParams";s:0:"";s:10:"flixParams";s:0:"";s:9:"framerate";s:5:"29.97";s:13:"audioChannels";i:2;s:17:"audioSamplingRate";i:22050;}
no issues...

----------------------
/var/www/frameworks/kalturaCE/kaltura/alpha/../bin/ffmpeg/ffmpeg -i "/var/www/frameworks/kalturaCE//archive/data//0/0/9oofvrlnx0.flv" -r 29.97 -b 400k -g 15 -ar 22050 -ac 2 -threads 0 -y "/var/www/frameworks/kalturaCE//content/entry/data/0/0/9oofvrlnx0_100000.flv" 2>>"/var/www/frameworks/kalturaCE//content/entry/data/0/0/9oofvrlnx0_100000.flv.log"
----------------------

----------------------
-r 29.97 -b 400k -g 15 -ar 22050 -ac 2 -threads 0 -y
----------------------

FFmpeg version 0.5, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --arch=i386 --extra-cflags=-O2 --enable-bzlib --disable-devices --enable-libfaac --enable-libfaad --enable-libgsm --enable-libmp3lame --enable-libschroedinger --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-avfilter --enable-avfilter-lavf --enable-postproc --enable-swscale --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-optimizations --disable-stripping --shlibdir=/usr/lib --cpu=i386
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.20. 0 / 52.20. 0
libavformat 52.31. 0 / 52.31. 0
libavdevice 52. 1. 0 / 52. 1. 0
libavfilter 0. 4. 0 / 0. 4. 0
libswscale 0. 7. 1 / 0. 7. 1
libpostproc 51. 2. 0 / 51. 2. 0
built on Jul 1 2009 11:44:09, gcc: 3.4.6 20060404 (Red Hat 3.4.6-10)
Compiler did not align stack variables. Libavcodec has been miscompiled
and may be very slow or crash. This is not a bug in libavcodec,
but in the compiler. You may try recompiling using gcc >= 4.2.
Do not report crashes to FFmpeg developers.

Seems stream 0 codec frame rate differs from container frame rate: 60.00 (60/1) -> 30.00 (30/1)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/var/www/frameworks/kalturaCE//archive/data//0/0/9oofvrlnx0.flv':
Duration: 00:00:15.16, start: 0.033333, bitrate: 1940 kb/s
Stream #0.0(eng): Video: h264, yuv420p, 1680x1050, 30 tbr, 30 tbn, 60 tbc
Output #0, flv, to '/var/www/frameworks/kalturaCE//content/entry/data/0/0/9oofvrlnx0_100000.flv':
Stream #0.0(eng): Video: flv, yuv420p, 1680x1050, q=2-31, 400 kb/s, 90k tbn, 29.97 tbc
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
/var/www/frameworks/kalturaCE/kaltura/alpha/../bin/ffmpeg/ffmpeg: line 5: 5870 Segmentation fault LD_LIBRARY_PATH=$KALTURA_BIN_FFMPEG $KALTURA_BIN_FFMPEG/ffmpeg "$@"

----------------------
/var/www/frameworks/kalturaCE/kaltura/alpha/../bin/mencoder/mencoder "/var/www/frameworks/kalturaCE//archive/data//0/0/9oofvrlnx0.flv" -of lavf -ofps 29.97 -oac mp3lame -srate 22050 -ovc lavc -lavcopts vcodec=flv:vbitrate=400:mbd=2:mv0:trell:v4mv:cbp:last_pred=3:keyint=15 -o "/var/www/frameworks/kalturaCE//content/entry/data/0/0/9oofvrlnx0_100000.flv" 2>>"/var/www/frameworks/kalturaCE//content/entry/data/0/0/9oofvrlnx0_100000.flv.log"
----------------------

----------------------
-of lavf -ofps 29.97 -oac mp3lame -srate 22050 -ovc lavc -lavcopts vcodec=flv:vbitrate=400:mbd=2:mv0:trell:v4mv:cbp:last_pred=3:keyint=15
----------------------

** MUXER_LAVF *****************************************************************
REMEMBER: MEncoder's libavformat muxing is presently broken and can generate
INCORRECT files in the presence of B-frames. Moreover, due to bugs MPlayer
will play these INCORRECT files as if nothing were wrong!
*******************************************************************************
Compiler did not align stack variables. Libavcodec has been miscompiled
and may be very slow or crash. This is not a bug in libavcodec,
but in the compiler. You may try recompiling using gcc >= 4.2.
Do not report crashes to FFmpeg developers.
[flv @ 0x9f24d30]Codec for stream 0 does not use global headers but container format requires global headers

Joined: 08/12/2009
Points: 40

Well, it seems that your ffmpeg makes a segfault for some reason. You may try to adjust your settings to see which one makes it crash.