GNOME Bugzilla – Bug 761086
splitmuxsrc: use the max ts of all streams as the offset to align the next stream with
Last modified: 2017-02-27 11:11:59 UTC
Created attachment 319684 [details] [review] splitmuxsrc: use the max ts of all streams as the offset to align the next stream with Splitmuxsrc currently finds and uses the minimum timestamp of all streams (audio/video/subtitle) as the first timestamp for the next part, but this is incorrect and gets noticed when you have subtitles, which are sparse. (In audio/video cases it can easily go unnoticed because the ending timestamps are very close together) So for example if the current part ends at t=5s and the last subtitle was at t=1s, then the next part's timestamps start from t=1s and you lose 4 seconds of data in the output. The attached patch fixes the issue.
I only just noticed this bug. Using the max of all timestamps is not correct, and pretty much guarantees that there'll be a gap in the audio or video timelines, which are supposed to be seamless.
I was just looking at this again. You are right, it makes sense to use the min of all timestamps, but there should be a way to exclude sparse streams from the calculation.
I agree. Basing it on the stream-start event sparse flag should work. I think that's widely enough implemented.
Created attachment 346554 [details] [review] splitmuxpartreader: identify sparse streams
Created attachment 346555 [details] [review] splitmuxpartreader: ignore sparse streams when calculating the end offset of a part
Created attachment 346556 [details] [review] tests: splitmux: add unit test for content with sparse streams
Review of attachment 346554 [details] [review]: Looks good
Review of attachment 346555 [details] [review]: Looks good
Review of attachment 346556 [details] [review]: Awesome, thanks!
commit e6bd2a5c180958f74d58549ac8786e8e5584bd37 Author: George Kiagiadakis <george.kiagiadakis@collabora.com> Date: Thu Feb 23 12:11:15 2017 +0200 tests: splitmux: add unit test for content with sparse streams https://bugzilla.gnome.org/show_bug.cgi?id=761086 commit 9b845133377275e0e218f878d739b3869efc7510 Author: George Kiagiadakis <george.kiagiadakis@collabora.com> Date: Wed Feb 22 11:23:19 2017 +0200 splitmuxpartreader: ignore sparse streams when calculating the end offset of a part A sparse stream's ending timestamp can be considerably smaller than the ending timestamps of the other streams, which can lead to skipping considerable time from the next part. https://bugzilla.gnome.org/show_bug.cgi?id=761086 commit 99728792cde38ac6cd2cc30d84d5aede84b50c04 Author: George Kiagiadakis <george.kiagiadakis@collabora.com> Date: Wed Feb 22 11:21:06 2017 +0200 splitmuxpartreader: identify sparse streams