This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

[HELP] Custom Filter Queue
#1
Hi
I am looking for a way to make a two step resize and apply a filter in between. I have read in your post 
" add most filters multiple times (atm. Deinterlacers, Crop, Rotation, FrameInterpolation, Resize, Letterboxing, AddingSubtitle can only be added once, since I didn't get time to write code for adding them multiple times)" 
but I would argue that there is reasons to add one them the "Resize". Depending on the resolution we apply a filter we have changes in quality and time to process.

Cheers
Reply
#2
To keep things manageable, Hybrid does require a fixed order for Crop, Rotate, Resize, Letterbox (Crop < Rotate < Resize < Letterbox).
Allowing multiple free placeable resize steps would (extremly) complicate tons of things regarding the code validation&generation and the ui integration.
So I don't plan to change that.

I probably could add options to the 'Stepped Resize' for additional (specific) filters and maybe even add a way to add custom code between the resize steps.
Would need details what really is needed, before I think about whether this is worth the effort.

If you know your way around Vapoursynth you could also do what you want in a custom section, but you should let Hybrid know if your code changed some of the characteristics, etc.
In custom sections:
# requires colorformat <colorspace name>
tells Hybrid that the custom section requires the clip to be <colorspace name> for the custom section.
# requires mod<X>
requires modX.
# width X
lets Hybrid know that after the custom section the width is always X.
# Height Y
lets Hybrid know that after the custom section the width is always Y.
# scantype <progressive/tff/top filed first/bff/bottom field first/telecine>
lets Hybrid know that after the custom section the scan type is changed to a specific value.
# colorformat <colorspace name>
lets Hybrid know that after the custom section the color format is always as specified.
# framerate <X>
lets Hybrid know that after the custom section the frame rate is always X.

Cu Selur
Reply
#3
From my little programing knowledge I can understand you have
"Crop, Rotate, Resize, Letterbox" in a "programming Loop" how about outside that loop? In a separate step just as you add an other filter.
(Crop < Rotate < Resize (1) < Letterbox)--> Filter --> Resize (2) --> Filter --> Output and easaly choose what we want from Filter Order.
That would require little UI integration since only thing is needed is a second "Picture Resize" in the Crop/Resize" tab.

The filter I am most interested is the BasicSRV++ in "other" tab. Rarely the output resolution is the exact double of the input, NNEDI3 needs
an exact double resolution so that could be in the first step, and second step using an other upscaling method to reach the required resolution.
By the way which is the best upscaler that doesn't need double resolution in your opinion?
Reply
#4
Quote:Rarely the output resolution is the exact double of the input, NNEDI3 needs
an exact double resolution so that could be in the first step, and second step using an other upscaling method to reach the required resolution.
All resizers that output multiple of X as output have a 'Resizer'/'Downsizer' option which configures what resizer is used to adjust to the wanted target resolution.
For example when a 640x352 source should be resized to 960x528 and NNEDI3 is selected as (down-/)resizer Hybrid would create something like:
# resizing using ZNEDI3
# current: 640x352 target: 960x528 -> pow: 2
clip = edi_rpow2.nnedi3_rpow2(clip=clip, rfactor=2) # 1280x704
# adjusting resizing
clip = core.fmtc.resample(clip=clip, w=960, h=528, kernel="spline64", interlaced=False, interlacedd=False)# before YUV420P8 after YUV420P16P16
first resizing with ZNEDI3 and then adjusting to the target resolution using 'spline64' to adjust to the target resolution. ('spline64' was selected as resizer)

So where would you want to apply BasicVSR++ in this example?
Do you want to:
1. resize with NNEDI3
2. use BasicVSR++
3. use 'spline64' resize
, or do you aim for something different?

Side note: I don't really think it is a good idea to 1st upscale and then apply BasicVSR++ unless your video resolution is below SD.

Quote: By the way which is the best upscaler that doesn't need double resolution in your opinion?
You mean an upscaler that doesn't output X-times the output resolution and then needs adjusting?
If for some reason I couldn't use such filters - or I just needed minimal resolution changes, I would either use Lanczos-, Bicubic-, Blackmann- or Point-Resize depending on the source.


Cu Selur
Reply
#5
Isn't a waste of processing power and "lossy" for NNEDI3 this double conversion? I haven't seen much of a difference vs Bicubic.
Actually the only model I have seen better results is SwinIR-L x4 any other suggestion?

ok work process input Res 756x432 --> bicubic 900x676 --> BasicVSR++ --> 1440x1080
If you apply VSR at higher res you get better results for small details.. but @ 1440 is slow and @ 756 is missing details...
Reply
#6
Quote:Isn't a waste of processing power and "lossy" for NNEDI3 this double conversion? I haven't seen much of a difference vs Bicubic.
If you don't see a difference with your sources, than stick with Bicubic.
If you don't see a difference between these, you probably won't see a difference in the adjustement. (normal resizers are fast, so it should not really make a difference in speed)

Quote:If you apply VSR at higher res you get better results for small details..
Okay, did a quick test (https://imgsli.com/MjUwNzIx, https://imgsli.com/MjUwNzIy).
Adding a sharpener before BasicVSR++ might help more.
That said, I can see that with some sources this might be interessting.
=> I probably could add an option to BasicVSR++ to adjust to a specific width (height gets calculated) before applying.

Cu Selur
Reply
#7
Send you a link to a dev version, via pm, which has a 'wanted width' option for BasicVSR++.

Cu Selur
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)