adm = Avidemux()
ed = Editor()
gui = Gui()
if not adm.isFileOpen():
gui.displayError("1s fade-in + 3s fade-out", "No video loaded")
return
# require at least 4 seconds to be selected
if (adm.markerA < 0):
adm.markerA = 0
if (adm.markerB < 0):
adm.markerB = 0
if (adm.markerB > ed.getVideoDuration()):
adm.markerB = ed.getVideoDuration()
if (adm.markerB - adm.markerA < 4 * 1000 * 1000):
gui.displayError("1s fade-in + 3s fade-out", "Selection too short, must be at least 4 seconds")
return
fadeInDuration = 1000 # in ms
fadeOutDuration = 3 * 1000 # in ms
fadeInStart = int(adm.markerA / 1000)
fadeOutStart = int((adm.markerB - 3 * 1000 * 1000) / 1000)
adm.addVideoFilter("fadeToBlack", "startFade=" + str(fadeInStart), "endFade=" + str(fadeInStart + fadeInDuration), "inOut=True", "toBlack=True")
adm.addVideoFilter("fadeToBlack", "startFade=" + str(fadeOutStart), "endFade=" + str(fadeOutStart + fadeOutDuration), "inOut=False", "toBlack=True")
gui.displayInfo("Done", "Fade-in and fade-out added. Select video codec other than \"Copy\" to re-encode video")
Quote from: eumagga0x2a on March 26, 2024, 11:24:09 AM"Taille du fichier: 756 Octets".Missed bytes (instead of megabytes) in the translation. Lav58.29.100 indicated an older version.