Log in

View Full Version : Aspect ratio question


pieroxy
18th March 2005, 13:53
On a DVD, the resolution of the video is 720x576 ot 720x480, and could be 4/3 or 16/9. This means the pixels are not squares, but rectangles.
One of the biggest flaws of encoding to DivX is that you HAVE to loose resolution because DivX pixels are necessarily squares. Or you can make your DivX 1024x576...

Why? Why is MPEG2 able to do that while DivX (supposedly superior) is blocked by such a stupid restriction? Did I miss something, is the option burried somewhere? Is it just not doable for some reason?

This is one of the last obstacles holding me from converting all my DVDs to my Media Center HDD.

Any help/hint appreciated.

MarcN
18th March 2005, 16:03
Actually it can be done. :)

DivX is just one flavour of MPEG-4 and MPEG-4 video streams can contain aspect ratio information. With XviD you can set this right during the encoding. You can use Moitah’s MPEG4 Modifier (http://forum.doom9.org/showthread.php?s=&threadid=78050) to add/change that information later.

However many players (Hard- and Software) just ignore that information so you end up with a wrong aspect ratio. :(

Marc

pieroxy
18th March 2005, 17:32
With XviD you can set this right during the encoding
Where? I tried encoding a video but can't see anything about "aspect ratio" in the encoder options?

If the encoder supports it, one might think that the decoder also does...

Brother John
18th March 2005, 19:24
Originally posted by pieroxy
With XviD you can set this right during the encoding
Where? I tried encoding a video but can't see anything about "aspect ratio" in the encoder options?
"More" button to the right of "profile@level" in main settings. Then "aspect ratio" tab. There you can set MPEG4-AR.

Afaik the decoder is pre-configured to use AR info. If you want to change that, don't use the "decoder" button in the encoder config, but your players filter dialog.

Zhnujm
18th March 2005, 20:29
You can also use MPEG4Modifier to change the settings afterwards.
Even for DivX files.

pieroxy
18th March 2005, 22:29
I must be missing something then. I use AVI as a container for my divx files, and the compressor options dialog specify that the setting will be ignored if used in an AVI. After a short test, it is. Video is 4:3 no matter what I put in there.

What did I miss? Which soft are you using to encode/play? I need WMP to play my videos but I can use whatever to encode / store.

SeeMoreDigital
18th March 2005, 23:39
Originally posted by pieroxy
Where? I tried encoding a video but can't see anything about "aspect ratio" in the encoder options? Here: -

http://img85.exs.cx/img85/1803/XviD_AR_signalling.gif

Originally posted by pieroxy
If the encoder supports it, one might think that the decoder also does... If you are using XviD's 1.1.0 beta1 codec, AFAIK, it should include a "beta decoder" that supports Mpeg4 "anamorphic signalling detection".

Even DivX's "Fusion" decoder appears to support Mpeg4 signalling to... Provided you select the following option: -

http://img17.exs.cx/img17/5181/divxfilter6uv.gif

And if you want to play/view your "anamorphic" encodes correctly on a stand-alone player... get one with an MediaTek chip-set!


Cheers

pieroxy
19th March 2005, 08:16
I finally got something, but I had to set it manually. On my system, it's the DivX decoder that is used to decode my XviD movies. Additionally, I had to set it manually to 16:9 to see my movie in this aspect ratio. Automatic didn't work...

How can I tell WMP that I want the XviD decoder to decode the XviD fourcc?

SeeMoreDigital
19th March 2005, 09:30
Originally posted by pieroxy
I finally got something, but I had to set it manually. On my system, it's the DivX decoder that is used to decode my XviD movies. Additionally, I had to set it manually to 16:9 to see my movie in this aspect ratio. Automatic didn't work...

How can I tell WMP that I want the XviD decoder to decode the XviD fourcc? Like this: -

http://img32.exs.cx/img32/9915/wmpdsfiltertest0ht.gif


Cheers

pieroxy
19th March 2005, 11:53
Thanks, but I am not completely brainless. ;)

The properties shows which codec is used to render the file. AFAIK, they don't allow me to change it.

SeeMoreDigital
19th March 2005, 13:43
Originally posted by pieroxy
Thanks, but I am not completely brainless. ;)

