Loading (not appending) a new video resets the encoder settings to "Copy"

Started by eumagga0x2a, August 17, 2016, 05:36:41 PM

Previous topic - Next topic

eumagga0x2a

STR:


  • Select and configure your desired encoder(s), then "Edit" --> "Save current settings as default"
  • Restart Avidemux, enjoy your encoder settings being restored
  • Load a video.

Actual Results:
Encoders are reset to "Copy". You have to reload the configuration from "Recent" --> "Recent Projects" or probably setup everything from scratch again if you are new to Avidemux.

Expected Results:
Retain encoder (and filter) settings across videos.

I know that this is by design. However, the current behaviour looks strange in context of Avidemux loading the user defined default settings on startup, but discarding them immediately once the user starts to use the software.

mean


Toto

This behaviour is really annoying to me, I think an option to allow retaining settings between projects, just like 2.6.10 and before, is really needed.

The way I mostly use Avidemux is for quickly editing hundreds of small videos in a similar way, my workflow is usually like that:

  • Load my custom settings once at the start of Avidemux
  • Seek with the mouse to the beginning of the part that I want to keep
  • Fine tune the frame with the left and right arrows
  • Mark the beginning with "["
  • Do the same as 2., 3., and 4. but for the end with "]"
  • Press Ctrl+S to save and encode
  • Press Ctrl+W to close video
  • Drag and drop the next video to edit
  • Repeat from number 2.

I'm really glad that Avidemux exists and allows me to edit small videos so fast!

Jan Gruuthuse

Have you tried Avidemux Menu: Edit: Keep current settings as default?

If this does not help: When you done making your settings:
Avidemux Menu: File: Project Script: Save As Project.
the project is saved as .py file, edit this file and remove the specific video file relations:
similar to these:
adm.loadVideo("/media/user/source/720p4audioTracks3satá´´á´°.ts")
adm.clearSegments()
adm.addSegment(0, 0, 37930000)
adm.markerA = 0
adm.markerB = 37930000
adm.videoCodec("Copy")

and then follow this guide: Custom Menu and Saved projects
now you should be able to call these settings from Avidemux Menu: Custom

Toto

Quote from: Jan Gruuthuse on September 11, 2016, 05:25:21 AM
Have you tried Avidemux Menu: Edit: Keep current settings as default?

That's the first thing that I tried, but those defaults only get loaded when Avidemux is started, but as soon as I open a video both encoders reset to "Copy"
This is issue is exactly what OP already describes.

Quote from: Jan Gruuthuse on September 11, 2016, 05:25:21 AM
If this does not help: When you done making your settings:
Avidemux Menu: File: Project Script: Save As Project.
the project is saved as .py file, edit this file and remove the specific video file relations:
similar to these:
adm.loadVideo("/media/user/source/720p4audioTracks3satá´´á´°.ts")
adm.clearSegments()
adm.addSegment(0, 0, 37930000)
adm.markerA = 0
adm.markerB = 37930000
adm.videoCodec("Copy")

and then follow this guide: Custom Menu and Saved projects
now you should be able to call these settings from Avidemux Menu: Custom

I already use that, but I don't want to have to do it for every video that I edit! I spend between 30 seconds and 2 minutes on each video usually.
This is my current script:

adm = Avidemux()
adm.videoCodec("x265", "useAdvancedConfiguration=False", "general.params=CQ=5", "general.poolThreads=4", "general.frameThreads=4", "general.preset=slow", "general.tuning=psnr", "general.profile=main", "level=-1", "vui.sar_height=1"
, "vui.sar_width=1", "MaxRefFrames=3", "MinIdr=25", "MaxIdr=250", "i_scenecut_threshold=40", "MaxBFrame=3", "i_bframe_adaptive=1", "i_bframe_bias=0", "i_bframe_pyramid=2", "b_deblocking_filter=True", "interlaced_mode=0"
, "constrained_intra=False", "lookahead=40", "weighted_pred=2", "weighted_bipred=True", "cb_chroma_offset=0", "cr_chroma_offset=0", "me_method=3", "me_range=16", "subpel_refine=5", "trellis=1", "psy_rd=1.000000"
, "fast_pskip=True", "dct_decimate=True", "noise_reduction=0", "noise_reduction_intra=0", "noise_reduction_inter=0", "ratecontrol.rc_method=0", "ratecontrol.qp_constant=0", "ratecontrol.qp_step=4", "ratecontrol.bitrate=0"
, "ratecontrol.rate_tolerance=1.000000", "ratecontrol.vbv_max_bitrate=0", "ratecontrol.vbv_buffer_size=0", "ratecontrol.vbv_buffer_init=0", "ratecontrol.ip_factor=1.400000", "ratecontrol.pb_factor=1.300000"
, "ratecontrol.aq_mode=2", "ratecontrol.aq_strength=1.000000", "ratecontrol.cu_tree=True", "ratecontrol.strict_cbr=False")
adm.audioCodec(0, "Faac");
adm.setContainer("MKV", "forceDisplayWidth=False", "displayWidth=1280")

Jan Gruuthuse

You only create the script once with your preferred settings.
So you have a script without a reference to any videofile
name it example: "MyDefaults.py"
and place it in the current user folder for avidemux 2.6.
For Linux this would be
Quote/home/user/.avidemux6/custom/
if the folder custom does not exists, make one there.

Windows has an equivalent location.

After loading the video you can now load the script from Avidemux Menu => Custom

You Should  see now the name of the script you put there "MyDefaults"

eumagga0x2a

Yes, a workaround exists. No, there shouldn't be any need for such a workaround in the first place.

Quote from: Toto on September 12, 2016, 06:30:47 PM
This is my current script:

adm = Avidemux()
adm.videoCodec("x265", "useAdvancedConfiguration=False", "general.params=CQ=5", "general.poolThreads=4", "general.frameThreads=4", "general.preset=slow", "general.tuning=psnr", "general.profile=main", "level=-1", "vui.sar_height=1"
, "vui.sar_width=1", "MaxRefFrames=3", "MinIdr=25", "MaxIdr=250", "i_scenecut_threshold=40", "MaxBFrame=3", "i_bframe_adaptive=1", "i_bframe_bias=0", "i_bframe_pyramid=2", "b_deblocking_filter=True", "interlaced_mode=0"
, "constrained_intra=False", "lookahead=40", "weighted_pred=2", "weighted_bipred=True", "cb_chroma_offset=0", "cr_chroma_offset=0", "me_method=3", "me_range=16", "subpel_refine=5", "trellis=1", "psy_rd=1.000000"
, "fast_pskip=True", "dct_decimate=True", "noise_reduction=0", "noise_reduction_intra=0", "noise_reduction_inter=0", "ratecontrol.rc_method=0", "ratecontrol.qp_constant=0", "ratecontrol.qp_step=4", "ratecontrol.bitrate=0"
, "ratecontrol.rate_tolerance=1.000000", "ratecontrol.vbv_max_bitrate=0", "ratecontrol.vbv_buffer_size=0", "ratecontrol.vbv_buffer_init=0", "ratecontrol.ip_factor=1.400000", "ratecontrol.pb_factor=1.300000"
, "ratecontrol.aq_mode=2", "ratecontrol.aq_strength=1.000000", "ratecontrol.cu_tree=True", "ratecontrol.strict_cbr=False")
adm.audioCodec(0, "Faac");
adm.setContainer("MKV", "forceDisplayWidth=False", "displayWidth=1280")


Off-topic: users argue in x265 Configuration - empty / blank "Tuning" not available that Avidemux forcing tuning when encoding in x265 is detrimental. Could you please test if replacing "general.tuning=psnr" in your script with "general.tuning=" works? If it does, this would be a nice workaround for another shortcoming of the GUI.

A small nit: https://trac.ffmpeg.org/wiki/Encode/AAC rates FAAC as the worst AAC encoder available. Use rather the ffmpeg's internal one.

Jan Gruuthuse

Quote from: eumagga0x2a on September 13, 2016, 06:04:57 AM
Yes, a workaround exists. No, there shouldn't be any need for such a workaround in the first place.
As user you can only work with the tools you provided with.
Workaround is there to provide a workable solution, until it is changed in avidemux by developer(s).
Custom is there to avoid doing repetitive work over and over again.

Toto

Quote from: Jan Gruuthuse on September 13, 2016, 04:22:32 AM
You only create the script once with your preferred settings.
So you have a script without a reference to any videofile
name it example: "MyDefaults.py"
and place it in the current user folder for avidemux 2.6.
For Linux this would be
Quote/home/user/.avidemux6/custom/
if the folder custom does not exists, make one there.

Windows has an equivalent location.

After loading the video you can now load the script from Avidemux Menu => Custom

You Should  see now the name of the script you put there "MyDefaults"

I know that very well and I use custom settings already since several years, but I don't want to open the "custom" menu and select my settings every time I open a video! I just want to do it once for my editing session instead of a hundred times!
In Avidemux 2.6.10 and previous versions, the settings stay the same when I close a video and open an other one, which is perfect for me, but unfortunately this behavior was removed in recent versions, and that's the whole point of this thread.
So I have no choice but to stay on 2.6.10 for now, which is fine.

Jan Gruuthuse

#9
OK, think I get your point/understand what is going on.

Loading a new video resets both Video Output And Audio Output settings. While the settings made to Video Output And Audio Output are saved in the Save current settings as default
These are only loaded when Avidemux starts.

The question is now: Can "Save current settings as default" be loaded after a new video is loaded into Avidemux?

And Users should be made aware of this.
- don"t make setting changes before video is loaded
- load preferred settings from Custom (if you do work regularly with different workflow(s))
- Save current settings as default

Now every time you load a new video: default settings are applied to this new video
When you change work flow either:
- Save current settings as default (one of)
- or load settings from Custom and Save current settings as default

Dev(s): Can you change behaviour when loading new video the Save current settings as default is loaded?

eumagga0x2a

The following minimal patch should fix the issue:

diff --git a/avidemux/common/gui_main.cpp b/avidemux/common/gui_main.cpp
index 1a73404..d3c1baa 100644
--- a/avidemux/common/gui_main.cpp
+++ b/avidemux/common/gui_main.cpp
@@ -662,7 +662,6 @@ int A_openVideo (const char *name)
         res = video_body->addFile(longname);

     //  DIA_StopBusy ();
-    UI_reset();
     // forget last project file
     video_body->setProjectName("");


I have not seen any ill effects testing a build including this patch so far.

edit: please note that filters do get reset when loading a new video and this is a good thing, I think.