Skip to content

Instantly share code, notes, and snippets.

@hijarian
Forked from donis/ffmpeg_cut_video
Created January 6, 2022 00:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hijarian/4a3c81433a59172258cffc89ab243010 to your computer and use it in GitHub Desktop.
Save hijarian/4a3c81433a59172258cffc89ab243010 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