ffmpeg-python icon indicating copy to clipboard operation
ffmpeg-python copied to clipboard

How to display the following subtitles when there are multiple lines at a particular time?

Open FaberSid opened this issue 3 years ago • 1 comments

I was trying to figure out how to write subtitles for the various places I plan to put them, but I couldn't come up with an answer, so I decided to ask for help.

import ffmpeg

mp4 = ffmpeg.input('input.mp4')
subtitle = ffmpeg.input('test.vtt')
out = ffmpeg.output(mp4, subtitle, 'output.mp4', vcodec='copy', acodec='copy', scodec='mov_text', **{'metadata:s:s:0':"language=eng"})
out.run()
WEBVTT

00:01.000 --> 00:30.000 line:70% position:30.00% align:start
test 1

00:01.000 --> 00:30.000 line:85% position:32.00% align:start
test 2

FaberSid avatar Aug 30 '21 10:08 FaberSid

did you find a solution?

robinkbr avatar Jul 17 '22 14:07 robinkbr