Skip to content

Commit 4bf7ad5

Browse files
committed
output vtt subtitle
1 parent cb5348d commit 4bf7ad5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/com/animecap/system/controllers/VideoController.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ public Video videoUpload(@RequestParam("file") MultipartFile file,
5050
Runtime rt = Runtime.getRuntime();
5151
Process pr = rt.exec("ffmpeg -i " +VideoConverter.sourceDirectory+v.getOriginal()+ " -ss 00:03:21.435 -vframes 1 -vf scale=300:168 "+VideoConverter.sourceDirectory+v.getOriginal() + ".png");
5252
pr.waitFor();
53+
rt = Runtime.getRuntime();
54+
pr = rt.exec("ffmpeg -i " +VideoConverter.sourceDirectory+v.getOriginal()+" -map 0:s:0 " +VideoConverter.sourceDirectory+v.getOriginal()+ ".vtt");
55+
pr.waitFor();
56+
5357
try {
5458
FFprobe ffprobe = new FFprobe("ffprobe");
5559
FFmpegProbeResult probeResult = ffprobe.probe(VideoConverter.sourceDirectory+v.getOriginal());

0 commit comments

Comments
 (0)