Avidemux Forum

Participate => User interface and Usability => Topic started by: nekomaru22 on September 26, 2020, 02:03:24 AM

Title: set it to mp3
Post by: nekomaru22 on September 26, 2020, 02:03:24 AM
I want to set it to mp3.
After save current settings as default
The next time you start it, the Output Format will be mp4.
Audio Output remains Copy.
WS000723.JPGWS000722.JPG
Title: Re: set it to mp3
Post by: eumagga0x2a on September 26, 2020, 05:29:35 PM
Avidemux indeed doesn't save audio output configuration because this configuration is created per audio track and it is not guaranteed that a file has one (trying to add an audio track which is not there = crash).

With a future Avidemux nightly, you could save

adm = Avidemux()
gui = Gui()

if adm.audioTotalTracksCount():
    adm.audioClearTracks()
    adm.audioAddTrack(0)
    adm.audioCodec(0, "Lame", "bitrate=192", "preset=0", "quality=2", "disableBitReservoir=False")
    return
gui.displayInfo("Warning", "No audio tracks to add")

as e.g. "MP3.py" in the "custom" subfolder of the Avidemux profile directory (%appdata%\avidemux\custom) and use it from the "Custom" menu. Alternatively, you could append

if adm.audioTotalTracksCount():
    adm.audioClearTracks()
    adm.audioAddTrack(0)
    adm.audioCodec(0, "Lame", "bitrate=192", "preset=0", "quality=2", "disableBitReservoir=False")
    return

to "defaultSettings.py" file in %appdata%\avidemux\ folder. If you want a differnt bitrate, please adjust the code accordingly.

Don't try this with a build compiled before today (Sep. 26) – it won't have audioTotalTracksCount() method I've just added to the interface. Without this check, Avidemux would crash if a video doesn't have an audio track.