Log in

View Full Version : help with addborders in avisynth script


ricardo.santos
2nd July 2008, 20:22
Hi everyone!

I have a avi file and i wanted to a add a small rectangular black area with the same width of the video at the bottom of it, the addborders function looks like the right one to use, the thing is that i just wanted the black area to appear during the first 10 seconds. Is it possible? I tried it but cant manage to apply it just to the first 10 seconds.

A workaround could be to splite the avi file in 2 parts( first 10 seconds and the rest of the video), aplly the addborder to the first one and then putting them together via avisynth in just one script.

Another problem is that i didnt want to increase the resolution of the video and i think addborders function increases it.

Can anyone help me this?

gzarkadas
2nd July 2008, 20:52
When you use addborders you are changing the size (width, height) of the video clip. Thus you cannot then splice it with the same video clip, since their dimensions would then be incompatible.

Assuming that you want to hide a part of the bottom of the clip for the first 10 seconds, then you need to do something like that:

AviSource(...your source...)
src = last
head_frames = Round(10 * src.Framerate)
bar_height = 40 # the height of the black bar; modify appropriately
head = src.Trim(0, -head_frames)
tail = src.Trim(head_frames, 0)
head_bar = StackVertical(head.Crop(0, 0, 0, -bar_height), head.BlankClip(height=bar_height))
head_bar ++ tail

Alex_ander
2nd July 2008, 21:24
Use Letterbox() instead of AddBorders(), it does what you want without need to crop:

Trim(0,249).Letterbox(0,16)++Trim(250,0)