How do I crop (time not picture) an MP4 video file
ffmpeg
ffmpeg -i source.mp4 -ss 00:00:00 -t 00:00:00 -vcodec copy -acodec copy splice.mp4
This will take source.mp4 and, using the same audio and video codecs and not degrading quality, take -t time after -ss start time video and output your splice.mp4
Please note that the timing is very sensitive to formatting (above is one example formatting). Also, in some distributions, ffmpeg
has been replaced with avconv
. Simply run the above command and replace the word ffmpeg with avconv to solve this.
Another excellent source of information on this topic. (Thanks @pbhj)
In Ubuntu 16.04 the equivalent of ffmpeg
is the command avconv
To install it run:
sudo apt-get install libav-tools
Example command line to crop a video by time:
avconv -i originalFile.ogv -ss 00:00:00 -t 00:00:10 -vcodec copy -acodec copy croppedFile.ogv