0

I managed to cut the video and keep subtitle in sync by embedding the subtitles in the video:

$ ffmpeg -i sample-mp4-file.mp4 -hide_banner \
    -vf subtitles=subtitles.srt -ss 0:30:00 -t 1:33:31 \
    OutputVideo.mp4

I'm wonder if it possible to cut subtitle file in accordance / sync with the cut video, instead of embedding them in the video?

1

Found out that ffmpeg works on the text based subtitle file just as well:

$ cat subtitles.srt
1
00:00:06,000 --> 00:00:20,000
This is demo subtitle 1

2
00:00:20,000 --> 00:00:40,000
This is demo subtitle 2

$ ffmpeg -i subtitles.srt -ss 5 -t 60 -y cut.srt

$ cat cut.srt
1
00:00:01,000 --> 00:00:15,000
This is demo subtitle 1

2
00:00:15,000 --> 00:00:35,000
This is demo subtitle 2

$ ffmpeg -i subtitles.srt -ss 10 -t 60 -y cut.srt

$ cat cut.srt
1
00:00:10,000 --> 00:00:30,000
This is demo subtitle 2

Just exactly as what I wanted.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.