Answers.Body: <p><strong>Update:</strong> Solution does NOT work with H.265</p>
  <p>One solution that has proven to be stable and fast over the years is to use <a href="https://www.fame-ring.com/smart_cutter.html" rel="nofollow noreferrer">Fame-Ring Smart.Cutter</a>. The software is natively designed to perform frame-perfect cuts without quality loss or re-encoding.</p>
  <p>It is recommended to disable &quot;audio VU meter&quot; in program settings to improve stability, (<a href="https://forum.videohelp.com/threads/391669-Trying-to-use-Smart-Cutter-for-1920x1080-video#post2580152" rel="nofollow noreferrer">learn more</a>)</p>
  <p>Ever since Windows 7, the <a href="https://forum.videohelp.com/threads/331916-Smart-Cutter-for-DV-and-DVB-crashes" rel="nofollow noreferrer">software is reported to crash, especially when seeking too fast</a>. It's possible to avoid crashes either by seeking slowly or by using an XP VM.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-01-04T15:10:59.900Z
Answers.LastActivityDate: 2023-11-11T17:33:53.060Z
Answers.LastEditDate: 2023-11-11T17:33:53.060Z
Answers.UserDisplayName: TAbdiukov
Answers.Body: <p><a href="http://fixounet.free.fr/avidemux/" rel="nofollow noreferrer">Avidemux</a> 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.</p>
  <p>AVC (H.264) and HEVC (H.265) encoded videos have certain complete frames (<strong>keyframes</strong>) that are called <strong>I-frames</strong> or <strong>Intra Frames</strong>.</p>
  <p>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 <em>between</em> two <strong>I-frames</strong>. In Avidemux, after opening the video:</p>
  <p>(1) Ensure the output is lossless (without rencoding) by selecting <code>Copy</code> in the drop-down menu under '<strong>Video Output</strong>' and '<strong>Audio Output</strong>' (on the left-hand sidebar).</p>
  <p>(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 <kbd>UP</kbd> or <kbd>DOWN</kbd> arrow keys to move between keyframes. To select a portion of video between keyframes, use the <kbd>UP</kbd> and <kbd>DOWN</kbd> arrow keys on your keyboard to find the first keyframe of the video portion, and click the <strong><code>[A</code></strong> button on AviDemux. Then use the <kbd>UP</kbd> and <kbd>DOWN</kbd> arrow keys to again move to the final key frame of the video portion, and click the <strong><code>][B</code></strong> button on Avidemux. This will select the portion of video between the 2 keyframes.</p>
  <p>(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.</p>
  <p>More information on how to cut or extract videos on Avidemux can be read here - <a href="https://www.avidemux.org/admWiki/doku.php?id=using:cutting" rel="nofollow noreferrer">Simple cutting on Avidemux</a>.</p>
  <hr />
  <p>Another free and opensource software that is capable of doing <strong>lossless video and audio</strong> editing is <a href="https://github.com/mifi/lossless-cut" rel="nofollow noreferrer">LosslessCut</a>. 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.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-06T12:18:03.467Z
Answers.Text: Upvoted, thanks for sharing info!
Answers.UserDisplayName: TAbdiukov
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-08T10:13:23.890Z
Answers.Text: 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"?](https://stackoverflow.com/help/accepted-answer) to learn more.
Answers.UserDisplayName: sfxedit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-09T11:35:48.630Z
Answers.Text: 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'?
Answers.UserDisplayName: TAbdiukov
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-10T20:47:39.060Z
Answers.Text: @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?](https://meta.stackexchange.com/questions/11740/what-are-community-wiki-posts). For this, you should make a request here https://video.meta.stackexchange.com/ and if the mods are satisfied they can convert this post to a wiki.
Answers.UserDisplayName: sfxedit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-07-09T23:02:33.073Z
Answers.Text: Sorry for the delay - done
Answers.UserDisplayName: TAbdiukov
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-03T23:02:12.390Z
Answers.LastActivityDate: 2024-07-14T13:22:05.707Z
Answers.LastEditDate: 2024-07-14T13:22:05.707Z
Answers.UserDisplayName: sfxedit
Body: <p>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?</p>
  
Tags: <editing><lossless>
Title: How to cut MPEG and H.264 files frame-accurately without re-encoding?
UserDisplayName: TAbdiukov
ThreadText: # How to cut MPEG and H.264 files frame-accurately without re-encoding?
  
  (Asked by: username_0 on 2022-01-04)
  
  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?
  
  **Tags:** editing, lossless
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2022-02-03. Score: 6 | Accepted answer
  
  [Avidemux](http://fixounet.free.fr/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](https://www.avidemux.org/admWiki/doku.php?id=using:cutting).
  
  ---
  
  Another free and opensource software that is capable of doing **lossless video and audio** editing is [LosslessCut](https://github.com/mifi/lossless-cut). 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.
  
  > **Comments:**
  > **username_0**: Upvoted, thanks for sharing info!  
  > **username_1**: 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"?](https://stackoverflow.com/help/accepted-answer) to learn more.  
  > **username_0**: Hey @username_1 , 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'?  
  > **username_1**: @username_0 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?](https://meta.stackexchange.com/questions/11740/what-are-community-wiki-posts). For this, you should make a request here https://video.meta.stackexchange.com/ and if the mods are satisfied they can convert this post to a wiki.  
  > **username_0**: Sorry for the delay - done  
  
  ---
  
  ### Answer by username_0 on 2022-01-04. Score: 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](https://www.fame-ring.com/smart_cutter.html). 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](https://forum.videohelp.com/threads/391669-Trying-to-use-Smart-Cutter-for-1920x1080-video#post2580152))
  
  Ever since Windows 7, the [software is reported to crash, especially when seeking too fast](https://forum.videohelp.com/threads/331916-Smart-Cutter-for-DV-and-DVB-crashes). It's possible to avoid crashes either by seeking slowly or by using an XP VM.
  
  
  ---
  
  