[FFmpeg-devel] [patch] pixel vs aspect ratio behaviour

vmrsss vmrsss
Sat May 24 03:01:53 CEST 2008


Hello.

	I think ffmpeg could be improved re the subject. Currently ffmpeg  
preserves (display) *aspect* ratio when resampling, and this is indeed  
extremely reasonable. However, it does so also when cropping and/or  
padding, and this is the wrong behaviour: cropping and padding should  
preserve the *pixel* ratio, and not the *aspect*. Because by cropping  
(padding) one typically wants to chop away (extend) parts of the  
frame, not to change shapes in it (exactly as when scaling one  
typically wants to change the frame size, not shapes).

(Incidentally: the current incarnation of avfilter always preserves  
the pixel aspect ratio, also in the case of scale=....)

	Of course this can be corrected by specifying -aspect on the command  
line. Yet, the patch below fixes the default behaviour. It just adds  
one top level variable to track the pixel aspect ratio while the input  
parameters are processed. Can it be considered for inclusion in the  
build tree?

          Notice that, with the exception of the pairs "-s ... - 
aspect ..." and "-crop... -pad...", the relative order of parameters  
on the command line matters (eg "-s... -crop..." is different from "- 
crop... -s..." and "-aspect... -crop..." is different from "-crop... - 
aspect..."). This makes sense to me, I expect it'll come useful, and  
it preserves as much as possible of the current behaviour, but can of  
course be changed if undesired.

-vmrsss

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sar.patch
Type: application/octet-stream
Size: 2210 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080524/030266ca/attachment.obj>
-------------- next part --------------




More information about the ffmpeg-devel mailing list