2

Let's say I have 10-minute video, I want to remove 1:00-2:00 and 4:00-5:00 Is that possible to do that on one FFmpeg command? (Other program also welcomed) Or maybe a command to cut the part that I use (for each time stamp), and another command to merge the all video inside a folder?

Background story (feel free to skip this part). My job is patrolling the national park, and I make 30-40 minutes video for monthly report (about new finding, like new nests, trespass sign, new faunas, etc). And sometimes my chief ask to delete few clips that He consider not important enough. That also mean I need to re-encode the whole thing in this slow computer office, that'll take about 8-10 hours to encode 1080p60 footage, which also mean I'll go home late at night. Today I learn that it's possible to cut and join using FFmpeg without re-encoding, so maybe it could save my time :)

2 Answers 2

7

LosslessCut

Try LosslessCut:

Screenshot of Lossless Cut

LosslessCut aims to be the ultimate cross platform FFmpeg GUI for extremely fast and lossless operations on video, audio, subtitle and other related media files. The main feature is lossless trimming and cutting of video and audio files, which is great for saving space by rough-cutting your large video files taken from a video camera, GoPro, drone, etc. It lets you quickly extract the good parts from your videos and discard many gigabytes of data without doing a slow re-encode and thereby losing quality. Or you can add a music or subtitle track to your video without needing to encode. Everything is extremely fast because it does an almost direct data copy, fueled by the awesome FFmpeg which does all the grunt work.

mpv

The player mpv has some scripts that allow you to perform interactive cutting, splicing, and concatenating/joining.

ffmpeg

You can use the concat demuxer to cut on keyframes without re-encoding. If your cut timestamps do not align with keyframes then the cuts will not be perfectly accurate. But it might be close enough for what you're doing.

  1. Make input.txt containing:

    file 'input.mp4'
    outpoint 60
    file 'input.mp4'
    inpoint 120
    outpoint 240
    file 'input.mp4'
    inpoint 300
    
  2. Concatenate:

    ffmpeg -f concat -i input.txt -c copy output.mp4
    

For a list of keyframes see Checking keyframe interval?

1
  • 1
    How do I force ffmpeg to re-encode in case I miss the keyframes? Commented Nov 18, 2022 at 18:50
0

https://mkvtoolnix.download/ is another option for you if you are working with MKV (Matroska format)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .