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. |
22nd December 2005, 13:25 | #1 | Link |
Registered User
Join Date: Dec 2003
Posts: 51
|
SAR - Just checking I understand this right
Ok so I'm testing out x264 for the first time. I'm going to encode Star Wars Episode 1 using full resolution just cropping away the black borders.
720x576 crop 72 off the top and bottom... (to make sure height is divisible by 16, is this still needed these days?) So thats 720x432 SAR_x DAR_x * height ----- = -------------- SAR_y DAR_y * width So.... 16 * 432 = 6912 9 * 720 = 6480 So I need to use --sar 6912:6480??? is that correct? If not then I've no idea lol. |
22nd December 2005, 13:58 | #2 | Link |
HDConvertToX author
Join Date: Nov 2003
Location: Cesena,Italy
Posts: 6,552
|
i think (and i hope) you must retain full height. So in calculation you cannot take off crop
BHH
__________________
HDConvertToX: your tool for BD backup MultiX264: The quick gui for x264 AutoMen: The Mencoder GUI AutoWebM: supporting WebM/VP8 |
22nd December 2005, 14:46 | #3 | Link |
Mr. Sandman
Join Date: Sep 2003
Location: Haddonfield, IL
Posts: 11,768
|
Q17 on http://forum.doom9.org/showthread.ph...689#post696689
use full height and width.
__________________
MPEG-4 ASP Custom Matrices: EQM V1(old), EQM AutoGK Sharpmatrix (aka EQM V2), EQM V3HR (updated 01/10/2004), EQM V3LR, EQM V3ULR (updated 04/02/2005), EQM V3UHR (updated 17/12/2004) and EQM V3EHR (updated 05/10/2004) Info about my ASP matrices. MPEG-4 AVC Custom Matrices: EQM AVC-HR Info about my AVC matrices My x264 builds. Mooo!!! |
22nd December 2005, 16:06 | #4 | Link |
Registered User
Join Date: Dec 2003
Posts: 51
|
Ahhh so cropping makes no difference. I did read Q17, and the linked thread, but didn't see anything about cropping. The thread also confused me as people were posting all kinds of different numbers.
So it should be... 16 * 576 = 9216 9 * 720 = 6480 which I can see is the same as SeeMoreDigital's post saying "PAL 16:9 DAR = 64:45". StephanV's post is different though, and I'm sure there was a different one yet again somewhere in that or another post I looked at. |
22nd December 2005, 20:58 | #5 | Link |
Registered User
Join Date: Dec 2003
Posts: 51
|
So why does MeGUI get it so wrong then as well? That confused me as well, just got back and confirmed that when using the avisynth creator, if I don't crop it and click the retain anamorphic box and set to 720x576 then it says...
# Set SAR in encoder to 720 : 506 which is close, but not the same as 64:45. If I crop then it changes it to... # Set SAR in encoder to 720 : 675 Which is certainly not right? I also have to click on the suggest resolution checkbox a couple of times before it works properly. Is it just my machine playing up or is it like this for other people too? I'll report it in the MeGUI thread if it's a bug? |
23rd December 2005, 06:12 | #6 | Link | ||
Registered User
Join Date: Jul 2004
Posts: 383
|
Quote:
64/45=1.4222recurring The difference is a result of rounding errors in the integer arithmetic (necessary to accomodate different sizes and ARs) and is less than 0.05%... Don't lose sleep over it. Quote:
BTW, star wars films are 2.35:1, so you should set a custom DAR of 2.35 and crop away the black borders at top and bottom. |
||
23rd December 2005, 10:27 | #7 | Link |
Registered User
Join Date: Dec 2003
Posts: 51
|
Open d2v file, click auto-crop, click retain anamorpic (leaving resolution set to 640*...), if I click on edit now it has the SAR as -1:-1. Then increase the resolution to 720*... and it changes to 720:675.
You're completely right about the 2.35 aspect, I didn't think about that. What should I set the SAR to for that? I don't know how to work it out from that. |
23rd December 2005, 11:26 | #9 | Link | |
Life's clearer in 4K UHD
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
|
Quote:
Crop away all the mattes to leave you with an 720x432 image frame size. Then add a custom SAR of 24:17 Cheers
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
|
|
23rd December 2005, 11:55 | #10 | Link | |||
Registered User
Join Date: Jul 2004
Posts: 383
|
Quote:
Quote:
Quote:
If you're still worried, just open the avs in Notepad and add Trim(0,25) to the end then run a test encode - this will encode a 1 second sample which you can play back to check you have the right aspect ratio at the end of the process. |
|||
23rd December 2005, 12:08 | #11 | Link |
Registered User
Join Date: Dec 2003
Posts: 51
|
Thanks guys, getting my head around it now I think.
Just kicking off an encode now using 24:17, is that the non-ITU calculation and the one MeGUI uses is ITU standard or something? I know it's very little difference and that you probably can't notice anyway, just curious. SeeMore : How did you work that out? Interested in the math behind it so I could do it myself. |
23rd December 2005, 12:11 | #12 | Link | |
Registered User
Join Date: Dec 2003
Posts: 51
|
Quote:
So surely the 720:506 should be right and the same whether you're cropping or not? |
|
23rd December 2005, 15:22 | #13 | Link | |
Registered User
Join Date: Jul 2004
Posts: 383
|
Quote:
As far as ITU goes: no, the calculations assume that the output device has square pixels (the Common Image Format standard) rather than the anachronistic values found in the ITU standard that are just a hold-over from the days of analog. I've updated meGUI to catch user input more consistently in the resizing/SAR caluclations: version 0.2.3.1024 at the end of the meGUI development thread. Last edited by charleski; 23rd December 2005 at 15:24. |
|
23rd December 2005, 16:12 | #14 | Link |
Registered User
Join Date: Dec 2003
Posts: 51
|
"i think (and i hope) you must retain full height. So in calculation you cannot take off crop"
"use full height and width." And now you say to use 432, which is after cropping. So which is it? Can anyone else see why I'm getting confused here? |
23rd December 2005, 17:12 | #15 | Link |
Registered User
Join Date: Jul 2004
Posts: 383
|
You want to use the full image height and width so that you keep all the information that is available from the DVD. The black matting is not part of the image and is only there because the DVD standard has a very rigid specification. You don't want to keep the black bars, so you can throw them away. You very definitely do need to apply the crop first before further calculations, otherwise you'd be including picture area that isn't going to be encoded and the calculations would be invalid.
There are, of course, times when you would want to resize the picture down, for instance if you're doing a 1CD encode of a longish movie, or are preparing something for a channel which needs smaller dimensions than the DVD standard. The actual way meGUI calculates the SAR is as follows: 1) Apply the cropping and then determine the aspect ratio of the input video image (inputPixelCountRatio). 2) Scale the vertical resolution according to the horizontal resolution that's been specified (resizedVerticalResolution = horizontalResolution / inputPixelCountRatio) 3) Adjust the vertical resolution so that it matches the closest multiple of 16. 4) Set SARX to the horizontal resolution. 5) Set SARY to Round(HorizontalResolution^2 / (VerticalResolution * DAR)), this is then truncated to an integer. |
23rd December 2005, 19:58 | #17 | Link |
Registered User
Join Date: Jul 2004
Posts: 383
|
Yes
There's a lot of confusing stuff around on the web about aspect ratios, but it's easy when you realise that the only aspect ratio that really matters is the DAR, the AR that you want to end up with. Everything else is just a transform (how do I get there from here). The whole thing isn't helped by the lingering analog embers of the ITU kludge that attempted to map digital pixels onto analog bandwidth, but as SeeMoreDigital points out on his website, the ITU standard for ARs is irrelevant nowadays. |
23rd December 2005, 20:14 | #18 | Link | |
Life's clearer in 4K UHD
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
|
Quote:
It's probably more accurate to say that the matte has in-fact been encoded along with the image. So in reality it could just as well have been coloured grey instead black Thankfully the edge of the matte on most of todays DVD is much sharper than with earlier DVD transfers, so in some repects it's less important to crop them away. Cheers
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
|
|
23rd December 2005, 20:30 | #19 | Link | |
Registered User
Join Date: Jul 2004
Posts: 383
|
Quote:
|
|
23rd December 2005, 21:52 | #20 | Link | |
Registered User
Join Date: Dec 2003
Posts: 51
|
Quote:
Thanks for the help guys. One thing I'd like in the avisynth creator bit is a tick box for resize, the same as there is for crop. Not that it matters much cause I just go into the edit tab and remove the resize line anyway if I'm keeping full res. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|