Page 1 of 2

Frame properties support for Avisynth+

Posted: Tue Oct 19, 2021 10:08 am
by Guest 2
Do you plan to introduce frame property support as per the newest builds of AVS+?

Feature Requests

Posted: Tue Oct 19, 2021 10:20 am
by Rocky
Yes.

Feature Requests

Posted: Tue Oct 19, 2021 1:58 pm
by Guest 2
Rocky wrote:
Tue Oct 19, 2021 10:20 am
Yes.
/me happy :D

Feature Requests

Posted: Tue Oct 19, 2021 2:35 pm
by Rocky
Please tell me the list of properties in priority of importance for you.

Feature Requests

Posted: Thu Oct 21, 2021 7:07 am
by Boulder
I think these ones would be generally very useful in any resampling function.

_ChromaLocation
_Primaries
_Transfer
_Matrix

Maybe _ColorRange too even though any regular release should be 'limited'.

Feature Requests

Posted: Thu Oct 21, 2021 9:06 am
by Rocky
Thank you, Boulder!

Feature Requests

Posted: Wed Oct 27, 2021 8:41 pm
by Rocky
Things are working for DGSource(). There is a problem with _ChromaLocation, however. Seems that CUVID does not return the VUI info we need. Still checking but may have to add manual parsing for that. Not a big deal having already done manual parsing for linux dgdecnv. Let's first add properties passthru to the bundled filters.

Feature Requests

Posted: Fri Oct 29, 2021 11:00 am
by Rocky
Do any of you fine gentlepeople have a sample with a chroma location other than left (0) for a BT709 stream? It would be great to get both AVC and HEVC. I need them to test my implementation for _ChromaLocation. I know that BT2020 uses topleft (2) so need to give one of those. Thank you.

Frame properties support for Avisynth+

Posted: Sat Oct 30, 2021 10:42 am
by Rocky
Released as build 236.

Example:

DGSource("file.dgi")
propShow()

or

DGSource("file.dgi")
DGDenoise()
DGSharpen()
propShow()

Frame properties support for Avisynth+

Posted: Sun Oct 31, 2021 1:38 pm
by renols
Rocky wrote:
Sat Oct 30, 2021 10:42 am
Released as build 236.

Example:

DGSource("file.dgi")
propShow()

or

DGSource("file.dgi")
DGDenoise()
DGSharpen()
propShow()
Will 236 still work with "older " avisynth+ versions?

Am using avisynth+ r2772 and have no real need to update, since it works fine.

renols

Frame properties support for Avisynth+

Posted: Sun Oct 31, 2021 1:46 pm
by Rocky
Hello renols! Should be OK, but you tell me. ;)

We check for interface version 8 or greater. If that is the case, only then will the frame properties be populated.

Frame properties support for Avisynth+

Posted: Sun Oct 31, 2021 2:07 pm
by renols
Ok.

Guess I will test it then.

Just tested avisynth 3.70 compared to the r2772 with avsmeter 390.

With a 4k source 3.70 is about 4% slower than r2772 (with the same avs file). I know that for 4k, CPU is the bottleneck, but why upgrade to something that is slower than what one is currently using :-)

Since r2772 is interface version 6, I guess it should be fine.

Anyone who can maybe enlighten me on what I would use the frame properties info for in a practical workflow?

Frame properties support for Avisynth+

Posted: Sun Oct 31, 2021 2:22 pm
by Boulder
renols wrote:
Sun Oct 31, 2021 2:07 pm
Ok.

Guess I will test it then.

Just tested avisynth 3.70 compared to the r2772 with avsmeter 390.

With a 4k source 3.70 is about 4% slower than r2772 (with the same avs file). I know that for 4k, CPU is the bottleneck, but why upgrade to something that is slower than what one is currently using :-)

Since r2772 is interface version 6, I guess it should be fine.

Anyone who can maybe enlighten me on what I would use the frame properties info for in a practical workflow?
There are quite a lot of fixes in the 3.x branch, so it's very highly recommended to upgrade from such an old version. The biggest changes are in caching and multithreading, I think. SetCacheMode(1) should minimize the amount of memory needed and also provide the best possible performance. Prefetch has two arguments, threads and frames. I have a 12-core 3900X and I've discovered that Prefetch(threads=24, frames=12) works best with my base script. I also use SetMemoryMax(20480) to allow 4K video to use as much memory as needed, usually around 10-12 GB.

The frame properties are useful in resampling situations, i.e. where you change the colorspace before resizing. For example, I now have this kind of a function which does the resizing part with a bit clunky deduction logic and with the frame properties, I can make it foolproof :)

Code: Select all

