[FFmpeg-devel] ffmpeg detects wrong framerate

Jason Self jason.self
Wed Jun 24 05:56:23 CEST 2009

I am trying to transcode a .vob file from a DVD to a .mkv file
containing Theora video and Vorbis audio. The problem that I
encountered is that the resulting file looks like it's playing twice
as fast as it's supposed to.

jason$ ffmpeg -i /Users/jason/Movies/TV\ Shows/Holding\
Area/KUNG_FU_PANDA.VOB -f Matroska -vcodec libtheora -ar 44100 -ab
128K -ac 2 -acodec libvorbis ~/Desktop/test.mkv
FFmpeg version SVN-r19258, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --enable-gpl --enable-postproc --enable-libvorbis
--enable-libtheora --enable-pthreads
  libavutil     50. 3. 0 / 50. 3. 0
  libavcodec    52.32. 0 / 52.32. 0
  libavformat   52.34. 1 / 52.34. 1
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0. 7. 1 /  0. 7. 1
  libpostproc   51. 2. 0 / 51. 2. 0
  built on Jun 23 2009 20:43:19, gcc: 4.0.1 (Apple Inc. build 5465)
Input #0, mpeg, from '/Users/jason/Movies/TV Shows/Holding
  Duration: N/A, start: 0.280633, bitrate: N/A
    Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720x480 [PAR 32:27
DAR 16:9], 9800 kb/s, 59.94 tbr, 90k tbn, 59.94 tbc
    Stream #0.1[0x80]: Audio: ac3, 48000 Hz, 5.1, s16, 384 kb/s
Output #0, matroska, to '/Users/jason/Desktop/test.mkv':
    Stream #0.0: Video: libtheora, yuv420p, 720x480 [PAR 32:27 DAR
16:9], q=2-31, 200 kb/s, 1k tbn, 59.94 tbc
    Stream #0.1: Audio: libvorbis, 44100 Hz, 2 channels, s16, 128 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Press [q] to stop encoding
frame=  619 fps= 17 q=0.0 Lsize=    1191kB time=10.33 bitrate= 944.9kbits/s
video:761kB audio:401kB global headers:7kB muxing overhead 1.952109%

BTW: The 59.94 shown is not the correct frame rate.

The problem is reproducible for ogg, mkv and mov if libtheora is used
(audio codec does not matter). Other video codecs work fine.

Something that I thought was interesting is that I can pipe ffmpeg to
the Theora reference encoder and can make it work fine with Ogg and
Theora even though that doesn't happen inside ffmpeg proper.

ffmpeg -i kfp_small.vob -croptop 56 -cropbottom 56  -aspect 2.35 -r
24000:1001 -f yuv4mpegpipe - | sh
libtheora-1.1alpha2/examples/encoder_example -v 9 - -o small.ogv

ffmpeg -i kfp_small.vob -vn -ac 6 -f wav - | oggenc -R 48000 -C 6 - -o out.ogg

oggz-merge -o kfp_small.ogv small.ogv out.ogg

I can also encode this file this using HandBrake 0.9.3 (which uses
libavcodec and libavformat from the FFmpeg project) and the frame rate
is correct.

So it seems limited to just ffmpeg itself where it most likely
attempts to decode the stream at ~60fps (2 x 29.970) for some reason.

Sample input file has been placed at upload.ffmpeg.org/MPlayer/incoming/jxself.

The entire reason I'm mentioning this is that I'm actually trying to
do the encoding with ffmpeg2theora. Since ffmpeg proper decodes the
video at ~60fps for some reason, ffmpeg2theora inherits the same
problem (and it doesn't provide a -r switch like ffmpeg proper does),
so I'm hoping to get this fixed "upsteam" so to speak so that
ffmpeg2theora can then inherit this fix.

More information about the ffmpeg-devel mailing list