[MPlayer-dev-eng] Recommend error for bad dimensions

D Richard Felker III dalias at aerifal.cx
Tue Mar 2 21:42:57 CET 2004

On Tue, Mar 02, 2004 at 08:38:21PM +0100, Jindrich Makovicka wrote:
> Adam Rice wrote:
> >Erm... the docs recommend to use cropdetect, and cropdetect helpfully 
> >prints
> >out a commandline fragment with the exact dimensions of the video. If 
> >mencoder
> >then choked on the commandline it just suggested, it wouldn't exactly 
> >inspire
> >confidence, now, would it? Besides, it seems a little absurd to require 
> >users
> >to do mental arithmetic when they're sat in front of a $1000 adding 
> >machine.
> >
> >I propose that the problem lies not in lavc, but in cropdetect. I think
> >cropdetect should be modified to report the exact dimensions of the useful
> >video, but suggest dimensions that are rounded to multiples of 16 (or 
> >perhaps
> >multiples of 8 when the video < 400 pixels wide or so).
> This patch adds two additional parameters for position and size 
> rounding. Defaults are 2 for position and 16 for size.

Default should be to only round to even numbers, since normally you
will be using scale after crop! Anyway, does your rounding round in
the right direction? IMO the correct way is to round x1,y1 UP, round
x2,y2 DOWN, and then round size DOWN and recenter the region as best
as possible, keeping the alignment restrictions on the offsets.

BTW, the old code that rounds to even numbers looks incorrect too...


More information about the MPlayer-dev-eng mailing list