View Full Version : Resolution/Aspect Ratio question
fanerman
29th January 2007, 10:05
Hi,
I'm new, but I've been playing around with Gordian Knot for awhile. I have a question regarding aspect ratios and input resolutions of DVD's and the resulting XviD files (I hope this isn't in the wrong forum, but I don't know where to put it).
Background: I'm ripping TV shows to my hard drive to stream through my xbox with xbox media center. I chose XviD because the xbox isn't powerful enough to play newer codecs at the normal 480 resolution.
I want to create XviD files from my DVD's (TV shows) with the same resolution and aspect ratio as the original DVD's. However, (correct me if I'm wrong), but all DVD's are 720x480, regardless if they're 4:3 or 16:9. So then, are there rectangular pixels in the DVD's? How does the DVD player know how to scale the image properly so the aspect ratio is correct?
I'm currently encoding 4:3 DVD's to 640x480 XviDs and 16:9 DVD's to 852x480 XviD's to get the aspect ratios right. To save space, I'd like to just be able to rip 16:9 DVD's to 720x480 and somehow have the software player know how to scale the image properly. Is there an easy way to do that? Is it as easy as using rectangular pixels in the XviD Configuration -> Profile @ Level -> Aspect Ratio menu? Would that actually save me space? What would be my best course of action?
Any help would be appreciated. Thank you very much.
Brother John
29th January 2007, 17:01
So then, are there rectangular pixels in the DVD's?
Yes, always. DVD pixels are never square.
How does the DVD player know how to scale the image properly
There's a flag on the DVD indicating if it's 16:9 or 4:3. If it's PAL or NTSC is obvious anyway. And that's all the information the player needs for proper display.
Is there an easy way to do that?
With Gordian Knot, no, not that easy. What you need to do is set an aspect ratio flag in the video bitstream that the splitter/decoder can evaluate. Fortunately Xvid provides you with an option to do this. Quick walk through:
Options tab: Disable the advanced SaveAVS window
Resolution tab: Use 1:1 input pixel ar for all sources. Then crop to a mod16 resolution (or at least mod8).
SaveAVS window: Edit the AVS script and delete the resize line.
Xvid config dialog: Go to "Profile@Level / More / Aspect Ratio" and set the "Pixel Aspect Ratio" according to your source. Strictly speaking that's only necessary for 2nd pass config.
You need a DirectShow splitter/decoder pair that can handle ar-flags. Safest choice is Haali's splitter (http://haali.cs.msu.ru/mkv/) and ffdshow (http://ffdshow.info). Non-DirectShow players must have ar-flag support built in.
fanerman
29th January 2007, 20:57
Thanks Brother John,
Where are the SaveAVS window and the AVS script?
Brother John
29th January 2007, 22:19
In the video preview window click save&encode and there you are. The Edit button opens the script.
fanerman
7th February 2007, 08:28
Brother John,
I've tried following what you said, but the aspect ratio is incorrect. Instead of 16:9, it's 20:11 (which is pretty close to 16:9), but it's still wider. I played it back with media player classic and ffdshow, and media player classic said the aspect ratio was 20:11. I compared this with the .vob file (also with media player classic) and the xvid was clearly wider.
It's not a huge difference but I just want to rip them right.
I'm using an input and output aspect ratio of 720x480. Do you have any idea what could be the problem?
Brother John
7th February 2007, 16:38
The slightly wider picture is normal.
Because of small deviations in the DVD production process and then cropping you hardly ever have exakt "standard ARs" (like 16:9, 1.85:1, 2.35:1) anyway. Then Xvid uses PAR values from the MPEG-4 standard which are almost identical to ITU-R BT.601. Thus the slightly wider picture is perfectly normal. In fact DVDs should be produced according to that ITU recommendation. Not all of them are though, and there's no easy way to find out.
If you don't like this, you can always set a DAR in Xvid's config instead of the PAR. Which value is more correct depends on the way the DVD was mastered, which you can't easily find out. Deviations are small anyway so it's mostly a matter of personal preference. In my opinion respecting ITU-R is the better choice.
Btw: Software DVD-players usually don't respect ITU-R.
SeeMoreDigital
7th February 2007, 18:43
Not so long ago I conceived a little application called ARS Calculator.
Essentially you could say, generate an encode at any weird shaped resolution and use the ARS Calculator to work out the required level of Aspect Ratio Signalling to correct it.
For more information look here: -
http://www.ziova.com/forum/index.php?showtopic=873
Cheers
Brother John
7th February 2007, 18:53
Keep in mind, though, that ARS Calculator does not respect ITU (it uses so called "generic PARs"). So it's only useful if you aim for exact "standard ARs".
HeadBangeR77
7th February 2007, 19:08
@ fanerman
You've got a preview window in GK, which shows the output image's proportions. When you either check or uncheck the ITU resizing, it usually changes proportions - choose what seems best to you, since an encode should look ok for your eyes. You could then go back to 1:1 input pixel, and set the apropriate pixel values in the codec's settings, as already explained (Brother John has PARs for all formats in his guide ;)).
Software players almost always resize according to generic PAR, like this:
1:2.35
http://www.hidebehind.com/thumbs3/86BFC47.png (http://www.hidebehind.com/86BFC47)
while the proper ITU resizing is 1:2.40. I usually choose sth in between those two, for instance:
http://www.hidebehind.com/thumbs3/4A20E424.png (http://www.hidebehind.com/4A20E424)
When you've saved them to hdd, plz view at full screen. The difference is very small (1:2.35 vs. 1:2.37), yet easy to spot, at least for me.
cheers,
HDBR77
@ SeeMoreDigital
Gonna have a look at that fruit of your conception. :D
SeeMoreDigital
7th February 2007, 19:12
Keep in mind, though, that ARS Calculator does not respect ITU (it uses so called "generic PARs"). So it's only useful if you aim for exact "standard ARs".As you said so yourself software players (and decoder filters) don't follow the ITU specs anyway. Neither do many MPEG-4/DVD harware players...
HeadBangeR77
7th February 2007, 19:16
As you said so yourself software players (and decoder filters) don't follow the ITU specs anyway. Neither do many MPEG-4/DVD harware players...
Haven't you learnt there's no way to convince the ITU-resizing fans to accept the opposite pov? ;) And the other way round. ;)
That's why I sit somewhere in the middle and laugh. :D ;)
SeeMoreDigital
7th February 2007, 19:25
Why does this link: -
http://www.hidebehind.com/thumbs3/4A20E424.png (http://www.hidebehind.com/4A20E424)
...point to an image that has a cropped resolution of 1024x432 pixels? ie: 2.37:1
HeadBangeR77
7th February 2007, 19:33
Why does this link: -
(...)
...point to an image that has a cropped resolution of 1024x432 pixels? ie: 2.37:1
Since: "I usually choose sth in between those two, for instance:" ...
I'm not interested in anomorphic encodes, but I wanted to give an example as to proportions /aspect ratios. Cropping is always done, but I really can't understand why some of the ITU-resizing fans say: "always crop to 702x???" - in the given example cropping 4 pixels from both sides is enough (actually 3, but it's impossible).
cheers.
Brother John
7th February 2007, 20:28
Well, if you find someone saying »always« or »ever« in connection with aspect ratios and ITU/generic, you know you’ve found a zealot and any discussion is useless anyway. Under absolutely no circumstances will a true zealot deviate from the path of righteousness! Never! He might even encode HD DVD material with his beloved one any only true PAR. ;)
Actually your way of sitting in between is not such a bad idea. Maybe even better than trying to deduce stuff from standalone behaviour etc. Since we hardly ever know the true source PAR it’s all about minimizing the error anyway.
I guess this is becoming way to technical for the original question. But now I started thinking. Choosing either ITU or generic means you’re always either correct or 2.56% (PAL) off (1.29% for NTSC). Sitting in between you’re never correct and always 1.28% (0.645%) off. And those are quite reasonable numbers. But the question remains: Is ITU more common or generic? Because if most DVDs are ITU/generic taking the in-between value isn’t such a good idea. If the situation is not so clear cut in-between becomes more and more interesting. At least in my opinion being 1.28% off for every film is better than being correct half the time and 2.56% off for the other half.
unskinnyboy
7th February 2007, 20:57
déjà vu (http://forum.doom9.org/showthread.php?t=114143)...
HeadBangeR77
7th February 2007, 22:41
Well, if you find someone saying »always« or »ever« in connection with aspect ratios and ITU/generic, you know you’ve found a zealot and any discussion is useless anyway. Under absolutely no circumstances will a true zealot deviate from the path of righteousness! Never! He might even encode HD DVD material with his beloved one any only true PAR. ;)
That's why I usually try to avoid such a discussion, or sometimes (like e.g. here) I try to point to "the other way" (aurea mediocritas it is not, nevertheless ... ;)).
In your guide I happened to read (;)) there's a hint AFAIR - if the DVD source have small black bars on both sides, it's rather ITU-PAR. I spent a few days once on trying to guess the right AR for the above encode (Black Pearl), and the ITU's PAR looked a bit too squeezed (horizontally), while the generic one was way too "slim". Anyway, cropping may distort the right proportions a bit, so it's another variable we should be aware of. In the end I chose "sth in between" and stated I had wasted too much time on such a thing.
Actually your way of sitting in between is not such a bad idea. Maybe even better than trying to deduce stuff from standalone behaviour etc. Since we hardly ever know the true source PAR it’s all about minimizing the error anyway.
I guess this is becoming way to technical for the original question. But now I started thinking. Choosing either ITU or generic means you’re always either correct or 2.56% (PAL) off (1.29% for NTSC). Sitting in between you’re never correct and always 1.28% (0.645%) off. And those are quite reasonable numbers. But the question remains: Is ITU more common or generic? Because if most DVDs are ITU/generic taking the in-between value isn’t such a good idea. If the situation is not so clear cut in-between becomes more and more interesting. At least in my opinion being 1.28% off for every film is better than being correct half the time and 2.56% off for the other half.
I've marked one thing - if you spend some time on one movie, you're getting used to its look, and hence the AR as well. If you change the AR then, the new proportions appear simply false, no matter if they are right or wrong, unless the AR error is really huge.
I'm not into standalones, though I own one, but most of the time the picture seems a bit too vertically squeezed, as if the ITU-way was used more often.
Ufff - Kaffeepause ;)
@ unskinnyboy:
It's been much worse already ... (http://forum.doom9.org/showthread.php?t=85220)
Someone even accused the thread's founder, who was interested in upsizing, of hijacking the thread, when he wanted to go back to the main matter. :p
SeeMoreDigital
7th February 2007, 23:18
LOL....
You guys just go ahead and do want you want to do ;)
But in answer to fanerman's original question....
If he wants to generate 4:3 shaped 720x480 MPEG-4 encodes from 4:3 shaped 720x480 MPEG-2 DVD sources I would add 4:3 DAR signalling (an ARS value of 8:9)
If he wants to generate 16:9 shaped 720x480 MPEG-4 encodes from 16:9 shaped 720x480 MPEG-2 DVD sources I would add 16:9 DAR signalling (an ARS value of 32:27)
Brother John
7th February 2007, 23:35
You guys just go ahead and do want you want to do
Don't we all? :D
Hm... could it be we're hijacking another thread for that neverending AR discussion? fanerman, what about you? Are you happy or have we confused you completely?
Sharro
8th February 2007, 00:46
What is more important for standalones, PAR or DAR ?
:rolleyes: I've been only setting PARs :D and left DARs untouched... between my 0% aspect ratio error of my resized encodes and my 16:9 PARs of my Anamorphic Encodes they had exactly the same AR, so I guess my SA just needs PAR ?
All the best,
Sharro
Hmmm Hope I'm not hijacking anything
Brother John
8th February 2007, 14:14
PAR and DAR are only different notations for the same thing. There's no better or worse between the two. Only in some situations working with PAR is more convenient and in others DAR.
henryho_hk
8th February 2007, 15:54
MKV container seems to accept DAR only.
BTW, there is also a calculator for ITU-R sizes: http://www.haku.co.uk/ARCT.html
Sharro
8th February 2007, 17:45
PAR and DAR are only different notations for the same thing. There's no better or worse between the two. Only in some situations working with PAR is more convenient and in others DAR.
My understanding is that PAR setting is more compatible with Standalones than DAR, but as I said, I've just started with anamorphic encoding (I guess all these years looking at SeeMoreDigital signature had a subconscious effect in my brain :D )
All the best,
Sharro
SeeMoreDigital
8th February 2007, 18:05
My understanding is that PAR setting is more compatible with Standalones than DAR.... Not at all....
Only players fitted with "weak chip-sets" fom ESS (such as the Vibratto II, which can be found in players like the Philips DVP630/632 and DVP640/642) have problems with DAR associated aspect ratio signalling values.
Cheers
Brother John
8th February 2007, 19:05
Standalone and DAR? That't highly unlikely. AR flag in the MPEG-4 bitstream is a PAR. Container AR flag of MP4 is a PAR. AVI doesn't have a container flag. Only Matroska's container AR is a DAR; or a display resolution? No idea how that's handled internally. But Matroska has no hardware support anyway. So a standalone player doesn't come into contact with a DAR at all. However I think it's quite possible that "weak" chipsets choke on "odd" PAR values.
SeeMoreDigital
8th February 2007, 19:34
In that case, why not generate some test encodes with DAR and PAR signalling and invite some Philips DVP630/632 and DVP640/642 owners to test them for you...
Like some of use did a few years ago!
Brother John
8th February 2007, 22:15
If you're talking about AVI or MP4 DAR signalling is not possible because the bitstream/container flag fields are defined as holding a PAR value. Every DAR you enter as a user gets converted to the appropriate PAR eventually.
SeeMoreDigital
8th February 2007, 22:52
Sorry but you are wrong..... Reference: http://forum.doom9.org/showthread.php?s=&postid=561784#post561784
fanerman
21st February 2007, 08:30
Just to update everybody, I've managed to correctly rip the DVD's to 720x480 and then have the xbox stretch it properly. It looks great.
I used that mpeg4 modifier program first, but eventually I got Gordian Knot to do it from the get-go, following Brother John's instructions.
Thanks everybody.
HeadBangeR77
21st February 2007, 12:29
Just to update everybody, I've managed to correctly rip the DVD's to 720x480 and then have the xbox stretch it properly. It looks great.
I used that mpeg4 modifier program first, but eventually I got Gordian Knot to do it from the get-go, following Brother John's instructions.
Thanks everybody.
Glad to hear you've managed it. :)
tranfa
28th February 2007, 22:33
Yes, always. DVD pixels are never square.
There's a flag on the DVD indicating if it's 16:9 or 4:3. If it's PAL or NTSC is obvious anyway. And that's all the information the player needs for proper display.
With Gordian Knot, no, not that easy. What you need to do is set an aspect ratio flag in the video bitstream that the splitter/decoder can evaluate. Fortunately Xvid provides you with an option to do this. Quick walk through:
Options tab: Disable the advanced SaveAVS window
Resolution tab: Use 1:1 input pixel ar for all sources. Then crop to a mod16 resolution (or at least mod8).
SaveAVS window: Edit the AVS script and delete the resize line.
Xvid config dialog: Go to "Profile@Level / More / Aspect Ratio" and set the "Pixel Aspect Ratio" according to your source. Strictly speaking that's only necessary for 2nd pass config.
You need a DirectShow splitter/decoder pair that can handle ar-flags. Safest choice is Haali's splitter (http://haali.cs.msu.ru/mkv/) and ffdshow (http://ffdshow.info). Non-DirectShow players must have ar-flag support built in.
Hi Brother John,
having the same problem as fanerman, would you suggest me a similar procedure with VirtualDubMPEG?
Thank you in advance.
Brother John
1st March 2007, 01:34
It's hardly any different:
- Crop to mod16 (or mod8) and filter your DVD as you like, but don't resize.
- See steps 4. and 5. GK and VDub both use Xvids VfW configuration and playback is the same anyway.
tranfa
2nd March 2007, 20:56
Hi Brother John,
thank you for the answer.
I hope not to abuse of your patience, but I still have an issue I don't fully understand, and I'd like to go in depth of it.
The source is a 720x576 DVD, 16:9; am I wrong assuming it's a native mod16 res.?
If I follow the procedure indicated, without cropping or cropping to 720x400, trying to change the PAR in the Xvid config dialogue box to 16:9 but without resizing, the avi outcome isn't consistent with the 16:9 display.
Same result as if I leave the square pixel AR in Xvid config dialogue.
What am I doing wrong?
Instead, resizing to 720x400, while converting to a 16:9 Xvid, I get the result I want.
I'm probably missing something trivial, but I'd like to undestand....
Thank you for the cooperation!
Mazer Rackham
2nd March 2007, 21:18
If I follow the procedure indicated, without cropping or cropping to 720x400, trying to change the PAR in the Xvid config dialogue box to 16:9 but without resizing, the avi outcome isn't consistent with the 16:9 display.
Same result as if I leave the square pixel AR in Xvid config dialogue.
What am I doing wrong?
If your avi plays with wrong aspect ratio on your PC you probably did something wrong. If your avi plays with wrong aspect ratio on your standalone it's his fault. I guess.
Brother John
2nd March 2007, 21:46
The source is a 720x576 DVD, 16:9; am I wrong assuming it's a native mod16 res.?
Correct. Cropping to 720x400 is mod16 again. To test this, devide the number in question by 16 and see if the result is an integer.
but without resizing, the avi outcome isn't consistent with the 16:9 display.
Same result as if I leave the square pixel AR in Xvid config dialogue.
I'm assuming PC playback. If you're using a DirectShow based player (MPC, Zoomplayer, WMP, BSPlayer etc.) get Haali's splitter (http://haali.cs.msu.ru/mkv/) and ffdshow (http://ffdshow.info). When installing Haali make sure you enable AVI support. After installing ffdshow open its video config, go to the "output" page and make sure "Use overlay mixer" is ticked. AR should be alright afterwards.
For non-DS players like VLC I'm afraid I can't help. There's probably an AR option somewhere in the player's settings.
Instead, resizing to 720x400, while converting to a 16:9 Xvid, I get the result I want.
Don't do this. You'll end up with a completely distorted picture once you've set up AR support properly.
Btw:
Cropping to 720x400 is a really strange value but resizing to 720x400 is perfectly ordinary. Are you completely sure you only cropped and did not resize? 720x432 or 720x416 would be more typical values for cropping only.
tranfa
2nd March 2007, 21:54
If your avi plays with wrong aspect ratio on your PC you probably did something wrong. If your avi plays with wrong aspect ratio on your standalone it's his fault. I guess.
It's on the PC: on the standalone I can play with the AR from the remote control, and I can easily get what I want.
My questions are driven more from the willingness to understand than from a practical need.
tranfa
2nd March 2007, 22:00
I'm assuming PC playback. If you're using a DirectShow based player (MPC, Zoomplayer, WMP, BSPlayer etc.) get Haali's splitter (http://haali.cs.msu.ru/mkv/) and ffdshow (http://ffdshow.info). When installing Haali make sure you enable AVI support. After installing ffdshow open its video config, go to the "output" page and make sure "Use overlay mixer" is ticked. AR should be alright afterwards.
For non-DS players like VLC I'm afraid I can't help. There's probably an AR option somewhere in the player's settings.
Yes, using the settings of Ffdshow I can get the right AR when playing the movie: what I'd like to obtain is a Xvid avi file straight encoded with the right AR, without the need of fiddling with the players/overlay programs, both on the PC and on the standalone player.
(Maybe my mistake is in my expectation..?)
Don't do this. You'll end up with a completely distorted picture once you've set up AR support properly.
Btw:
Cropping to 720x400 is a really strange value but resizing to 720x400 is perfectly ordinary. Are you completely sure you only cropped and did not resize? 720x432 or 720x416 would be more typical values for cropping only.
I'll try again cropping at the res you mention.
Thank you again for the patience....
tranfa
2nd March 2007, 22:16
Tried cropping at 720x416, same issue.
I start thinking that looking for the right aspect ratio "per se", independently from the player or from ffdshow settings, is my mistake...
Brother John
2nd March 2007, 23:00
what I'd like to obtain is a Xvid avi file straight encoded with the right AR, without the need of fiddling with the players/overlay programs
So you have a DVD source, you want to crop only and you don't want to resize, right? That way you'll always get an anamorphic encode with the need for support on the playback side. The alternative is to resize to a proper AR (the traditional way of encoding).
HeadBangeR77
2nd March 2007, 23:09
Just a small remark: Haali's media splitter isn't needed to decode AVIs with the proper pixel aspect radio, indicated by flags in the video stream. Seeking AVIs with Haali's splitter is a nightmare, comparing to the standard M$ AVI-splitter. FFDshow does the job on its own, at least for me. ;)
tranfa
3rd March 2007, 09:47
So you have a DVD source, you want to crop only and you don't want to resize, right? That way you'll always get an anamorphic encode with the need for support on the playback side. The alternative is to resize to a proper AR (the traditional way of encoding).
Ok, then the procedure indicated in post #32, with resizing, is the right one for me.
Thank you for your help.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.