Skip to content

Instantly share code, notes, and snippets.

A fast way to split both a video and its subtitle then integrate the subtitle back into the new segment

Segment video file

(sometimes you may encounter a weird behavious where the output video starts before 5 seconds than specified in the -ss parameter)

ffmpeg -ss 00:00:14.500 -i input.mp4 -t 00:17:05.500 -c copy d:\_ffmpeg_output\output.mp4

or use the -copyts and -to paramaters

ffmpeg -ss 00:00:14.500 -copyts -i input.mp4 -to 00:17:20.0 -c copy d:\_ffmpeg_output\output.mp4

Segment subtitle file

ffmpeg -ss 00:00:14.500 -i input.srt -t 00:17:05.500 d:\_ffmpeg_output\output.srt