Last active
December 19, 2019 17:34
-
-
Save alexarje/5771fb4ab0a4a0bfe895ae57b5838bb3 to your computer and use it in GitHub Desktop.
Trim video using ffmpeg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i input.mp4 -ss 01:10:27 -to 02:18:51 -c:v copy -c:a copy output.mp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you use the ss parameter before input param, the process will happen even faster, as you will be seeking rather than decoding. Placing ss after the input results in the same effect but...
"Here, the input will be decoded (and discarded) until it reaches the position given by -ss. This will be done very slowly, frame by frame. As of FFmpeg 2.1, the main advantage is that when applying filters to the output stream, the timestamps aren't reset prior to filtering (i.e. when burning subtitles into a video, you don't need to modify the subtitle timestamps), but the drawback is that it will take a lot of time until it finally reaches that time point. The bigger the seeking time is, the longer you will have to wait."
https://trac.ffmpeg.org/wiki/Seeking