[MPlayer-users] MPlayer-1.0pre8 detecting wrong aspect ratio
Nico Sabbi
nicola_sabbi at fastwebnet.it
Tue Aug 1 23:47:22 CEST 2006
Giacomo Comes wrote:
>On Mon, Jul 31, 2006 at 10:31:18PM +0200, Nico Sabbi wrote:
>
>
>>>
>>>
>>try to use -vf scale=100:200 -lavcopts vcodec=mpeg1video:aspect=4/3 and
>>see what happens :)
>>
>>
>
>Let's try to clarify the situation.
>I understand that you are now using in order to determine
>the aspect ratio the pel aspect ratio of the mpeg1 standard:
>3 0.7031 16/9 PAL
>6 0.8437 16/9 NTSC
>8 0.9375 4/3 PAL
>12 1.1250 4/3 NTSC
>
>and you determine the aspect ratio using the exact coefficent
>present in the second column.
>But it is the proper way to do it?
>
>
lavc is using the right method. Unfortunately mpeg1 (that uses PAR
instead of DAR)
can't specify a DAR corresponding to a PAR > 1.2+ something, so 100x200
@ 4/3
can't be expressed. My fault, I should have remembered
>Let's consider an example.
>
>PAL VCD is encoded at 352x288.
>When you watch the VCD on a (4/3) TV, the video is expanded to fit
>the displayed aspect ratio: 384x288.
>This is how mpeg2 is handled.
>For mpeg1 now mplayer expand the video to (352/0.9375=376) 376x288.
>The aspect ratio is not anymore 4/3 but 13/10.
>It means that if I make an mpeg stream and I connect my computer to a
>TV and I use mplayer to watch the movie, the result will be a little
>bit different if I encode to 352x288 mpeg1 or 352x288 mpeg2
>because mplayer will play the mpeg1 movie with 1.30 A/R and the mpeg2 movie
>with 1.33 A/R.
>In my opinion this should be considered wrong.
>
>PAL 352x288 mpeg1 (aspect 8) should be played as 384x288 (Movie-Aspect 1.33:1)
> not as 376x288 (Movie-Aspect 1.30:1)
>NTSC 352x240 mpeg1 (aspect 12) should be played as 352x264 (Movie-Aspect 1.33:1)
> not as 352x270 (Movie-Aspect 1.30:1)
>PAL 352x288 mpeg1 (aspect 3) should be played as 512x288 (Movie-Aspect 1.78:1)
> not as 500x288 (Movie-Aspect 1.74:1)
>NTSC 352x240 mpeg1 (aspect 6) should be played as 426x240 (Movie-Aspect 1.78:1)
> not as 418x240 (Movie-Aspect 1.74:1)
>
>I know it's a bit confusing but I hope I was able to explain what I meant.
>
>Giacomo
>
>
while mpeg2 specifies a plain DAR (that is, display width / display
height, irrespective
of the picture resolution) mpeg1 specifies the aspect code as 1/PAR
(decode h/ decode w),
so
+ float par[] = {
+ 0, 1, 0.6735, 0.7031, 0.7615, 0.8055, 0.8437, 0.8935,
+ 0.9375, 0.9815, 1.0255, 1.0695, 1.1250, 1.1575, 1.2015
+ };
+
+ if(picture.mpeg1) {
+ if(picture.aspect_ratio_information > 0 &&
picture.aspect_ratio_information < 15)
+ *aspect = picture.display_picture_width /
(par[picture.aspect_ratio_information] * picture.display_picture_height);
+ else
+ *aspect = 0.0;
+ } else // MPEG2
thus if aspect_info = 8, *asepct = 352 / (0.9375*288) = 1.3037...
I understand that having fixed the code spread out a can full of
previously hidden worms,
but since bugs had better be fixed than hidden I still maintain that I
did the right thing.
Of course, as I wrote yesterday, since correct playback is more
important than the formal
correctness of the code, I'm favorable to the introduction of an option
to restore
the old behaviour.
Nico
More information about the MPlayer-users
mailing list