[FFmpeg-user] Splicing/Trimming video

Joshua Grauman jnfo-c at grauman.com
Fri Feb 10 16:11:50 CET 2012

Thanks. I sort of feared that would be the only way. I've used MP4Box to 
cat video streams together before, and this allowed me to work directly on 
mp4s, so maybe that's easiest rather than converting to flv and back? I 
must admit I don't fully understand why ffmpeg doesn't do this, the 
difference between the containers and streams, and particularly which 
tools are designed for which aspects of the process.

It seems like maybe I'm using the wrong tool for the job? Or is it just a 
necessity when doing work in this area to have to use multiple tools? 
Should I be aware of any other commandline (Linux) tools for 
cutting/splicing/joining video files (mine are mp4s).

> 2012/2/9 Joshua Grauman <jnfo-c at grauman.com>:
>> Hello all,
>> I have used the following command to take video straight from my Canon
>> camcorder and to cut off the front and back end of it and scale it down to
>> my desired resolution. This command works great. However, now I'd like to
>> 'edit' the video by cutting out several portions from the *middle* of the
>> video. In other words, I'd like to remove a few seconds here or there from
>> the video by specifying the start and end times (or durations) I want to cut
>> out. There will probably be several little sections cut out from the video.
>> Any ideas on how to do this from the command-line? I'd prefer to cut the
>> sections out of the Final.mp4 file with a -new- ffmpeg command, but if I
>> need to go back and change my initial command that could work too. Thanks!
>> cat 00012.MTS 00013.MTS 00014.MTS | /usr/local/ffmpeg/ffmpeg -threads 4 -i -
>> -ss 50 -t 2405 -vf scale=853:480,crop=640:480 -aspect 4:3 -r 30 -b 1200k -ab
>> 256k Final.mp4
>> _______________________________________________
>> ffmpeg-user mailing list
>> ffmpeg-user at ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> You can think your desire to cut off some intervals as equivalent
> desire to _save_ certain intervals, and then join them.
> For cutting, there's ready functionality in ffmpeg
> For joining, it can be problematic, you can use my tiny tool which can
> merge flv files.
> https://github.com/krieger-od/imgs2video/blob/master/cat.c

More information about the ffmpeg-user mailing list