Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 7th July 2023, 16:52   #301  |  Link
StvG
Registered User
 
Join Date: Jul 2018
Posts: 450
avsresize_r22 (pass: m6UEtJm68sPV):
- interlaced now works with use_props=1 too.
If interlaced is not specified, frame property "_FieldBased" is read to enable/disable the interlaced mode.
If interlaced is specified, "_FieldBased" doesn't have effect.
- zimg v3.0.5.
StvG is offline   Reply With Quote
Old 7th July 2023, 19:11   #302  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by StvG View Post
avsresize_r22 (pass: m6UEtJm68sPV):
- interlaced now works with use_props=1 too.
If interlaced is not specified, frame property "_FieldBased" is read to enable/disable the interlaced mode.
If interlaced is specified, "_FieldBased" doesn't have effect.
- zimg v3.0.5.
thank you, I will test it as soon as possible

edit: everything seems ok, what about chroma subsampling parameter? https://forum.doom9.org/showthread.p...50#post1989150
__________________
See My Avisynth Stuff

Last edited by real.finder; 8th July 2023 at 02:37.
real.finder is offline   Reply With Quote
Old 8th July 2023, 09:59   #303  |  Link
StvG
Registered User
 
Join Date: Jul 2018
Posts: 450
Quote:
Originally Posted by real.finder View Post
thank you, I will test it as soon as possible

edit: everything seems ok, what about chroma subsampling parameter? https://forum.doom9.org/showthread.p...50#post1989150
What's the difference between z_ConvertFormat(pixel_type="yuv444p16") and z_ConvertFormat(chroma_subsampling="444") (assuming YUV420P16 input)?
StvG is offline   Reply With Quote
Old 8th July 2023, 13:12   #304  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by StvG View Post
What's the difference between z_ConvertFormat(pixel_type="yuv444p16") and z_ConvertFormat(chroma_subsampling="444") (assuming YUV420P16 input)?
with YUV420P16 case both are same but with yv12 (8bit YUV420) z_ConvertFormat(pixel_type="yuv444p16") will convert it from 8 bit to 16 bit and 4:4:4 while z_ConvertFormat(chroma_subsampling="444") will only convert it to 4:4:4 (it will be yv24)

edit: maybe it also worth adding bit_bepth parameter too

and both chroma_subsampling and bit_bepth will be ignored when pixel_type is used
__________________
See My Avisynth Stuff

Last edited by real.finder; 8th July 2023 at 13:29.
real.finder is offline   Reply With Quote
Old 9th July 2023, 06:18   #305  |  Link
StvG
Registered User
 
Join Date: Jul 2018
Posts: 450
Quote:
Originally Posted by real.finder View Post
with YUV420P16 case both are same but with yv12 (8bit YUV420) z_ConvertFormat(pixel_type="yuv444p16") will convert it from 8 bit to 16 bit and 4:4:4 while z_ConvertFormat(chroma_subsampling="444") will only convert it to 4:4:4 (it will be yv24)

edit: maybe it also worth adding bit_bepth parameter too

and both chroma_subsampling and bit_bepth will be ignored when pixel_type is used
Code:
z_ConvertFormat(pixel_type="yuv444p" + (ComponentSize() == 4 ? "s" : String(BitsPerComponent())))
Is the above code too complicated?

Don't get me wrong. There are already a lot of parameters that making the usage a bit complicated at first look. Adding more parameters with actions that are already covered is unnecessary further complication imo.
StvG is offline   Reply With Quote
Old 9th July 2023, 10:41   #306  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
if the problem that it got lot of parameters, then can we got pixel_type to accept things like "444" (or "yuv444*") or "Y" (without any number or "Y*") and same with bitbepth (like *P16)
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 9th July 2023, 14:41   #307  |  Link
StvG
Registered User
 
Join Date: Jul 2018
Posts: 450
avsresize_r23 (pass: m6UEtJm68sPV):
- Added parameter bit_depth: output bit depth. It doesn't have effect if pixel_type is defined;
- Added parameter chroma_subsampling: output chroma subsampling. It doesn't have effect if pixel_type is defined;
- zimg v3.0.5.

