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 August 2014, 20:11 | #1 | Link |
Registered User
Join Date: Nov 2013
Posts: 16
|
ApplyRange Bug?
Using an example for "Animate", I'm trying to create a scene that fades to black, but only over a certain range of frames. Im trying to figure out why this works:
Animate(4900,4950,"Levels", 0,1,255,0,255, 0,1,255,0,0) but this doesn't: ApplyRange(4900,4950,"Levels", 0,1,255,0,255, 0,1,255,0,0) According to this it seems like it should work: http://avisynth.org.ru/docs/english/...rs/animate.htm Am I doing something wrong? Edit: I get "invalid arguments to function "ApplyRange" from AvsPmod. |
17th August 2014, 20:28 | #2 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,346
|
Error is expected, because you're changing the start and end arguments
Quote:
|
|
17th August 2014, 20:41 | #3 | Link | |
Registered User
Join Date: Nov 2013
Posts: 16
|
Quote:
|
|
17th August 2014, 20:51 | #4 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,346
|
Quote:
"fade to black" isn't the same thing as a crossfade where "clip A" fades into "clip B" Can you describe more specifically what you want to do ? You can probably use animate() with overlay() and adjust the opacity parameter Alternatively you can control using layer luma matte layer that controls the opacity (you're using a mask that controls the opacity of a layer. White = 100% visible, Black = 0 % visible, shades in between are intermediate) |
|
17th August 2014, 21:01 | #5 | Link | |
Registered User
Join Date: Nov 2013
Posts: 16
|
Quote:
I'd never messed with fadein / fadeout before - I never imagined doing it between scenes would be this complicated. I'll look into overlay. EDIT: Actually, this convoluted mess seems to work blah1=Animate(4900,4950,"Levels", 0,1,255,0,255, 0,1,255,0,0) ReplaceFramesSimple(last, blah1, mappings="[4900 4950]") Last edited by mugz; 17th August 2014 at 21:08. |
|
17th August 2014, 21:08 | #6 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,346
|
Quote:
"Fade out and right into the second" - it's still not clear what you want to do. For example does it fade out to black, stay black for a while, then the 2nd scene abruptly starts ? You don't have to "physically" cut the video. You can use Trim() in avisynth and append the segments using AlignedSplice(). ie. everything can be done in the script If you describe more clearly what you want, I'm sure people here can give you several methods that would probably work |
|
17th August 2014, 21:24 | #7 | Link | |
Registered User
Join Date: Nov 2013
Posts: 16
|
Quote:
I'm just surprised that there doesn't seem to be a plugin already that does that easily. Last edited by mugz; 17th August 2014 at 21:30. |
|
17th August 2014, 21:44 | #8 | Link |
Registered User
Join Date: Jul 2010
Location: Germany
Posts: 357
|
You can write a function that does the trimming.
Code:
... Insert_FadeOut(1000) function Insert_FadeOut(clip c, int i, int "NumberOfFrames") { c NumberOfFrames = default(NumberOfFrames, round(FrameRate * 2)) # ca. 2 seconds p1 = Trim(0, -i).FadeOut(NumberOfFrames).Trim(0, -i) # FadeOut adds a blank frame p2 = Trim(i, 0) p1 + p2 # (c.HasAudio) ? last.AudioDub(c) : last # uncomment this line if you don't want the audio to fade } Last edited by creaothceann; 17th August 2014 at 22:41. |
17th August 2014, 21:57 | #9 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,346
|
Or if you want a helper function. I called it "FTB" but you can rename it whatever you want for easier use. FTB(start frame, number of frames)
eg. WhateverSource() FTB(4900,50) #this would replace frames 4900-4950 with a fade to black FTB(6000,10) #this would replace frames 6000-6010 with a fade to black . . . Code:
#FadeToBlackWithin #Replaces frames within a clip from Start Number, for a given number of frames #eg. FTB(100,50) would fade gradually from frame number 100 to 150, where 150 would be 100% black function FTB(clip Source, int start, int frames) { an=Animate(source, start, (start+frames), "Levels", 0,1,255,0,255, 0,1,255,0,0) Source.trim(0,-start) ++ an.trim(start,start+frames) ++ Source.trim(start+frames+1,0) } Last edited by poisondeathray; 17th August 2014 at 22:01. |
17th August 2014, 23:41 | #11 | Link |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
|
Thread Tools | Search this Thread |
Display Modes | |
|
|