DEV Community

Cover image for Split a video file with ffmpeg
Matt Ryan
Matt Ryan

Posted on

Split a video file with ffmpeg

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

Top comments (0)