The properties shows which codec is used to render the file. AFAIK, they don't allow me to change it. Sorry, I miss read your post...

You can try changing the 4CC priority detection settings for each of your Mpeg4 direct-show decoders....

Which you can do here for XviD: -

http://img211.exs.cx/img211/1171/xviddsdec4ep.gif


And here for DivX: -

http://img61.exs.cx/img61/8629/SMD_DivX_Decoder_Filter.gif


Or here for FFDshow: -

http://img65.exs.cx/img65/8141/SMD_FFdshow_properties.gif


You can also use Nic's Mini AVI FourCC Changer: -

http://img162.exs.cx/img162/8281/nicsminiavifourccchanger6jx.gif


Cheers

obieobieobie
19th March 2005, 13:56
Just a little question, and don't shoot me if this has been answered before numerous times, but why are we losing resolution when encoding to mpeg4 with square pixel aspect ratio?

Brother John
19th March 2005, 14:46
*takes out his gun, hesitates, thinks about all the trouble with the police, shrugs, puts the gun away*

(I'm no NTSC expert. Please correct me, if I'm getting its numbers wrong.)

Assuming DVD input we have 720x576 for PAL or 720x480 for NTSC. For simplicity assuming furthermore a movie with 16:9 (1.78:1) AR and without any black border. 720x576 is not 1.77 but 1.25 and 720x480 is 1.5 meaning we do not have square source pixels.

For a AR 1:1 encoding we need to do one of two things. Either stretch the frame horizontally or squeeze it vertically to reach the correct playback AR.
Of course when stretching we would not lose resolution, but we'd have to deal with rather big frame sizes (1024x576 PAL, 854x480 NTSC). Because MPEG4 is traditionally used to bring file size down as much as possible, those big frames are simply too big to achieve reasonable quality (e.g. for a 1 CD encoding). That's why for a long time the only option was to use small, at least vertically (and normally also horizontally) shrunk frames.

Today support for anamorphic (in the sense of »not stored with correct playback AR«) MPEG4 is growing, so that option is becoming more and more interesting.

pieroxy
19th March 2005, 15:19
Originally posted by obieobieobie
Just a little question, and don't shoot me if this has been answered before numerous times, but why are we losing resolution when encoding to mpeg4 with square pixel aspect ratio?
You don't necessarily loose resolution. Let's take an axample: A 16/9 DVD which is 720x576 pixels. If you want to convert it in a square pixel ratio without loosing resolution, you will need a resolution of 1024x576. This is bigger than the original and is thus wasted resolution. And since it does not map to the original, you have to resize the pic which looses some precision.

If you want to keep 720 as a horizontal resolution, you will have a vertical resolution of 405 pixels. Lost some lines.

With square pixels, the ratio btw horizontal reso and vertical reso HAS to be the ratio of your video (4/3 or 16/9 or other). The very definition.

If your original material doesn't have square pixels, you then need to resize, loosing quality.

obieobieobie
19th March 2005, 16:35
Thanks guys. Very nice explanations. :)

And thanks for not shooting me. :)

SeeMoreDigital
19th March 2005, 16:53
Originally posted by pieroxy
If you want to convert it in a square pixel ratio without loosing resolution, you will need a resolution of 1024x576. This is bigger than the original and is thus wasted resolution. And since it does not map to the original, you have to resize the pic which looses some precision. Not necessarily...

Quite a few of us on the forum do this and have found that fast panning and high motion scenes are often improved. The additional pixels appear to reduce motion blur!

That said, I've found there's nothing to gain by increasing the vertical quantity of pixels... but others may think differently.

Obviously you can't encode using such pixel frame sizes, if your intension is to spin them in a stand-alone player and view them on your TV... Well, not unless you have a high-def stand-alone player.