Last edited by StvG; 10th July 2023 at 02:29. Reason: Fix typo
StvG is offline   Reply With Quote
Old 9th July 2023, 18:05   #308  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by StvG View Post
avsresize_r23 (pass: m6UEtJm68sPV):
- Added parameter bit_depth: output bit depth. It doesn't effect if pixel_type is defined;
- Added parameter chroma_subsampling: output chroma subsampling. It doesn't effect if pixel_type is defined;
- zimg v3.0.5.
thanks! both work fine
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 9th July 2023, 19:43   #309  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,905
Quote:
Originally Posted by StvG View Post
- Added parameter bit_depth: output bit depth. It doesn't effect if pixel_type is defined;
- Added parameter chroma_subsampling: output chroma subsampling. It doesn't effect if pixel_type is defined;
- zimg v3.0.5.
So, as long as I specify the pixel_type, everything stays the same as in the last version if I don't specify the two new parameters, right?
FranceBB is offline   Reply With Quote
Old 10th July 2023, 02:31   #310  |  Link
StvG
Registered User
 
Join Date: Jul 2018
Posts: 450
Quote:
Originally Posted by FranceBB View Post
So, as long as I specify the pixel_type, everything stays the same as in the last version if I don't specify the two new parameters, right?
Yes, if you specify pixel_type the two new parameters are ignored even if they are specified too.
StvG is offline   Reply With Quote
Old 10th July 2023, 05:25   #311  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,905
Perfect, so it won't break any of my supply chains.

Well, I'm suffering from insomnia due to the heatwave (I'm currently in Milan, Italy and not in the UK unfortunately) and the fan is just blowing hot air on me, which is useless...
So... I might just get up, take a shower, have breakfast, go to the office (where I actually have AC) and update all my servers xD
FranceBB is offline   Reply With Quote
Old 30th July 2023, 07:50   #312  |  Link
joearmstrong
Registered User
 
Join Date: Jul 2013
Posts: 38
I'm not sure if I'm using chromaloc_op correctly. I haven't used it so far.

I want to convert HDR PQ to SDR:
Example 1:
z_ConvertFormat(pixel_type="RGBP16", colorspace_op="2020ncl:st2084:2020:limited=>rgb:st2084:2020:full", chromaloc_op="top_left=>top_left", dither_type="none")
Cube("D:\5-NBCU_PQ2SDR_DL_Adobe_v1.cube", interp=1, fullrange=1)
z_ConvertFormat(pixel_type="YV12", colorspace_op="rgb:709:709:full=>709:709:709:limited", chromaloc_op="top_left=>left", dither_type="ordered")

Example 2:
z_ConvertFormat(pixel_type="YUV444P16",colorspace_op="2020ncl:st2084:2020:l=>2020ncl:st2084:2020:l",chromaloc_op="top_left=>top_left",dither_type="none")
ConvertYUVtoXYZ(Color=0,HDRMode=0,OOTF=false,OutputMode=2)
ConverXYZ_BT2446_C_HDRtoSDR(PQMode=true,Lhdr=50000.0,Lsdr=100.0,pColor=0,pct_ref=0.6,pct_ip=0.6,pct_wp=1.0,pct_sdr_skin=1.0,pct_hdr_skin=0.44)
ConvertXYZtoYUV(Color=2,pColor=0,OOTF=false)
z_ConvertFormat(pixel_type="YV12",colorspace_op="709:709:709:l=>709:709:709:l",chromaloc_op="top_left=>left",dither_type="ordered")

I think the change to "left" (mpeg2), which is the standard for Rec709, should be placed at the end of the scripts ?

Last edited by joearmstrong; 30th July 2023 at 10:09.
joearmstrong is offline   Reply With Quote
Old 30th July 2023, 11:04   #313  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,905
It should, in theory, be fine.
When you upscale the chroma to RGB, you're essentially going to the same resolution for both luma and chroma and, just like with 4:4:4, the chroma location loses its meaning.
When you're downscaling the chroma to go back to 4:2:0, however, it actually matters, but given that by default it assumes that you want the classic 4:2:0 (i.e left) and not type 2 (i.e top left), it will automatically get it right even if you don't specify it
FranceBB is offline   Reply With Quote
Old 30th July 2023, 11:46   #314  |  Link
joearmstrong
Registered User
 
Join Date: Jul 2013
Posts: 38
Thanks for your answer and explanation, FranceBB.
joearmstrong is offline   Reply With Quote
Old 1st October 2023, 20:11   #315  |  Link
StvG
Registered User
 
