View Full Version : Blacking out frames
AlanHK
29th September 2008, 06:27
Is there a simple command to black out frames?
(I don't want to generate a black clip.)
Best I could come up with was:
Trim(0,52).AddBorders(0,Height,0,0).CropBottom(Height)++\
Trim(53,0)
Alex_ander
29th September 2008, 10:01
All I can suggest (not tested; FadeOut always adds an extra blank frame in the end):
Trim(0,51).FadeOut(1).FreezeFrame(0,52,52)++Trim(53,0)
P.S. Looks like the above will give a 2-frame audio glitch. Then one more trim is needed:
Trim(0,53).FadeOut(1).FreezeFrame(0,54,54).Trim(0,52)++Trim(53,0)
And finally, the shortest version (frame 0 can be also used for further blanking as source frame):
FadeIn(1).FreezeFrame(0,53,0)
mikeytown2
29th September 2008, 10:45
Try ReplaceFramesSimple
http://avisynth.org/stickboy/
ColorBars()
b=AddBorders(0,0,0,Width).Crop(0,Width,0,0)
ReplaceFramesSimple(last,b,mappings="[52 52]")
It's about as simple as it gets.
Gavino
29th September 2008, 15:50
I second mikeytown2's solution, which you can easily extend to black out additional frames (or frame ranges) just by extending the mappings string.
But I don't understand what you (AlanHK) have got against BlankClip. A simpler (and I would expect faster) solution would be
b=BlankClip(last)
ReplaceFramesSimple(last,b,mappings="[52 52]")
IanB
29th September 2008, 15:54
What's with the reluctance to use BlankClip, like ColorBars, it is a zero cost source filter. Provide it with a template clip and the parameters will identically match the template.
AddBorders(0,Height,0,0).CropBottom(Height) is not zero cost, it involves a full frame blit plus a full frame fill.
ColorBars()
B=BlankClip(Last, Color=$000000)
ReplaceFramesSimple(last, B, mappings="[0 52]")
Or
ColorBars()
BlankClip(Last, 1, Color=$000000) ++ Last # Add Frame 0 as Black frame
FreezeFrame(0+1, 52+1, 0) # Make frames 0 to 52 black
Trim(1, 0) # Restore original clip start
Dreassica
29th September 2008, 17:44
I always use a simple applyrange(0,52,"tweak",0,0,0,0)
stickboy
29th September 2008, 20:15
JDL_Blackout (http://avisynth.org/stickboy/) (although BlankClip + ReplaceFramesSimple also would work very nicely and would be more efficient if there are many disjoint segments that need to be blacked out).
mikeytown2
29th September 2008, 20:25
I think AlanHK (OP) wanted to keep the audio track, thats why he was against BlankClip(). ReplaceFramesSimple() doesn't touch the sound, and JDL_Blackout() with ApplyRange() doesn't create any new clips. Using Trim() would have messed up the audio.
Gavino
29th September 2008, 20:58
I think AlanHK (OP) wanted to keep the audio track, thats why he was against BlankClip().
A fair point, but it's a trivial matter to AudioDub the original soundtrack at the end of the filter chain (whichever way you do it), again at zero cost.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.