Created
August 29, 2022 16:14
-
-
Save flavioribeiro/7fd94dd71fabf6c7cd01aa60a5519b77 to your computer and use it in GitHub Desktop.
This file contains 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 characters
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"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment