1

I have an MP4 format video.

I was wondering if there is a good tool to take a video, and create n number of new videos, by just setting a bunch of cut points.

Obviously most video editors will be capable of cutting a video and exporting. But I am wondering if there are any tools who are exceptional fast at this.

For example, and ideal situation would be like..

take a 2 min video and say..

set split @ 30 seconds set split @ 60 seconds set split @ 90 seconds

and then just hit export function that spits out 4 new videos orig_name_[number].mp4.

In an even MORE ideal world this could be done with a command line program and a batch file :)

Thanks for any feedback you can provide!

3

You can use ffmpeg, a command-line tool to do this.

If you want equal-sized splits, use

ffmpeg -i input -segment_time 30 -f segment -force_key_frames expr:gte(t,n_forced*30) -reset_timestamps 1 a%02d.mp4

If you need to split at irregular intervals, use

ffmpeg -i input -crf 18 -segment_times 30,60,90 -f segment -force_key_frames 30,60,90 -reset_timestamps 1 files%01d.mp4
|improve this answer|||||
  • I am curious what the files%01d syntax is doing. When I try to add this to a batch file called video_cut.bat I get error "Invalid segment filename template 'filesvideo_cut1d.mp4" – ScottF Feb 22 '16 at 20:20
  • You have to escape special characters in a bat, so it will be filesvideo_cut%%1d.mp4 inside the BAT. Since you are generating sequentially named files, the %nd specifies the numeral field width. For files test-0000 to test-3342, you would use test-%04d – Gyan Feb 22 '16 at 20:24
  • One more question. What does the -crf 18 refer to. What would the command be just to resave the whole video? – ScottF Feb 22 '16 at 22:13
  • CRF is a rate control method which controls the quality of the output. Lower values are better but larger. 18-28 is a good range. To resave the entire source is ffmpeg -i input -crf 18 output.mp4 – Gyan Feb 23 '16 at 5:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.