Answers.Body: <p>You can use <a href="https://ffmpeg.org/download.html" rel="nofollow">ffmpeg</a>, a command-line tool to do this.</p>
  
  <p>If you want equal-sized splits, use </p>
  
  <pre><code>ffmpeg -i input -segment_time 30 -f segment -force_key_frames expr:gte(t,n_forced*30) -reset_timestamps 1 a%02d.mp4
  </code></pre>
  
  <p>If you need to split at irregular intervals, use</p>
  
  <pre><code>ffmpeg -i input -crf 18 -segment_times 30,60,90 -f segment -force_key_frames 30,60,90 -reset_timestamps 1 files%01d.mp4
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-22T20:20:36.500Z
Answers.Text: 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"
Answers.UserDisplayName: Scorb
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-22T20:24:43.067Z
Answers.Text: You have to [escape](http://www.robvanderwoude.com/escapechars.php) 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`
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-22T22:13:41.970Z
Answers.Text: One more question. What does the -crf 18 refer to. What would the command be just to resave the whole video?
Answers.UserDisplayName: Scorb
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-23T05:27:00.450Z
Answers.Text: 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`
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-22T20:07:07.417Z
Answers.LastActivityDate: 2016-02-22T20:07:07.417Z
Answers.UserDisplayName: Gyan
Body: <p>I have an MP4 format video.</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>For example, and ideal situation would be like..</p>
  
  <p>take a 2 min video and say..</p>
  
  <p>set split @ 30 seconds
  set split @ 60 seconds
  set split @ 90 seconds</p>
  
  <p>and then just hit export function that spits out 4 new videos orig_name_[number].mp4.</p>
  
  <p>In an even MORE ideal world this could be done with a command line program and a batch file :)</p>
  
  <p>Thanks for any feedback you can provide!</p>
  
Tags: <video><ffmpeg><video-editor><conversion>
Title: Tool for cutting video
UserDisplayName: Scorb
ThreadText: # Tool for cutting video
  
  (Asked by: username_0 on 2016-02-22)
  
  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!
  
  **Tags:** video, ffmpeg, video-editor, conversion
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-02-22. Score: 2 | Accepted answer
  
  You can use [ffmpeg](https://ffmpeg.org/download.html), 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
  
  ```
  
  > **Comments:**
  > **username_0**: 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"  
  > **username_1**: You have to [escape](http://www.robvanderwoude.com/escapechars.php) 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`  
  > **username_0**: One more question. What does the -crf 18 refer to. What would the command be just to resave the whole video?  
  > **username_1**: 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`  
  
  ---
  
  