1

I was able to find this thread on cutting a specific portion out of a file. It's not very useful since I'm looking to do the exact opposite which is to remove the selected portion of the video.

This user's solution for extracting a part without re-encoding works pretty well. Can I do something similar to remove a selection portion instead?

I prefer not having to re-encode, but I'm fine either way so any solution would do.

Yimiko
  • 11

1 Answers1

1

Extract the parts you want by using the as codec the "Copy" option -c:v copy -c:a copy

Let's say you have a 6 minutes video and you don't want the parts from 2-3 min and from 4-5 min:

ffmpeg -ss 00:00:00 -to 00:02:00 -i input.mp4 -c:v copy -c:a copy input_part1.mp4
ffmpeg -ss 00:03:00 -to 00:04:00 -i input.mp4 -c:v copy -c:a copy input_part2.mp4
ffmpeg -ss 00:05:00 -to 00:06:00 -i input.mp4 -c:v copy -c:a copy input_part3.mp4

Create a text file for the files you extracted (filelist.txt)

file 'input_part1.mp4'
file 'input_part2.mp4'
file 'input_part3.mp4'

Then join them together with something like this

ffmpeg -safe 0 -f concat -i filelist.txt -c copy output.mp4

output.mp4 should not have the parts you don't want.