How do you split a large MPEG-4 video file into smaller files?

10

6

I have an hour of raw footage from a users group meeting that I want to split in to 10-minute chunks so I can upload them to YouTube. I did some searching and couldn't really find a good way to accomplish this. Do you know of a good method or tool for splitting video? I have access to Adobe software from work.

EDIT: A friend at work suggested I check out http://videohelp.com but it is blocked here at work, so I guess I'll have to check it out later.

Robert Greiner

Posted 2009-09-04T14:11:10.120

Reputation: 505

2I know MeGUI has the ability to split MP4's by filesize, but I don't think it can do timecodes... How has the source been encoded - CBR or VBR? – Breakthrough – 2009-09-04T14:18:23.433

1cool, I'll check out MeGUI I'm almost positive the encoding is VBR. I recorded it with the Flip Ultra HD – Robert Greiner – 2009-09-04T14:23:46.513

1Hmm, that makes it more difficult. If it was CBR, then you could just determine how big 10 minutes would be, and split it by that size.

For VBR, you might need to reencode the file, since it's difficult to just split the files at specific timecodes without keyframes. – Breakthrough – 2009-09-04T14:27:49.827

Ah, I see. Still might be worth a try though. – Robert Greiner – 2009-09-04T14:31:24.173

1I guess you could always approximate it by getting the average video size for ten minutes (or nine if you want to be safe), and then splitting it by that size. Just so you know, you can get to the splitting menu in MeGUI by going to Tools -> Muxer -> MP4 Muxer, and setting the second last option (Splitting). – Breakthrough – 2009-09-04T14:33:45.057

yeah, it doesn't have to be exact, just small and short enough to go on youtube (I don't want to host several GB of files on my webserver). – Robert Greiner – 2009-09-04T14:35:04.867

@breakthrough put all this info into an answer so I can vote it up and you can get some rep :P – Robert Greiner – 2009-09-04T14:35:41.480

Good point, Robert. :P – Breakthrough – 2009-09-04T14:57:40.297

Answers

13

If you're not afraid of the command line ffmpeg is the tool to use.

It's a bit complicated, but most free tools are based on ffmpeg because it's the most powerful one out there. This is a sample of a command to split out 30 seconds of a video.

ffmpeg -i input.avi -vcodec copy -ss 00:00:10:15 -t 00:00:30:00 output.avi

If you're on windows, it's a little tough to get installed, but here are some good links to get it. http://ffmpeg.arrozcru.org/wiki/index.php?title=Links

chills42

Posted 2009-09-04T14:11:10.120

Reputation: 2 646

This reencodes the audio. Use -codec instead of -vcodec to copy both streams (and not just the video). – Henning – 2015-02-08T14:02:34.203

doesn't -an mean no audio? did he want no audio? – barlop – 2011-06-10T01:26:24.423

Good catch, i think this was originally copied/modified from something i was working on and I must have overlooked the -an parameter. It isn't really relevant here so I removed it. – chills42 – 2011-06-10T15:02:02.230

1+1 excellent, that might be just what I am looking for. I'll check it out this evening when I get home from work. Thank you. – Robert Greiner – 2009-09-04T14:32:03.733

hope it works for you, I'm using linux and I've been able to do some great stuff with it. – chills42 – 2009-09-04T14:35:32.777

1That's pretty good actually... Does it do any encoding or does it just split the files and write the appropriate headers? – cp2141 – 2009-09-10T19:23:43.047

I believe in this case you avoid encoding and simply copy the stream, but I'm not sure in the specifics. – chills42 – 2009-09-15T14:15:55.390

3

If you're willing to give it a shot, meGUI can handle splitting MP4 files by filesize. To do so, simply fire up the program, and go to Tools -> Muxer -> MP4 Muxer. Import the file, and then you can input a filesize to split it by.

If you're working with CBR content, then you can determine the filesize for a ten minute segment via the bitrate. If it's VBR, then this is less consistent depending on the content, so you should aim for a slightly lower time (e.g. the average size of a nine-minute segment), so you don't overshoot the 10-minute limit.

Breakthrough

Posted 2009-09-04T14:11:10.120

Reputation: 32 927

2

ffmpeg -i input.avi -acodec copy -vcodec copy -ss 00:00:00:00 -t 00:10:00:00 output.avi

This will copy the audio as well...just uploaded a mute video to YouTube of a musical performance. -an is the culprit. Manpages FTW.

Garrett

Posted 2009-09-04T14:11:10.120

Reputation:

0

If your video is in an MP4, MOV or 3GP container (i.e. has .mp4, .mov or .3gp extension) then MP4Box (command line util) and YAMB (a GUI for MP4Box) are what you need.

Run YAMB and select the Editing section, there is an option "Click to split MP4/M4A/MOV/3GP Files."

YAMB

Alternate download locations: MP4Box and YAMB

Shevek

Posted 2009-09-04T14:11:10.120

Reputation: 15 408