12

I have a 2 hour video. I want to make 30 minute sections but avoid re-encoding. So 2 hours of video into four 30 minute videos. How can I do this using a single ffmpeg command?

I am using Ubuntu 16.04 64-bit.

llogan
  • 11,868

1 Answers1

24

You can use the segment muxer:

ffmpeg -i input.mp4 -map 0 -c copy -f segment -segment_time 1800 -reset_timestamps 1 output_%03d.mp4
  • In this example output files will be named output_000.mp4, output_001.mp4, etc.

  • Segments may not be exactly 30 minutes long because it must cut on keyframes only.

llogan
  • 11,868
  • You can also format the arguments for -segment_time in hours, minutes, and seconds (eg. 01:00:00) – plunker May 21 '23 at 03:44