Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Request for TTML subtitle support (STPP) #7573

Closed
teb opened this issue Mar 31, 2020 · 8 comments
Closed

Request for TTML subtitle support (STPP) #7573

teb opened this issue Mar 31, 2020 · 8 comments

Comments

@teb
Copy link

teb commented Mar 31, 2020

I just tested a mp4 file with STPP (TTML) subs and mpv shows it as 0 subs.
Output from mp4box under:

Track # 4 Info - TrackID 4 - TimeScale 1000
Media Duration 02:09:02.400 - Indicated Duration 02:09:02.400
Media Info: Language "Norwegian (nor)" - Type "subt:stpp" - 1825 samples
XML Subtitle Stream - namespace http://www.w3.org/ns/ttml
 Size 0 x 0 - Translation X=0 Y=0 - Layer 0
        RFC6381 Codec Parameters: stpp
        All samples are sync
@jeeb
Copy link
Member

jeeb commented Mar 31, 2020

This should be a request towards FFmpeg.

Demuxing these is simple (as long as you remember stpp is "times are offsets from PTS=0, not the sample", and dfxp is "times the sane way, offsets from the sample"), too bad the format is XML and all. Thus I am noting that it is highly unlikely that someone will attempt to make a decoder for this.

@CounterPillow
Copy link
Contributor

Already reported upstream https://trac.ffmpeg.org/ticket/4859

@teb
Copy link
Author

teb commented Mar 31, 2020

Well, ffmpeg closed this case years ago, not willing to move it with a cryptic response ;).
TTML is the defacto standard for CMAF in the form of the IMSC1 format which is common for Apple as well as android cmaf. @jeeb Not sure why the resentment for xml ?

@CounterPillow
Copy link
Contributor

Well, ffmpeg closed this case years ago

No they didn't, the ticket is still open.

not willing to move it

because presumably, nobody who isn't getting paid to wants to touch this trash fire of a standard.

@ghost
Copy link

ghost commented Apr 1, 2020

Not sure why the resentment for xml ?

Because it's one of the worst pieces of shits ever invented?

@teb
Copy link
Author

teb commented Apr 1, 2020

@CounterPillow Ure right! Its still open for business, just got put of on the discussion at the end!
@wm4 that can be

@ghost
Copy link

ghost commented Apr 1, 2020

It certainly is. Because XML is so surprisingly complex and messy, and because there's no sane light-weight XML parser, ffmpeg does not well with XML based stuff. On top of this, TTML seems to have its own misdesigned mess on top of it.

@3052
Copy link

3052 commented Mar 15, 2024

looking at sample from Mubi, it seems easy enough to parse:

<?xml version="1.0" encoding="utf-8"?>
<tt xmlns="http://www.w3.org/ns/ttml"
xmlns:ttm="http://www.w3.org/ns/ttml#metadata"
xmlns:ttp="http://www.w3.org/ns/ttml#parameter"
xmlns:tts="http://www.w3.org/ns/ttml#styling" xml:lang="en"
ttp:profile="http://www.w3.org/ns/ttml/profile/imsc1/text">
  <head>
    <metadata>
      <ttm:title/>
      <ttm:desc/>
      <ttm:copyright/>
    </metadata>
    <styling>
      <style xml:id="basic" tts:backgroundColor="transparent" tts:color="white" tts:fontFamily="proportionalSansSerif" tts:fontSize="16px" tts:textAlign="center"/>
    </styling>
    <layout>
      <region style="basic" xml:id="speaker" tts:displayAlign="center" tts:extent="80% 10%" tts:origin="10% 85%"/>
    </layout>
  </head>
  <body>
    <div xml:lang="en">
      <p begin="00:01:08.000" end="00:01:09.642" region="speaker">Sorry to interrupt your dinner.</p>
      <p begin="00:01:09.666" end="00:01:10.000" region="speaker">Never mind, let's sit over there.</p>
    </div>
  </body>
</tt>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants