GNOME Bugzilla – Bug 756967
matroskamux: drops JPEG input buffers with just PTS and no DTS set on them
Last modified: 2015-10-28 19:12:05 UTC
From video sources producing JPEG format and only setting the PTS for the outgoing buffer (not setting the DTS), matroska muxer drops all the buffer assuming invalid time time (during gst_matroska_mux_write_data()). The root cause of the issue is for JPEG, a dts_only flag is set to TRUE. And based on this flag, matroska tries to get the DTS as the time stamp of the buffer (matroska-ids.c:gst_matroska_track_get_buffer_timestamp()).
I am working on it.
the problem is here: http://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/gst/matroska/matroska-ids.c#n307 jpeg is muxed as V_MS/VFW/FOURCC so dts is expected, this behavioiur was introduced by this patch: https://bugzilla.gnome.org/show_bug.cgi?id=745192#c9 maybe a fallback to pts could be used if dts is not valid
additionally for jpeg and raw streams muxed as V_MS/VFW/FOURCC dts and pts are the same since these are all keyframes streams
maybe this new macro: http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=41e1bea7efb8196820539534b3d07eeb621b36c0 can be used here: http://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/gst/matroska/matroska-ids.c#n308 please advise if you want a patch
Yes, that new macro is indeed meant for such use-cases
(In reply to Edward Hervey from comment #5) > Yes, that new macro is indeed meant for such use-cases Ok, I'll send a patch later today then
Created attachment 314201 [details] [review] proposed fix Srimanta, can you please confirm that this patch fix your issue? thanks Nicola
ok..I will check it as soon as possible and give you the feedback :)
Hi Nicola, it works now. That is exactly the same fix I was trying before but with out the MACRO :).
(In reply to Srimanta Panda from comment #9) > Hi Nicola, it works now. > That is exactly the same fix I was trying before but with out the MACRO :). ok thanks for confirming, so now we have to wait for developers code reviews and suggestions
Should be fine, thanks for the patch. commit 65d08e2154eba75323fa7badfb78c0c9327d0a43 Author: Nicola Murino <nicola.murino@gmail.com> Date: Tue Oct 27 10:48:00 2015 +0100 matroskamux: don't drop JPEG frames that only have PTS but no DTS set For the MS/VfW codec ids, we want to write DTS timestamps instead of PTS because that's what everyone else seems to do (and it's also how it is in AVI). So for those input formats we use the buffer DTS instead of the PTS. However, if there's no DTS set but only the PTS then just take the PTS instead of dropping the input buffer. This is useful especially for I-frame only codecs like JPEG and huffyuv, but should also be fine as fallback in general. Fixes regression with input JPEG frames that only have PTS set on them. https://bugzilla.gnome.org/show_bug.cgi?id=756967