[MEncoder-users] Missing Keyframes

Chris Ferry chris at futuredead.com
Fri Feb 22 23:08:37 CET 2008


Background:

Convert any type of video to FLV format

tag with flvtool2 or flvmeta and play...

Problem:

After moving from the stock ubuntu 6.06 LTS  
mencoder( 0.99+1.0pre7try2+cvs20060117-0ubuntu8 ) to 1.0rc2(also tried  
SVN from today with same results).
With the custom mencoder I've seen several examples of videos playing  
at 2-3 times their normal speed.

Upon inspecting the output from flvtool2 and flvdump I noticed that  
Keyframes would just stop.

Customer mencoder configure:
Config files successfully generated by ./configure --prefix=/opt/video  
--disable-mplayer --with-extraincdir=/opt/video/include --with- 
extralibdir=/opt/video/lib !

   Install prefix: /opt/video
   Data directory: /opt/video/share/mplayer
   Config direct.: /opt/video/etc/mplayer

   Byte order: little-endian
   Optimizing for: pentium3

   Languages:
     Messages/GUI: en
     Manual pages: en

   Enabled optional drivers:
     Input: ftp tv-teletext tv-v4l2 tv-v4l tv libdvdcss(internal)  
dvdread(internal) vcd dvb network
     Codecs: x264 xvid libdv libavcodec qtx real xanim win32 faad2  
faac libmpeg2 liba52 mp3lib tremor(internal)
     Audio output: oss mpegpes(dvb)
     Video output: pnm jpeg png mpegpes(dvb) fbdev xvidix cvidix x11  
xover md5sum tga
     Audio filters:
   Disabled optional drivers:
     Input: dvdnav vstream pvr radio live555 nemesi cddb cdda smb
     Codecs: libamr_wb libamr_nb musepack libdca libtheora speex  
toolame twolame libmad liblzo gif
     Audio output: sun alsa openal jack polyp esd arts v4l2 ivtv dxr2  
nas sdl
     Video output: v4l2 ivtv dxr3 dxr2 sdl vesa gif89a zr zr2 svga  
caca aa ggi xmga mga winvidix opengl 3dfx dga xvmc xv dfbmga directfb  
bl xvr100 tdfx_vid s3fb tdfxfb
     Audio filters: ladspa


Example:

mencoder encoding:

/opt/video/bin/mencoder video.avi -ofps 25 -o video.flv -of lavf -oac  
mp3lame -lameopts vbr=2:q=8:aq=0:mode=1:lowpassfreq=16300 -channels 2 - 
srate 22050 -ovc lavc -lavcopts  
vcodec=flv:keyint=50:vbitrate=400:mbd=2:mv0:trell:v4mv:cbp:aic -vf  
scale=455:-2'

flvdump(partial output):

  keyframes => {
         times: [
             0.000000
             2.000000
             2.800000
        ...
	    14.200000
             16.200000
             18.200000
             20.200000
             22.200000
         ]
         filepositions: [
             1047.000000
             164668.000000
             215081.000000
      ...
             932955.000000
             1076965.000000
             1202701.000000
             1355104.000000
             1465038.000000
         ]
     }

Now using the stock ubuntu mencoder:
/usr/bin/mencoder video.avi -ofps 25  -lavfopts  
i_certify_that_my_video_stream_does_not_use_b_frames -o video.flv -of  
lavf -oac mp3lame -lameopts vbr=2:q=8:aq=0:mode=1:lowpassfreq=16300 - 
channels 2 -srate 22050 -ovc lavc -lavcopts  
vcodec=flv:keyint=50:vbitrate=400:mbd=2:mv0:trell:v4mv:cbp:aic -vf  
scale=455:-2

flvdump(partial output):
  keyframes => {
         times: [
             0.000000
             1.320000
             1.840000
             ....
             43.240000
             43.360000
             46.600000
             47.840000
             52.800000
         ]
         filepositions: [
             1968.000000
             77600.000000
             100434.000000
   	    .....
	     1347315.00000
              1351816.000000
              1483224.000000
              1509498.000000
              1616857.000000
         ]
     }
}

As you can see the older mencoder seems to add the proper # of  
keyframes.  flvmeta returns the proper duration, but does not find the  
keyframes?
For the particular example the video codec is mjpeg and the audio  
codec is pcm_u8.

The big difference between two calls is the omission of "-lavfopts  
i_certify_that_my_video_stream_does_not_use_b_frames"   which from  
what I've read isn't necessary with mencoder 1.0 or greater?

Any ideas why the keyframes aren't being generated or is this an issue  
with these flv metadata injectors?

NOTE:  We need to use the recent mencoder as we noticed performance  
and quality issues with the stock mencoder.

Please let me know if you require any additional information.

Thanks

Chris




More information about the MEncoder-users mailing list