Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MPEG Aspect Ratio Problems Explained and Fixed

0 views
Skip to first unread message

rhmd

unread,
May 25, 2003, 8:57:34 AM5/25/03
to
Pardon the grandiose header, but I was excited to find some solutions.
The following is for WindowsXP, but probably applies to other OS's as
well.

The info below is from various posts, the most valuable of which was
the Google groups post--
From: Alessandro Angeli [MVP::DigitalMedia]
(a.angel...@sogetelREMOVE.it)
Subject: Re: Aspect ratios still broken
Newsgroups: microsoft.public.windowsmedia
Date: 2003-01-09 01:12:07 PST (and other posts in that thread)
Many thanks are due to Angeli for some excellent service to all users
of video software.


A number of posts to various user groups have reported recent problems
with AspectRatio in Mpeg-1 files, e.g. a 320x240 file playing as
520x240, especially after upgrading to WindowsMediaPlayer9 (WMP9).
This occurs with some mpegs made by Ulead VideoStudio and by other
apps as well.

Explanation: video files have headers for each packet, mpeg-1 files
have header that specify the width, height, and aspect ratio, etc. (I
think the aspect ratio number here relates to pixel aspect ratio, not
screen aspect ratio and that different displays need to be set in
different ways, but the following discussion ignores this technicality
and just focuses on what to do to fix the problem).

The problem is that the Ulead (et al.) software does not correctly
encode the aspect ratio bit in the headers for each packet of the mpeg
file. (Apparently using 2H=0010 as the aspect ratio) Up until
recently, the error didn't matter because most video players (WMP8 and
before, etc)just ignored the aspect ratio specified in the mpeg
headers and played the video based on the specified width and height.
Life became complicated with the newer software (e.g. WMP9) which now
reads the AspectRatio header data and uses it. It may be that DirectX
9 also does this, but I'm not sure. At any rate, after upgrading to
WMP9 and DirectX 9, all my Ulead mpeg-1 files became hyper-widescreen,
not only in WMP9, but also in ATI FilePlayer.

To solve the problem one must either
(1)fix the headers in the MPEG files or
(2)set the video player to ignore the aspect ratio.
WMP9 allows option (2), for other players you may be stuck with option
(1)

EASY SOLUTION:(WMP only): When WMP is running just
Tools > Options > Performance > Advanced
and uncheck the "Use Video Mixing Renderer" box
voila!

More complicated solution (worked for ATI FilePlayer)
Make a backup copy of the mpeg file, in case of screwups.
Open the mpeg file in a hex editor (I HIGHLY recommed EditPadPro from
http://www.EditPadPro.com
which will make this task very easy.),
Search for the first occurrence of:

00 00 01 B3

which is the synch code for each packet and is about line 1200 in the
file
you will see that this is the beginning of code that looks something
like...

00 00 01 B3 16 00 F0 24 FF .........

the first twelve bits after the synch code (in this case
160H=320decimal) is the width, the next twelve bits (0F0H=240decimal)
is the height, and the next 4 bits (2H)is the aspect ratio.
Change the aspect ratio to the correct value (which for NTSC 4:3 is
supposed to be CH), i.e., when fixed the code should look like

00 00 01 B3 16 00 F0 C4 FF ............

I tried this and it worked great! And, frankly, I never hex edited
anything in my life before.

You may have to play around with different aspect ratios, to make sure
you get what you need. A list of the Mpeg-1 video IS0 standard aspect
ratio codes:

0 0000 forbidden
1 0001 1.0000 VGA etc.
2 0010 0.6735
3 0011 0.7031 16:9, 625line (PAL)
4 0100 0.7615
5 0101 0.8055
6 0110 0.8437 16:9, 525line (NTSC)
7 0111 0.8935
8 1000 0.9375 CCIR601, 625line (VCD/PAL/4:3)
9 1001 0.9815
A 1010 1.0255
B 1011 1.0695
C 1100 1.1250 CCIR601, 525line (VCD/NTSC/4:3)
D 1101 1.1575
E 1110 1.2015
F 1111 reserved

0 new messages