Avidemux Forum

Avidemux => Windows => Topic started by: conhelio on October 03, 2020, 08:50:05 AM

Title: Manual / Help to use Avidemux as beginner (Windows 10)
Post by: conhelio on October 03, 2020, 08:50:05 AM
Hi, is there any basic manual available describing how to work with avidemux? The help button doesn´t appear to provide this kind of info... ???
Thanks for any hints!
Title: Re: Manual / Help to use Avidemux as beginner (Windows 10)
Post by: eumagga0x2a on October 03, 2020, 08:58:05 AM
Please describe your goal and I will try to give you a step-by-step guide.
Title: Re: Manual / Help to use Avidemux as beginner (Windows 10)
Post by: conhelio on October 03, 2020, 12:10:54 PM
Hi, I want to edit a videoclip MP4 format, just cutting parts, e. g. beginning, end, or cutting a piece in the middle. I have found I have to use the markers A and B, but not really how to do it. A step by step guide would be helpful.

So is there really no manual or similar around?

Thanks anyway for your help!
Title: Re: Manual / Help to use Avidemux as beginner (Windows 10)
Post by: eumagga0x2a on October 03, 2020, 12:29:17 PM
Quote from: conhelio on October 03, 2020, 12:10:54 PMI want to edit a videoclip MP4 format, just cutting parts, e. g. beginning, end, or cutting a piece in the middle.

With or without re-encoding the video stream?

Quote from: conhelio on October 03, 2020, 12:10:54 PMSo is there really no manual or similar around?

There are pretty many third-party tutorials around, mostly severely outdated or incorrect.
Title: Re: Manual / Help to use Avidemux as beginner (Windows 10)
Post by: eumagga0x2a on October 03, 2020, 01:01:02 PM
I'll go ahead and provide a walk-through for the case of cutting in copy mode (re-encoding is simpler).

0. The most important thing: please use the latest Avidemux nightly, it has got a lot of important fixes, not present in the last release.

https://avidemux.org/nightly/win64/ (these are cross-compiled builds)

or

https://avidemux.org/nightly/vsWin64 (these are native builds)

At the moment of writing the 64-bit build from the former directory is more recent. It doesn't matter much which one you use unless you need VapourSynth support which is possible only with native builds – if you don't know what VapourSynth is, you don't need to care, just grab the newest.

1. Load the video

2. Make sure that "MP4 Muxer" is selected as output format and both video codec and audio codec are set to "Copy".

3. Is the video displayed in the right orientation? If it is on the side or upside-down, press the button to open the configuration dialog for the output format and set Rotation to the right angle.

4. Drag the navigation slider approximately to the location where you would like to start to cut away a piece of the video, refine the position with UP and DOWN arrows (both the navigation slider and the UP and DOWN arrow keys seek to keyframes – the type of frames where cut points in case of cutting in copy mode must be placed).

5. Set marker A here.

6. Repeat Step 4 to find the suitable keyframe to place the end point of the cut.

7. Set marker B here.

8. Press "Delete".

If you get a warning that the stream is using non-IDR frames as keyframes TAKE IT VERY SERIOUSLY, don't override it and try to find a combination of start and end point which doesn't trigger this warning.

9. If you need more cuts within the video, repeat Steps 4-8 accordingly.

10. Navigate to the keyframe where you would like to start the output.

11. Set marker A here.

12. Navigate to the keyframe where you would like the video to end.

Please note: this frame doesn't need to be a keyframe, but it is not a keyframe, the real last frame in the output may be slightly different, depending on stream properties.

13. Set marker B here.

14. Save the video (Ctrl+S).

If you get errors: please don't hesitate to ask.

(edited, forgot to mention that marker B must be set before saving)
Title: Re: Manual / Help to use Avidemux as beginner (Windows 10)
Post by: conhelio on October 03, 2020, 04:30:20 PM
Hello, thanks for your quick answers! Indeed I meant copy mode, without new encoding. From my limited understanding of video editing until now, is it correct that encoding mode might be simpler, but it would take considerably more time to  produce the final result, especially if you are dealing with long videos (2 hours, 900 MB mp4 file)?

I will try to go through your detailed description, but let´s be sure about the best release. I have now 2.7.6, installed this morning. Last seems to be 2.7.7 date 1. October, so I would update. Is there any difference in result doing this via the .exe file versus first downloading the zip file?

And yes, I realized there are third party "help" files.. indeed not up to date. Mostly leading you to other products (e. g. filmora).

Thanks!
Title: Re: Manual / Help to use Avidemux as beginner (Windows 10)
Post by: eumagga0x2a on October 03, 2020, 06:39:34 PM
Quote from: conhelio on October 03, 2020, 04:30:20 PMFrom my limited understanding of video editing until now, is it correct that encoding mode might be simpler, but it would take considerably more time to  produce the final result, especially if you are dealing with long videos (2 hours, 900 MB mp4 file)?

It would take not just much more time and computational power but it implies also a quality loss unless using a lossless codec which means huge output size and, depending on codec, is often also very slow. But it is independent from the structure of the source video stream, i.e. cut points can be set to any frame. Applying video filters mandates re-encoding.

Quote from: conhelio on October 03, 2020, 04:30:20 PMI have now 2.7.6, installed this morning. Last seems to be 2.7.7 date 1. October, so I would update.

Yes, please do. Substantial bugs in cut point check for copy mode were discovered and fixed only after the 2.7.6 release.

QuoteIs there any difference in result doing this via the .exe file versus first downloading the zip file?

The release is a VC++ build (a native build), you can keep all of them if you want (the VC++-built release, an exe-packaged MinGW build (a cross-compiled build) and a ZIP-packaged cross-compiled build elsewhere), just never mix them in the same directory and never run them simultaneously.
Title: Re: Manual / Help to use Avidemux as beginner (Windows 10)
Post by: conhelio on October 04, 2020, 09:55:53 AM
Good morning.. or day or whatever time it is in your place.
Thanks, I followed your steps with the updated version and it works. The only thing I found surprising in my test video (it is a 14 second test video, which I edited before in movie maker from Windows10), the key frames apparently are exactly every 2 seconds, precisely. Is this usual?
Title: Re: Manual / Help to use Avidemux as beginner (Windows 10)
Post by: eumagga0x2a on October 04, 2020, 11:09:29 AM
The decision where to insert a keyframe depends on video encoder and its configuration. High quality software encoders like x264 for the H.264 codec use three values for that: the minimum number of frames between keyframes, the maximum number of frames between keyframes and a measure of how much a picture differs from the preceding one.

Hardware encoders often take the easy path and use just a fixed interval. 2 seconds (100 frames at 25 fps) look in general like a good compromise between seek granularity and compression rate, but if the degree of changes in the picture is not taken into account (no keyframe inserted at scene change), then it is what it is.
Title: Re: Manual / Help to use Avidemux as beginner (Windows 10)
Post by: conhelio on October 13, 2020, 08:34:46 PM
Hi, now I have successfully edited (cut) some video files. Can you also explain how I could reduce the file size (compress) some files? I come up with 2 GB file sizes for a 2 hours recording (original source are zoom recordings of conference sessions). I would like to reduce size by factor of 2 or 4 to make streaming easier.
Any hints welcome!
Title: Re: Manual / Help to use Avidemux as beginner (Windows 10)
Post by: eumagga0x2a on October 13, 2020, 10:12:52 PM
Please provide the text output of MediaInfo for one of such video files.
Title: Re: Manual / Help to use Avidemux as beginner (Windows 10)
Post by: conhelio on October 13, 2020, 10:48:18 PM
Sorry, but I don´t know where to find that. When I open the file in Avidemux, or where do I get that Mediainfo?
Title: Re: Manual / Help to use Avidemux as beginner (Windows 10)
Post by: eumagga0x2a on October 13, 2020, 10:55:35 PM
MediaInfo is a great standalone application, it is not related to Avidemux: https://mediaarea.net/en/MediaInfo
Title: Re: Manual / Help to use Avidemux as beginner (Windows 10)
Post by: conhelio on October 14, 2020, 08:46:04 PM
Please find the file attached. I had difficulties to send yesterday, first said it contained contact info, and then that I had used the reply option too frequently.
Title: Re: Manual / Help to use Avidemux as beginner (Windows 10)
Post by: eumagga0x2a on October 14, 2020, 09:18:17 PM
Thank you. The bitrate of mere 1448 kb/s for a H.264 video in a 4K resolution is extremely low, so the first question is whether it is acceptable for you to reduce resolution to 1920x1080 or even to 1280x720. Another question is whether the target device supports HEVC or you have to stick to H.264.

Honestly, I don't think that the bitrate can be significantly (above factor 2) reduced without quality becoming totally terrible even when going all the way down to 1280x720. HEVC would help to improve quality at low bitrates, but not all devices support it, and the codec is very heavy computationally.
Title: Re: Manual / Help to use Avidemux as beginner (Windows 10)
Post by: conhelio on October 16, 2020, 10:15:56 PM
Thank you! Honestly I have no idea why this video is in 4k resolution, while others (all produced from zoom recordings of conference sessions in the same way) are in 1920x1080. Having said that, I think reducing resolution would be the first step, can I do this with avidemux?
Title: Re: Manual / Help to use Avidemux as beginner (Windows 10)
Post by: eumagga0x2a on October 16, 2020, 10:48:12 PM
Quote from: conhelio on October 16, 2020, 10:15:56 PMI think reducing resolution would be the first step, can I do this with avidemux?

Sure, please have a look at the "swsResize" video filter (you need to choose a video codec first, filters are not available in copy mode).
Title: Re: Manual / Help to use Avidemux as beginner (Windows 10)
Post by: conhelio on October 18, 2020, 09:50:29 PM
Thanks, I tried with a short HD-testvideo. I don´t find swsResize Filter, but swScale (maybe because my language version of avidemux is German?). It allows to reduce resolution, but suprisingly a resolution to 45% (846x480 pxl) increases the filesize from about 35 MB to 43 MB. Apart from that, it works.
Title: Re: Manual / Help to use Avidemux as beginner (Windows 10)
Post by: eumagga0x2a on October 19, 2020, 12:08:57 PM
Yes, the original English name is "swsResize", the German translation is "Bildgröße ändern (swScale)". libswscale (short: sws) is the library which does the job.

Quote from: conhelio on October 18, 2020, 09:50:29 PMsuprisingly a resolution to 45% (846x480 pxl) increases the filesize from about 35 MB to 43 MB.

Compressing with which encoder with which codec? If x264 --> H.264, then it is not surprising at all as I already mentioned how strongly compressed the source was. By all means, you need to do 2-pass encoding with given output size. I don't know whether this helps with that particular video, but you could additionally try to increase the number of reference frames to 5 as used by the source video.

Using HEVC would allow for a significantly better compression and quality, but HEVC is not universally supported by hardware decoders and very computationally expensive when decoded in software.

VP9 allows excellent quality, but the rate control seems to be very broken, the encoder is unbelievably slow in modes providing high quality while support by hardware decoders is even worse than for HEVC.