[MPlayer-dev-eng] Error in docs? (Preserving aspect ratio)

D Richard Felker III dalias at aerifal.cx
Fri Apr 25 18:19:21 CEST 2003


On Fri, Apr 25, 2003 at 09:40:02AM +0200, Diego Biurrun wrote:
> Jason Tackaberry writes:
>  > http://mplayerhq.hu/DOCS/encoding.html rightly suggests to crop out
>  > black bars in the original movie source when encoding.  It then goes on
>  > to suggest that you should preserve the aspect ratio if you use
>  > libavcodec.  Both excellent practices, which I follow.
>  > 
>  > But as I was reading these docs, I noticed a problem in the proposed
>  > command line:
>  > 
>  > $ mencoder sample-svcd.mpg -ovc lavc -lavcopts vcodec=mpeg4:aspect=16.0/9.0 -vop crop=714:548:0:14 -oac copy -o output.avi
>  > 
>  > Now either there is a problem here, or I am misunderstanding something
>  > and as a result have messed up all my encodings. :)
>  > 
>  > The problem, as I understand things, is that if you specify a crop
>  > region, you must also adjust the aspect ratio for the new size.   The
>  > cropped region above is no longer 16/9.
>  > 
>  > For a 16/9 DVD, the video source is usually 720x480 which gets scaled to
>  > 854x480.  So the correct aspect ratio for the above cropped video, where
>  > the original is 16/9, is 714*(854/720)/548, or 1.545.  The libavcodec
>  > option should then be aspect=1.545.
>  > 
>  > Although I think I have a handle on this, and I think the docs are
>  > wrong, please do let me know if I'm misguided. :)
> 
> I'll change it after the weekend.  Thanks for pointing this out.
> Regards

IMO, the correct fix is to add an option to -lavcopts called
preserveaspect or autoaspect or something. It would simply use the
d_width/d_height values passed into it from the end of the filter
chain as the aspect, for *automatic* aspect correction. It could also
(optionally?) round to nice exact ratios when the ratio is very close.

Sound good? :)

Rich



More information about the MPlayer-dev-eng mailing list