Log in

View Full Version : DivX and aspect ratio


Sulik
2nd November 2003, 21:17
I encoded some videos to DivX, but the aspect ratio is wrong when playing back the file in any player.
The problem is that my resolution is 352x480, and DivX ignores the aspect ratio encoded in the MPEG-4 bitstream (in this case 4:3).
Is there a DivX codec that supports the aspect ratio ?

SeeMoreDigital
2nd November 2003, 22:31
Hi Sulik

352x480 is an odd image pixel frame size for Mpeg4!

It's more usually associated with S-VCD and/or half D1 Mpeg2 encodes, whereby the theory is to keep as much of the vertical resolution as possible at the sacrifice of the horizontal resolution.

Mpeg4 is best encoded using a pixel ratio that closely matches the source images aspect ratio. So if your source image is, say 2.35:1. You can use any reasonable amount of pixels that conforms to the source frame size. Like 640x272 (640/272 = 2.35...) or 720x368 etc.

It's really up to the individual user to decide what looks best for them!

As for controlling the aspect ratio of an DivX encode. Although it's supposed to be possible, it's not been implemented for use with the AVI container.

Cheers

Neo Neko
4th November 2003, 11:21
Originally posted by SeeMoreDigital
Mpeg4 is best encoded using a pixel ratio that closely matches the source images aspect ratio. So if your source image is, say 2.35:1. You can use any reasonable amount of pixels that conforms to the source frame size. Like 640x272 (640/272 = 2.35...) or 720x368 etc.


In reality that is all a matter of oppinion. I do almost all my captures in 480x480 Xvid or of late ffvfw. I have even done several DVD encodes that way. And I can say that it is prefferable to me. In order to play the files back with the right AR I have only to tell ffdshow to resize it that way or put it in a Matroska file with an AR flag and have ffdshow decode it. And in the case of ffvfw you can set the AR flag in the MPEG4 bitstream itself and software like Mplayer will decode the right AR even from AVI.

Originally posted by SeeMoreDigital
As for controlling the aspect ratio of an DivX encode. Although it's supposed to be possible, it's not been implemented for use with the AVI container.

Cheers

Actually I think OpenDML AVI does support it. The trick is that most AVI parsers(especially Microsoft's) ignore it. And I don't know of a single authoring software that supports it either. Kinda like 5.1 MP3. The specification exists. But no one has implemented it. The other part of the dificulty as I understand it is that the frame size in directshow must be set before the video headers are read. So if the AR is in the videostream headers how can can directshow resize the frame after it has read it. In short it can't. Chalk it up to superior Microsoft coding and design. So the only way to automate AR changes under directshow is to embed them in the container itself. Which at this time Matroska is the only container that has such a specification that is actually implemented in most parsers unlike AVI.

jonny
4th November 2003, 11:34
For some high compressible 2.35(AR) movies i go for 704x400 or 704x432, isn't to difficult to correct the AR with bsplayer or zoomplayer (or using Matroska)... and you see a large difference (playing at 1024x768 you are able to see all those tiny vertical detailed lines :)).

SeeMoreDigital
4th November 2003, 12:37
Originally posted by Neo Neko
In reality that is all a matter of oppinion. I do almost all my captures in 480x480 Xvid or of late ffvfw. I have even done several DVD encodes that way. And I can say that it is prefferable to me. In order to play the files back with the right AR I have only to tell ffdshow to resize it that way or put it in a Matroska file with an AR flag and have ffdshow decode it. And in the case of ffvfw you can set the AR flag in the MPEG4 bitstream itself and software like Mplayer will decode the right AR even from AVI.It would seem quite a sensible proceedure to capture at 480x480. By doing this you are of course, capturing just about all the vertical resolution available!

It does not sound like you generate many DVD encodes, if you feel 480x480 is preferable encode frame size to use.

Many users like their encodes to open up in their media players at the correct aspect ratio. There are many ways to do this and using ffdshow is one of them. However cropping and resizing is the most popular way.

So for NTSC users who would to keep all the vertical resolution of a 4:3 (or 1.33:1) source, 640x480 is what you should use.

Personally I generate most of my encodes using the same image pixel frame size as the source. For PAL DVD's that means 720x576 anamorphic. For NTSC DVD's that means 720x480 anamorphic.

And providing you have one of the DivX codecs installed, it is possible view all your 720x480/576 anamorphic encodes at the correct ratio with the Windows MediaPlayer.

Just launch the DivX config.exe. Go to 'Quality Setting' and put a tick in the 'Overlay Extended Mode' Then put a dot against the 16:9 'Aspect Ratio' option. 'Apply' then 'OK'

And it is a real shame that AR flagging is not supported. I did'nt know about 6Ch Mp3 audio being a specification. What an missed opportunity! But I don't suppose there would be very much of a data saving compared to 6Ch AC3!

Cheers