Selur's Little Message Board

Full Version: Crop/Resize
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
(31.10.2020, 20:47)Selur Wrote: [ -> ]Why do you think 720x528 is wrong?

To me it seem to be the correct resolution for what you configured.

Input is 720x480 with PAR 10/11 (=MPEG-4 NTSC 4:3), so output resolution with square pixel (1/1) should be 720x 480*11/10 = 720x528.

Ah,... I know why you expected 720x540 since you expected the input PAR to be 8/9 which is "Generic NTSC 4:3", if you want Hybrid to use generic enable 'Force input PAR type' and set it to 'generic', this way Hybrid should change the 10/11 to 8/9.

Cu Selur

In order to convert 720x480 4x3 NTSC to square pixel  you need resize it to 640x480 or 720x540 or 960x720 or 1440x1080
http://www.miraizon.com/support/info_aspectratio.html
Those numbers are only true for 'generic' pixel mapping.
-> if you need/want those adjust 'Force input PAR type' and set it to 'generic', but you might want to check the preview since MediaInfo usually isn't wrong about the PAR,..

Cu Selur
(31.10.2020, 21:09)Selur Wrote: [ -> ]Those numbers are only true for 'generic' pixel mapping.
-> if you need/want those adjust 'Force input PAR type' and set it to 'generic', but you might want to check the preview since MediaInfo usually isn't wrong about the PAR,..

Cu Selur
 
'Force input PAR type' and set it to 'generic' change nothing.
I set input PAR from10:11 to 8:9.
That time it showed proper 720x540.
However cropping the border still doesn't resize picture to preserve PAR.
[Image: crop5.jpg]


P.S. Just for your reference:

Computer generated images are mostly square pixels...
Video footage is mostly rectangular (non-square) pixels...

Format                                           Rectangular Size              Square Size
DV NTSC................................................720x480.................................720x540
NTSC CCIR601......................................720x486.................................720x547
DV NTSC 16:9 (Anamorphic).................720x480.................................853x480
NTSC CCIR601 16:9 (Anamorphic).......720x486.................................853x486
PAL........................................................720x576.................................768x576
PAL 16:9 (Anamorphic).........................720x576.................................1024x576
HDV 720p..................................................NA.....................................1280x720
HDV 1080i.................................................NA.....................................1920x1080
Quote:Computer generated images are mostly square pixels...
Video footage is mostly rectangular (non-square) pixels...
It's not that simple A Quick Guide to Digital Video Resolution and Aspect Ratio Conversions,...
---

I'll look into the resizing issue, btw. it would really help if instead of screenshots you could share a debug output, because then I see what Hybrid and you did.
Since the main problem is to reproduce your click-order to reproduce the issue.

Cu Selur
(31.10.2020, 22:08)Selur Wrote: [ -> ]
Quote:Computer generated images are mostly square pixels...
Video footage is mostly rectangular (non-square) pixels...
It's not that simple A Quick Guide to Digital Video Resolution and Aspect Ratio Conversions,...
---

I'll look into the resizing issue, btw. it would really help if instead of screenshots you could share a debug output, because then I see what Hybrid and you did.
Since the main problem is to reproduce your click-order to reproduce the issue.

Cu Selur

On the next load it shows proper resizing ????

[Image: crop6.jpg]

You never now what happen on the next session. I'll play around end send you debug of the next (if any) ussue.
It would be best if you also wrote down what you do step by step because otherwise I spend 1/2hr+ reading the debug output to figure it out,...
After looking at the screenshots again, I don't the what you think is wrong.

regarding post #13:
Quote:I set input PAR from10:11 to 8:9.
That time it showed proper 720x540.
However cropping the border still doesn't resize picture to preserve PAR.
Yes it did.

720x480 input resolution @PAR 8/9
714x480 crop resolution @PAR 8/9 (cropping right 6 pixels)
resize is set to adjust the width
target height: 540 -> resizeMult = 540/480 = 1.125
target par: 1:1 -> parMult = 8/9
resized width = cropWidth*resizeMult*parMult 714*1.125*0.888 = 713.286 = 714
-> 714x540, which is shown in your image

regarding post #14:
720x480 input resolution @PAR 8/9
714x476 crop resolution @PAR 8/9 (cropping right 6 pixels, top 4 pixels)
resize is set to adjust the height
target width: 720 -> resizeMult = 720/714 = 1.0084033613445378151260504201681
target par: 1:1 -> parMult = 9/8
resized height = cropHeight*resizeMult*parMult = 476*1.0084033613445378151260504201681*9/8 = 540
-> 720x540, which is shown in your image

I don't see any mistake in the calculations or you screenshots.

So if you think something is wrong then please write down what you configured, what Hybrid showed and what you think is correct.
To me it seems all working correctly atm.

Cu Selur
(31.10.2020, 22:24)Selur Wrote: [ -> ]It would be best if you also wrote down what you do step by step because otherwise I spend 1/2hr+ reading the debug output to figure it out,...

Step 1: Launch "Hybrid".
Step 2: Load " input.m2v" you provided me with.
Step 3: Crop/Resize -> Input PAR 8:9 -> Force Input PAR type: generic, Convert output to PAR "Square Pixel (1:1) - it shows proper 720x540.
step 4: Activate "Picture Crop" - crop right side to 6 px.
- "Picture Resize" with Auto adjust - "height" shows 720x546
So, I need to crop extra 6 pixels (that's incorrect, correct value is 4px) from top/bottom to get 540
Crop: bottom - 4px, top- 2px. Picture Resize shows 720x538 (instead of 540).
Crop: bottom - 2px, top- 2px. Picture Resize shows  correct 720x540.
Quote:]
Step 1: Launch "Hybrid".
Step 2: Load " input.m2v" you provided me with.
Step 3: Crop/Resize -> Input PAR 8:9 -> Force Input PAR type: generic, Convert output to PAR "Square Pixel (1:1) - it shows proper 720x540.
So far so good, this I can reproduce.
Quote:step 4: Activate "Picture Crop" - crop right side to 6 px.
- "Picture Resize" with Auto adjust - "height" shows 720x546
same here
Quote:So, I need to crop extra 6 pixels (that's incorrect, correct value is 4px) from top/bottom to get 540
That assumption is only correct if:
a. input and output PAR
and
b. input and output width is the same
or
these two compensate each other.
Quote:Crop: bottom - 4px, top- 2px. Picture Resize shows 720x538 (instead of 540).
Yes, and 538 is correct.
What Hybrid calculates is:
crop resolution: 714x474
target width: 720 -> resizeMult = 720/714 = 1.0084033613445378151260504201681
target par: 1:1 -> parMult = 9/8
resized height = cropHeight*resizeMult*parMult = 474*1.0084033613445378151260504201681*9/8 = 537.73109243697478991596638655462 = 538
-> Hybrid is correct here.

Quote:Crop: bottom - 2px, top- 2px. Picture Resize shows correct 720x540.
crop resolution: 714x476
target width: 720 -> resizeMult = 720/716 = 1.0055865921787709497206703910615
target par: 1:1 -> parMult = 9/8
resized height = cropHeight*resizeMult*parMult = 476*1.0055865921787709497206703910615*9/8 = 538.49162011173184357541899441341 = 539 which gets rounded to 540 since mod2 is configured (and required due to the color space).
-> Hybrid is correct here.

=> The problem is that you did not think about the resizeMult and parMult that are part of the calculation, since resize should be always done after cropping in Hybrid. Smile

In Hybrid currently the processing order always is:
1. crop
2. resize
3. letterbox

(Now that I think about it, there is another bug: this order is not enforced when using Avisynth or Vapoursynth)


Cu Selur
(31.10.2020, 23:41)Selur Wrote: [ -> ]
Quote:]
Step 1: Launch "Hybrid".
Step 2: Load " input.m2v" you provided me with.
Step 3: Crop/Resize -> Input PAR 8:9 -> Force Input PAR type: generic, Convert output to PAR "Square Pixel (1:1) - it shows proper 720x540.
So far so good, this I can reproduce.
Quote:step 4: Activate "Picture Crop" - crop right side to 6 px.
- "Picture Resize" with Auto adjust - "height" shows 720x546
same here
Quote:So, I need to crop extra 6 pixels (that's incorrect, correct value is 4px) from top/bottom to get 540
That assumption is only correct if:
a. input and output PAR
and
b. input and output width is the same
or
these two compensate each other.
Quote:Crop: bottom - 4px, top- 2px. Picture Resize shows 720x538 (instead of 540).
Yes, and 538 is correct.
What Hybrid calculates is:
crop resolution: 714x474
target width: 720 -> resizeMult = 720/714 = 1.0084033613445378151260504201681
target par: 1:1 -> parMult = 9/8
resized height = cropHeight*resizeMult*parMult = 474*1.0084033613445378151260504201681*9/8 = 537.73109243697478991596638655462 = 538
-> Hybrid is correct here.

Quote:Crop: bottom - 2px, top- 2px. Picture Resize shows  correct 720x540.
crop resolution: 714x476
target width: 720 -> resizeMult = 720/716 = 1.0055865921787709497206703910615
target par: 1:1 -> parMult = 9/8
resized height = cropHeight*resizeMult*parMult = 476*1.0055865921787709497206703910615*9/8 = 538.49162011173184357541899441341 = 539 which gets rounded to 540 since mod2 is configured (and required due to the color space).
-> Hybrid is correct here.

=> The problem is that you did not think about the resizeMult and parMult that are part of the calculation, since resize should be always done after cropping in Hybrid. Smile

In Hybrid currently the processing order always is:
1. crop
2. resize
3. letterbox

(Now that I think about it, there is another bug: this order is not enforced when using Avisynth or Vapoursynth)


Cu Selur

So, in this case we need somehow calculate and present other required cropping value (in my case vertical 4px) based on Input/Output PARs before resizing.
When you said "...this order is not enforced when using Avisynth or Vapoursynth" - did you mean that they don't respect filter order specified in "Misc"?
Pages: 1 2 3 4