Awesome, thanks for the updated versions. I had a quick play with them and everything seems to be working so far. It's great to see feathering working with BoxBlur now. I'll try and give Frosty+BoxBlur some good use over the coming days and fingers crossed there won't be any more flashes!
+ Reply to Thread
Results 181 to 202 of 202
-
-
In case you missed it, I've updated the ffdshow script in the opening post so FrostyBorders can use a SAR in frame properties for anamorphic video. Assuming frame properties are added in ffdshow. I haven't tried it, and thinking about it, with ffdshow as the source filter they're probably not added anyway...
Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
thebib62,
Give this script a try for your 4:3 tablet.
Borders are never added to the sides. Only the top and bottom.
The defaults for letterbox borders are darker than pillarbox borders as I found letterbox borders changing color to be more distracting.
If (DAR >= 2.0) the video is cropped to 2.0
If (2.0 > DAR >= 16:9) the video is cropped to 16:9
If (16:9 > DAR >= 1.5) the video is cropped to 1.5
If (DAR < 1.5) the video is cropped to 4:3
Code:clip = last W = width(clip) H = height(clip) # If the source is anamorphic the correct pixel/sample aspect ratio must # be specified instead of undefined(). For example, 64.0/45.0 for a PAL 16:9 DVD. # SAR must be float (not an integer). SAR = undefined() # Cropping. CR and CB must be negative (or zero) CL = 2 CT = 2 CR = -2 CB = -2 VideoDAR = float(W - CL + CR) / float(H - CT + CB) VideoDAR = !defined(SAR) ? VideoDAR : VideoDAR * SAR CropDAR = (VideoDAR >= 2.0) ? 2.0 : (VideoDAR >= (16.0/9.0)) ? 16.0/9.0 : \ (VideoDAR >= 1.5) ? 1.5 : 4.0 / 3.0 NewW = (W > 1920) ? 2048 : (W > 960) ? 1440 : (W > 720) ? 960 : (W > 640) ? 720 : 640 NewH = (W > 1920) ? 1536 : (W > 960) ? 1080 : (W > 720) ? 720 : (W > 640) ? 540 : 480 return FrostyBorders(NewW,NewH, CL,CT,CR,CB, InSAR=SAR, CropDAR=CropDAR, TCRatio=0.3)
Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
New version dated 2024-12-27 in the opening post.
Pab_ and thebib62,
Believe it or not I ended up reverting the FastBlur changes and the defaults are back to the same as they were for the previous version.
The reason for that is I changed the blurring for the default borders to make them more stable (they should be a lot calmer and not prone to changing drastically (flashing) when something with a different color or brightness than the rest of the picture is close to the edge) and by doing the blurring first so I could blur a lot of more the picture into the borders the width of the picture being blurred has increased substantially, and the FastBlur blocky color issue seems to have gone away as a result. The Threads argument still exists though, just in case, but the default is now undefined, so FastBlur is back to using it's own default value.
The BoxBlur version of the function is included in the zip file in the opening post, so if it does turn out that FastBlur is still problematic, using the BoxBlur function for blurring instead is still an option. Full details of what's changed since the version dated 2024-11-16 are in the changes text file.
Please let me know how it goes....
Cheers.Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
-
New version of FrostyBorders dated 2024-12-30 in the opening post.
Just a tweak to the way the default borders are created. They should look the same as the version uploaded a few days ago, but creating them should also be faster.Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
Pab_ and thebib62,
Someone at doom9 mentioned there's a DirectShow Avisynth and VapourSynth filter that works much like ffdshow's Avisynth filter, but with support for 10 bit and 16 bit, more color formats and HDR. The main difference is you load an existing script rather than paste it into the filter as you do for ffdshow. I've only given the Avisynth filter a try so far, and only running on Windows in VirtualBox, but that's working with both MPC-HC and MPC-BE. You might need to use the MPC Video Renderer for it to work correctly, but that's the default for MPC-HC now and it can be installed as an external renderer for MPC-BE.
Edit: I forgot to post the link to the filter.
https://github.com/CrendKing/avisynth_filter
I modified the script a little but the output is still much the same as the ffdshow version in the second post.
Edit: I've changed the second post to add instructions for using the Avisynth DirectShow filter rather than ffdshow.
Code:# ------------------------------------------------------------------------------- AvsFilterSource() clip = last W = width(clip) H = height(clip) # ------------------------------------------------------------------------------- # Frosty=False disables/bypasses FrostyBorders. # ------------------------------------------------------------------------------- Frosty = True # ------------------------------------------------------------------------------- # If the source is anamorphic the correct pixel/sample aspect ratio must be # specified instead of undefined(). For example, 64.0/45.0 or 1.4222 for a PAL 16:9 DVD. # The input SAR must be float (64.0/45.0 rather than than 64/45, for example). # ------------------------------------------------------------------------------- InSAR = undefined() # ------------------------------------------------------------------------------- # Cropping. CR and CB must be negative (or zero). # ------------------------------------------------------------------------------- CL = 2 CT = 2 CR = -2 CB = -2 # ------------------------------------------------------------------------------- DAR = (float(W - CL + CR) / float(H - CT + CB)) * (!defined(InSAR) ? 1.0 : InSAR) CropDAR = (1.75 <= DAR <= 1.8) ? 16.0 / 9.0 : (DAR > 2.0) ? 2.0 : \ (DAR > (14.0 / 9.0)) ? 0.0 : (DAR > (4.0 / 3.0)) ? 14.0 / 9.0 : 13.0 / 9.0 NewW = (W > 1600) || (H > 900) ? 1920 : (W > 1280) || (H > 720) ? 1600 : \ (W > 960) || (H > 540) ? 1280 : (W > 704) || (H > 396) ? 960 : 704 NewH = (W > 1600) || (H > 900) ? 1080 : (W > 1280) || (H > 720) ? 900 : \ (W > 960) || (H > 540) ? 720 : (W > 704) || (H > 396) ? 540 : 396 if (Frosty && (DAR != (16.0 / 9.0))) { FrostyBorders(clip, NewW,NewH, CL,CT,CR,CB, InSAR=InSAR, CropDAR=CropDAR, TCRatio=0.3) } else { AvsFilterDisconnect() } # -------------------------------------------------------------------------------
Hopefully I'll have time to play with the VapourSynth filter tomorrow. If it works just as well it'll be a second alternative to the Avisynth version of FrostyBorders using FastBlur.Last edited by hello_hello; 14th Jan 2025 at 01:03.
Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
I had a chance today to play with the VapourSynth version of the filter I mentioned in my last post, but unfortunately I couldn't get it to work. Well, that's not entirely accurate. It works, but not when adding the default frosty borders to the video (and probably the Clone borders will be the same).
I think it's similar to the problem I was experiencing when FrostyBorders was included in a VapourSynth filter for MPV Player and any borders created using a blank clip wouldn't work. I worked around that by using AddBorders instead, and all the border types work in a VapourSynth MPV Player filter, aside from the FrostyStatic borders, probably because they're created from a single frame and then looped. The default borders aren't created with a blank clip though, so I don't know why they won't work as a VapourSynth DirectShow filter when they work for MPV Player. When FrostyBorders is adding plain borders it works fine, but that's not it's main purpose, and none of my attempted work-arounds made any difference. Oh well....Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
Hi, sorry I've been quiet, been busy lately.
Regarding the newer versions, while I appreciate the reasons, I personally find the output to be less pleasant than the older 2024-12-21 and below. With the older versions I find FrostyBorders with Feathering=4 fills in the sides of a 4:3 image so well I often don't notice any bars at all (note: I don't use CropDAR or TCRatio as I prefer to keep the original image). With the newer versions this effect is often lost, with the borders appearing to be quite different to the sides of the picture in comparison, which makes them more distracting and less appealing, at least to my eyes, compared with before. If there's an existing option or way to get the old output or similar that would be great, but if not don't worry about it on my account, I'm happy to stick with 2024-12-21.
The new DirectShow Avisynth filter is a nice addition. I managed to get it to work with the latest version of FB but it doesn't seem to work on 2024-12-21 version (playback never starts). Regardless, getting away from the 10+ year old ffdshow raw filter seems like a good idea. If there's a tweak I can make to get 2024-12-21 to work this way I'd like to test it more.
One last, rather puzzling thing. As previously mentioned I have an old Intel i5 and there didn't appear to be any flashes when using FrostyBorders. Well this past week I've been watching some content on it instead of my main PC and I've been getting a fair amount of them. During one 45m video there were 8 very obvious flashes, and they have also been happening during other sessions. I haven't changed anything on that PC, including the FB version (which is an old one, not sure which right now) so it's quite strange. Not important, I could always update FB and/or switch to BoxBlur on that system but I thought it was interesting to note the flashes also happening on an Intel CPU. -
Sorry, I haven't been around much myself.
The main difference between the old and new borders is the new borders use more of the picture for blurring so I could blur more of it into the borders, but with the old blur values the borders should look pretty much the same as they did previously. So you could try:
FrostyBorders(clip, NewW,NewH, CL,CT,CR,CB, InSAR=InSAR, CropDAR=CropDAR, TCRatio=0.3, Blur=60, VBlur=18)
That's based on adding 240 pixel borders to a 1080p 4:3 video. The original formula was BorderWidth/4.0 and BorderHeight/10.0 for pillarbox borders (BorderWidth/10.0 and BorderHeight/4.0 for letterbox borders), but change the values to whatever you prefer. Blend=0.2 was also the old default if you want to add it. For the latest version the default is Blend=0.1.
If you're upscaling or downscaling, something like this might produce more consistent blurring as the borders are created before the resizing when upscaling, and after the resizing when downscaling, but play around with the values.
FrostyBorders(clip, NewW,NewH, CL,CT,CR,CB, InSAR=InSAR, CropDAR=CropDAR, TCRatio=0.3, Blur=W/32.0, VBlur=H/10.0)
The newest version of the function might use a little more picture for creating the borders, but the blurring is the main difference. If that still doesn't look the same it shouldn't be too hard to add the old borders back along with an argument to select them, but I think changing the blurring should be enough.
Someone at doom9 mentioned the flashes of color using an Intel CPU, although at the time I wasn't sure he was referring to the FastBlur problem. The only thing left I can suggest you try is limiting the CPU instructions. According to the wiki, this only applies to Intel CPUs. I tried it with my AMD CPU and Info() indicated it was working, but it didn't make a difference to the flashing. Maybe with an Intel CPU it will though. I'm pretty sure my old Intel topped out at SSE4.1 and I never saw any flashing using it, but maybe try limiting the CPU instructions to see if it helps.
https://avisynthplus.readthedocs.io/en/latest/avisynthdoc/syntax/syntax_internal_funct...html#setmaxcpu
By the way, once you set a value for SetMaxCPU, I'm pretty sure changing it won't have any affect unless Avisynth is shut down completely, but maybe add Info() to the script to be sure it's having the desired affect. I think you can add SetMaxCPU anywhere in a script and it affects the instructions used for the whole script, but I haven't played with it much so experiment yourself.
Edit: I confused myself.
If you try the current version of FrostyBorders, can you let me know if there's still a problem with the flashes of blocky color? The latest version applies blurring to more of the video, whereas the older versions crop the picture they use for the borders, then blur it, so the picture being blurred is generally pretty narrow, maybe 16 or 32 pixels wide. I don't think I've seen any flashes of color since the change to blur more of the picture, so the problem might be related to the size of the image being blurred. Then again, I haven't used the Avisynth version a great deal, but I'm hopeful...
I have no idea why the older FrostyBorders won't work with the Avisynth DirectShow filter. The same thing was happening with the VapourSynth filter for me (the player would open the video but it'd never start playing) and I couldn't work out why. Maybe I should report the issue to the author of the DirectShow filters to see if he/she knows why.
Please let me know how you go with all of that.
Cheers.
Edit: I've reported the problem with the VapourSynth filter to the author.
https://github.com/CrendKing/avisynth_filter/issues/96Last edited by hello_hello; 14th Jan 2025 at 09:51.
Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
Pab_,
If you return soon, there's another test version attached. I changed the default values.... again.....
Actually, I changed them back to their old values. So....
FrostyBorders(1280,720) will create the borders you prefer. They're not 100% identical because the function is cropping picture for the borders a little differently, but they should be about 95% the same.
FrostyBorders(1280,720, Frosty2=true) will blur more picture into the borders. They're the borders you don't like as much, although I've tweaked the contrast and saturation a bit this time.
I'm now 99.99% sure FastBlur only produces the flashes of blocky color when the size of the video it's blurring is quite small. I've been running multiple FrostyBorders instances in order to compare their borders today, and only one instance has produced flashes of blocky color.
Both pictures on the left side have the borders with more blurring. FrostyBorders(704,396, CropDAR=4.0/3.0, Frosty2=true)
The top right picture is using the old blurring values (the ones you prefer). FrostyBorders(704,396, CropDAR=4.0/3.0)
The bottom right picture was created with an older version of FrostyBorders, and those borders are the only ones where I've seen any flashing colors.
Sometime soon I'll update the BoxBlur version, although with any luck it won't be needed much longer.
[Attachment 84838 - Click to enlarge]Last edited by hello_hello; 15th Jan 2025 at 20:19.
Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
It turns out that I was wrong and the FastBlur issue was still happening even when the video being blurred was wider. It was just happening much less frequently (at least for me). I posted about it again at doom9 and the guy who's been doing all the work updating Avisynth+ had a look at it. Apparently he's found the cause, although I don't know what it is yet, but hopefully there'll be a new version of FastBlur sometime soon. https://forum.doom9.org/showthread.php?p=2013325#post2013325
Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
I've read the posts on Doom9, that's great news and hopefully a fix will come out of it.
I forgot to check back to this topic after your post Jan 13 post, so I haven't seen or tried 2025-01-16 yet. I did however try those settings you gave me previously, and the second one produced results very similar to the older versions I preferred. The first command produced thin lines shooting out from the sides of the image, which was an interesting look.
As always, thanks for your efforts, and I will try the new version soon. From your screenshots I can already tell it looks very close to the old versions. -
I noticed there was a new FastBlur version up on Doom9 and couldn't resist trying it out.
First, I had to downgrade FrostyBorders to the 2024-11 version as you've done such a good job mitigating the flashes on the newer ones I can't really use them for testing. Then I put iterations up to 100, and sure enough, flashing borders every second or two on average.
Next, I switched FastBlur to the new 0.3.2 version and... no flashes! I watched several minutes of video to be sure. Again, this is with iterations 100 and an older FrostyBorders, a setup which flashed all the time previously on this PC. More testing needed obviously but it's looking good here so far.
Thanks to all involved for your efforts in tracking down and fixing this obscure problem. -
Excellent! I hadn't had a chance to do any real testing of the new FastBlur myself yet.
I'll be uploading a new version of FrostyBorders sometime soon. The defaults for the default pillarbox borders will still be much the same as they were originally, with the Frosty2=true argument to automatically increase the blurring. I'm still not sure which one I prefer. I think it depends on the content. I'm in the process of adding a gamma adjustment so any of the borders that can be adjusted with Bright, Cont and Sat can also have their gamma adjusted. It's not a game changer, but if you prefer to keep the borders darker, as I do for letterbox borders, reducing the gamma instead of brightness and contrast seems to work a little better as it darkens the borders but stll allows them to get somewhat brighter along with the picture, so they don't look as "flat". I'm still playing around with it but the following seems pretty good.
[Attachment 85124 - Click to enlarge]
[Attachment 85125 - Click to enlarge]Last edited by hello_hello; 25th Jan 2025 at 23:58.
Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
There's a link for FrostyBorders 2025-01-26 in the opening post.
The main change is the addition of the gamma argument mentioned in the previous post, and for the VapourSynth version the Bright argument now auto-scales according to bitdepth (I had foolishly assumed the Tweak function I borrowed from adjust.py would auto-scale as Avisynth's Tweak does).Last edited by hello_hello; 26th Jan 2025 at 15:50.
Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
You're welcome.
For anyone interested, with the help of the developer I managed to get the VapourSynth DirectShow filter to work, so the VapourSynth version can be used with MPC-HC or MPC-BE in the same way as the Avisynth version. It requires editing the registry to increase the initial buffer size and then it works very well. I'll add some instructions to post #2.Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
I am adding this starter pack mainly for myself, but hopefully it comes in handy for others as well.
-
-
TCRatio adjusts the percentage of bottom cropping relative to the top cropping, but only when the function is cropping the height and only when the CropDAR argument is used to adjust the cropping to a specific DAR (if I remember correctly). As most of the video you'd be watching on a 4:3 display will probably be 4:3 or wider, the top and bottom won't be cropped very often.
If you're asking if you can change the cropping to make the borders smaller, that's fairly easy, but for a widescreen picture, the smaller you want the letterbox borders to be the more picture you'll have to crop from the sides.
This is the line that controls the automatic cropping, so you can change the numbers to whatever you prefer.
For example if you're watching a video with an aspect ratio greater than 2:1, the script will crop it to 2:1, but on a 4:3 display you'll still have fairly large letterbox borders. Likewise if the aspect ratio is between 2:1 and 16:9, it'll be cropped to 16:9.
CropDAR = (VideoDAR >= 2.0) ? 2.0 : (VideoDAR >= (16.0/9.0)) ? 16.0/9.0 : (VideoDAR >= 1.5) ? 1.5 : 4.0 / 3.0
You could change it so the maximum picture aspect ratio will be 16:9, cropping more from the sides from a widescreen video.
CropDAR = (VideoDAR >= (16.0/9.0)) ? 16.0/9.0 : (VideoDAR >= 1.5) ? 1.5 : 4.0 / 3.0
Or if you want the maximum to be 1.5:1
CropDAR = (VideoDAR >= 1.5) ? 1.5 : 4.0 / 3.0
If you want to manually specify the cropping for each video, you can use CL and CR.
CL = 120
CT = 2
CR = -120
CB = -2
Keep in mind the cropping applied by the CropDAR argument is applied after any cropping you specify and the cropped picture is used for the video DAR calculation used to configure the CropDAR argument.
As an example, if you specified a cropping of 100 pixels left and right for a widescreen picture, it might end up with a DAR between 2:1 and 16:9 after cropping, and according to the rules for CropDAR it'll then apply additional cropping to the sides to crop it to 16:9. Increasing the cropping to 120 pixels each side might still leave you with a picture between 2:1 and 16:9, which will be cropped to 16:9 as before so the output won't change. The original idea was to use the cropping arguments to crop the black if necessary, and from there the CropDAR rules would crop the remaining picture to the appropriate DAR.
If you prefer to specify the cropping yourself for each video, the simplest way to have that work as expected is to remove the CropDAR argument, so the only cropping the function will apply is the cropping you tell it to apply.
return FrostyBorders(NewW,NewH, CL,CT,CR,CB, InSAR=SAR)
Does any of that help, or make sense?Last edited by hello_hello; 1st Feb 2025 at 15:26.
Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
Similar Threads
-
AudioSpeed & AudioMeter/AudioWave scripts
By hello_hello in forum AudioReplies: 21Last Post: 25th Sep 2022, 02:35 -
ffmpeg script
By loa909 in forum Newbie / General discussionsReplies: 2Last Post: 2nd Nov 2018, 12:15 -
Need a particular 3D avisynth script
By mazinz in forum Video ConversionReplies: 8Last Post: 25th Feb 2018, 05:55 -
SW Script
By suadnovic in forum SubtitleReplies: 2Last Post: 30th Nov 2016, 11:13 -
Best possible AviSynth Script
By Suwadith in forum Video ConversionReplies: 31Last Post: 10th Sep 2015, 07:43