i am learning how to use ffmpeg. i wanna edit a 6 hour video. i wanna remove the 3rd, and 4th hour of the video. what kind of command line would i use? I wanna TRIM the video, so there is no quality loss.
+ Reply to Thread
Results 1 to 3 of 3
-
-
Since you don't want to use a GUI (like https://www.videohelp.com/software/LosslessCut or similar), but want to learn about ffmpeg
you would:- cut the clip into multiple chunks you want to keep
read: https://trac.ffmpeg.org/wiki/Seeking especially "Cutting small sections"Code:ffmpeg -ss <START_TIME i.e. 00:01:00> -i <PATH TO INPUT FILE> -to <END_TIME i.e. 00:02:00> -c copy <PATH_TO_OUTPUT i.e. part1.mkv>
- you merge the parts together using ffmpeg concat
First, create a text file called parts.txt containing the filenames of the video segments in the correct order:
Then merge them:Code:file 'path to part1.mkv' file 'path to part2.mkv' file 'path to part3.mkv'
read: https://trac.ffmpeg.org/wiki/ConcatenateCode:ffmpeg -f concat -safe 0 -i "path to parts.txt" -c copy "path to output.mkv"
Note that usually 'no quality loss' means only cutting on key frames.
Cu SelurLast edited by Selur; 4th Dec 2026 at 13:24.
users currently on my ignore list: deadrats, Stears555, marcorocchini - cut the clip into multiple chunks you want to keep
-
Try this first:
It the code above result is out of sync try this instead:Code:ffmpeg -ss 03:00:00 -to 05:00:00 -i input.mp4 -c copy output.mp4
If both these fail to give you a good result then it gets more complicated as you need to re-encode.Code:-flags +genpts ffmpeg -ss 03:00:00 -to 05:00:00 -copyts -i input.mp4 -c copy output.mp4
Methodes with re-encoding will take much longer.
Similar Threads
-
I have a 3 hour Broken Video File
By Gr8rSpy in forum Newbie / General discussionsReplies: 1Last Post: 6th Jan 2025, 03:41 -
Editing and Uploading 4-5 Hour Video?
By Captain13 in forum Newbie / General discussionsReplies: 5Last Post: 14th Nov 2023, 23:05 -
How can I auto edit a 1 hour video down to 1 minute?
By linha_chilena in forum EditingReplies: 12Last Post: 28th Apr 2023, 17:15 -
install ffmpeg to Subtitle Edit 3.6.10
By loninappleton in forum SubtitleReplies: 2Last Post: 14th Dec 2022, 09:35 -
ffmpeg edit and save as lagarith 32bit lossless avi?
By Tom4 in forum EditingReplies: 37Last Post: 10th Nov 2022, 23:30



Quote