05 September, 2010

Stitching Mpeg Videos Together

Start with a video stream captured from your good 'ole television and you'll likely wanna remove the commercials. This act essentially requires you to split the video, less the commercials, into segments and them stitching them back together.

Relatively easy, break into video segments (minus the commercials)


$ ffmpeg -i Desktop/Futureweapons\ -\ \'\'Maximum\ Impact\'\'\ \(Recorded\ May\ 4\,\ 2006\,\ DSC\).mpg -ss 0 -t 10 /var/tmp/out1.mpg
$ ffmpeg -i Desktop/Futureweapons\ -\ \'\'Maximum\ Impact\'\'\ \(Recorded\ May\ 4\,\ 2006\,\ DSC\).mpg -ss 10 -t 10 /var/tmp/out2.mpg


Now stitch them together, using the 'cat' utility:

$ cat /var/tmp/out1.mpg /var/tmp/out2.mpg > /var/tmp/out.mpg


Simple.

No comments: