News:

--

Main Menu

Newbie questions

Started by rhino, March 25, 2025, 03:29:41 AM

Previous topic - Next topic

rhino

I had Avidemux recommended to me to do some editing for a presentation I want to do. I've downloaded and installed it without incident but I'm struggling with certain aspects of it so I hope someone can help me. I'm running the Windows 64 bit version in Windows 10.

First of all, I'm using version 2.8.1 which was the current version when I downloaded it a few weeks back. That seems to make it newer than the "main version 2.6" which is the title of this forum. Is this the right place to ask about issues with 2.8.1 or should I be somewhere else?

And now my main question. I know that the frame type for each frame of the video I am editing is shown at the bottom of the panel beneath the control buttons. I know that keyframes and i-frames are the same thing; P-frames and B-frames are interframes and are definitely NOT keyframes.

I am essentially cutting out scenes from a longer video - roughly 45 minutes long - so that I can show them individually within my presentation. Each scene will be discussed for a few minutes, then I'll show the next scene.

I know how to set the A and B markers and then click on delete to get rid of scenes that I don't want but most of the time when I do this, I get a message complaining that I'm not cutting on a keyframe and this will corrupt the file. If I use the controls to set the A and B markers on keyframes, the keyframes never seem to be where the scene ends or begins. I don't know how to reconcile this. I want the scenes that are saved or deleted to be complete, not to be chopped off a few seconds too soon or too late.

How do I do that?

szlldm

If you need to do frame accurate cutting, then you have to re-encode the video. On the left, at Video output change "Copy" to one of your preferred codec. If unsure, select "Mpeg4 AVC (x264)".

sark

Keyframe trimming is only practical from some sources. My camcorder places keyframes at approx half second intervals. Also, because keyframe referencing is mostly done in a backwards direction the B frame can often reside on an intermediate frame. Footage recorded with a greater distance between keyframes will mostly require re-encoding.

It is also worth mentioning that re-encoding does not have to impact the quality of the output. It is mostly an issue of the additional time taken to re-encode compared to keyframe trimming in copy mode.

rhino

Quote from: szlldm on March 25, 2025, 07:04:10 AMIf you need to do frame accurate cutting, then you have to re-encode the video. On the left, at Video output change "Copy" to one of your preferred codec. If unsure, select "Mpeg4 AVC (x264)".

I'm very new to video editing. Are you saying that if I change Video output to "Mpeg4 AVC (x264)" from "Copy" that this will re-encode the video for me when I click on Save? Or does this only format the file so that Avidemux (or some other program) can re-encode it in a separate operation? Does it matter if the source file that I'm trying to edit is in MKV format?

I'm wondering if an alternate approach would work. My keyframes are 10 seconds apart. If I made a point a point of finding the existing keyframe immediately prior to the start of the scene that I want to keep and set it as the A marker and then find the existing keyframe immediately after the end of the scene and then set that as the B marker, my scenes would have several frames at the beginning and end that I don't want. Could I overlay the surplus frames at the beginning and end with something like a black frame or transparency so that they wouldn't be seen by the audience of my presentation? Perhaps this would be an easier alternative.

eumagga0x2a

Quote from: rhino on March 25, 2025, 03:29:41 AMI'm using version 2.8.1

I would recommend using the latest known good 2.8.2 developer build which is at the moment r241212 from https://avidemux.org/nightly/win64/ rather than the last release which has got long in the tooth. This won't remove the fundamental limitations of the structure of a compressed video stream, but I deem it a lot less buggy than the ancient 2.8.1.

Quote from: rhino on March 25, 2025, 03:29:41 AMIs this the right place to ask about issues with 2.8.1

Yes, it is exactly the right place, unless you suspect that your topic is specific to a particular operating system (which is not the case here). "2.6" should have been "anything newer than 2.5.x" as Avidemux was essentially rewritten after the 2.5.x generation.

Quote from: rhino on March 25, 2025, 03:29:41 AMI know how to set the A and B markers and then click on delete to get rid of scenes that I don't want

As far as I understand your goal, this is an inefficient approach. Instead of deleting what you don't need, export what you do.

Quote from: rhino on March 25, 2025, 03:29:41 AMI know that keyframes and i-frames are the same thing

No, they are not. It is just a limitation of Avidemux GUI (legacy from an epoch as DivX marked the state of the art regarding video compression) that doesn't differentiate between IDR (instantaneous decoder refresh, always a keyframe), I-frames (intra-coded frame, not necessarily a keyframe) and keyframes (either IDR or a so-called "recovery" frame, i.e. a non-IDR frame from where a decoder can begin decoding and avoid outputting incomplete pictures). I'm not delving into further details right now, but this is a fundamental (mathematical) limitation of video compression that a video must start with a keyframe.

Quote from: rhino on March 25, 2025, 03:08:38 PMif I change Video output to "Mpeg4 AVC (x264)" from "Copy" that this will re-encode the video for me when I click on Save?

Yes, this is how Avidemux works.

Quote from: rhino on March 25, 2025, 03:08:38 PMDoes it matter if the source file that I'm trying to edit is in MKV format?

The source container is entirely irrelevant.

Quote from: rhino on March 25, 2025, 03:08:38 PMIf I made a point a point of finding the existing keyframe immediately prior to the start of the scene that I want to keep and set it as the A marker and then find the existing keyframe immediately after the end of the scene and then set that as the B marker, my scenes would have several frames at the beginning and end that I don't want. Could I overlay the surplus frames at the beginning and end with something like a black frame or transparency so that they wouldn't be seen by the audience of my presentation?

Theoretically, this could be achieved with edit lists feature of QuickTime / MP4, but Avidemux doesn't support it for export. Unsure about support by various video players.

Therefore, the easiest and the only reliable solution it to re-encode the video stream during export.

rhino

Quote from: eumagga0x2a on March 25, 2025, 08:32:08 PM
Quote from: rhino on March 25, 2025, 03:29:41 AMI'm using version 2.8.1

I would recommend using the latest known good 2.8.2 developer build which is at the moment r241212 from https://avidemux.org/nightly/win64/ rather than the last release which has got long in the tooth. This won't remove the fundamental limitations of the structure of a compressed video stream, but I deem it a lot less buggy than the ancient 2.8.1.

Okay, I've installed 2.8.2 (the December 2024 build).

Quote from: rhino on March 25, 2025, 03:29:41 AMIs this the right place to ask about issues with 2.8.1

Yes, it is exactly the right place, unless you suspect that your topic is specific to a particular operating system (which is not the case here). "2.6" should have been "anything newer than 2.5.x" as Avidemux was essentially rewritten after the 2.5.x generation.

I had a feeling the title was a bit dated when I didn't see categories for anything newer.

Quote from: rhino on March 25, 2025, 03:29:41 AMI know how to set the A and B markers and then click on delete to get rid of scenes that I don't want

As far as I understand your goal, this is an inefficient approach. Instead of deleting what you don't need, export what you do.

THAT is useful information. I've looked at several YouTube videos, starting with ones that were for basic editing for beginners and including a more detailed one but none of them really addressed efficient use of Avidemux.

To be more specific, I have a 45 minute long video and I want to clip selected scenes from it. The scenes run from a minute or two up to 4 minutes. Presumably, I begin by opening the video in Avidemux and then locating the start and end points of the first scene I want. I mark those start and end points with the A and B markers respectively, then export (via the Save command), which will re-encode that scene to mp4 if that's what I've chosen for Video Output format. The exported file should be named so that it reflects the scene content and will be in mp4. Then I repeat for the other scenes I want. Is that all correct?

Quote from: rhino on March 25, 2025, 03:29:41 AMI know that keyframes and i-frames are the same thing

No, they are not. It is just a limitation of Avidemux GUI (legacy from an epoch as DivX marked the state of the art regarding video compression) that doesn't differentiate between IDR (instantaneous decoder refresh, always a keyframe), I-frames (intra-coded frame, not necessarily a keyframe) and keyframes (either IDR or a so-called "recovery" frame, i.e. a non-IDR frame from where a decoder can begin decoding and avoid outputting incomplete pictures). I'm not delving into further details right now, but this is a fundamental (mathematical) limitation of video compression that a video must start with a keyframe.

I really don't want to open a can of worms but I'm a little confused. There was a clear claim that keyframes and i-frames are the same thing in the longest video I saw. Apparently, that is wrong (or perhaps outdated: the video was 4 years old.) What does this mean for what I'm trying to do? Can I cut my file on any frame type regardless of it is is i-frame, p-frame or b-frame without corrupting the original file or the exported one?

Quote from: rhino on March 25, 2025, 03:08:38 PMif I change Video output to "Mpeg4 AVC (x264)" from "Copy" that this will re-encode the video for me when I click on Save?

Yes, this is how Avidemux works.

Excellent. That's clear :-)

Quote from: rhino on March 25, 2025, 03:08:38 PMDoes it matter if the source file that I'm trying to edit is in MKV format?

The source container is entirely irrelevant.

Perfect: one less thing to worry about :-)

Quote from: rhino on March 25, 2025, 03:08:38 PMIf I made a point a point of finding the existing keyframe immediately prior to the start of the scene that I want to keep and set it as the A marker and then find the existing keyframe immediately after the end of the scene and then set that as the B marker, my scenes would have several frames at the beginning and end that I don't want. Could I overlay the surplus frames at the beginning and end with something like a black frame or transparency so that they wouldn't be seen by the audience of my presentation?

Theoretically, this could be achieved with edit lists feature of QuickTime / MP4, but Avidemux doesn't support it for export. Unsure about support by various video players.

Therefore, the easiest and the only reliable solution it to re-encode the video stream during export.

I wish I'd known that the first time I tried to edit my file.

I've taken several runs at it but most of them were based on sheer guesswork since I know very little about the file structures involved and if there is a tutorial on how to edit with Avidemux, I haven't seen it. When my guesswork failed, I tried watching videos but they are obviously flawed too. It's looking like I've finally found a place where I can ask questions and get expert advice! :-)


rhino

I have finished editing my files and am very happy with the results. It was particularly helpful to learn that it was much better to mark the beginning and end of each scene I wanted on the exact start and end frames of the scene with the A and B markers and then Save that. That was a MUCH better approach than trying to cut the scenes individually (or cutting out the bits I didn't want).

Thank you all very much for your guidance! I'll be sure to drop in again if I find myself editing other videos :-)