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

Render TTML subtitles #5879

Open
sjvudp opened this issue Mar 18, 2024 · 3 comments
Open

Render TTML subtitles #5879

sjvudp opened this issue Mar 18, 2024 · 3 comments

Comments

@sjvudp
Copy link

sjvudp commented Mar 18, 2024

Description of the feature or enhancement you'd like to see in HandBrake

TTML subtitle files look quite similar to today's HTML, so I wonder whether supporting them to create "overlay subtitles" from the TTML would be too much of code bloat.

For example here's a very simple TTML example created by DaVince Resolve Studio 18:

<?xml version="1.0" encoding="UTF-8"?>
<tt xml:lang="en" xmlns="http://www.w3.org/ns/ttml" xmlns:ttm="http://www.w3.org/ns/ttml#metadata" xmlns:tts="http://www.w3.org/ns/ttml#styling" xmlns:ttp="http://www.w3.org/ns/ttml#parameter" xmlns:ittp="http://www.w3.org/ns/ttml/profile/imsc1#parameter" xmlns:itts="http://www.w3.org/ns/ttml/profile/imsc1#styling" ttp:profile="http://www.w3.org/ns/ttml/profile/imsc1/text" ttp:frameRate="24" ttp:timeBase="media">
  <head>
    <styling>
      <style xml:id="DE_style" tts:color="#ffffff" tts:opacity="1" tts:fontSize="100%" tts:fontFamily="proportionalSansSerif" tts:fontWeight="bold" tts:textOutline="#ffffff 1px" tts:textAlign="center"/>
    </styling>
    <layout>
      <region xml:id="DE" tts:origin="41.271% 74.884%" tts:extent="17.500% 10.278%" tts:displayAlign="center"/>
    </layout>
  </head>
  <body>
    <div xml:id="d0" region="DE" style="DE_style">
      <p begin="01:00:01.000" end="01:00:06.000">DE-utlich</p>
    </div>
  </body>
</tt>

Compared to SRT-type subtitles, this format obviously allows to specify the font, size, and other attributes.

What Operating System are you running?

Windows 10

What version of HandBrake are you running?

1.7.3 (2024021000)

Where did you download HandBrake from?

handbrake.fr

Activity Log, Crash Log or any other details

No response

@Nomis101
Copy link
Contributor

This was already requested 4 years ago.
#2724

Back then there was no support for TTML in FFmpeg, some support has been added in the meantime.
https://github.com/search?q=repo%3AFFmpeg%2FFFmpeg+TTML&type=commits
Do not know how this changes the situation for HandBrake.

@sr55
Copy link
Contributor

sr55 commented Mar 28, 2024

Does it by chance handle it if you embed it into the file to begin with?

We might have to make some tweaks for us to recognise it.

Do you have a sample file you can share please?

@sjvudp
Copy link
Author

sjvudp commented Mar 28, 2024

Does it by chance handle it if you embed it into the file to begin with?

AFAIK my program to create those TTML files is not able to embed them (that's why I used HandBrake at all). The manual states:
As embedded captions: Outputs the currently selected subtitle track as an embedded
metadata layer within supported media formats. There is currently support for CEA-608 closed
captions within MXF OP1A and QuickTime files. You can choose the subtitle format from the
Codec pop-up that appears.

We might have to make some tweaks for us to recognise it.

Do you have a sample file you can share please?

A sample file of what exactly: A video, or a TTML file?

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

No branches or pull requests

3 participants