[FFmpeg-user] Noticed TimeStamp Issue When Muxing Raw h.264 into MKV

Andrey Utkin andrey.krieger.utkin at gmail.com
Wed Feb 29 22:48:18 CET 2012

среда, 29 февраля 2012 г. пользователь luke wilson <lukec.wilson86 at gmail.com>
> To Whomever,
> I hope I'm in the right place with this. Anyway I noticed that you can not
> mux a raw h.264 streams into MKV because of the lack of a TimeStamp.
> Correct me if I'm wrong but I believe this error(see error below) is due
> raw h.264 streams not containing any specific timestamp information.
>  If this is the case I believe I have a proof of concept for creating
> timestamps
>  data for a MKV mux.
> Proof Of Concept:
> 1. Get FPS from (Annex E) VUI   FPS = time_scale / num_unit_in_tick * 2
>    (I know this isn't perfect but it gets it close enough)
> 2. Take stream within each given cluster in MKV and count frames
>    (There are a few variations)
> 3. Create a TimeStamp for Segments based on frame count against FPS
> I don't think this is a perfect science but if you use libx264 and ffmpeg
> encode the raw h264 file I think it should be close enough that playback
> on directshow will not be the wiser (it works for me). I think you might
> be doing something like this for mp4 muxing.
> Please let me know if I am misunderstanding something. If I'm not mis-
> understanding something let me know if you would like me to build this out
> for the community. FFMPEG has helped me out a lot so I would like to
> give back to the community if possible.
> Error:
> "[matroska @ 01386340] Can't write packet with unknown timestamp
> av_interleaved_write_frame(): Invalid argument"
> -Luke
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user

Full uncut commandline and output are missing.

Andrey Utkin

More information about the ffmpeg-user mailing list