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

Oliver Fromme oliver at fromme.com
Wed Apr 10 22:08:45 CEST 2013


Gabri Nurtinaz Shally wrote:
 > On Apr 2, 2013 1:15 AM, "Oliver Fromme" <oliver at fromme.com> wrote:
 > > I've got an .m4v file that contains a h.264 video stream.
 > > First thing I did is to convert it to .mkv because I can
 > > handle Matroska files much better.  So far, so good.
 > 
 > since your purpose is canging container, have you try to use the m4v file
 > directly?!
 > 
 > ffmpeg -i input.m4v -c:a copy -c:v copy output.mkv
 > 
 > or you can use mkvtoolnix to muxing stream into mkv container

Yes, in fact I'm using my own script that's based on mkvmerge
(from the mkvtoolnix package).

However, it doesn't matter at all what tool I use to change
the container, because the problem is not in the container.
The problem seems to be caused by wrong or missing time
stamps (these are called PTS, right?) in the h.264 stream.

I tried to have a close look at the h.264 stream, using the
report tools from the tstools package (tstools.berlios.de).
The output is somewhat complicated, but it seems to indicate
that the stream does not have any time stamps at all.  This
might explain why different tools display different fps
values for the raw stream, and why mplayer plays it fine
while my hardware media player doesn't.

I'm not an h.264 expert, though, so I might be completely
wrong.  Maybe raw h.264 isn't supposed to contain time
stamps at all.  Maybe I have to put it into PES format
(some googling seems to confirm that PES has time stamps),
but I have no idea how to do that.

Best regards
   Oliver



More information about the ffmpeg-user mailing list