Page 1 of 3

Resize with only one value

Posted: Mon Aug 01, 2022 6:36 pm
by video_m
Hello,

it's it posible to use the resize tool and give only the width a value? so that the computer itself determines the height based on the aspect ratio?

Thank in advance!

Kr,
Mkz

Re: Resize with only one value

Posted: Mon Aug 01, 2022 7:32 pm
by FranceBB
If by "resize tool" you mean the resize filter that you can use after the A/V decoder, that's not aspect ratio aware (unless something changed in the last few years), so if you put an arbitrary resolution, it will always shrink. On the other hand, the resize inside the encoding nodes goes through the filter builder and it's aspect ratio aware.
Anyway, to accomplish this, instead of the resizing node, I can easily write a custom Avisynth Script for you.
I'm currently on my mobile 'cause I'm in the UK and not in the office, but if you can wait till the end of the week, I'll come back with one.
Out of curiosity, do you have a particular resolution in mind?

Re: Resize with only one value

Posted: Mon Aug 01, 2022 8:26 pm
by admin
Hi video_m,

You can sort of easily do the computation yourself by storing the calculated width or height in a variable.
For example, if you want to resize 1080 video to 720 you can do the following in the Populate node.

%i_my_digit% = (%i_width%/%i_height%)*720

The result of this would be 1280 if source was 1920x1080. %i_my_digit% being just some arbitrary variable you create yourself and you use it as input for the resize width in the Resize node.
populate.jpg
populate.jpg (30.49 KiB) Viewed 8145 times
resize.jpg
resize.jpg (22.82 KiB) Viewed 8145 times
Hope this helps.

-steinar

Re: Resize with only one value

Posted: Tue Aug 02, 2022 8:43 am
by emcodem
Additionally i want to mention that using the resize processor (in combination with the A/V decoder) is only needed in certain special cases e.g. you want to select the resize algorithm or you want to do further filtering after the resize. You could instead just specify the new width and height in each and every encoder processor directly.

If @momocampo answers as well, you have repsone from the whole team, congrats :D

Re: Resize with only one value

Posted: Tue Aug 02, 2022 9:06 pm
by video_m
FranceBB wrote: Mon Aug 01, 2022 7:32 pm Anyway, to accomplish this, instead of the resizing node, I can easily write a custom Avisynth Script for you.
I'm currently on my mobile 'cause I'm in the UK and not in the office, but if you can wait till the end of the week, I'll come back with one.
Out of curiosity, do you have a particular resolution in mind?
Thank you, For now have i a special project where everything must be 800px with.

Thank you @steinar and emcodem. i will try your solution!

Re: Resize with only one value

Posted: Thu Aug 04, 2022 7:23 pm
by video_m
admin wrote: Mon Aug 01, 2022 8:26 pm Hi video_m,

You can sort of easily do the computation yourself by storing the calculated width or height in a variable.
For example, if you want to resize 1080 video to 720 you can do the following in the Populate node.

%i_my_digit% = (%i_width%/%i_height%)*720

The result of this would be 1280 if source was 1920x1080. %i_my_digit% being just some arbitrary variable you create yourself and you use it as input for the resize width in the Resize node.

populate.jpg
resize.jpg

Hope this helps.

-steinar
Hello Steinar,

I have try this solution but i get back a error back. "Could not get value for %i_my_digit%!
Did you know what i do wrong?

Thank you.

Kr,

Re: Resize with only one value

Posted: Sun Aug 07, 2022 6:30 pm
by video_m
Here also me template

Re: Resize with only one value

Posted: Mon Aug 08, 2022 7:17 am
by emcodem
Aye Kr,

sorry but i cannot imagine how you come to the error message "Could not get value for %i_my_digit%"!
Aside from that, you need to insert a stills decoder processor after the monitor or better before the resize.

Re: Resize with only one value

Posted: Mon Aug 08, 2022 8:17 pm
by video_m
i found the mistake. i forgot the av-media deencode :)

Re: Resize with only one value

Posted: Sun Sep 04, 2022 7:49 pm
by video_m
Hello All,

I will change the workflow to a another computer. but now get i the error: Watermark@DESKTOP-LG01KEO: Validate: Unknown error occured.
Did somebody what i can do?

Kind regards,
MKZ