[FFmpeg-user] h264 frame rate detection

Jan Pohanka xhpohanka at gmail.com
Thu Apr 12 07:41:17 CEST 2012


Hello,

I want to use ffmpeg to format a raw h264 stream to some container (mkv,
mp4, flv, ...). Unfortunately it seems that ffmpeg has problems with
analyzing the frame rate of the stream. I have found a description of this
issue in the mailing list or somewhere on the internet, but no solution
have been provided there...

My raw stream was encoded on TI dm365 multimedia processor with the
time_scale = 5000 and  num_units_in_tick = 1000. As far as I know this
should imply fps = 5 (5000/1000). Ffmpeg gives a message that codec frame
rate differs from the container frame rate

ffmpeg -i test.264
ffmpeg version 0.9, Copyright (c) 2000-2011 the FFmpeg developers
       built on Mar 12 2012 14:02:26 with gcc 4.6.1
       configuration: --enable-gpl --enable-nonfree --enable-version3
--enable-bzlib --enable-frei0r --enable-gnutls --enable-libass
--enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libdc1394 --enable-libfreetype --enable-libgsm
--enable-libmodplug --enable-libmp3lame --enable-libopenjpeg
--enable-libpulse --enable-librtmp --enable-libschroedinger
--enable-libspeex --enable-libtheora --enable-libv4l2
--enable-libvo-aacenc --enable-libvorbis --enable-libvpx --enable-libx264
--enable-libxvid --enable-openssl --enable-zlib --extra-cflags=-I../x264
       libavutil    51. 32. 0 / 51. 32. 0
       libavcodec   53. 42. 0 / 53. 42. 0
       libavformat  53. 24. 0 / 53. 24. 0
       libavdevice  53.  4. 0 / 53.  4. 0
       libavfilter   2. 53. 0 /  2. 53. 0
       libswscale    2.  1. 0 /  2.  1. 0
       libpostproc  51.  2. 0 / 51.  2. 0
[h264 @ 0x1d36f20] max_analyze_duration 5000000 reached at 5200000
[h264 @ 0x1d36f20] Estimating duration from bitrate, this may be inaccurate

Seems stream 0 codec frame rate differs from container frame rate: 5.00
(5/1) -> 2.50 (5/2)
Input #0, h264, from 'test.264':
       Duration: N/A, bitrate: N/A
         Stream #0:0: Video: h264 (High), yuvj420p, 1600x1200, 2.50 fps,  
2.50
tbr, 1200k tbn, 5 tbc

When I try to play this file with ffplay it is surprisingly played
correctly on 5 fps (seconds on the watch on the video are really seconds)
but the command line still informs about 2.50 fps.

However after formating the stream to a container
ffmpeg -i test.264 -c:v copy -y test.mkv
the resulting file is played on the 2.5 fps in all players, which I have.
Forcing frame rate with -r parameter as described in documentation has no
effect.

Could please someone give me some advice how to solve this issue? The test
file could be downloaded on this link
http://dl.dropbox.com/u/72776563/test.264
best regards
Jan

-- 
Tato zpráva byla vytvořena převratným poštovním klientem Opery:
http://www.opera.com/mail/


More information about the ffmpeg-user mailing list