Tag Archives: mp4box

os x: split and concat video files

brew install mp4box


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:

mp4box -splits 716800 input.mp4

(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:

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-½ 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