Created
April 19, 2020 20:33
-
-
Save twmbx/24f23d6bd5116fc78756c5c2aa3905cf to your computer and use it in GitHub Desktop.
FFMPEG complex Video Trim
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
# cut out parts of a video by splitting it into parts delineated by seconds | |
# then combining them to create a single video | |
# example splits into 4 and then combines. | |
ffmpeg -i input-video.ext -filter_complex " | |
[0:v]split=4[vc1][vc2][vc3][vc4], | |
[vc1]trim=00:911,setpts=PTS-STARTPTS[v1], | |
[vc2]trim=974:2971,setpts=PTS-STARTPTS[v2], | |
[vc3]trim=2997:5129,setpts=PTS-STARTPTS[v3], | |
[vc4]trim=5155:5915,setpts=PTS-STARTPTS[v4], | |
[0:a]asplit=4[ac1][ac2][ac3][ac4], | |
[ac1]atrim=00:911,asetpts=PTS-STARTPTS[a1], | |
[ac2]atrim=974:2971,asetpts=PTS-STARTPTS[a2], | |
[ac3]atrim=2997:5129,asetpts=PTS-STARTPTS[a3], | |
[ac4]atrim=5155:5915,asetpts=PTS-STARTPTS[a4], | |
[v1][a1][v2][a2][v3][a3][v4][a4] concat=n=4:v=1:a=1[v][a]" -map "[v]" -map "[a]" output-video.ext |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment