View Single Post
Old 19th April 2005, 17:17   #1  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,770
HowTo split/concatenate MP4 files with MP4Box

some might have already noticed it: MP4Box now supports splitting and concatenating of MP4 files too

splitting

splitting can be done timewise, sizewise (eg split every 700MB). parts of a MP4 can be extracted timewise (eg from sec 10 - 60)...

of course splitting video will be done at keyframes automatically. to avoid too much hassles with keyframes the splitting option will only work on mp4 files which have only 1 video stream!

the flags for splitting are:
- split seconds
- splits size (in kb)
- splitx Starttime:Endtime (in seconds)

eg if you want to split a 1400mb MP4 file into two parts a 700mb you can use the following cmdl:
Code:
MP4Box -splits 716800 input.mp4
concatenating

concatenating (or appending) can be done on all files which are similar (eg same resolution, some audio/video format...), framerate shouldnt matter (as MP4 supports variable framerate)

the flag for concatenating is:
- cat
it works in a similar way as "-add", which means you can even -cat two .avi or .mpg files into one MP4 file in one commandline

eg for concatenating two files you can use:
Code:
MP4Box -cat file1.mp4 -cat file2.mp4 output.mp4
both cat and split should work with all streams supported in MP4Box, like ASP, AVC, AAC, MPEG-1/2 Audio and Video (eg MP3), TTXT and even on Vobsubs and ALAC (apple's lossless audio codec using in itunes) and the chapters should be edited too

i did lots of tests with these functions, so it seems to be pretty stable already, but of course there can still be glitches as its a pretty new feature

get a binary supporting it here (compiled by celtic_druid)
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau)
I know, that I know nothing (Socrates)

MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide)
Ogg Theora | Ogg Vorbis
use WM9 today and get Micro$oft controlling the A/V market tomorrow for free

Last edited by bond; 2nd June 2005 at 21:02.
bond is offline   Reply With Quote