sandflow / ttconv

Subtitle conversion. Converts STL, SRT, TTML and SCC into TTML, WebVTT and SRT.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Option to remove all TTML element tags

sh-smpte opened this issue · comments

Could we please have an option to remove all TTML element tags when converting from TTML to vtt and srt?

I'm not sure I understand the request. Can you provide an example?

I think the idea is to have the option to remove all styling from the input file.

@sh-smpte Is that correct?

I am thinking maybe adding a --input_filter <filter_name> option to the command line.

One such filter would be remove_all_styles.

Yes, correct. For example, when I convert some of my TTML to vtt, there are lines with styling below remains in the conversion result:

<i>[Text]</i>

Couple of observations upon closer observation:

  • I am not convinced it makes sense to remove formatting from WebVTT since, generally, WebVTT is selected when more control over styling is desired

  • implementing systemwide formatting filters is not straightforward

I proposed instead adding a text_formatting option to SRT writer that allows text formatting to be disabled in SRT output alone.

See #391

tt convert -i <.ttml file> -o <.srt file> --config '{"srt_writer": {"text_formatting": false }}'

Edited per #389 (comment)

tt convert -i <.ttml file> -o <.srt file> --config '{"stl_reader": {"text_formatting": false }}'

I assume this should read:

tt convert -i <.ttml file> -o <.srt file> --config '{"srt_writer": {"text_formatting": false }}'

@andreastai Thanks for the eagle eye!