GNOME Bugzilla – Bug 709415
mp4mux: Expects and needs DTS on h264 but happily muxes streams without
Last modified: 2013-10-10 13:13:03 UTC
Created attachment 256450 [details] GST_DEBUG=*:5 I'm using the following pipeline to mux an h264 stream in to mp4, ./gst-launch-1.0 -e rtspsrc location="rtsph://..." ! rtph264depay ! h264parse ! mp4mux faststart=true ! filesink location=... the resulting file ends up without duration, if i use matroskamux i get a druation. This pipeline used to work in GStreamer 1.0. I investigated the problem and it seems that all buffer handled by the mp4mux has DTS = -1 and a correct PTS. This yields gst_qt_mux_add_buffer () will set the buffer DTS = 0 and hence no duration.
I upload a possible fix, I do not know the correctness of the patch. I leave that up to you.
Created attachment 256741 [details] [review] potential fix
I don't think this is correct. For h264 you want DTS set on the buffers, otherwise you can't properly mux the stream into an MP4 container. In the worst case you'll have to invent DTS.
I suspected that, but the files turns out fine. In Gstreamer 1.0 there was a property called dts-method which is deprecated in 1.2, do we need that again or just a way of inventing DTS? Any hints on how to achieve this? Or is this a bug in some of the upstream elements since they do not set DTS on the buffers? Only the first buffer received by the rtph264depay sink pad has DTS all others has -1. Well a lot of questions and rambling on my part but any help is much appreciated.
I think h264parse should put proper DTS on the h264 buffers. I'm sure there's a bug about that already but I can't find it right now ;)
Found it: h264parse: Calculate PTS from DTS (and vice-versa) https://bugzilla.gnome.org/show_bug.cgi?id=659489
Thanks! *** This bug has been marked as a duplicate of bug 659489 ***