2016-12-31, 12:35 AM
Code:
###########################################################################################
### DeFade: recovers the faded part of a clip ###
### ###
### Usage: DeFadeIn(clip,frames) and DeFadeOut(clip,frames) ###
### ###
### The frames number includes the most near to the unfaded, and the nearest to black ###
### Nearest black frame(s) suffers of banding ###
### ###
### AviSynth script made by Gavino, using Motenai Yoda's method - Created: 2016-12-29 ###
### Original idea: spoRv - reference: http://forum.doom9.org/showthread.php?t=174140 ###
### ###
### Creative Commons 4,0 - Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) ###
### Link to the licence page: https://creativecommons.org/licenses/by-sa/4.0/ ###
###########################################################################################
function DefadeOut(clip c, int frames) {
c
Animate(framecount-frames-1, framecount, "Defade2", 1.0, 0.0)
}
function DefadeIn(clip c, int frames) {
c.reverse
Animate(framecount-frames-1, framecount, "Defade2", 1.0, 0.0)
reverse
}
# Helper function to be animated by Defade()
function Defade2(clip c, float div) {
mx = 1.0/div
c.mt_lut(expr="x 128 - "+string(mx)+" * 128 +", yexpr="x 16 - "+string(mx)+" * 16 +",u=3,v=3)
}
To be perfect, if should include also the frame number where the defade should start; but I'm too lazy to do that, so it's up to you - waiting for your modifications!
Happy New Year!