i would like to take a video, lets say 10:00 mins long, and split based on times i type into a program.
ex: 00:00-01:00, 01:01-03:30, 05:00-07:00 splits the 10:00 clip into 3 files
does anyone know of a program that can do this? thx
EDIT: if you have to do it one by one meaning:
00:00-01:00 -> clip1
01:01-03:30 -> clip2
05:00-07:00 -> clip3
that is ok thanks
+ Reply to Thread
Results 1 to 14 of 14
-
-
One way would be to mux it into an MKV, add chapters at the splitting points then run MKVMerge with the "Split at all Chapters" command.
Another would be to use "Split by parts"
Either way can be accomplished through either MMG or the MKVMerge command line.
FFMPEG will split, MP4Box will split, hell AVIDemux will split too. If you don't mind re-encoding AVISynth + VDub will happily split a video too.
And they're just the free programs. The ultimate splitters are the smart splitters, that will re-encode a small section at the splitting point while leaving the bulk of the video untouched, letting you cut at literally any point regardless of where frame referencing extends. -
do you know of any way to do this with an .mp4/.avi? possibly without re-encoding? free or paid for is fine, as long as it works.
ideally, i would like to cut all at one time, but if need be i will split individually
i definitely need something that will cut based on timecodes, rather than just dragging the cursor. that is priority #1 -
You can make a split.bat batch file with notepad and use ffmpeg to cut. Put the split.bat, ffmpeg.exe and your video.mp4 in same folder :
Use this code in the split.bat to cut it.
Code:ffmpeg -i video.mp4 -ss 00:00:00 -to 00:01:00 -c copy clip1.mp4 ffmpeg -i video.mp4 -ss 00:01:01 -to 00:03:30 -c copy clip2.mp4 ffmpeg -i video.mp4 -ss 00:05:00 -to 00:07:00 -c copy clip3.mp4 pause
Note that you can't cut exactly when you use copy mode.
FFmpeg: seeking and splitting: http://trac.ffmpeg.org/wiki/Seeking -
I mostly work with MKVs, if you mux an mp4 into an MKV, you can cut it, then extract the tracks and mux it back into an MP4.
Most muxing programs can split. FFMPEG can:
https://www.ffmpeg.org/ffmpeg.html#toc-Main-options
-to position
-ss position
(when I tried to split a file with PCM FFMPEG added an awful lot of lead in to the track.)
MP4Box:
http://gpac.wp.mines-telecom.fr/mp4box/mp4box-documentation/#split_concat
MKVMerge seems easier though.
Other than that, if you found the right plugins for VirtualDub, that could probably handle it via a command line, actually AVIDemux has a command line too. I'm not sure if either of them use time-codes though. -
Then you'd want to completely re-encode the files or use a smart cutter.
-
does the smart cutter allow me to use timecodes or use that same "make a .bat file" method to cut?
-
*sigh* I didn't realise there was an actual program called "smart cutter".
A smart cutter will re-encode the frames belonging to the GOPs at the split points yet simply copy the rest of the video stream as is.
This would be the relevant list:
https://www.videohelp.com/tools/sections/video-editors-h264-avc
you'll have to search through it an figure out which ones are smart cutters though. -
Yep. You must reconvert if you want exact cuts with ffmpeg. Instead of -c copy you use for example: -c:v libx264 -preset slow -crf 22 -c:a copy ( http://trac.ffmpeg.org/wiki/Encode/H.264 )
-
i tried that line you recommended but it made the video look worse, with greater size, and didn't make the cut better
if i need to re-encode it completely, that is fine. if i do re-encode it, would the copy function cut better? what is the re-encoding you recommend to improve the copy function? so far that is the closest to perfection that i have used. thanks again for all the help -
You may have better cuts if you cut at frame boundary and I have had very good luck playing the video by loading an AVS file with the following lines:
Code:DirectShowSource(("C:\Users\Bud\Desktop\Various test Formats\[dp]Manjandani-1.mp4"), Pixel_Type="yuy2").Crop(0,0,-0,-0) ShowFrameNumber(scroll=true, x=10, y=27, font="Arial", size=24, text_color=$ff0000) ShowTime(x=72, y=44, font="Arial", size=24, text_color=$ff0000) ShowSMPTE(fps=23.976, x=68, y=61, font="Arial", size=24, text_color=$ff0000)
Then use the batch enties Baldrick provided but with times in greater detail:
ffmpeg -i video.mp4 -ss 00:00:00.000 -to 00:01:00.251 -c copy clip1.mp4
ffmpeg -i video.mp4 -ss 00:01:01.251 -to 00:03:30.684 -c copy clip2.mp4
ffmpeg -i video.mp4 -ss 00:05:00.112 -to 00:07:00.254 -c copy clip3.mp4
pause
Or to recode as Baldrick also pointed out:
ffmpeg -i video.mp4 -ss 00:00:00.000 -to 00:01:00.251 -c:v libx264 -preset slow -crf 22 -c:a copy clip1.mp4
ffmpeg -i video.mp4 -ss 00:01:01.251 -to 00:03:30.684 -c:v libx264 -preset slow -crf 22 -c:a copy clip2.mp4
ffmpeg -i video.mp4 -ss 00:05:00.112 -to 00:07:00.254 -c:v libx264 -preset slow -crf 22 -c:a copy clip3.mp4
pause
Bear in mind this video IS 23.976 fps and the times are only examplesLast edited by Budman1; 12th Feb 2015 at 23:40. Reason: extra copied line removal
-