Created
August 29, 2022 16:14
-
-
Save flavioribeiro/7fd94dd71fabf6c7cd01aa60a5519b77 to your computer and use it in GitHub Desktop.
Revisions
-
flavioribeiro created this gist
Aug 29, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ import fr.noop.subtitle.vtt.*; import fr.noop.subtitle.model.SubtitleParsingException; import fr.noop.subtitle.ttml.*; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; public class Hello { public static void main (String[] args) throws IOException, SubtitleParsingException { System.out.println("converting"); VttParser parser = new VttParser("utf-8"); TtmlWriter writer = new TtmlWriter(); FileInputStream vtt = new FileInputStream("/Users/flavior/Development/subtitles/example2.vtt"); VttObject subtitle = parser.parse(vtt); writer.write(subtitle, new FileOutputStream("/tmp/output.ttml")); vtt.close(); System.out.println("done"); } }