[FFmpeg-user] h264 frame rate detection

Jan Pohanka xhpohanka at gmail.com
Thu Apr 12 10:43:59 CEST 2012


Hello Carl,

I have tried it again with last git master head

>> 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.
>
> Can you confirm that this is also true for ffplay and that
> ffmpeg -i test.mkv out.avi produces an incorrectly playing file?
>

The steps to reproduce are:
1. get the new raw video test.264
2. ffplay test.264
The video is played with the correct speed (5 fps) even if the ffplay  
informs about 2.50 fps (see bellow)

ffplay version N-39733-g733cf0a Copyright (c) 2003-2012 the FFmpeg  
developers
   built on Apr 12 2012 10:26:12 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. 46.100 / 51. 46.100
   libavcodec     54. 14.101 / 54. 14.101
   libavformat    54.  3.100 / 54.  3.100
   libavdevice    53.  4.100 / 53.  4.100
   libavfilter     2. 67.101 /  2. 67.101
   libswscale      2.  1.100 /  2.  1.100
   libswresample   0. 11.100 /  0. 11.100
   libpostproc    52.  0.100 / 52.  0.100
[h264 @ 0x2dc5280] max_analyze_duration 5000000 reached at 5200000
[h264 @ 0x2dc5280] Estimating duration from bitrate, this may be inaccurate
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
[buffersink @ 0x2de6040] auto-inserting filter 'auto-inserted scale 0'  
between the filter 'src' and the filter 'out'
[scale @ 0x2de67a0] w:1600 h:1200 fmt:yuvj420p sar:0/1 -> w:1600 h:1200  
fmt:yuv420p sar:0/1 flags:0x4
    6.89 A-V:  0.000 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0   0/0

3. ffmpeg -i test.264 -c:v copy -y test.avi
...
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
Output #0, avi, to 'test.avi':
   Metadata:
     ISFT            : Lavf54.3.100
     Stream #0:0: Video: h264 (H264 / 0x34363248), yuvj420p, 1600x1200,  
q=2-31, 2.50 fps, 5 tbn, 5 tbc
Stream mapping:
   Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame=   22 fps=0.0 q=-1.0 Lsize=      84kB time=00:00:08.20 bitrate=   
83.8kbits/s
video:77kB audio:0kB global headers:0kB muxing overhead 8.611181%

4. ffplay test.avi
Now the video is played 2 times slowly BUT the ffplay informs about 5 fps  
- this is new in current git master

...
Input #0, avi, from 'test.avi':
   Metadata:
     encoder         : Lavf54.3.100
   Duration: 00:00:08.20, start: 0.000000, bitrate: 83 kb/s
     Stream #0:0: Video: h264 (High) (H264 / 0x34363248), yuvj420p,  
1600x1200, 5 fps, 5 tbr, 5 tbn, 5 tbc
[buffersink @ 0x302b7e0] auto-inserting filter 'auto-inserted scale 0'  
between the filter 'src' and the filter 'out'
[scale @ 0x302bf20] w:1600 h:1200 fmt:yuvj420p sar:0/1 -> w:1600 h:1200  
fmt:yuv420p sar:0/1 flags:0x4

5. ffmpeg -i test.264 -c:v copy -y test.mkv
6. ffplay test.mkv
Video is also played 2 times slowly and there is info about 2.5 fps

...
[matroska,webm @ 0x2c85280] max_analyze_duration 5000000 reached at 5200000
Input #0, matroska,webm, from 'test.mkv':
   Metadata:
     ENCODER         : Lavf54.3.100
   Duration: 00:00:08.44, start: 0.000000, bitrate: 75 kb/s
     Stream #0:0: Video: h264 (High), yuvj420p, 1600x1200, SAR 1:1 DAR 4:3,  
2.50 fps, 2.50 tbr, 1k tbn, 5 tbc (default)
[buffersink @ 0x2ca6ba0] auto-inserting filter 'auto-inserted scale 0'  
between the filter 'src' and the filter 'out'
[scale @ 0x2ca72a0] w:1600 h:1200 fmt:yuvj420p sar:1/1 -> w:1600 h:1200  
fmt:yuv420p sar:1/1 flags:0x4
    1.24 A-V:  0.000 fd=   0 aq=    0KB vq=   10KB sq=    0B f=0/0   0/0


>> Forcing frame rate with -r parameter as described in
>> documentation has no effect.
>
> Where is this described?

http://ffmpeg.org/ffmpeg.html#Description
  To force the frame rate of the output file to 24 fps:  	ffmpeg -i  
input.avi -r 24 output.avi

  To force the frame rate of the input file (valid for raw formats only) to  
1 fps and the frame rate of the output file to 24 fps:  	ffmpeg -r 1 -i  
input.m2v -r 24 output.avi

but maybe this is an old information

>
>> Could please someone give me some advice how to solve this issue?
>
> Please test current git head, this is usually the only supported
> version (if you are a user and not a distributor), if the
> problem is still reproducible, consider opening a ticket on trac.
>
> Please understand that the result of
> ffmpeg -i test.mkv out.avi is the primary indication for the bug.

I'm still not sure if there is some problem in the raw file. I do not know  
how to analyze it...

>
> Carl Eugen
>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user


-- 
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