News:

--

Main Menu

Scripting a FadeToBlack Filters

Started by nastyphoenix, December 20, 2021, 02:19:58 PM

Previous topic - Next topic

nastyphoenix

Avidemux 2.7.8 with OS Linux Mint 20.04 or/and 20.2
Hello
Everything is in the subject  :)

I have made a small bash in Linux that loads a sequence of AVI files ; the user choose the first and the last video with a "read -p".
My "sequence" is loaded in Avidemux.
I know how to save the file with a .py script or with the CLI but i want to add a Fade To Black filters (and maybe a greyscale).
No matter if the FadeToBlack is added by a .py script or by an Avidemux CLI.

Is it possible ?

Regards

sorry for my poor english i'm french.

eumagga0x2a

#1
adm = Avidemux()
ed = Editor()

if not ed.nbSegments():
    return

effectDuration = 3 * 1000 # in ms
videoDuration = ed.getVideoDuration() / 1000 # microseconds --> milliseconds
effectStart = videoDuration
if videoDuration <= effectDuration * 2:
    effectDuration = videoDuration / 2

effectStart -= effectDuration

adm.addVideoFilter("fadeToBlack", "startFade=0", "endFade=" + str(effectDuration), "inOut=True", "toBlack=True")
adm.addVideoFilter("fadeToBlack", "startFade=" + str(effectStart), "endFade=" + str(videoDuration), "inOut=False", "toBlack=True")

adds fade-in and fade-out of max 3 seconds duration to the currently loaded video. The script presumes a current Avidemux 2.8.0 (a nightly so far). It may work with 2.7.8 (untested).

Quote from: nastyphoenix on December 20, 2021, 02:19:58 PMsorry for my poor english i'm french.

https://avidemux.org/smif/index.php/board,2.0.html :-)

nastyphoenix

Hi
A very complete answer.
Thanks a lot I will test it as soon as possible.

nastyphoenix

It works like a charm.  ;)
You are an Hero.  8)

May I do something else to close this topic ?

THANKS AGAIN

eumagga0x2a

Glad that it worked, no need to close the topic.