[FFmpeg-devel] [PATCH] Scale width/height keeping aspect when given just one dimension

Michael Niedermayer michaelni
Sun Sep 27 22:14:02 CEST 2009

On Fri, Sep 25, 2009 at 04:40:23PM +0200, Daniel G. Taylor wrote:
> Hey,
> This patch will allow FFmpeg to scale the output width/height of a
> stream to a given width xor height while keeping aspect via the -s
> option, which gets the ability to accept one -1 value, e.g.
> ffmpeg -i input.mp4 -s 640x-1 scaled.mp4
> ffmpeg -i input.mp4 -s -1x720 scaled720p.mp4
> The patch modifies avcodec/utils.c to allow a single -1 value when
> parsing the dimensions, and modifies ffmpeg.c to detect the -1 values
> and scale accordingly. After multiplying the value is incremented by one
> if it is odd.
> Currently this also means you can enter -1 when using libav* but the
> scaling must still be done manually in your software. I'm not sure how
> this can be done inside libav* itself. Suggestions?

-s will be replaced by libavfilters scale filter.
i will not review this and am mildly against it being applied because
every improvment done to the current stuff means there will be someone
who will cry foul if its not also in libavfilter when we switch ->
which will delay switching or make it a bigger mess than needed ...

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090927/023607f5/attachment.pgp>

More information about the ffmpeg-devel mailing list