Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
17th April 2021, 13:23 | #1 | Link |
Registered User
Join Date: May 2016
Posts: 235
|
Fading in and out with image?
I dont know if dissolve or fadein/fadeout is what I should use and what is best. I wan't the fade to begin at 405 with 29 frames fading in (only the image not the avi-file) and fading out with 29 frames and end at frame 558. This is the script I have so far:
Code:
A=DirectShowSource("D:\0000.avi") B=ImageSource("D:\present.png", start=0, end=A.framecount-1, fps=A.framerate, pixel_type="RGB32") C=Overlay(A,B, mask=B.showalpha()) A.Trim(0,404) ++ C.Trim(405,558) ++ A.Trim(558,0)
__________________
Automatic Colorization Last edited by color; 17th April 2021 at 13:35. |
17th April 2021, 14:21 | #2 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Maybe you want to restate your requirement a little more clearly.
Fade, transitions from black to normal image, or the other way around. [in or out] Dissolve overlaps [in your case 29 frames], so that your result length clip is 29 frame shorter due to the overlap. It starts out using all of one image/clip, and at end of dissolve uses all of the other image/clip, so result contains a bit of both, hence the overlap requirement.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
17th April 2021, 15:30 | #3 | Link |
Registered User
Join Date: Sep 2005
Posts: 130
|
As StainlessS mentioned, the requirement is not quite clear, and we can only guess from the script that you have.
However I gave it a try, excuse my newbieness though. Code:
A = FFmpegSource2("D:\App\youtube-dl\S2_E09_clip.mkv").KillAudio().TFM().TDecimate().ConvertToRGB32(matrix = "Rec601") B = ImageSource("D:\App\youtube-dl\flintstones.png", start=0, end=100, fps=A.framerate, pixel_type="RGB32") fdin = B.FadeIn(100) fdout = B.FadeOut(100) Afin = A.Trim(200,300) Afout = A.Trim(300,400) C = Overlay(Afin, fdin, mask=fdin.ShowAlpha()) D = Overlay(Afout, fdout, mask=fdout.ShowAlpha()) # if you want the image is faded in and then faded out WITHOUT overlay to the video #A.Trim(0,200) ++ fdin ++ fdout ++ A.Trim(200,687) # if you want the image is faded in and then faded out WITH overlay to the video A.Trim(0,200) ++ C ++ B ++ D ++ A.Trim(400,687) Last edited by patul; 17th April 2021 at 15:35. |
17th April 2021, 18:50 | #5 | Link | |
Guest
Posts: n/a
|
Quote:
Code:
A=AviSource("D:\0000.avi") B=ImageSource("D:\present.png", start=0, end=152, fps=A.framerate, pixel_type="RGB32") Dissolve( \Dissolve( \Trim(A, 0, 433), \B, \29), \Trim(A, 529, 0), \29) To begin a fade at 405, count forward the required number of frames, and adjust the call to Trim() accordingly, so that Dissolve() gives you the result that you want. The same principle applies to the fade out (although you count backwards instead). I've replaced DirectShowSource() with AviSource(). Use KillAudio() if necessary. Last edited by Richard1485; 17th April 2021 at 18:54. |
|
19th April 2021, 17:26 | #6 | Link |
Registered User
Join Date: May 2016
Posts: 235
|
Oh sorry. I see it's quite vage. What i ment was that the image has an transparent (png) and i want it to fade in from "invisible". I did however solved it. I did a "trim" similar to patul.
Thank you.
__________________
Automatic Colorization |
19th April 2021, 18:41 | #8 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
|
19th April 2021, 21:55 | #9 | Link | |
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,695
|
Quote:
If all the OP wants to do are fades and crossfades, it can be done using any one of 99 different programs, including using AVISynth, but compared to the flexibility offered by an NLE, the results are going to take a long time to achieve, and the results will be less pleasing because of the lack of interactivity and GUI. As just one example, I have twelve defaults in my NLE of how quickly a fade or crossfade happens. I can change the crossfade behavior in one second with a single click of the mouse, and I can change the duration of the fade just by sliding video clips back and forth on the timeline. I can also change the fade to a dissolve (not the same thing) or can apply some other effect (e.g., wipe) if I want. |
|
19th April 2021, 23:35 | #10 | Link |
Guest
Posts: n/a
|
For my purposes, AviSynth accomplishes this sort of work perfectly well. In a matter of seconds, I can type exactly what I want to achieve without leaving the script that contains the rest of my processing/editing. This avoids involving another program, generating intermediate files, making additional renders, etc. For me, it's easier than using an NLE, but different strokes...
|
20th April 2021, 00:15 | #11 | Link |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,496
|
It's also an assumption to declare that someone is doing the wrong thing based on only their immediate question. We have no idea what the rest of color's requirements or plans are. If he was a first-time poster without a script in progress and asking how to use AviSynth to do a fade, then a suggestion that he might have better luck with an NLE would certainly be warranted. But to declare it as fact is presumptuous in any case.
|
20th April 2021, 00:39 | #12 | Link | |||
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
Many/most NLE's operate in RGB, especially the transition and overlay operations - it's easy to demonstrate that this produces lower quality, more banding in the base video layer Quote:
Quote:
But OP asked for 1 fade in/out with a transparent overlay |
|||
20th April 2021, 15:16 | #14 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
For me, I mainly can't be bothered to try an NLE, its just something new to learn and easier to use what I know, old dog, old tricks.
Dont give up John, its just this damn Covid silly season getting you down.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
Tags |
avisynth, fading. |
|
|