VideoHelp Forum




+ Reply to Thread
Results 1 to 14 of 14
  1. 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
    Quote Quote  
  2. Member
    Join Date
    Sep 2012
    Location
    Australia
    Search Comp PM
    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.
    Quote Quote  
  3. 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
    Quote Quote  
  4. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    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
    Then double click on the split.bat to start cut.

    Note that you can't cut exactly when you use copy mode.

    FFmpeg: seeking and splitting: http://trac.ffmpeg.org/wiki/Seeking
    Quote Quote  
  5. Member
    Join Date
    Sep 2012
    Location
    Australia
    Search Comp PM
    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.
    Quote Quote  
  6. Originally Posted by Baldrick View Post
    ...
    just tried this and it worked! thx! but if i wanted that precise cut using ffmpeg, rather than "copy", what would i use?

    Originally Posted by ndjamena View Post
    ...
    i mostly use mp4/avi, less mkv, so i appreciate the response, but i will try the ffmpeg first
    Quote Quote  
  7. Member
    Join Date
    Sep 2012
    Location
    Australia
    Search Comp PM
    Then you'd want to completely re-encode the files or use a smart cutter.
    Quote Quote  
  8. Originally Posted by ndjamena View Post
    ...
    does the smart cutter allow me to use timecodes or use that same "make a .bat file" method to cut?
    Quote Quote  
  9. Member
    Join Date
    Sep 2012
    Location
    Australia
    Search Comp PM
    *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.
    Quote Quote  
  10. Originally Posted by ndjamena View Post
    ...
    alright thanks

    Originally Posted by Baldrick View Post
    ...
    if you have a way with ffmpeg that can cut exactly that would be good if there is one
    Quote Quote  
  11. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    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 )
    Quote Quote  
  12. Originally Posted by Baldrick View Post
    ...
    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
    Quote Quote  
  13. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    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)
    If gives a video to select times such as:
    Click image for larger version

Name:	ScreenHunter_136 Feb. 12 23.18.jpg
Views:	288
Size:	64.6 KB
ID:	30222

    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 examples
    Last edited by Budman1; 12th Feb 2015 at 23:40. Reason: extra copied line removal
    Quote Quote  
  14. Originally Posted by Baldrick View Post
    ...
    Originally Posted by Budman1 View Post
    ...
    Hey guys, just wanted to thank you again for these posts. A few years later and I still come back to this thread and use them. Thanks again


    "I'm aware that this thread is 1091 days old but I still want to reply."
    Quote Quote  
Visit our sponsor! Try DVDFab and backup Blu-rays!