Dash-Industry-Forum / dash.js

A reference client implementation for the playback of MPEG DASH via Javascript and compliant browsers.
http://reference.dashif.org/dash.js/nightly/samples/dash-if-reference-player/index.html
Other
5.1k stars 1.67k forks source link

TTML Subtitles are non-functional #437

Closed Varun9160 closed 9 years ago

Varun9160 commented 9 years ago

Video plays, but ttml/xml subtitles do not show for any of the "Inserstion of Timed Text" sources.

SoleneChiche commented 9 years ago

What subset of TTML format do you use and on what browser? It would help to have more context.

Varun9160 commented 9 years ago

Browser used: Google chrome & mozilla firefox, can get version #'s if needed, but I suspect the issue will manifest across all browsers.

After some investigation, it appears that the ttml file referenced in the following mpd source file: http://dash.edgesuite.net/dash264/TestCases/4b/qualcomm/2/TearsOfSteel_onDem5secSegSubTitles.mpd

Lacks "layout" fields in its ttml body. It seems that both styling and layout are required and so the source file is failing validation & the code aborts subtitles parsing. Have not tested with other source files yet(but the other files seem to lack any kind of timestamp info, so I'm not sure how they would be valid?). Disabling the validation causes the ttml to be parsed correctly, but later code errors & does not display subtitles(needs more investigation as to what is happening here). I think the solution though is to modify the source to be compliant with the ttml spec.

Edit: The source ttml file lives at: http://dash.edgesuite.net/dash264/TestCases/4b/qualcomm/2/TearsOfSteel_EN.ttml

I'm unsure which version of ttml this is, as I'm not very familiar with the spec.

SoleneChiche commented 9 years ago

Actually the TTML format needs to correspond to a TTML SDP US profile, which is a subset of TTML. So your solution is exact, you need to modify the source to be compliant with the ttml spec.

Varun9160 commented 9 years ago

Yeah that was my plan. The disabling of the validation was just to see if I could get subtitles displaying, or if there was another problem lurking. Can I/how can I modify the hosted source file on edgesuite.net? I was planning on downloading it & modifying it locally, but that wouldn't help anyone down the line.

SoleneChiche commented 9 years ago

Honestly I'm playing right now in local. When I'll have something solid I'll publish. It depends on what you are planning to do?

Varun9160 commented 9 years ago

To clarify, were you referring to publishing an updated ttml source file? If you're already on it, I'll hold off for your commit. I was simply planning on adding a minimal layout field to make the source compliant with the spec & the code happy. My motivation for this is that I'm trying to design a dash ttml subtitles encoder for my company, and so having a player that can validate my encoding with working subtitles would be great.

wilaw commented 9 years ago

@Varun9160 That manifest http://dash.edgesuite.net/dash264/TestCases/4b/qualcomm/2/TearsOfSteel_EN.ttml is one of the official test vectors of the DASH IF, so there is a process to update it. Please file a bug at their bug tracker for the vectors: https://gitreports.com/issue/Dash-Industry-Forum/Test-Vectors. If you can post your fixed source as a reference, that would be great.

SoleneChiche commented 9 years ago

Actually I am working on TTML parsing and rendering, so I'm working with my own test material in local for now. I am sure that @wilaw is much more aware about the testing vectors submission process.

Varun9160 commented 9 years ago

Ok cool. I'll make some local changes & see if I can get everything working. I'll post an updated file here for you guys to verify before posting it on the dash bug tracker.

Varun9160 commented 9 years ago

@SoleneBuet I'm having some trouble getting the manifest loader script to accept a local mpd. Are you hosting your mpd on a local webserver, or just referencing an mpd on your hard drive directly? If it's the latter, I'd be curious to know what syntax you're passing for your webpage's var url field.

davemevans commented 9 years ago

Out of curiosity, is any of this TTML work to support EBU-TT-D?

SoleneChiche commented 9 years ago

@bbcrddave I am currently working on it. I'll keep you updated when I'll have something solid. I have some issues with styling and positioning to render through Dash.js. I am still trying to figure out which approach would be ideal to achieve that.

@Varun9160: hosted on a web server. No idea how you could make work your second option I'm sorry.

Varun9160 commented 9 years ago

Ok I have something that works & shows ttml subs on screen. A dummy layout as well as a profile field needed to be added to the source file to satisfy the spec.

Turns out there was also a bug in the dash player, trying to look-up a nonexistent object with the ttml subtitles code. I'm still not sure if the current code is ideal - ttml cues are being created as VTTCue objects, so this should probably be changed in the future but it does work. How do you guys manage pull requests? Should I push my changes to a bugfix #437 branch?

Not sure how to attach txt files, so I'll try pasting plain text in my next post.

Varun9160 commented 9 years ago

file name: Tears Of Steel_EN.ttml (insertion of timed text 2 on the hosted player's page)

<?xml version="1.0" encoding="UTF-8"?>
<tt xml:lang="" xmlns="http://www.w3.org/ns/ttml" xmlns:tts="http://www.w3.org/ns/ttml#styling">
    <head>
        <metadata xmlns:ttm="http://www.w3.org/ns/ttml#metadata">
            <ttm:title>Tears Of Steel_EN.ttml</ttm:title>
            <ttm:desc>English Subtitles</ttm:desc>
        </metadata>
        <styling>
        </styling>
        <layout>
        </layout>
        <profile use="http://www.w3.org/ns/ttml/profile/sdp-us" xmlns="http://www.w3.org/ns/ttml#parameter">
        </profile>
    </head>
    <body>
        <div>
            <p begin="00:00:23.000" end="00:00:24.500" >You're a jerk, Thom.<br /></p>

            <p begin="00:00:25.000" end="00:00:26.965" >Look Celia, we have to follow our passions;<br /></p>

            <p begin="00:00:27.000" end="00:00:30.500" >...you have your robotics, and<br />I just want to be awesome in space.<br /></p>

            <p begin="00:00:30.800" end="00:00:34.000" >Why don't you just admit that<br />you're freaked out by my robot hand?<br /></p>

            <p begin="00:00:34.500" end="00:00:36.000" >I'm not freaked out by- it's...<br /></p>

            <p begin="00:00:37.000" end="00:00:37.965" >...alright! Fine!<br /></p>

            <p begin="00:00:38.000" end="00:00:41.000" >I'm freaked out! I have<br />nightmares that I'm being chased...<br /></p>

            <p begin="00:00:41.035" end="00:00:42.000" >...by these giant robotic<br />claws of death...<br /></p>

            <p begin="00:00:43.000" end="00:00:45.000" >Whatever, Thom. We're done.<br /></p>

            <p begin="00:00:50.000" end="00:00:53.500" >Robot's memory synced and locked!<br /></p>

            <p begin="00:01:01.000" end="00:01:03.000" >This is pretty freaky.<br /></p>

            <p begin="00:01:57.000" end="00:01:59.000" >Shouldn't you be down there?<br /></p>

            <p begin="00:02:11.000" end="00:02:13.000" >I heard you guys talking last night.<br /></p>

            <p begin="00:02:16.000" end="00:02:18.000" >It's not my fault, you know.<br /></p>

            <p begin="00:03:11.000" end="00:03:12.000" >Are you ready?<br /></p>

            <p begin="00:03:13.000" end="00:03:15.000" >Of course you're ready, you're a rockstar.<br /></p>

            <p begin="00:03:17.000" end="00:03:18.000" >How's it looking, Barley?<br /></p>

            <p begin="00:03:19.000" end="00:03:21.000" >We should have about ten minutes...<br /></p>

            <p begin="00:03:21.500" end="00:03:23.000" >Well that's perfect.<br /></p>

            <p begin="00:03:23.500" end="00:03:26.500" >We're on in one! All systems<br />go! Yeah you, go!<br /></p>

            <p begin="00:03:28.000" end="00:03:32.000" >Go! Move your asses! Go go go!<br /></p>

            <p begin="00:03:43.000" end="00:03:44.000" >That's nice.<br /></p>

            <p begin="00:03:44.500" end="00:03:45.700" >Nothing to worry about.<br /></p>

            <p begin="00:03:46.000" end="00:03:47.000" >Thom.<br /></p>

            <p begin="00:03:51.000" end="00:03:53.000" >There she is.<br /></p>

            <p begin="00:03:53.500" end="00:03:54.500" >Now.<br /></p>

            <p begin="00:03:55.000" end="00:03:56.000" >You love her.<br /></p>

            <p begin="00:03:57.000" end="00:03:58.500" >She is your passion!<br /></p>

            <p begin="00:04:00.000" end="00:04:01.000" >Be tender to her.<br /></p>

            <p begin="00:04:01.500" end="00:04:04.500" >Be honest! Eh- be tender.<br /></p>

            <p begin="00:04:05.000" end="00:04:08.000" >Remind her what love is.<br /></p>

            <p begin="00:04:52.000" end="00:04:55.000" >...and, action!<br /></p>

            <p begin="00:04:56.500" end="00:04:58.000" >Memory overwrite in progress!<br /></p>

            <p begin="00:05:02.500" end="00:05:05.000" >Ohp- Sorry! Sorry.<br /></p>

            <p begin="00:05:16.000" end="00:05:17.000" >Look Celia.<br /></p>

            <p begin="00:05:18.000" end="00:05:20.000" >We have to follow our passions.<br /></p>

            <p begin="00:05:21.000" end="00:05:23.000" >You have your robotics...<br /></p>

            <p begin="00:05:25.000" end="00:05:28.000" >...and I just want to be awesome in space.<br /></p>

            <p begin="00:05:39.000" end="00:05:41.000" >Okay, they're coming. Two minutes left!<br /></p>

            <p begin="00:05:45.000" end="00:05:46.000" >Vivacissimo!<br /></p>

            <p begin="00:05:47.000" end="00:05:50.000" >Why don't you just admit that<br />you're freaked out by my robot hand?<br /></p>

            <p begin="00:05:56.000" end="00:05:59.000" >Listen Celia, I was young...<br /></p>

            <p begin="00:05:59.500" end="00:06:00.965" >...and a dick.<br /></p>

            <p begin="00:06:01.000" end="00:06:03.000" >But that's no reason to destroy the world.<br /></p>

            <p begin="00:06:05.000" end="00:06:06.000" >Why does he do this?<br /></p>

            <p begin="00:06:06.500" end="00:06:08.500" >We already tried that one!<br /></p>

            <p begin="00:06:11.500" end="00:06:12.500" >Abort!<br /></p>

            <p begin="00:06:13.000" end="00:06:14.000" >Cut!<br /></p>

            <p begin="00:06:14.035" end="00:06:15.000" >Whoaaa!<br /></p>

            <p begin="00:06:19.000" end="00:06:20.000" >Whoaaa!<br /></p>

            <p begin="00:06:21.000" end="00:06:22.965" >Nooooo!<br /></p>

            <p begin="00:06:23.000" end="00:06:25.000" >You broke my heart.<br /></p>

            <p begin="00:06:26.000" end="00:06:26.965" >I know.<br /></p>

            <p begin="00:06:27.000" end="00:06:29.000" >You forgot me on earth.<br /></p>

            <p begin="00:06:29.035" end="00:06:30.000" >I know.<br /></p>

            <p begin="00:06:30.500" end="00:06:33.000" >I should just crush you.<br /></p>

            <p begin="00:06:36.000" end="00:06:37.000" >I'm-<br /></p>

            <p begin="00:06:47.000" end="00:06:48.000" >I'm sorry.<br /></p>

            <p begin="00:06:50.000" end="00:06:51.000" >Good ad-lib.<br /></p>

            <p begin="00:06:59.000" end="00:07:00.500" >Not my fault!<br /></p>

            <p begin="00:07:02.000" end="00:07:03.000" >This time.<br /></p>

            <p begin="00:07:08.000" end="00:07:09.500" >Quiet on set!<br /></p>

            <p begin="00:07:10.000" end="00:07:11.000" >We're out of time!<br /></p>

            <p begin="00:08:13.000" end="00:08:14.000" >Come on!<br /></p>

            <p begin="00:08:22.000" end="00:08:23.965" >RAAAAAAAAH!<br /></p>

            <p begin="00:08:24.000" end="00:08:25.000" >Memory overwrite, 90%.<br /></p>

            <p begin="00:08:26.000" end="00:08:28.000" >Captain! We have to abort!<br /></p>

            <p begin="00:08:38.000" end="00:08:40.000" >The world's changed, Celia...<br /></p>

            <p begin="00:09:19.000" end="00:09:20.000" >You know.<br /></p>

            <p begin="00:09:22.000" end="00:09:24.000" >There's a lesson to be learned from this.<br /></p>
            <p begin="00:09:26.000" end="00:09:27.000" >Could'a gone worse.<br /></p>

        </div>
    </body>
</tt>
TobbeMobiTV commented 9 years ago

As far as I can tell. TTML subtitles work well in going to Release 1.5. Rich HTML-rendering of TTML was included via PR #705.