DEV Community

loading...
Cover image for Split a video file with ffmpeg

Split a video file with ffmpeg

Matt Ryan
Pumpkin Spiced Java.
・1 min read

Say you have a two-parter episode of a show as a single 42 minute long video file.

Split the video from the beginning until the 21 minute point:

ffmpeg -i input.mkv -vcodec copy -acodec copy -t 00:21:00 output.mkv
Enter fullscreen mode Exit fullscreen mode

Split the video from 21 minutes until the end:

ffmpeg -i input.mkv -vcodec copy -acodec copy -ss 00:21:00 output.mkv
Enter fullscreen mode Exit fullscreen mode

Discussion (0)