This is the video encoding using the fixed script, video now runs with audio and playing with correct speed.
Thank you hello_hello!
+ Reply to Thread
Results 91 to 109 of 109
You're welcome, although maybe download the new version again. I realised I made a little mistake about five minutes after uploading it (related to checking that the border widths are wide enough for images) so I fixed it and replaced the attachment in my previous post. Chances are you didn't download it before then, but just in case.
I'm downloading your sample at the moment, but my internet connection is running like a dog today. If it doesn't drop the connection before it's done, it looks like it'll be 20 minutes away. The screenshots in your previous post look great!
I'll get the new script, thank you hello_hello!
My internet connection today are really bad too, it took me forever to upload that sample, even a google search is very slow.
Once again, thank you very much hello_hello!
I had some time to kill so here's another version.
SideImages(Video, OutWidth, LeftImage, RightImage, Flip, Stretch=false, BlankFrame=false, Offset=1.0)
It's pretty much the same as before, except when BlankFrame=true and borders are being added, one additional frame is added to the end of the video. That frame is completely blank, without the images for borders.
Offset can be used to move the picture off centre. The default is 1.0 and the range is from zero to 2.0.
Offset values less than 1.0 decrease the size of the left border and increase the right border. Values greater than 1.0 decrease the size of the right border. The border should be totally on the left when Offset=2.0 and totally on the right when Offset=0. It's not really linear but it's at least a way to adjust the relative size of the borders.
The attached screenshot is Offset=0.75.
Flip works much the same way, flipping the left image to the right if no right image is specified, unless Offset=0, in which case if you only specify a left image it'll appear without being flipped on the right. You can still over-ride the defaults with Flip=true/false.
This version doesn't use the first frame of the video for the border image when no LeftImage is specified. That seemed pointless as you can always specify that for LeftImage yourself if you want to, so instead it adds plain black borders until border image(s) are specified.
Hopefully I didn't introduce any gremlins.
That is really nice hello_hello!
Here's a new function of you want to give it a test drive. It works much the same way as FrostyBorders. The argument names for the images are now Image1 and Image2.
If you need to crop, you'll either have to use the crop function first, or if you need to specify an InDAR and cropping will change it, crop and resize with CropResize first as before. If you don't need to crop, ImageBorders can be used on it's own.
ImageBorders(Video, OutWidth, OutHeight, Image1, Image2, Matrix1, Matrix2, \
InDAR, InSAR, Mod, Flip, Stretch, BlankFrame, Offset, Resizer, IResizer)
There's no longer any need to make sure the color formats or bit depths match, the only thing you need to check yourself is when images need to be converted to YV12 etc, their width and height are the correct mod (ie mod2), otherwise you'll get an error. I'll probably add a check for that later and automatically crop a pixel for mod2 if need be. I'm bored of looking at it at the moment.
Mod determines the width mod of the video when borders are added to the sides, or the video height when borders are added top and bottom. The default is Mod=4.
Matrix1/Matrix2 lets you specify the matrix when the border images need to be converted from/to RGB. The default is matrix="rec601", the same as for the Avisynth Convert functions.
If Matrix2 is unspecified, Matrix1 is used.
Resizer specifies the resizer for the video. The default is "Spline36".
IResizer can be used to specify a resizer for the border images, independent of the video resizing (assuming they need to be resized). If IResizer is unspecified it defaults to the same as Resizer.
See post #101 for an updated/fixed version.
BorderImage = ImageSource("Border.bmp")
ImageBorders(720,540, BorderImage, Offset=0.75)
ImageBorders(720,400, BorderImage, Offset=0.75)
I'm not home right now but I'll give a try.
Thank you hello_hello!
Thank you hello_hello!
A = ImageSource("EA.png") B = ImageSource("EB.png") ImageBorders(1920,1080, A, B)
BorderImage = ImageSource("EA.png") ImageBorders(1920,1080, BorderImage)
A = ImageSource("EA2.png") B = ImageSource("EA2.png") ImageBorders(1920,1080, A, B)
Last edited by amaipaipai; 12th Mar 2020 at 12:53.
I had some time to kill again, so here's the (hopefully) final version. It's the same as the previous version except it now crops the images to the correct dimensions (if need be) before converting them to the same color format as the main video.
The Mod setting for the main video is also self adjusting.
If Offset=1, the default Mod is twice the required mod for the color format. That means for YV12, which requires a mod2 width, the default Mod picture width (or height when adding top/bottom borders) would be mod4, so if you also specify a mod4 Outwidth (or OutHeight), the borders/images will always be exactly the same size. If Offset doesn't equal one, the Mod setting defaults to the same mod the color format requires. ie Mod=2 for YV12. In any case, you can over-ride those defaults by using the Mod argument to specify something else.
I'll probably add ImageBorders to the same thread as FrostyBorders once I get around to creating a proper help file.
There's always something...
Uploaded again to fix a silly that stopped Stretch=false working for top/bottom borders.
ImageBorders(640,360, A, InDAR=2.0/1.0, Stretch=false)
Thank you hello_hello!
There's a link for an updated version of CropResize in the opening post, containing some minor fixes. The new version is dated 2020-03-26. There's a text file included describing the changes.
I fixed some minor gremlins in the ImageBorders function and added an Info argument for displaying the picture and border size etc over the video. There's also a wrapper function included so Info=true can be enabled by preceding the function name with "i" as per the CropResize function. ie iImageBorders()
The minimum image border size now changes according to the resizer being used. There's details in the help file. Images under the minimum width/height can be used as long as they don't need resizing.
There's also an updated version of SideImages included in the ImageBorders zip file. There's a link in my signature.
Great work hello_hello, works like a charm.
There's a link for an updated version of CropResize in the opening post, containing fixes for a couple of obscure aspect ratio bugs when specifying an Output DAR. The new version is dated 2020-06-23.
There's a link for an updated CropResize in the opening post dated 2020-09-11. There's a summary of changes above the link.
There's a link for an updated CropResize in the opening post dated 2020-10-28. It fixes a minor color conversion gremlin. Details in the "Changes" text file.
Sorry about an update so soon. It was just to fix some obsolete information in the help file, but I changed the version date to 2020-10-30.
There be a link in the opening post.