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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 31st May 2010, 18:36   #1  |  Link
Cunhambebe
Registered User
 
Cunhambebe's Avatar
 
Join Date: Nov 2004
Location: São Paulo (Saint Paul) - Brazil
Posts: 206
Insert Blank And Fade In/Out

Hi, I'm having some difficulties to fix one of my videoclips using AviSynth. The thing is, I would like to insert a blank space in the beginning (first 200 frames) and only then fade in (some 30 frames) - fading from the very first frame as you know, won't work at all. I'd like to achieve the same effect at the end of the video, inserting fade out (let's say 30 frames) and after the last blank frame, inserting some blank space 'til the end of the video clip (some more 200 frames). I was trying to do this with InsertFrame + Fade In/Out but the result is nor acceptable. Thanks in advance.
Cunhambebe is offline   Reply With Quote
Old 31st May 2010, 18:43   #2  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,377
source = ...
BlankClip(source, length=...) + source.FadeIO(...) + BlankClip(source, length=...)
Gavino is offline   Reply With Quote
Old 31st May 2010, 19:08   #3  |  Link
davidhorman
I'm the Doctor
 
Join Date: Jan 2004
Posts: 1,331
Note that fadeio will add an extra frame of black at the end of your clip - won't cause you any problems but you could use fadeio0 in this case, since you're adding the black yourself.

Incidentally, I've never understood how this bit in the documentation works:

Quote:
Clip.FadeOut0(60).FadeOut0(60).FadeOut(60) gives a much sharper attack and gentler tailoff. The 50% point is at frame 12 of the fade, at frame 30 the fade is 12.5%, at frame 45, 1.6% the effectiveness is more pronounced with audio.
And yet it does work!

David
davidhorman is offline   Reply With Quote
Old 31st May 2010, 19:23   #4  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,377
Quote:
Originally Posted by davidhorman View Post
Incidentally, I've never understood how this bit in the documentation works...
At a fraction x into a fade (x in [0,1]), level is multiplied by factor (1-x).
Repeating fade twice more reduces it to (1-x)^3.

Hence for x=0.5, level is 1/8 = 12.5%, at x=0.75 level is 1/64 = 1.6%, etc

Last edited by Gavino; 31st May 2010 at 19:25.
Gavino is offline   Reply With Quote
Old 1st June 2010, 10:38   #5  |  Link
Cunhambebe
Registered User
 
Cunhambebe's Avatar
 
Join Date: Nov 2004
Location: São Paulo (Saint Paul) - Brazil
Posts: 206
Thanks to both of you to take time to respond. I was thinking about a++b++c etc.., I mean editing 3 clips so that I could insert the blank space and then the fade in/out. I'll give it a try and reply as soon as possible.
Thank you very much.
PS: I think that'd be a good idea to edit a tutorial for newbies on how to edit in AviSynth. I've seen some guides on the web but most are outdated and miss parts such as the explanations right above.
Cheers,
Mark
Cunhambebe is offline   Reply With Quote
Old 1st June 2010, 10:49   #6  |  Link
GodofaGap
Registered User
 
Join Date: Feb 2006
Posts: 823
Most of this is actually explained in the documentation that comes with the normal Avisynth installation.
GodofaGap is offline   Reply With Quote
Old 1st June 2010, 10:55   #7  |  Link
Cunhambebe
Registered User
 
Cunhambebe's Avatar
 
Join Date: Nov 2004
Location: São Paulo (Saint Paul) - Brazil
Posts: 206
I know that, but someway, it's a little bit difficult to understad
Cunhambebe is offline   Reply With Quote
Old 1st June 2010, 11:35   #8  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,377
If there are specific bits that you find hard to understand, raise it on the forum and we can answer your question and/or improve the documentation. The wiki is constantly being updated (hopefully, for the better).
Gavino is offline   Reply With Quote
Old 1st June 2010, 12:12   #9  |  Link
Cunhambebe
Registered User
 
Cunhambebe's Avatar
 
