Skip to content

Instantly share code, notes, and snippets.

@donis
Last active July 31, 2023 13:49
Show Gist options
  • Save donis/85f4f96d16549fa43d02 to your computer and use it in GitHub Desktop.
Save donis/85f4f96d16549fa43d02 to your computer and use it in GitHub Desktop.
Cut middle out from some video with ffmpeg
# First we cut the video in how many parts we want
# Step 1. cut the first part of the video and cut it to a separate file
ffmpeg.exe -ss 00:00:00.000 -t 00:02:18.00 -i recording-full.flv -c:v copy -c:a copy recording-full-part1.flv
# Step 2. cut the second part from original video
ffmpeg.exe -ss 00:03:47.000 -i recording-full.flv -c:v copy -c:a copy recording-full-part2.flv
# Step 3. create a file with your cut parts to concat into one video with these contents and name it whatever (i.e. videos.txt):
file 'C:\Path\To\recording-full-part1.flv'
file 'C:\Path\To\recording-full-part2.flv'
# Step 4. concat all the videos into one final
ffmpeg.exe -f concat -i videos.txt -c copy recording-final-cut.flv
# This will result in recording-final-cut.flv with both videos included. Have fun!
# donis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment