News:

--

Main Menu

Change default settings.

Started by User007, March 29, 2022, 11:09:30 AM

Previous topic - Next topic

User007

How do i change default settings so every time i open program it already set like this?

szlldm

You have to edit defaultSettings.py
For help, check lastEdit.py after you made the required settings, and closed the app.
You should have some basic python skill though.
The audio settings are trickier, because it needs a video to be loaded, so after loading a video you have to reload the settings Edit/Load saved settings (Ctrl+R).
Audio settings have to be guarded in the python code:
if adm.audioTotalTracksCount() > 0:

User007

Quote from: szlldm on March 29, 2022, 01:08:52 PMYou have to edit defaultSettings.py
For help, check lastEdit.py after you made the required settings, and closed the app.
You should have some basic python skill though.
The audio settings are trickier, because it needs a video to be loaded, so after loading a video you have to reload the settings Edit/Load saved settings (Ctrl+R).
Audio settings have to be guarded in the python code:
if adm.audioTotalTracksCount() > 0:

Nice thanks my defaultSettings.py script looks like this if someone else needs.

adm = Avidemux()
adm.videoCodec("x264")
adm.audioCodec(0, "FDK_AAC")
adm.setContainer("MP4")

eumagga0x2a

Quote from: User007 on March 30, 2022, 01:07:52 PMadm.audioCodec(0, "FDK_AAC")

szlldm tried to explain you that you should not do it this way (albeit your code won't make current nightlies crash anymore). You should check in your code that at least one audio track exists:

if adm.audioTotalTracksCount() > 0:
    adm.audioCodec(0, "FDK_AAC")

Besides that, your code will always use the default configuration of x264, FDK_AAC and MP4, which may work, but depending on the properties of the source may produce poor results.

Last but not least, all user-defined entries in defaultSettings.py will be overwritten and lost when using the "Save current settings as default" menu action in Avidemux. Therefore, I would suggest placing custom configurations where it belongs – into the "custom" subdirectory of Avidemux profile, so that scripts can be selected from the "Custom" menu when needed.