Cropping question.

This forum is for questions and discussion of all the aspects of handling and cleaning up your footage with Avisynth.
Locked
User avatar
Vanity
Joined: Fri Dec 28, 2007 10:52 pm
Status: XIII
Location: Everywhere, yet no where
Org Profile

Cropping question.

Post by Vanity » Wed Apr 25, 2012 1:48 am

Just wanted to know if the footage doesn't show any black bars that needs re-cropping, should I worry about it?
Spoiler :
Image

User avatar
mirkosp
The Absolute Mudman
Joined: Mon Apr 24, 2006 6:24 am
Status: (」・ワ・)」(⊃・ワ・)⊃
Location: Gallarate (VA), Italy
Contact:
Org Profile

Re: Cropping question.

Post by mirkosp » Wed Apr 25, 2012 6:20 am

The AVTECH is VERY generic about aspect ratios. Ideally, assuming the ITU values are respected as they should (they generally are, though not always, but it's hard to tell otherwise unless you have something that allows you to be sure), cropping 8 from left and 8 from right gets you the almost perfect 4:3 or 16:9 area (it's an approximation, but a good one). But then it just goes full retard and tells people to resize to 848x480 (actual 16:9 is a bit larger than that), so it might as well tell people to overcrop from 720x480 to something extra rather than just 704x480 (though cropping to 704x480 and resizing to 640x480 is ok).
Obviously, more recent sources don't always need to get all that much cropped, or, sometimes, you'll need to crop more, and obviously you'll need to keep the ratio correct. But with a guide that teaches you to resize to the wrong resolution, you're not going to go too far. Not that many people care since the difference is tiny, but it is there, and for all intents and purposes, it is better to stick with proper math:
http://ps-auxw.de/cgi-bin/ar-calc.pl
As you can check for yourself, if absolutely no cropping has been done from the original 720x480 on the DVD, the display aspect ratio is supposed to be around 875x480, but since odd numbers are no go, and since mod2 numbers are in bad taste too for distro, so 876x480 is a good approximation if you need to go with 1.0 PAR. If you, however, do need 848x480, then you'll have to crop to keep the AR. Let's crop before resizing, shall we?
So, in the calculator, first you tell the resolution after the crop, then you can already hit Calculate and check if the Display Aspect Ratio is what you want. In this case, let's try this:
Set the first Transform to Crop: and then set 698, 480. You can set the second transform to resize and 848x480 if you so wish; it's not necessary to specify it in this case, as we are resizing only horizontally, but let's do it anyway. And then you'll see it tells you:
Results

Numbers

Source resolution: 720x480
Source AR: Widescreen
Final resolution: 848x480
Final PAR: 251280/251167 = 1.00044989986742
Final display resolution: 848x480
Final DAR (square pixels): 8376/4739 = 1.76746148976577

Transforms

Crop: 698, 480
Scale: 848, 480
So yes, if you want to resize to 848x480, you will have to crop to 698x480 from the original 720, or, in other words, you'll need to:

Code: Select all

ResampleHQ(848,480,srcmatrix="TV.601",chroma_kernel="SINC",chroma_karg1=8,src_left=11,src_width=-11)
OR, with old-fashioned, non-gamma-aware avisynth's internal resizers:

Code: Select all

Spline36Resize(848,480,11,0,-11,0)
So, that's it.

Of course, this is all assuming you ARE using the original DVD (and just used MakeMKV to rip it) instead of downloading some shitty encode that might have done things the wrong way for all we know ─ and thus there is not way to be sure we are doing the correct thing if whoever ripped it fucked something up, like for example cropping just what necessary, then resizing to 720x480 or 704x480 and flagging as if this was the perfect 16:9 area.
Image

User avatar
BasharOfTheAges
Just zis guy, you know?
Joined: Tue Sep 14, 2004 11:32 pm
Status: Breathing
Location: Merrimack, NH
Org Profile

Re: Cropping question.

Post by BasharOfTheAges » Wed Apr 25, 2012 8:10 am

Mirko - I think you need to provide pictures with your explanation. The wall of text seems to give the impression the actual image geometry going from the source animation to DVD in terms of PAR isn't changing. If the studio is using a transform to get the frame onto a DVD, the inverse of the transform should be able to get it back without involving cropping. It's just a matter of how they took over-scan into account when they applied the (1.0PAR to 0.9PAR) transform in the first place. As to the need to explain practical theory, I think it's becoming easier to deal with, since HD displays are 1.0PAR so we don't have the image geometry issues, and while over-scan still exists, you don't find it as much on optical media as you do on broadcast signals.
Anime Boston Fan Creations Coordinator (2019-2023)
Anime Boston Fan Creations Staff (2016-2018)
Another Anime Convention AMV Contest Coordinator 2008-2016
| | |

User avatar
mirkosp
The Absolute Mudman
Joined: Mon Apr 24, 2006 6:24 am
Status: (」・ワ・)」(⊃・ワ・)⊃
Location: Gallarate (VA), Italy
Contact:
Org Profile

Re: Cropping question.

Post by mirkosp » Wed Apr 25, 2012 8:16 am

This is past overscan, Bashar. The PAR on DVDs is strictly specified by the ITU, and it's always 40:33 for widescreen, which means that at 720x480 it's actually slightly wider than 16:9. If you check his script, he isn't doing any cropping and resizing directly to 848x480, which is shorter than 16:9. This is wrong, as it completely ignores the ITU PAR, so the error increases even further than what the guide already suggests. You are not forced to crop what does not need to be cropped, but in that case, you should not be using 848x480, and I did explain that quite clearly in the start of the WoT.
Image

User avatar
Vanity
Joined: Fri Dec 28, 2007 10:52 pm
Status: XIII
Location: Everywhere, yet no where
Org Profile

Re: Cropping question.

Post by Vanity » Wed Apr 25, 2012 10:45 am

Very much appreciated mirk. I have no idea where you learn these things but I'm glad you know it :)

Mister Hatt
Joined: Tue Dec 25, 2007 8:26 am
Status: better than you
Contact:
Org Profile

Re: Cropping question.

Post by Mister Hatt » Thu Apr 26, 2012 8:26 am

What mirko said is how it is though, but you can set a DAR flag in the container if you like specific resolutions.

The only thing you really have to do is ensure your PAR is 1:1. You can leave the physical dimensions alone, or you can scale them as you feel like, but just adjust the display to compensate. The reason for this is that cropping changes the DAR while resizing changes the PAR. If you don't crop but want a specific resolution for encoding, then by forcing the PAR to non-square you will be changing the pixel dimensions. Because you changed the dimensions similar to a crop, you need to adjust the DAR so that your PAR renders correctly.

Locked

Return to “AviSynth Help”