Log in

View Full Version : bad image stretching forseeable ?


Masure
27th July 2002, 21:15
when opened with mpeg2dec, the image is badly streched. I wonder how to know the ratio which is applied to the image. If this ratio is not a constant, where to find it (16/9 ? 4/3 ?). It seems to be difficult to foresea

DJ Bobo
27th July 2002, 22:12
The image isn't stretched but showed as encoded on the DVD (anamorph).
DVD2AVI gives you the right aspect ratio.
If you get 16:9 and you see big black bars, you have 2,35:1 of course

Masure
27th July 2002, 22:24
ok it's understood. But now i wonder if all the DVDs are strectched like that (anamorph so)

DJ Bobo
27th July 2002, 22:40
yeah, all of them, even normal 4:3 DVDs are anamorph, PAL ones have 720 instead of 768 x-resolution and NTSC ones have 720 instead of 640 x-resolution.

Didée
28th July 2002, 15:20
No.

Most DVDs are, but not all. For sure.

One example: CUBE (the movie). No stretching at all.

And, DJ Bobo, the 720->768 thingy is NOT the anamorph thingy ...

Anamorph has something to do with having to stretch the image in only one direction, regardless of the aiming display AR being 16:9 or 4:3. (Try it out: Take a 720*576 PAL DVD, anamorph encoded, and stretch it to 768*576. Still squeezed, isn´t it?)

At least this is my understanding after having read uncounted guides and forum posts.

A very good explanation was in the SVCD forum here at doom9, but that was a couple of months ago, so I can´t point you directly to it (apart from being too lazy to search quite now).

Wilbert
28th July 2002, 15:51
Yes, it is my understanding that:

4:3 --> always letterboxed
16:9 --> anamorphic/letterboxed

If it is anamorphic you have to resize it to 16/9*576 x 576 = 1024x576. If the aspect ratio = 2.35:1 the picture will be 1024x436 plus black borders below/above. If it is letterbox you don't need to resize and the picture is 720x306 plus black borders below/above.

If you play a anamorphic dvd it is only stretched horizontally, while a letterboxed (16:9 and 2.35:1) dvd is stretched horizontally to 16/9*576 = 1024 and vertically to 1024/720*576 = 819 (note that excluding black borders we have 1024/720*306 = 436).

Hope this is right, because I always get confused by this stuff. What I don't know however: Does 4:3 anamorphic exist?

edit: sorry I spread nonsense. A letterboxed 16:9 has to be resized just like a 4:3 DVD, thus 720x576-->768x576.

Didée
28th July 2002, 16:44
Well, I´m not a guru on this stuff ... and I also get a headache when thinking *too* long about it.

But, we have to remember that the original destination of a DVD is a TV set. This is what is was intended for, and playback on a PC is only - - some neat stuff.

Now, the encoding of a DVD is *always* 4:3 overall, including the letterboxing black bars (or at least I never got my hands on anything other).
On widescreen DVDs, there is always black borders hard-coded in it.
And, for playback on a TV set, the stream always has to be resized in only one direction, never in both:
Playing on a 4:3 TV : keeps 720 horizontal, resizes vertically down
Playing on a 16:9 TV: keeps 576 vertically, resizes horizontally up

BTW, the most ridiculous explanation for anamorphic encodings I ever read (and I read this many, many times all over the web):

"Anamorphic encoding is used to reduce the amount of black borders that have to be encoded."

ROFL !!! Those are the quides we don´t need ...

