Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Regression: error using TTML subtitles with DASH #478

Closed
Jason239 opened this issue Sep 17, 2018 · 6 comments
Closed

Regression: error using TTML subtitles with DASH #478

Jason239 opened this issue Sep 17, 2018 · 6 comments
Assignees
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@Jason239
Copy link

Jason239 commented Sep 17, 2018

I have a question about the supported subtitle format.

The readme document states that the following subtitles are supported:

WebVTT in both text form and embedded in MP4
TTML in text form (DASH only)

However, it behaves as if TTML is not supported.
In fact, the packager.cc source returns an error if the format is not webvtt as follows:

Status CreateTextJobs(
    const std::vector<std::reference_wrapper<const StreamDescriptor>>& streams,
    const PackagingParams& packaging_params,
    SyncPointQueue* sync_points,
    MuxerListenerFactory* muxer_listener_factory,
    MuxerFactory* muxer_factory,
    MpdNotifier* mpd_notifier,
    JobManager* job_manager) {
  DCHECK(muxer_listener_factory);
  DCHECK(job_manager);
  for (const StreamDescriptor& stream : streams) {
    // There are currently four options:
    //    TEXT WEBVTT --> TEXT WEBVTT [ supported ]
    //    TEXT WEBVTT --> MP4 WEBVTT  [ supported ]
    //    MP4 WEBVTT  --> MP4 WEBVTT  [ unsupported ]
    //    MP4 WEBVTT  --> TEXT WEBVTT [ unsupported ]
    const auto input_container = DetermineContainerFromFileName(stream.input);
    const auto output_container = GetOutputFormat(stream);

    if (input_container != CONTAINER_WEBVTT) {
      return Status(error::INVALID_ARGUMENT,
                    "Text output format is not support for " + stream.input);    // <--- here
    }

Can you tell me exactly which subtitles format are supported?

Thanks.

@kqyang
Copy link
Contributor

kqyang commented Sep 17, 2018

There is very limited support for TTML right now, i.e. only TTML in text output is supported, e.g. you can do something like this:

> ./packager in=test.mp4,stream=video,out=video_out.mp4 \
             in=text.ttml,stream=text,out=text_out.ttml --mpd_output out.mpd

We will start working on TTML in mp4 next month. Follow #87 for the updates.

Does that answer your question?

@kqyang kqyang added type: question A question from the community and removed needs triage labels Sep 17, 2018
@Jason239
Copy link
Author

ah, I see.

However, I already tried both text input and output.

./packager in=Sintel.2010.480P.mp4,stream=video,out=video_out.mp4 in=sintel_de.ttml,stream=text,out=text_out.ttml --mpd_output out.mpd

And this is my 'sintel_de.ttml'

<?xml version="1.0" encoding="utf-8"?>
<tt xmlns="http://www.w3.org/ns/ttml" xmlns:ttp="http://www.w3.org/ns/ttml#parameter" ttp:timeBase="media" xmlns:tts="http://www.w3.org/ns/ttml#style" xml:lang="en" xmlns:ttm="http://www.w3.org/ns/ttml#metadata">
  <head>
    <metadata>
      <ttm:title></ttm:title>
    </metadata>
    <styling>
      <style id="s0" tts:backgroundColor="black" tts:fontStyle="normal" tts:fontSize="16" tts:fontFamily="sansSerif" tts:color="white" />
    </styling>
  </head>
  <body style="s0">
    <div>
      <p begin="107.25s" id="p0" end="110.5s">Diese Klinge birgt eine finstere<br />Vergangenheit.</p>
      <p begin="111.8s" id="p1" end="115.8s">Durch sie wurde viel unschuldiges Blut<br />vergossen.</p>
      <p begin="118.0s" id="p2" end="121.45s">Es ist töricht, so ganz allein und<br />unvorbereitet zu reisen!</p>
      <p begin="121.75s" id="p3" end="124.8s">Du kannst von Glück sagen, dass dein<br />Blut noch in deinen Adern fließt.</p>
      <p begin="125.25s" id="p4" end="126.3s">Danke.</p>
      <p begin="127.5s" id="p5" end="129.0s">Also...</p>
      <p begin="129.4s" id="p6" end="133.8s">...was führt dich in die Lande der<br />Torwaechter?</p>
      <p begin="135.0s" id="p7" end="137.5s">Ich suche jemanden.</p>
      <p begin="138.0s" id="p8" end="142.2s">Ein teurer Freund?<br />Eine verwandte Seele?</p>
      <p begin="143.4s" id="p9" end="145.0s">Ein Drache.</p>
      <p begin="148.85s" id="p10" end="151.75s">Ein gefährliches Unterfangen für eine<br />einsame Jägerin.</p>
      <p begin="152.95s" id="p11" end="155.87s">Ich bin einsam, solange ich mich<br />erinnern kann.</p>
      <p begin="207.25s" id="p12" end="210.5s">Wir sind fast fertig. Ruhig...</p>
      <p begin="210.75s" id="p13" end="213.5s">He, halt still.</p>
      <p begin="228.25s" id="p14" end="232.25s">Gute Nacht, Scales.</p>
      <p begin="250.35s" id="p15" end="253.85s">Los, hol ihn dir, Scales! Komm schon!</p>
      <p begin="265.25s" id="p16" end="268.25s">Scales?</p>
      <p begin="304.0s" id="p17" end="307.5s">Ja! Vorwärts!</p>
      <p begin="338.75s" id="p18" end="342.0s">Scales!</p>
      <p begin="445.85s" id="p19" end="447.5s">Ich habe versagt.</p>
      <p begin="452.8s" id="p20" end="456.5s">Du hast es nur nicht vermocht, genauer<br />hinzusehen.</p>
      <p begin="457.8s" id="p21" end="460.5s">Dies ist das Reich der Drachen, Sintel.</p>
      <p begin="460.85s" id="p22" end="464.0s">Du bist näher, als du ahnst.</p>
      <p begin="557.6s" id="p23" end="559.5s">Scales!</p>
      <p begin="621.6s" id="p24" end="624.0s">Scales?</p>
      <p begin="626.2s" id="p25" end="629.8s">Scales...</p>
    </div>
  </body>
</tt>

So, it seems to be error handling in this part of the code in packager.cc

if (input_container != CONTAINER_WEBVTT) {
      return Status(error::INVALID_ARGUMENT,
                    "Text output format is not support for " + stream.input);    // <--- here
    }

Doesn't this mean that it currently only supports the WEBVTT format ? or
Was the ttml format wrong?

@kqyang kqyang changed the title Support for TTML subtitles Regression: error using TTML subtitles with DASH Sep 18, 2018
@kqyang kqyang added type: bug Something isn't working correctly and removed type: question A question from the community labels Sep 18, 2018
@kqyang kqyang self-assigned this Sep 18, 2018
@kqyang kqyang added this to the v2.3 milestone Sep 18, 2018
@kqyang
Copy link
Contributor

kqyang commented Sep 18, 2018

This is a regression. Thanks for reporting the issue. Will fix it soon.

kqyang added a commit that referenced this issue Sep 20, 2018
Note that TTML in ISO-BMFF is not supported yet.

Also updated packager_test.py:
- Added a test using TTML passthrough.
- Computed output extension from input extension unless output_format
  is specified.

Fixes #478.

Change-Id: Ia917fc4ed3c326782791ed67601fba02ea28b11d
@kqyang
Copy link
Contributor

kqyang commented Sep 20, 2018

Cherry-picked to v2.2.1.

@Jason239
Copy link
Author

Jason239 commented Sep 28, 2018

I have additional questions.

WebVTT in both text form and embedded in MP4

Does that mean that VTT included in mp4 in track form is also supported?

@kqyang
Copy link
Contributor

kqyang commented Sep 28, 2018

Yes, Shaka Packager supports vtt in mp4 output.

@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Nov 18, 2018
@shaka-project shaka-project locked and limited conversation to collaborators Nov 18, 2018
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

3 participants