[FFmpeg-devel] [PATCH 1/2] vf_scale: add force_original_aspect_ratio

Timothy Gu timothygu99 at gmail.com
Sun Aug 4 00:21:43 CEST 2013


On Sat, Aug 3, 2013 at 7:15 AM, Andrey Utkin
<andrey.krieger.utkin at gmail.com> wrote:
> 2013/8/3 Stefano Sabatini <stefasab at gmail.com>:
>>> +
>>> +One useful instance of this option is that when you know a specific device's
>>> +maximum allowed resolution, you can use this to limit the output video to
>>> +that, while retaining the aspect ratio. For example, device A allows
>>> +1280x720 playback, and your video is 1920x800. Using this option (set it to
>>> +1) and specifying 1280x720 to the command line makes the output 1280x533.
>>
>> Not sure this is a good idea, since this tricks the output size in
>> possibly unexpected ways.

Unexpected?

Maybe I should add an av_log saying: width/length of the output video
has been corrected from ... to ...?

>> Why can't you use an expression to set that
>> condition, so that outw/h depends on the original input aspect ratio?
>

Then it would be something as complex as this: (I know this is not
correct, just to illustrate the complexity)

-vf scale=w='min(iw\, ih*dar)':h='min(ih\, iw*dar)'

I don't think most people trying to rescale their video with weird
aspect ratio to iPhone want to type and calculate such stuff.

> I am also unsure on usefulness of this feature. To add to the above,
> on such resizes user is possible to want dimensions to be divisable by
> 2, 4 or 8...

Maybe one should add a "modular" option to limit output to mod
1/2/4/8/16, etc., but it should not affect this patch.

Timothy


More information about the ffmpeg-devel mailing list