Join Date: Jul 2018
Posts: 450
The source code is uploaded here.
Builds are here.
StvG is offline   Reply With Quote
Old 2nd October 2023, 11:12   #316  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,582
Quote:
Originally Posted by StvG View Post
Builds are here.
Thank you
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 26th February 2024, 17:22   #317  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,829
I'm think I'm starting to seriously dislike frame properties. Nothing specific to AVSResize. Just generally.

AVSResize appears to have the same problem VapourSynth's resizers did previously, in that it doesn't take it's own cropping into account when calculating a new sample aspect ratio. I'm using AVSResize r23.
Thanks.

ColorBars.KillAudio().ConvertToYV12() # 640x480 (4:3)
propSet("_SARNum", 1).propSet("_SARDen", 1)
z_ConvertFormat(720,576)
# propGetAny("_SARNum") = 16
# propGetAny("_SARDen") = 15

ColorBars.KillAudio().ConvertToYV12() # 640x480 (4:3)
propSet("_SARNum", 1).propSet("_SARDen", 1)
z_ConvertFormat(720,576, src_left=240, src_top=0, src_width=400, src_height=480)
# propGetAny("_SARNum") = 16
# propGetAny("_SARDen") = 15

Last edited by hello_hello; 26th February 2024 at 17:31.
hello_hello is offline   Reply With Quote
Old 26th February 2024, 18:56   #318  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,905
Quote:
Originally Posted by hello_hello View Post
I'm think I'm starting to seriously dislike frame properties.
Amen.
I've been saying this for months, Tormento knows that 'cause I've been complaining to him for months when I had to implement them in all my workflows!

Life was easier when we only had clip properties.
Eventually, what I ended up doing in all my Avisynth workflow is:

1) propclearall() to nuke everything
2) do the stuff as I always did
3) propset() to re-populate everything correctly at the end

which is a big pain anyway...
FranceBB is offline   Reply With Quote
Old 26th February 2024, 20:05   #319  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,829
FranceBB, "starting to" was probably a bit of an under-statement.

It might be handy for resizers that support reading and writing a frame properties SAR to have a specific option for keeping the original SAR or even changing it. Sometimes you want to resize an image and keep the resized aspect ratio on playback instead of the player undoing the resizing, as would happen if the SAR is honored from Avisynth script through to encoder, which I assume is the ultimate goal. It'd probably be easier to do via a resizer argument rather than having to fiddle with frame properties. A DAR argument might even be a better as people tend to think in terms of a DAR rather than a SAR (I definitely do) and it'd be easy for the resizer to convert it to a SAR for frame properties. I can only dream....

Last edited by hello_hello; 27th February 2024 at 00:39.
hello_hello is offline   Reply With Quote
Old 28th February 2024, 04:34   #320  |  Link
StvG
Registered User
 
Join Date: Jul 2018
Posts: 450
avsresize r24:
- Added ST.428-1 (gamma 2.6) transfer function.
- Fixed SAR calculation when internal crop is used.
- zimg a0fac0f.

Quote:
Originally Posted by ErazorTT View Post
Would it be possible to include the 2.6 gamma to the possible transfer function which is used in st431-2 and st432-1?
Added in r24 as "st428". Related.

Quote:
Originally Posted by hello_hello View Post
I'm think I'm starting to seriously dislike frame properties. Nothing specific to AVSResize. Just generally.

AVSResize appears to have the same problem VapourSynth's resizers did previously, in that it doesn't take it's own cropping into account when calculating a new sample aspect ratio. I'm using AVSResize r23.
Thanks.

ColorBars.KillAudio().ConvertToYV12() # 640x480 (4:3)
propSet("_SARNum", 1).propSet("_SARDen", 1)
z_ConvertFormat(720,576)
# propGetAny("_SARNum") = 16
# propGetAny("_SARDen") = 15

ColorBars.KillAudio().ConvertToYV12() # 640x480 (4:3)
propSet("_SARNum", 1).propSet("_SARDen", 1)
z_ConvertFormat(720,576, src_left=240, src_top=0, src_width=400, src_height=480)
# propGetAny("_SARNum") = 16
# propGetAny("_SARDen") = 15
Fixed in r24.
StvG is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:27.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.