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 581296 - avimux: Support DivX subtitles
avimux: Support DivX subtitles
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-05-04 11:36 UTC by Christian Fredrik Kalager Schaller
Modified: 2018-11-03 14:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
avimux: add support for xsub subtitles (16.33 KB, patch)
2014-03-05 01:03 UTC, Thiago Sousa Santos
none Details | Review

Description Christian Fredrik Kalager Schaller 2009-05-04 11:36:23 UTC
Seems DivX got a subtitle system for Avi files. Seems to break the AVI specification though so they refer to the new files as divx files.

Misc tools generating this format:
http://userxp.tripod.com/sub2divx.htm
http://projects.gdion.biz/guides/dmfwithxsub.html
http://labs.divx.com/DivXMuxGUI

There is a SDK with some documentation here:
http://download.divx.com/labs/DivXMediaFormat_SDK_r2.rar
Comment 1 Christian Fredrik Kalager Schaller 2011-07-26 14:52:26 UTC
http://wiki.multimedia.cx/index.php?title=XSUB
Comment 2 Tim-Philipp Müller 2011-07-26 15:02:30 UTC
Also note bug #628429 for the decoding part.
Comment 3 Helio Chissini de Castro 2011-07-26 16:35:24 UTC
Another tool now opensource, Windows only:
http://drdivx.svn.sourceforge.net/

Pointing that a xsub track on and avi container is the only way to have non realtime transcoded or hardcoded subtitles in PS3.
Comment 4 Christian Fredrik Kalager Schaller 2014-02-20 10:18:23 UTC
Details on the XSUB format here:
http://wiki.multimedia.cx/index.php?title=XSUB

This format is supported by PS3, so supporting it would improve our ability to generate files for PS3 with subtitles.
Comment 5 Thiago Sousa Santos 2014-03-03 23:29:44 UTC
I got a WIP patch for avimux that already allows remuxing this file. It plays fine in VLC, but still not on PS3. I can see video and audio on the PS3 and it allows me to select one of the 2 available subtitles, but none show even when selected.
Comment 6 Thiago Sousa Santos 2014-03-05 01:03:11 UTC
Pushed those 2 patches to properly make avidemux output the subtitles track on the correct pad.

commit fd12ff4c29a18de945b97cfc081e5b06df23ebf4
Author: Thiago Santos <ts.santos@sisa.samsung.com>
Date:   Mon Mar 3 16:39:26 2014 -0300

    avidemux: expose xsub as a subtitle instead of as a video
    
    It is placed inside a 'vids' struct, so it was being exposed on
    a pad named video_%d. XSUB are subtitles and this patch adds
    an special case for it to be exposed in a subpicture_%d pad

commit dee861630a64d6c8056b023130298e16e0290f61
Author: Thiago Santos <ts.santos@sisa.samsung.com>
Date:   Mon Mar 3 16:38:45 2014 -0300

    avidemux: do not try to add a tag with tag_name set to NULL
    
    This can happen if there are subtitles in the stream, leading to
    an assertion

I also have a patch for muxing xsub into avi that I'll attach here, but there is still one remaining issue. avidemux does a terrible job at timestamping the xsub buffers because this is AVI. I quickly wrote a xsubparse to properly timestamp the buffers because it seemed more useful than inspecing the buffers from xsub inside avidemux to get the correct timestamps. This works, excepts for the patch pushed to fix https://bugzilla.gnome.org/show_bug.cgi?id=707230 that will completely ignore the subclass timestamps in this case and fallback to the original values. This causes the subtitles to be poorly interleaved in the resulting file and the PS3 won't display the subtitles.

The lines in question are in baseparse: http://cgit.freedesktop.org/gstreamer/gstreamer/tree/libs/gst/base/gstbaseparse.c#n2084

Not sure what is the correct approach here, do we want to fix this in avidemux or have a parser do it? I think the parser is better because it is modular and can be used separately, but then we need to somehow allow it to timestamp the buffers by modifying baseparse.

@christian, We also need to know how do you intend to generate xsub content to mux into avi? Or is this just for remuxing as I don't think we have a xsub encoder atm.
Comment 7 Thiago Sousa Santos 2014-03-05 01:03:44 UTC
Created attachment 270958 [details] [review]
avimux: add support for xsub subtitles
Comment 8 Christian Fredrik Kalager Schaller 2014-03-05 06:48:06 UTC
My plan is to support whatever is supported in GStreamer, be that remuxing or re-encoding. I also need subtitle support added to encodebin before I can expose either remuxing or re-encoding of subtitles.
Comment 9 Edward Hervey 2018-05-04 09:34:46 UTC
thiagoss, any chance you could refactor this against current master ?
Comment 10 GStreamer system administrator 2018-11-03 14:39:19 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/13.