Convert subtitles from the command line with SubtitleEdit

We can use SubtitleEdit from the command line in Windows to do batch operations to subtitle files.

Example:

Convert TTML to SRT:

SubtitleEdit /convert subtitle.ttml subrip

Its even easier in a Directory Opus button. Just make sure it is set to run as MS-DOS Batch function:

SubtitleEdit /convert {file$} subrip

Output:

This

<?xml version="1.0" encoding="UTF-8"?><tt xml:lang="no" xmlns="http://www.w3.org/ns/ttml" xmlns:tts="http://www.w3.org/ns/ttml#styling">
  <head>
    <styling>
      <style xml:id="italic" tts:fontStyle="italic" />
      <style xml:id="left" tts:textAlign="left" />
      <style xml:id="center" tts:textAlign="center" />
      <style xml:id="right" tts:textAlign="right" />
    </styling>
  </head>
  <body>
    <div>
      <p begin="00:00:00.000" dur="00:00:00.000">Copyright (C) NRK</p>
      <p begin="00:00:51.040" dur="00:00:02.400" style="left">(Hanegal)</p>
      <p begin="00:01:29.000" dur="00:00:03.460" style="left">-Idun? Idun!<br />-Hva er det?</p>
      <p begin="00:01:32.760" dur="00:00:03.280" style="left">-Nå må du komme og spise.<br />-Ok.</p>

Becomes this:

1
00:00:00,000 --> 00:00:00,000
Copyright (C) NRK

2
00:00:51,040 --> 00:00:53,440
(Hanegal)

3
00:01:29,000 --> 00:01:32,460
-Idun? Idun!
-Hva er det?

4
00:01:32,760 --> 00:01:36,040
-Nå må du komme og spise.