[Bug 758232] Add support for EBU-TT-D / TTML subtitles

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Fri Aug 19 15:00:36 UTC 2016


https://bugzilla.gnome.org/show_bug.cgi?id=758232

--- Comment #35 from Chris Bass <floobleflam at gmail.com> ---
(In reply to Sanjay from comment #34)
Hi Sanjay,

The reason this is happening is that currently ttmlparse expects that each
buffer it receives will contain a complete XML file. This will be the case if
the subtitles in a DASH stream are encapsulated in ISO BMFF (i.e., mp4)
format[*], but it won't be the case if the files are simply fetched as
unpackaged XML, which is the case with the DASH stream that you're using.

However, even if these files were packaged in ISO BMFF, they wouldn't work in
this case because they are not valid EBU-TT-D - they use a different profile of
TTML, and so ttmlparse would reject them.

There *is* a way to render subtitles from an unpackaged EBU-TT-D file over a
video stream. If, for example, you wanted to render an EBU-TT-D file containing
the subtitles for the whole of Elephants Dream (which you can get here:
http://rdmedia.bbc.co.uk/dash/ondemand/elephants_dream/1/elephantsdream_25fps.ebuttd.xml)
over an mp4 file containing h264 video, you can download the xml file to disk
and run the following command:

gst-launch-1.0 ttmlrender name=r filesrc location=<path to mp4 file> ! qtdemux
! h264parse ! avdec_h264 ! autovideoconvert ! r.video_sink filesrc
blocksize=16777216 location=<path to subtitle XML file> ! ttmlparse !
r.text_sink r. ! ximagesink

[Note that the blocksize argument passed to filesrc ensures that it doesn't
split the input EBU-TT-D file into smaller chunks, but passes the whole thing
in a single buffer.]

If you're interested, we do have a DASH stream of Elephants Dream containing
subtitles that are packaged in ISO BMFF; its hosted here:
http://rdmedia.bbc.co.uk/dash/ondemand/elephants_dream/

To play it, you just need to run the following:

gst-play-1.0
http://rdmedia.bbc.co.uk/dash/ondemand/elephants_dream/1/client_manifest-all.mpd

Hope that helps,

Chris

[*] The spec for packaging of EBU-TT-D in ISO BMFF is here:
https://tech.ebu.ch/files/live/sites/tech/files/shared/tech/tech3381.pdf

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list