Join Date: Nov 2004
Location: São Paulo (Saint Paul) - Brazil
Posts: 206
Thanks Gavino. I'll remember that. I meant the guide that comes with AviSynth is difficult for newbies not confusing, in spite of the fact I couldn't find what I was looking for, so that's why I have submited this new thread. There are some functions such as editing and improving video quality (filters) that are (or may be) the most used ones and those should be easily avilable for the ones who prefer this wonderful application over payware. Thanks.
Cunhambebe is offline   Reply With Quote
Old 1st June 2010, 12:42   #10  |  Link
Cunhambebe
Registered User
 
Cunhambebe's Avatar
 
Join Date: Nov 2004
Location: São Paulo (Saint Paul) - Brazil
Posts: 206
It doesn't work. Here's the script:

avcsource("C:\last_vacation.dga")
GradFun2DBmod()
BlankClip(length=380, width=1280, height=720, fps=30)
+ FadeIO(20)+BlankClip(length=786, width=1280, height=720, fps=30)


#At the end of the clip, I want blank the frames between (6403,7189) and fade out the previous 20
Lanczos4Resize(720,480)

Something like this:
blank(0 to 380)-fadein(20)-clip length-fadeout(20 frames)-blank(6403 to 7189).
Cunhambebe is offline   Reply With Quote
Old 1st June 2010, 14:46   #11  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,377
You don't say in what way it doesn't work, but I suspect you are getting an error in trying to join clips of a different colorspace or framerate. You need

BlankClip(last, length=380) + FadeIO(20) + BlankClip(last, length=786)

BlankClip is one of the few filters which does not default to 'last' for its input.
Gavino is offline   Reply With Quote
Old 1st June 2010, 17:26   #12  |  Link
Cunhambebe
Registered User
 
Cunhambebe's Avatar
 
Join Date: Nov 2004
Location: São Paulo (Saint Paul) - Brazil
Posts: 206
I'm sorry if I was misunderstood. That's the same clip, the same colorspace (YV12), same framerate. It doesn't work because all I can see in VDMod is a black screen. Nothing more. Thanks for the syntax, let's see if it works this time.
Cheers

PS: here's the result; it works this time but AviSynth is adding blank frames, and is not covering the first 380 and the last 786 ones. I guess I didn't make myself clear in the begining of this thread;
Quote:
The thing is, I would like to insert a blank space in the beginning (first 200 frames) and only then fade in (some 30 frames)
Sorry for that! In fact I want to keep the same frames there, I just want to add blank space on them, make them dark - then applying fade in and fade out at the end, covering those final 786 frames.
Cheers

Last edited by Cunhambebe; 1st June 2010 at 17:34.
Cunhambebe is offline   Reply With Quote
Old 1st June 2010, 17:51   #13  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,377
Ah, I see. You want to replace the first 380 frames with black ones rather than adding 380 black ones? Similarly with 786 frames at the end? Then you want:

Code:
BlankClip(last, length=380) + Trim(380, FrameCount-787).FadeIO0(20) + BlankClip(last, length=786)
or perhaps clearer to understand:
Code:
Trim(380, FrameCount-787)
BlankClip(last, length=380) + FadeIO0(20) + BlankClip(last, length=786)
BTW In your earlier script, did you have the + on a separate line? That would explain why your result was completely black.

Last edited by Gavino; 1st June 2010 at 18:10. Reason: alternative code
Gavino is offline   Reply With Quote
Old 2nd June 2010, 12:05   #14  |  Link
Cunhambebe
Registered User
 
Cunhambebe's Avatar
 
Join Date: Nov 2004
Location: São Paulo (Saint Paul) - Brazil
Posts: 206
Thanks a lot for taking time to respond, Gavino. Did you see what I wanted to say when I stated that a new and more simple AviSynth guide would be nice? I would never find a way to fix this without your help - as any other newbie.
Quote:
BTW In your earlier script, did you have the + on a separate line? That would explain why your result was completely black.
- I don't think so, anyway I've replaced the old script with that new one. I'll try this new one and reply as soon as possible. Can't wait to see the results.
Cheers and many thanks to you.

PS: Now it's working. Thanks a lot, man. Cheers! Please think about a new guide - that'd be so cool. People who don't know AviSynth don't know what they are missing.

PS2: How about if I wanted to fade out the last 40 frames and fade in the first 20 ones? Thanks in advance

Last edited by Cunhambebe; 2nd June 2010 at 12:15.
Cunhambebe is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 22:08.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.