DJ Bobo
28th July 2002, 16:49
@ Didée
You're right and unright. Generally, they call anamorphic only 16:9 or 2,35:1 movies that are stored in an "unusual" way, so in that point you're right.
But if you take precisely, all of them are anamorphic as explained above, and if you stretch a 4:3 DVD image of 720x576 to 768x576 it will (!) look normal (that's what PowerDVD makes every time you watch a 4:3 PAL DVD on your PC!)

dividee
28th July 2002, 18:19
The concept is much easier to grasp if you resize before cropping:
DVD has a DAR (display aspect ratio) of either 4:3 or 16:9 ,
if DAR=4:3 --> resize to any 4:3 resolution (such as 768x576, 640x480,...) then crop whatever black border you have
if DAR=16:9 (=anamorphic) --> resize to any 16:9 resolution (such as 1024x576, 640x360,...) then crop whatever black border you have.

We usually do the opposite, that is crop before resize, because cropping is very fast while resizing is much slower, so if we crop first we have less to resize. But then computations becomes a bit more difficult, that's why we have tools like GKnot.

Note for experts: I voluntarilly left out ITU resizing issues here.

Didée
28th July 2002, 19:08
@ DJ Bobo

You´re right, and you´re not.

Of course, if I stretch a *4:3 DVD image* of 720x576 to 768x576, it will look normal. I won´t deny facts.

It´s only that 720*576 -> 768*576 has nothing to do with anamorphic encoding ... :rolleyes:
This is only a matter of the different pixel aspect ratios of VGA and PAL. VGA has a PAR (<- ?) of 1:1. PAL has a PAR of ~1.06, or whatever exactly, but not 1:1. Thus you have to stretch from 720 to 768.

I only insist on anamorphic being an encoding technique that stores *additional* vertical data, which is discarded on 4:3 TV sets, and is only used on 16:9 ones.


@ dividee:

Yes.
Though I might not have understood the concept to 150%, I understood it good enough to (sometimes) leave Gknot sleeping and calculate the needed values with my good old Casio calculator ;)
Regarding the ITU aspect of resizing - to be honest, most times I try out both ways, and if I decide to respect it or not is, in the end, a matter of taste for me ...

hakko504
28th July 2002, 20:00
@didee

MPEG defines PAR inverted to what one would expect, thus making PAL 4:3 PAR = 720/768 = 0.9375!

Didée
2nd August 2002, 08:12
Finally I found the thread I mentioned earlier ... it seems to be already fallen out of this forum´s database, but my HD holds lots of stuff ;)

Wait for the attachment to appear.

Originally posted by Antonio
I have taken the time to graphically explain this to all of you so please read through and you will hopefully gain full understanding of aspect ratios and how they should be preserved when you watch a movie. You should gain an understanding of what to choose (16:9 or 4:3) when you encode a movie and gain maximum quality when viewing SVCD's.


Fig A

This image represents a 4:3 screen/television with a 16:9 video (SVCD) of a red "perfect" cirle in the correct aspect ratio. This is how we normally encode SVCD's. Notice the black bars are included in the 4:3 screen space? This red cirle "movie" has been encoded in 16:9 which means the black bars have been "included/recorded" as part of the video they are NOT generated by any DVD player automatically. This means they have been added by the encoder (cce/tmpg) and recorded into the mpg. Black bars are easy to compress and requires very little bitrate to encode it. Choosing 16:9 for this red cirlce movie allows all the bits to be allocated to the actual red circle and not the black bars.

Fig B (a 16:9 movie of a red circle anamorphically)

This image represents a 4:3 screen/television with a 16:9 movie (DVD anamorphic or SVCD anamorphic) which is specially elongated vertically to fit more of the movie's resolution on the 4:3 scale and no black bars. This image is stored in a way that would be extremely annoying to view a movie as the red circle is elongated (the same way heads of persons and other images would be). This DVD of the red cirlce is encoded in 4:3 and not 16:9 as they want to store as much of the original theatric analog picture into the digital 4:3 workspace as possible. DVD players understand and read DVD's which are anamorphic so the player squishes the image down to "look" and be viewed like fig A on a 4:3 TV. Then the image is projected as a 16:9 image and reveals the original aspect ratio the director of the movie intented (red perfect circle). The advantage of encoding to look like fig B is that when you watch it on a widescreen TV, the TV only has to stretch the picture horizontally to look like fig D (which is the shape of a 16:9 TV). Since more resolution was captured in fig B the image projected (after stretched horizontally) will look great and not destroyed or damaged. Alot of 16:9 TV's are set to "automatic stretch horizontal mode" which means you may never see the grey bars on the side unless you disable that feature. To get the best results on a 16:9 TV encode your 16:9 movies at 4:3 and the SVCD will act like an anamorphic DVD. Remember the more data/resolutio the more bitrate you will require or more number of CD's to spread the movie across. If you encode like fig B (4:3) the image will look exactly like fig B on a 4:3 TV as the DVD player wont squich SVCD's down the same way it does with DVD's which are anamorphic. Encode like Fig B only if you are viewing on 16:9 tv's for the rest of your life .

