GNOME Bugzilla – Bug 774840
qtmux: Fix various timestamp and duration related issues
Last modified: 2017-02-23 11:40:23 UTC
See commit messages
Created attachment 340517 [details] [review] qtmux: Only write "gap" edit list if there is a non-zero gap
Created attachment 340518 [details] [review] qtmux: Revert commits that set DTS and duration on buffers unconditionally 39f7e52266fde3b3c035e22cbcbb2bb1fa207b17 was setting the buffer duration to 0 if is not valid, under the assumption that this is "the last" buffer and no others are coming next. This is wrong, last_buf is the previous buffer and not the very last one. 4e3c13c87c258c9c95e2217d32ab314d12b5fffc was setting DTS to 0 if there was none. This will set DTS to 0 for all e.g. audio streams, completely messing up calculations if streams don't start at 0.
Created attachment 340519 [details] [review] qtmux: Only use buffer durations if they are actually valid
Created attachment 340520 [details] [review] qtmux: Error out much earlier if we don't have a valid PTS
Created attachment 340521 [details] [review] qtmux: Make sure to only change DTS of writable buffers And trivial cleanup
Attachment 340517 [details] pushed as 9acc0b5 - qtmux: Only write "gap" edit list if there is a non-zero gap Attachment 340518 [details] pushed as 351f2fc - qtmux: Revert commits that set DTS and duration on buffers unconditionally Attachment 340519 [details] pushed as 6fb5f85 - qtmux: Only use buffer durations if they are actually valid Attachment 340520 [details] pushed as 01e45b2 - qtmux: Error out much earlier if we don't have a valid PTS Attachment 340521 [details] pushed as 01682ae - qtmux: Make sure to only change DTS of writable buffers
I'm having issues with this. I've git bisected a problem that causes audio to sound skippy and broken on a pipeline that looks like this: gst-launch-1.0 filesrc location=testsrc-av.mkv ! matroskademux name=d d. ! aacparse ! queue ! m. qtmux name=m streamable=true faststart=true ! filesink location=audio-bisect.mp4 with the source file generated this way: gst-launch-1.0 videotestsrc pattern=ball is-live=1 ! timeoverlay ! video/x-raw,framerate=30/1,width=1280,height=720 ! videoconvert ! queue max-size-buffers=1 ! x264enc speed-preset=superfast tune=zerolatency key-int-max=1 b-adapt=0 option-string=scenecut=0 ! video/x-h264,profile=main ! m. audiotestsrc is-live=1 ! audioconvert ! faac ! queue ! m. matroskamux name=m streamable=true timecodescale=1000 ! filesink location=testsrc-av.mkv i've git bisected this (it still sounded okay in 1.10.3) and it came down to this: 51f2fca0a39cad58436ab83ae76ea6439de11e8 is the first bad commit commit 351f2fca0a39cad58436ab83ae76ea6439de11e8 Author: Sebastian Dröge <sebastian@centricular.com> Date: Tue Nov 22 15:59:19 2016 +0200 qtmux: Revert commits that set DTS and duration on buffers unconditionally 39f7e52266fde3b3c035e22cbcbb2bb1fa207b17 was setting the buffer duration to 0 if is not valid, under the assumption that this is "the last" buffer and no others are coming next. This is wrong, last_buf is the previous buffer and not the very last one. 4e3c13c87c258c9c95e2217d32ab314d12b5fffc was setting DTS to 0 if there was none. This will set DTS to 0 for all e.g. audio streams, completely messing up calculations if streams don't start at 0. https://bugzilla.gnome.org/show_bug.cgi?id=774840 :040000 040000 27866870bd6bd3151132fb258591cbb34787c790 4b51c225f3684daccd2ca996052ff0b2a9834ab0 M gst