• 2013
  • Jan
  • 18

Spliting a Mpeg video in smaller pieces

To split a MPEG video into smaller chunks to, e.g., get an 6 GB holiday video on an FAT32 USB-Stick the open source tool ffmpeg can be used.

To split a large input file you can use this commandline. It splits a 2 hour video into four half hour files:

ffmpeg -i largeinput.avi 
-ss 00:00:00 -t 00:30:00 -acodec copy -vcodec copy output1.avi 
-ss 00:30:00 -t 00:30:00 -acodec copy -vcodec copy output2.avi 
-ss 01:00:00 -t 00:30:00 -acodec copy -vcodec copy output3.avi 
-ss 01:30:00 -acodec copy -vcodec copy output4.avi

This command specifies largeinput.avi as input file. With the -ss option the start position is defined and -t specifies the duration. The two codec options enable the direct stream copy of video and audio, which prevents loss of quality. Last the name of the output files is specified. This is done for all four output files.

Voila, you split a 6GB video in handy four 1.5GB parts!