Fig C

This is an image of a 16:9 TV screen displaying the anamorphic "red circle movie" of fig B with the TV's "stretch horizontal feature" disabled. It is basically what fig B (anamorphic dvd or svcd) would look like on a 16:9 TV with the horizontal stretch switched off. The grey bars on the TV show you how much of the screen needs to be filled in with image. Enabling the horizontal stretch feature will pull the sides of Fig C's screwed up oval looking red circle image to look like fig D. Again fig D's image is merely destroyed or compromized because the TV stretched only 1 way and not 2. Plus the red cirlce is perfectly round = the correct aspect ratio.

Fig D

The resulting image of an anamorphic DVD when viewed on a 16:9 TV set to horizontal stretch. The red cirle is perfectly round and not stretched vertically. Plus the picture quality looks great due to 1 horizontal stretch and no more.

Fig G

This is an image of a 16:9 TV displaying a non-anamorphic SVCD or DVD (the kind we mostly encode). The image was encoded like Fig A and therefore the black bars are recorded into the mpg and not generated by any player in any way. This 16:9 TV is set to horizontal stretch mode and the image automatically stretches to look like fig G. This is the problem most of you are complaining about. You will now have to use your TV's vertical stretch feature to make the image look like Fig F. The image in fig F now looks damaged and compromized because your TV had to stretch once vertically and once horizontally which basically zooms into the mpg revealing many pixels and screwed up images. This is what you get if you encode your movie/svcd at 16:9. Although the movie might still look great on a 4:3 TV with the black bars and all (which are normal) it won't look so great on a 16:9 TV.

Fig E

This is an image of a 16:9 TV playing a non-anamorphic SVCD or DVD with the horizontal stretch feature turned OFF. The image will not look destroyed or compromized since there is no zooming or stretching occuring BUT you will have grey bars on the sides and black bars on the top and bottom AND the image will be smaller (due to less resolution because it was encoded at 16:9). To get this image to fill the whole screen AND play back at the correct aspect ratio you will need to do a vertical stretch on your 16:9 tv and set the horizontal stretch. Your image will then turn out like fig F. The red circle is a perfect circle meaning the aspect ratio is correct but the image is chalky and rough as if you had encoded it with half the bitrate that you really did. This is what you get for encoding SVCD's at 16:9.


My take on it is that it is probably better to "backup" your great DVD's by encoding them at 4:3 because the future of TV viewing is 16:9 Widescreen Sets. You'll have to put up with watching your SVCD's like fig B until 4:3 TV's become extinct. This way your SVCD's will translate beautifully on a 16:9 TV and not look like Fig F.


Good luck and keep the questions coming if you must.


Antonio (SVCD FREAK)

Wilbert
2nd August 2002, 09:43
Thanks! I was also looking for that thread. Could you sent me that picture please (w.j.dijkhof@tue.nl) or point to the corresponding webpage?

Didée
2nd August 2002, 10:35
@ Wilbert

Sorry, I tried to mail you, but got this:


This message was created automatically by mail delivery software.

A message that you sent could not be delivered to all of its recipients.

Below you can find the mail addresses that failed and the reason given
by the server that has been contacted for this address.

You sent this mail through our old unsecured mail relay. If your mail
has been rejected due to an RBL list entry (eg.
http://mail-abuse.org/), you should consider using our server with
SMTP authentication. For further information have a look in your FAQ
or contact your technical support.


Try http://home.iprimus.com.au/dnasongs/anamorphic.jpg

Else, I could have sent you the complete thread...

Didée
2nd August 2002, 11:06
Okay. I am stupid.

I just realized I could attach it here ... ;)

Hope the mods allow it, a RAR archive with the complete thread and the "anamorphic image", together 58 kB: