Радар на почту

Как разделить видео с помощью FFmpeg

DEV · 15.11.2026 · 00:29

Для разделения видео с помощью FFmpeg используется сегментный мультиплексор. Однако при использовании параметра -c copy FFmpeg может резать только по ключевым кадрам, что ограничивает…

Читать в источнике

Оригинал

How to Split a Video With FFmpeg (Why -c copy Ignores Your Segment Time, N Equal Parts, Scene Cuts, and a pytest Check)

Short answer: to split a video with FFmpeg, use the segment muxer: ffmpeg -i input.mp4 -map 0 -c copy -f segment -segment_times 4.041667,7.083333 -reset_timestamps 1 part_%03d.mp4 That is lossless and fast, but with -c copy FFmpeg can only cut on keyframes, so -segment_time 2 does not mean "2-second parts". If you need exact lengths you must re-encode and force a keyframe at every boundary. Below are the measurements on a real 10-second clip, a small Python module, and five pytest check