VideoHelp Forum




+ Reply to Thread
Results 1 to 3 of 3
  1. Member
    Join Date
    May 2020
    Location
    Las Vegas
    Search Comp PM
    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.
    Quote Quote  
  2. 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
      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>
      read: https://trac.ffmpeg.org/wiki/Seeking especially "Cutting small sections"
    • 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:
      Code:
      file 'path to part1.mkv'
      file 'path to part2.mkv'
      file 'path to part3.mkv'
      Then merge them:
      Code:
      ffmpeg -f concat -safe 0 -i "path to parts.txt" -c copy "path to output.mkv"
      read: https://trac.ffmpeg.org/wiki/Concatenate

    Note that usually 'no quality loss' means only cutting on key frames.

    Cu Selur
    Last edited by Selur; 4th Dec 2026 at 13:24.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  3. Try this first:
    Code:
    ffmpeg -ss 03:00:00 -to 05:00:00 -i input.mp4 -c copy output.mp4
    It the code above result is out of sync try this instead:
    Code:
    -flags +genpts ffmpeg -ss 03:00:00 -to 05:00:00 -copyts -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.
    Methodes with re-encoding will take much longer.
    Quote Quote  



Similar Threads