A function for adding images as borders to a video, rather than plain black borders.
Standard usage is to specify a width and height, and the image(s) to be used for the borders, and the script resizes and adds the image borders as required.
Border = ImageSource("Border.bmp")
A = AVISource("Video.avi").Trim(476,476)
ImageBorders(640,360, A, Stretch=false)
A = ImageSource("Elvis1.png")
B = ImageSource("Elvis2.png")
ImageBorders(640,360, A, B, InDAR=4.0/3.0)
Picture courtesy of amaipaipai.
- The argument names have been simplified. There's no longer separate arguments for pillarboxi and letterBox borders. For example, previously there were arguments named "Bright" and "BrightL", but now there's only "Bright".
- Added TextureC argument for enabling chroma texture over the borders. It's disabled by default. The Texture argument for adding luma texture remains unchanged.
- Added GPlugin argument (Grain Plugin). The default is GPlugin=1, which uses AddGrainC to add the border texture as before.
GPlugin=2 uses neo_f3kdb. The Texture and TextureC arguments should produce roughly the same result for either plugin.
Added Mod argument for specifying the picture width/height mod before adding borders.
Added Info argument for displaying information such as picture and border size over the video.
There's an included wrapper function so Info=true can be enabled by simply preceding the function name with "i".
Standard usage is to specify a width and height and the script resizes and adds FrostyBorders as required.
For anamorphic sources, you can also specify the appropriate input display aspect ratio or sample aspect ratio along with the desired output width and height.
+ Reply to Thread
Results 1 to 8 of 8
Last edited by hello_hello; 6th Apr 2021 at 16:24.
This is hopefully just a temporary version to work around what I think is a FastBlur bug.
Last edited by hello_hello; 19th Jul 2019 at 06:45.
This should be a better fix for the mod8 width problem, which may only be an Avisynth 2.6 issue. It's less restricted. See the "Mod8 Width Fix" text file in the zip file.
There's also a new version of the standard version of the script in the opening post. Just some very minor tweaks.
Last edited by hello_hello; 20th Jul 2019 at 07:04.
So it's possible the FastBlur mod8 width problem only effects CPUs that don't support SSE4.1 (FastBlur 0.1).
I don't know why I didn't do it originally, but the "mod8 width fix" version of FrostyBorders now pads the borders to mod8 if need be, blurs them, then crops them back to the original width. The output should be the same as the standard version of the script and there's no longer any output width or height restrictions.
Both versions of the script are in the zip file in the opening post, now dated 2019-07-20.
Last edited by hello_hello; 20th Jul 2019 at 08:59.
Updated the FrostyBorders function and added the ImageBorders function to the thread. Both are dated 2020-03-26. There's links in the opening post.
I've uploaded a new version of the FrostyBorders function. It's dated 2021-04-07. There's a link in the opening post.
I fixed one problem and caused another. It hasn't been uploaded long so I haven't changed the version date, but I've fixed an oversight preventing the script from checking that any specified mod is correct for the source. If anyone has downloaded FrostyBorders 2021-04-07 before reading this post, please download it again.
Would you be able to feather the edges between the video and the boarders? I have attached 2 pictures. One is how the script acts now, and the other is the desired effect.
jagabo was able to achieve this effect in his script. I have posted his below.
uncropped = potplayer_source() src = uncropped.Crop(8,0,-8,-0) ZOOM = 1.167 Spline36Resize(src, int(uncropped.width*ZOOM)/2*2, int(uncropped.height*ZOOM)/2*2) Crop(0, (height-src.height)/4*2, -0, src.height) alpha = Overlay(BlankClip(last, color=$000000), BlankClip(last, color=$ffffff).Crop(16,0,-16,-0), x=16, y=0).ColorYUV(cont_y=50).PointResize(width/16*2, width).BilinearResize(width,height) bg = Spline36Resize(width/16*2,height/16*2).Blur(1.4).Blur(1.4).Blur(1.4).Spline36Resize(uncropped.height*16/18*2,uncropped.height).ColorYUV(gain_y=-50) Overlay(bg, last, x=(bg.width-width)/4*2, y=0, mask=alpha) Spline36Resize(uncropped.width, uncropped.height) float(uncropped.width)/float(uncropped.height) < 1.77 ? last : uncropped