[FFmpeg-devel] [RCF] lavfi aspect ratio setting path

Baptiste Coudurier baptiste.coudurier
Fri Nov 19 01:45:48 CET 2010

On 11/18/2010 04:33 PM, Michael Niedermayer wrote:
> On Thu, Nov 18, 2010 at 04:12:29PM -0800, Baptiste Coudurier wrote:
>> Hi Stefano,
>> On 11/18/2010 01:27 PM, Stefano Sabatini wrote:
>>> Hi,
>>> -aspect currently works by changing the PAR in the video encoder
>>> context and in the output stream, thus readjusting the output DAR.
>>> If the libavfilter is enabled, in output_packet() we have:
>>>       if (ist->picref->video)
>>>           ost->st->codec->sample_aspect_ratio = ist->picref->video->pi
>>> so sample_aspect_ratio is set to the value in the filtered frame,
>>> thus ignoring the value set with -aspect.
>>> Workaround for this issue is either configure with --disable-avfilter
>>> and use -aspect, or use the aspect filter.
>>> I suggest to disable the -aspect option when using libavfilter, thus
>>> forcing the users to employ the aspect filter. Alternatively we could
>>> just drop support for -aspect in favor of libavfilter, but when that
>>> approach made sense with the pad and crop options which were
>>> "polluting" the ffmpeg code with much hard-to-maintain complex code,
>>> this doesn't seem the case for the aspect option and I still want to
>>> keep that option for users which for some reason (e.g. because of the
>>> lavfi regressions) are using an ffmpeg compiled with
>>> --disable-avfilter.
>> First, thanks for looking into this.
>> I, too, would like to keep the -aspect cli option.
>> I have a patch in my tree that actually set the aspect at the end of
>> configure_filters and disable the code you quoted above.
> can you post that to the list so i can take a look?
> from your description it sounds like a good solution

Here it is.

Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org

More information about the ffmpeg-devel mailing list