View Full Version : Command to produce black frames from frame x to y?
Franko30
29th January 2003, 21:26
Hi,
sorry for bothering but I guess now is my time for an annoying "noob" question.:confused:
A while ago I read (in the XVID) forum of a command for avisynth that sets it to deliver only "black" from a given frame onwards.
But now that I need it, I cant't find it anymore.
I searched the forum, but can't find the right combination of search terms and in the Avisynth "Learn to script" guide I only find "Blackness" - but how can I insert this into a script.
The example would be (to help you imagine what I'm trying to do):
Normal treatment of a movie with the usual crop, resize, etc. and then from frame x to y I want to have only black frames. Preferrably at the end, so from x onwards would be suiting me fine, if it might be the only possibility.
Is it possible?
Thanks in advance.
Franko30
matrix
30th January 2003, 01:01
This script would do it.
clip=mpeg2source("C:\Movie\movie.D2V")
t1=clip.Trim(0,whatever)
t2=BlankClip(length=whatever, width=whatever, height=whatever, fps=whatever, color=$000000).ConvertToYUY2
return t1+t2
Franko30
30th January 2003, 12:11
Thanks for the answer.
But somehow my logic fails. I simply can't make any sense out of the blank clip syntax and where to insert into the script.
So, how would I insert it in the script below, assuming I want frame 0 to 600 and 60000 to 62000 to be black?
Thanks again
Franko30
-----------------------------------------
Script
(for encoding a TV capture from a digital receiver; to be loaded in VirtualDub):
LoadPlugin("C:\PROGRA~1\GORDIA~1\mpeg2dec.dll")
mpeg2source("E:\ZDF Doku-Teil3.d2v")
crop(6,3,696,570)
SmartDeinterlace(2,15,true,true,true)
TemporalSmoother(2,1)
BicubicResize(576,432,0,0.75)
Wilbert
30th January 2003, 12:19
First read: http://www.avisynth.org/index.php?page=BlankClip.
So, start with loading your real clip:
LoadPlugin("C:\PROGRA~1\GORDIA~1\mpeg2dec.dll")
clip = mpeg2source("E:\ZDF Doku-Teil3.d2v")
clip = clip.crop(6,3,696,570)
clip = clip.SmartDeinterlace(2,15,true,true,true)
clip = clip.TemporalSmoother(2,1)
clip = clip.BicubicResize(576,432,0,0.75)
Then use Blankclip:
bclip1 = Blankclip(clip, 600) # bclip1 will take the parameters of clip
bclip2 = Blankclip(clip, 2000) # bclip2 will take the parameters of clip
Add them:
bclip1 + clip + bclip2
sh0dan
30th January 2003, 12:55
Perhaps a function would be appropriate (hint: ShareFunctions (http://www.avisynth.org/index.php?page=ShareFunctions) )
Candock
30th January 2003, 13:22
i'm new to AVISynth and don't know if the grammar is right
but my idea ist this!
AVISource("video.avi").trim(MovieBegin, BeginOfBlackness-1)+AVISource("video.avi").Tweak(0, 1, -255, 0).trim(BeginOfBlackness, EndOfBlackness)+AVISource("video.avi").trim(EndOfBlackness+1, MovieEnd)
{
and here the rest
}
sh0dan
30th January 2003, 13:24
Have a look at the first section here (http://www.avisynth.org/index.php?page=Troubleshooting). :)
Franko30
30th January 2003, 17:23
@ Wilbert:
Thanks a lot - my head ist still smoking, as I've only used GKnot's scripts so far - but with this example I was able to see the logics behind Blankclip that I just didn't see before.
My problem was, that I didn't find out how to insert the Blankclip of X frames into the script.
Again thanks for the solution.
@ the others:
Thanks to you, too!
Cheers
Franko30
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.