The following command overlays text on the video:

ffmpeg -hide_banner -i Loving_Caliber.mp4 -vf drawtext="textfile=subs1.txt:fontsize=75" output.mp4

where subs1.txt is a textfile containing the subtitles to be overlayed. The video file Loving_Caliber.mp4 has 30 seconds.

I want to display the subtitles in subs1.txt for the first 10 seconds of the video, and then starting from the 12 second of the video I want the other subtitles, included in subs2.txt, to be displayed for another 10 seconds. How do I do this? I've tried

ffplay -hide_banner -i Loving_Caliber.mp4 -vf drawtext="textfile=subs1.txt:fontsize=75:enable='between(t,0,10)" -vf drawtext="textfile=subs2.txt:fontsize=75:enable='between(t,12,22)"

but it only overlays subs1.txt.

P.S. I would like to do it with one command in order to minimize the losses with each re-encoding of the mp4 file.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.