[FFmpeg-user] Correct fps value for h.264 stream

Oliver Fromme oliver at fromme.com
Tue Apr 9 17:19:15 CEST 2013


Carl Eugen Hoyos wrote:
 > A bug was fixed today so it should be possible now
 > to set a framerate for raw (h264) input streams.
 > 
 > Please test and report back, Carl Eugen

When I download the "nightly snapshot", I should get that
fix, right?  So far I've been using the ffmpeg version of
the FreeBSD ports collection, which is currently 1.0.5.

I downloaded the snapshot and installed it (in parallel to
the "standard" version 1.0.5 so I can use both).
Unfortunately, it didn't change anything with regard to my
problem.

To be honest, I don't even know myself what exactly the
problem is ...  I just see the symptoms:  My hardware
player can't play the movie, it behaves like continuous
fast-forward, and it displays "-1fps" when I press the
info button on the remote.  That's why i *think* that the
fps value of the h.264 stream is wrong.  Does a raw h.264
stream even contain an fps value?  Does it contain time
stamps?  I don't know ...

Interestingly, ffmpeg 1.0.5 and the new snapshot display
very different fps values for the stream:

This is ffprobe 1.0.5:

$ ffprobe video.h264
ffprobe version 1.0.5 Copyright (c) 2007-2012 the FFmpeg developers [...]
  libavutil      51. 73.101 / 51. 73.101
  libavcodec     54. 59.100 / 54. 59.100
  libavformat    54. 29.104 / 54. 29.104
  libavdevice    54.  2.101 / 54.  2.101
  libavfilter     3. 17.100 /  3. 17.100
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[h264 @ 0x80a4c1420] Stream #0: not enough frames to estimate rate; consider increasing probesize
[h264 @ 0x80a4c1420] Estimating duration from bitrate, this may be inaccurate
Input #0, h264, from '/tmp/foo':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264 (Main), yuv420p, 720x432 [SAR 64:45 DAR 64:27], 6203.12 fps, 90k tbr, 1200k tbn, 180k tbc

And this is ffprobe from the snapshot of yesterday:

$ ffprobe video.h264
ffprobe version 1.1.git Copyright (c) 2007-2013 the FFmpeg developers [...]
  libavutil      52. 25.100 / 52. 25.100
  libavcodec     55.  2.100 / 55.  2.100
  libavformat    55.  1.100 / 55.  1.100
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 49.100 /  3. 49.100
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[h264 @ 0x80a0c1420] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #0, h264, from '/tmp/foo':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264 (Main), yuv420p, 720x432 [SAR 64:45 DAR 64:27], 25 fps, 90k tbr, 1200k tbn, 180k tbc

So, the former says 6203.12 fps, the latter says 25 fps
which *should* be the correct value, but I'm not sure how
this is determined by the ffprobe utility.

If have (many) other h.264 files for which *both* versions
of ffmpeg report the correct fps value.  These files play
fine.  This is also the case when I re-encode the stream
with ffmpeg:  then both versions report the correct value
of 25 fps for the new h.264 stream.

So, the question remains:  What is wrong with the original
h.264 stream?  Does it contain some corrupt header values
(fps, time stamps, whatever)?  And is there a way to correct
it without loss, i.e. without re-encoding?

Best regards
   Oliver

-- 


More information about the ffmpeg-user mailing list