4

Occasionally, the video-files need to be cut to keep only the relevant parts. Thus, how does one go about cutting the common video files (H.264, MPEG) without any re-encoding and thus quality loss?

2 Answers 2

6

Avidemux is the perfect tool for this. It's also free, open source and available for Windows, macOS and Linux. And is quite user-friendly compared to other similar softwares.

AVC (H.264) and HEVC (H.265) encoded videos have certain complete frames (keyframes) that are called I-frames or Intra Frames.

To ensure that you don't have to re-encode a video when you delete some some portions of it, just make sure that you select and delete the portion of video between two I-frames. In Avidemux, after opening the video:

(1) Ensure the output is lossless (without rencoding) by selecting Copy in the drop-down menu under 'Video Output' and 'Audio Output' (on the left-hand sidebar).

(2) Then select (or delete) part of the videos between keyframes. Avidemux makes finding keyframes or I-Frames very easy - just open the video in it, and use the UP or DOWN arrow keys to move between keyframes. To select a portion of video between keyframes, use the UP and DOWN arrow keys on your keyboard to find the first keyframe of the video portion, and click the [A button on AviDemux. Then use the UP and DOWN arrow keys to again move to the final key frame of the video portion, and click the ][B button on Avidemux. This will select the portion of video between the 2 keyframes.

(3) You can now either delete this portion (and then save the rest of the video) or click save to just extract and save this selected portion of the video. In both cases, if you have made sure to selected between the keyframes, no re-encoding will be done or Avidemux will warn you that you haven't selected between keyframes.

More information on how to cut or extract videos on Avidemux can be read here - Simple cutting on Avidemux.


Another free and opensource software that is capable of doing lossless video and audio editing is LosslessCut. It seems to have slightly better editing features like, for example, allowing you to rearrange the order of video / audio segments. It is regularly updated and available on all platforms too. The only con is that it is an Electron app and thus unnecessarily big and a resource hog on older computers.

5
  • Upvoted, thanks for sharing info!
    – TAbdiukov
    Commented Feb 6, 2022 at 12:18
  • Thanks. If this answered your question, please also mark it as the accepted answer by clicking the checkmark next to the answer (below the downvote arrow). See What does it mean when an answer is "accepted"? to learn more.
    – sfxedit
    Commented Feb 8, 2022 at 10:13
  • Hey @sfxedit , you miss the point! Much of thew lossless information is obscure, and the point of question is not to have the 'best' answer but to collect information in one place. If there's going to be an even better answer (or perhaps my answer may be better) - then why should it be less 'accepted'?
    – TAbdiukov
    Commented Feb 9, 2022 at 11:35
  • @tabdiukov The primary manner SE works is the question and answer format. If somebody posts a better answer, you can mark that as the accepted answer later. But from what you have described, what you desire is a community wiki. (See What are "Community Wiki" posts?. For this, you should make a request here video.meta.stackexchange.com and if the mods are satisfied they can convert this post to a wiki.
    – sfxedit
    Commented Feb 10, 2022 at 20:47
  • 1
    Sorry for the delay - done
    – TAbdiukov
    Commented Jul 9 at 23:02
0

Update: Solution does NOT work with H.265

One solution that has proven to be stable and fast over the years is to use Fame-Ring Smart.Cutter. The software is natively designed to perform frame-perfect cuts without quality loss or re-encoding.

It is recommended to disable "audio VU meter" in program settings to improve stability, (learn more)

Ever since Windows 7, the software is reported to crash, especially when seeking too fast. It's possible to avoid crashes either by seeking slowly or by using an XP VM.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.