After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 741306 - qtmux: handle overlapping subtitle buffers properly
qtmux: handle overlapping subtitle buffers properly
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other All
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-12-09 18:32 UTC by Matej Knopp
Modified: 2018-11-03 14:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to handle overlapping buffers properly (7.77 KB, patch)
2014-12-09 18:34 UTC, Matej Knopp
none Details | Review

Description Matej Knopp 2014-12-09 18:32:24 UTC
Overlapping subtitle buffers (buffers that start before previous buffer ends) are legal in many containers (i.e. MKV), but can not be represented in MP4. Trying to remux such file currently results in invalid file, because timestamp delta between buffer end time and next buffer start time is negative

In order to handle this well, the muxer should split and combine buffers in a way so that no information is lost. I.e. Two overlapping input buffers should be muxed as three separate buffers, with second buffer combining content from both input buffers.

[=======Buffer In 1========]
               [=======Buffer In 2========]

 [Buffer Out 1][Buffer Out 2][Buffer Out 3]

Sample MKV file with overlapped subtitles
https://s3.amazonaws.com/MatejK/Samples/OverlappedSubtitles.mkv

Remuxed file without the patch
https://s3.amazonaws.com/MatejK/Samples/OverlappedSubtitlesWithoutPatch.mp4

Remuxed file with the patch
https://s3.amazonaws.com/MatejK/Samples/OverlappedSubtitlesWithPatch.mp4
Comment 1 Matej Knopp 2014-12-09 18:34:09 UTC
Created attachment 292402 [details] [review]
Patch to handle overlapping buffers properly
Comment 2 Thiago Sousa Santos 2014-12-10 02:25:51 UTC
Review of attachment 292402 [details] [review]:

Out of curiosity, what is generating those broken subtitle streams?

Anyway, I think it would be better to solve this outside of qtmux because this isn't specific to qt/mp4 container and we would need to replicate it on other muxers and also could be used during rendering. So, why not put this on an element by itself?
Comment 3 Matej Knopp 2014-12-10 03:04:06 UTC
Uh. What do you mean by broken subtitle streams? Overlapping subtitles are a perfectly valid and common thing. I.e. web vtt specification: http://www.webmproject.org/docs/container/
> The timestamps for WebVTT cues can overlap in time.

It's only MP4 (and maybe FLV?) that can't represent this, because there are no timestamps, just durations. I think this restriction is muxer-specific, so I'm not sure if separate element is really the answer here.
Comment 4 Matej Knopp 2014-12-10 03:19:09 UTC
flvmux doesn't currently support subtitles though. I'm not aware of any other muxer with such restriction right now. But if there are any I agree separate plugin could make sense.
Comment 5 GStreamer system administrator 2018-11-03 14:56:29 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/146.