[MPlayer-users] Aspect Ratio in vfilters

Alexander Roalter alex at roalter.it
Tue Mar 13 10:59:34 CET 2007


When doing -vf cropdetect, I patched something in to compute the exact 
aspect ratio of the movie shown (sans black bars). Now I only can get 
the ratio of the image if it were all square pixels. A full screen image 
delivers therefore a ratio of 1.25:1 (720/576). Now we all know if the 
video is non-anamorphci 1.33:1, the image gets stretched to 768x576, 
which is a factor of 1.06666, which yields an aspect ratio of 1.3333333.

But I don't know how to get the desired aspect ratio from the video in 
the filters, since they seem to operate entirely on the image before 
stretching and resizing. Any way to do that?

The ratio is computed (easy as pie:)

ratio = ((float)(vf->priv->x2 - vf->priv->x1 + 1))/
         ((float)(vf->priv->y2 - vf->priv->y1 + 1));

in the function put_image in vf_cropdetect.c

cheers,
Alex



More information about the MPlayer-users mailing list