View Full Version : Help with anamorphic, aspect ratios and resolutions.
Vorkey
14th February 2011, 17:35
Hi, I have very limited understanding of any of this so forgive me if I sound stupid.
Anyway
I'm using MeGUI to encode my DVDs into h.264 and I am completely fine with that side of things, but I get confused when it comes to things like DAR, video resoultion etc... So I was wondering if someone could tell me if I'm doing something wrong, and if I am, tell me the correct way of doing this stuff.
Basically in simple terms, I want to rip DVDs onto my computer, encode them anamorphic and cut out the borders, thats it.
I'll use the DVD Spiderman 2 as my example. It's 720x576 and has DAR of 2.40:1
Heres what I do
1) I rip the DVD onto my computer using DVD Decrypter
2) I put it into MeGUI and run File Indexer, afters Avisynth pops up
3) I tick clever anamorphic encoding (resize mod16)
4) I tick crop and then click Auto Crop
5) My resolution changes to 720x432
6) I check my script and it says
global MeGUI_darx = 208
global MeGUI_dary = 85
I divide 208 / 85 and get 2.44705882352941
It's not quite 2.40 so I go back and mess with the cropping a bit to make it more accurate, eventually I get
global MeGUI_darx = 221
global MeGUI_dary = 92
I divide 221 / 92 and get 2.402173913043478
Thats about as close as I can get, so I settle for that.
7) I save my avs script and then encode the video.
The end result is, a good quality video at 720x432 with a DAR of 2.40:1 which is fine.
However, on media player classic next to 720x432 it says AR 1037x432 and I know the 1037 is the anamorphic resizing the width of the video..
For example, 432 * 2.40 = 1036.8 (rounded up = 1037)
Anyway, what I was wondering is, does all of this sound right? Is this the way its suppose to be done?
I know the frame sizes of the actual video 720 and 432 must be dividable by 16 which they are, but does the 1037 have to be dividable by 16 as well? Because obviously its not, its not even an even number. Anyway, I was just concerned that I'm doing something wrong.
Can someone tell me if all of this is the correct way to encode anamorphic?
Thanks
sneaker_ger
14th February 2011, 18:43
I know the frame sizes of the actual video 720 and 432 must be dividable by 16
Wrong. It's true though that H.264 works with mod16 resolutions internally, so those resolutions are usually preferred over non-mod16 resolutions. But resizing just to make them mod-16 is not worth it.
but does the 1037 have to be dividable by 16 as well?
No.
Vorkey
14th February 2011, 20:04
Thanks for quick response.
Wrong. It's true though that H.264 works with mod16 resolutions internally, so those resolutions are usually preferred over non-mod16 resolutions. But resizing just to make them mod-16 is not worth it.
Ok so your saying that I'd be better off doing non mod16.
So all I need to do is select non mod16, crop away the black borders, check the global MeGUI_darx and global MeGUI_dary values to make sure I have the right DAR and then I'm done, is that all I need to do?
I have a question about the Input DAR box on Avisynth Script Creator as well, what I want to know is, do I use the ITU 16:9 PAL option or the other 16:9 (1.777778) option?
yetanotherid
14th February 2011, 22:37
Ok so your saying that I'd be better off doing non mod16.
Originally most encoder GUIs didn't give you a choice. Mostly mod16 was the only option. These days encoding x264 it's not so vital. Personally I either overcrop to achieve mod16, or if there's not much resizing to be done I resize to mod16, but that's probably just me not being able to let go of the past. I've never had a problem playing non-mod16 video although I've not tried it on a wide variety of devices.
So all I need to do is select non mod16, crop away the black borders, check the global MeGUI_darx and global MeGUI_dary values to make sure I have the right DAR and then I'm done, is that all I need to do?
You shouldn't need to check anything. There's no reason why the display aspect ratio has to be exactly 2.40 etc. Those sorts of display aspect ratios are never exact when resizing and cropping anamorphic DVDs. You probably need to separate the way you think of the actual picture aspect ratio (the shape of objects in the video) in relation to the display aspect ratio (the width and height of the video), if that makes sense. The idea is to resize the video to it's original aspect ratio and then crop the crud. What's left is the display aspect ratio.... the dimensions of the video... but as long as the original picture hasn't been distorted (which MeGUI won't do when it's encoding anamorphically) the resulting display aspect ratio (video width and height) is somewhat irrelevant. Just remember a 2.40 aspect ratio DVD is really a 16:9 aspect ratio DVD with the picture in the middle and black bars added top and bottom to "fill the gaps". There's no guarantee though, that after cropping the black bars you'll end up with a perfect 2.40 aspect ratio video and there's no reason why you should have to.
I generally go into MeGUIs options and set the acceptable aspect error to 0%, crop what I need to crop (whether you worry about mod16 cropping is up to you) and let the display aspect ratio be wherever it will be. The only time I ever worry about it is when encoding video with a 4:3 aspect ratio. Then I generally adjust the cropping until the display aspect ratio is also 4:3, so there won't be any black space on the sides when playing the video on a 4:3 monitor, but other than that I never think about the display aspect ratio.
I have a question about the Input DAR box on Avisynth Script Creator as well, what I want to know is, do I use the ITU 16:9 PAL option or the other 16:9 (1.777778) option?
Use the other option. By far the majority of DVDs don't use the ITU resizing method. I wish MeGUI had an option to default to the non-ITU resize method because then you wouldn't have to worry about changing it all the time.
That's also another reason for not worrying about the display aspect ratio....
The ITU resize method and the non-ITU resize method use different pixel aspect ratios, or slightly different shaped pixels, so a DVD with a 16:9 aspect ratio will have slightly different dimensions according to which pixel resizing method you choose.
You can drive yourself mad trying to work out which method a DVD actually uses.... the only way to guess is to find something in the video which should be round (such as a direct shot of a clock face) and look to see if it's actually round after you've picked the resize method... but generally the non-ITU resize method is the one to use.
You don't have to worry about picking the wrong method though. The pixel aspect ratio (or display aspect ratio) of the encode isn't written in stone. If later on you decide you used the wrong resize method you can fix it by opening the mkv with MKVToolNix (or with YAMB if it's an MP4 etc) and simply resave the MKV (or MP4) using a different aspect ratio. You don't have to re-encode the video to do it.
yetanotherid
14th February 2011, 22:58
For the record, when you play the original vob files using MPC (and pretty much every other software player) it's using the non-ITU resize method to resize the video. So basically if when playing the vob files you think the picture aspect ratio looks correct, use the non-ITU resize method for encoding. If you're absolutely sure it's wrong (if it is objects in the picture will look slightly stretched vertically) then use the ITU resize method for encoding.
If you look at the figures next to the different MeGUI resize options the non-ITU resize method resizes a 16:9 DVD to 16:9 dimensions (1.777778).
A 16:9 DVD resized using the "official" ITU resize method isn't actually 16:9. :)
Vorkey
15th February 2011, 00:34
Thank you yetanotherid, that explained quite a lot. I think I know what I'm doing now.
Thanks again!
Although I do have one more question though, what effects would setting the Acceptable Aspect Ratio error to 0% have?
yetanotherid
15th February 2011, 03:13
Although I do have one more question though, what effects would setting the Acceptable Aspect Ratio error to 0% have?
I've not played with it enough to know exactly, but I'm guessing it effects the way MeGUI "rounds" the display aspect ratio. It probably only effects the display aspect ratio when resizing to mod16 rather than when overcropping or encoding non-mod16 etc and I'm pretty sure it only applies to anamorphic encoding.
Obviously setting it to zero should prevent MeGUI from fudging the picture aspect ratio at all. Increasing the allowed aspect ratio error would allow it to fudge a little.
I can only give you an example from my limited experience playing with it. I mentioned in my previous post the only time I worry about the display aspect ratio is when I want to achieve 4:3. Last time I encoded a 4:3 DVD I experimented with it a little while I had MeGUI set to resize to mod16 dimensions. With the allowed aspect error set to 1 or 2 percent it wasn't hard to crop to achieve a 4:3 display aspect ratio but with it set to zero I had to get the cropping exact. So I assume MeGUI will fudge the aspect ratio a little, maybe to give you a nice 4:3 or 16:9 display aspect ratios etc. if your cropping already gets you pretty close, or in other words it'll stretch or squish the picture a little to fit standard aspect ratios. Something like that anyway....
Personally I prefer no aspect ratio fudging so I set it to zero.
It's easy to see if it's having an effect. While you're doing your cropping go into MeGUI's options and change the allowed aspect error. Then go back to the encode and look at the script (you may have to adjust one of the cropping values.... say increase it by a couple of pixels then change it back again before the change to the allowed aspect error has an effect on your script) but basically if the display aspect ratio in the script being created changes then MeGUI is doing some sort of display aspect ratio "rounding" within the limits of the allowed aspect error. As I said though, it probably only has an effect when you're resizing to mod16.
Hopefully I explained that well enough, even though I don't really know when the allowed aspect error setting comes into effect as such, but the help files don't do much more than state the obvious. http://mewiki.project357.com/wiki/MeGUI/Settings
Ghitulescu
15th February 2011, 10:27
There have been a long debate among the purists which PAR is the correct one, all values for one type (say PAL 16:9 anamorph) differing with at most 2%. The analog standard itself and the TV leave room for some 1-2% variation, so watching on a consumer TV won't necessarily help finding the correct PAR. However, the most crucial restriction comes from the codec, most codecs require byte- or word-alignment, so both dimensions must be multiple of 8 or 16. Completely removing the matting (black bars) would induce another ~1-2% error (4 or 8 pixels in 480, 4 or 8 pixels in 640).
Since movies and especially live events originate from various sources, and sometimes from a mixed environment, it's not always evident which PAR was used for one particular video. Should this have been so simple, it should already have been implemented (sort of Automatic DVD to AVI converter ;)).
One should also bear in mind the utility of the new file (H.264). How it will be watched? Which player? Which display? How is this file internally processed in the player?
yetanotherid
15th February 2011, 17:35
There have been a long debate among the purists which PAR is the correct one, all values for one type (say PAL 16:9 anamorph) differing with at most 2%. The analog standard itself and the TV leave room for some 1-2% variation, so watching on a consumer TV won't necessarily help finding the correct PAR. However, the most crucial restriction comes from the codec, most codecs require byte- or word-alignment, so both dimensions must be multiple of 8 or 16.
Contrary to the advice given by the majority of forum members who actually encode non-mod16?
Completely removing the matting (black bars) would induce another ~1-2% error (4 or 8 pixels in 480, 4 or 8 pixels in 640).
How?
Since movies and especially live events originate from various sources, and sometimes from a mixed environment, it's not always evident which PAR was used for one particular video. Should this have been so simple, it should already have been implemented (sort of Automatic DVD to AVI converter
Obviously.
One should also bear in mind the utility of the new file (H.264). How it will be watched? Which player? Which display? How is this file internally processed in the player?
Do you have an example or is this another thread you're going to fill with theories which have no application in the real world?
Vorkey
16th February 2011, 14:53
Well thanks for all your help.
I decided to go with clever anamorphic and then set resize to mod16 and then crop away black borders and thats it, seems to work fine and I chose to leave acceptable aspect ratio error on 1% because the output videos look pretty much the same anyway, only difference is, with acceptable ratio error on 0% its so precise so you never get the DAR you want, and I know it doesn't really matter, but I want neat numbers like 2.35, 16:9, 2.40 and I couldn't get them with acceptable ratio error on 0% :(
Anyway, once again thanks for your help.
yetanotherid
16th February 2011, 18:18
Neat numbers? You'll be saying you encode everything to the same file size next. ;-)
Actually I can see the 16:9 thing, because of the 16:9 display thing. For the same reason I worry about 4:3, I guess.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.