function Resizer(clip clp, int "width", int "height", float "b", float "c", bool "hdr", bool "i", bool "spline", int "color", bool "debug") {

b = default(b, 0)
c = default(c, 0)
hdr = default(hdr, clp.width() > 1920 ? true : false)
i = default(i, false)
spline = default(spline, b == 0 && c == 0 ? true : false)
color = default(color, hdr ? 1 : clp.width() > 720 ? 2 : clp.framerate() == 25 || clp.framerate() == 50 ? 4 : 3)
cs_in = color == 1 ? "2020ncl:st2084=>rgb:linear" : color == 2 ? "709:709:709:limited=>rgb:linear:709:full" : color == 3 ? "470bg:601:170m:limited=>rgb:linear:170m:full" : "470bg:601:170m:limited=>rgb:linear:170m:full"
cs_out = color == 1 ? "rgb:linear=>2020ncl:st2084" : color == 2 ? "rgb:linear:709:full=>709:709:709:limited" : color == 3 ? "rgb:linear:170m:full=>470bg:601:170m:limited" : "rgb:linear:170m:full=>470bg:601:170m:limited"
debug = default(debug, false)

result = clp.z_ConvertFormat(pixel_type="RGBPS", chromaloc_op="auto=>same", colorspace_op=cs_in, approximate_gamma=true, cpu_type="AVX2")
result = !spline ? result.z_ConvertFormat(width, height, chromaloc_op="auto=>same", colorspace_op="auto=>same", resample_filter="Bicubic", resample_filter_uv="Bicubic", filter_param_a=b, filter_param_b=c, approximate_gamma=true, cpu_type="AVX2") : result.z_ConvertFormat(width, height, chromaloc_op="auto=>same", colorspace_op="auto=>same", resample_filter="Bicubic", resample_filter_uv="Bicubic", filter_param_a=0, filter_param_b=0.6, approximate_gamma=true, cpu_type="AVX2")
result = result.z_ConvertFormat(pixel_type="YUV420P16", chromaloc_op="auto=>same", colorspace_op=cs_out, approximate_gamma=true, cpu_type="AVX2")

result = i ? (width == 1920 || width == 3840 || (width == 1280 && (clp.framerate() == 25 || clp.framerate == 50))) ? interleave(clp, result.Lanczos4Resize(clp.width(), clp.height()).Subtitle("Lanczos4")) : interleave(clp, result.BicubicResize(clp.width(), clp.height(), b=0, c=0.5).Subtitle("Bicubic neutral")) : result
result = debug ? result.subtitle("hdr: " + string(hdr), x=0, y=0).subtitle("color: " + string(color), x=0, y=20).subtitle("cs_in: " + string(cs_in), x=0, y=40).subtitle("cs_out: " + string(cs_out), x=0, y=60) : result

return result
}

Frame properties support for Avisynth+

Posted: Sun Oct 31, 2021 2:51 pm
by Rocky
Too many fermented grapes for a Sunday Halloween afternoon. I'll get back to y'all on this. Sherman told me that DG 236 is fine with AVS+ 2772. Don't upgrade AVS+ if you don't want to. We aim to please. Burp. :oops:

DG started the fall/winter feeding protocol for the birds and squirrels this morning. They seem very happy. I know all their hiding places!

Frame properties support for Avisynth+

Posted: Sun Oct 31, 2021 2:56 pm
by renols
Thanks for info.

Never had any issues with r2772, but I also just use 3-4 lines in my avs files.

DGSource
ConvertBits(10) (only for 4k)
crop
Spline36Resize (if needed)

Most of the time I don't use SetFilterMTMode or Prefetch, since with the few lines I have in my avs file, I find that it slows my fps down. And sometimes quite significantly. I actually only use them in cases where I have to use deinterlace filters, in which case they help quite a bit.

If I have no real gain to use 3.70 in my workflow, which seems to be quite different than your complicated avs file, I will stick with r2772 :-)

If it works, don't fix it :-)

renols

Frame properties support for Avisynth+

Posted: Sun Oct 31, 2021 3:02 pm
by Curly
renols wrote:
Sun Oct 31, 2021 2:56 pm
If it works, don't fix it :-)
Fer shure, and anyway thinking hurts.

Happy Halloween everyone! :twisted: :cry: :wow:

Frame properties support for Avisynth+

Posted: Sun Oct 31, 2021 3:05 pm
by DG
Yes indeed, Happy Halloween!

Frame properties support for Avisynth+

Posted: Sun Oct 31, 2021 3:06 pm
by Natasha
Happy Halloween!

Frame properties support for Avisynth+

Posted: Sun Oct 31, 2021 3:07 pm
by Boris
Image

Frame properties support for Avisynth+

Posted: Sun Oct 31, 2021 3:24 pm
by Natasha
Knocked on DG's door and all he had was boiled eggs and carrots. Loser!

Frame properties support for Avisynth+

Posted: Sun Oct 31, 2021 3:25 pm
by Sherman
That was just for you. I got snickers, reeses pieces, and milky ways. Eat your heart out!

Frame properties support for Avisynth+

Posted: Sun Oct 31, 2021 3:26 pm
by Natasha
Eat your heart out!
Umm, no. But yours? Delicious.

Image

Frame properties support for Avisynth+

Posted: Sun Oct 31, 2021 3:30 pm
by new_guy
There is something terribly wrong with you people.

Happy Halloween!

Frame properties support for Avisynth+

Posted: Sun Oct 31, 2021 3:50 pm
by Rocky
Little goblins have started ringing my bell! Not sure if they are more scared of me than I am of them. Can you imagine knocking on a door and being greeted by a squirrel!? :lol:

Frame properties support for Avisynth+

Posted: Sun Oct 31, 2021 3:55 pm
by Bullwinkle
How about a moose? Snort!