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

Baptiste Coudurier baptiste.coudurier
Sun Nov 28 23:51:14 CET 2010


On 11/28/10 2:41 PM, Stefano Sabatini wrote:
> On date Wednesday 2010-11-24 00:50:17 -0800, Baptiste Coudurier encoded:
>> Hi guys,
>>
>> On 11/20/10 8:01 AM, Michael Niedermayer wrote:
>>> On Sat, Nov 20, 2010 at 12:42:52PM +0100, Stefano Sabatini wrote:
>>>> On date Friday 2010-11-19 19:14:28 -0800, Baptiste Coudurier encoded:
> [...]
>>>>> The aspect filter handling is weird anyway, dump_format and thus
>>>>> ffmpeg won't display the correct aspect ratio, I consider this
>>>>> broken so I disable his effects.
>>>>
>>>> The aspect filters have another problem, they may fail with
>>>> some encoder which needs to set the DAR/SAR when openining the
>>>> context, because they set DAR/SAR frame by frame (while this *may* be
>>>> a global property).
>>>>
>>>> If this is the case (I need confirmation from someone with more
>>>> expertise in encoders), then the only way to fix the problem is to
>>>> make the aspect a property of the link, and make it configurable
>>>> during the configuration stage. In case the aspect changes during
>>>> filtering, we may need to re-configure the filtergraph (as it should
>>>> happen when w/h change).
>>>
>>> SAR should be at a similar level as w/h
>>> alot of encoders and formats wont allow changing sar (like they dont allow w/h
>>> changes)
>>> and a sar change if it occurs is very likely also to change the w/h
>>> and if we have a input that changes sar (and w/h) a scale filter somewhere
>>> could be used to get rid of these changes for outputs that cant handle it
>>>
>>
>> Great, here is a shoot at it.
>>
>> Btw, I disabled the par alteration in scale filter, to keep the current
>> behaviour
>> of ffmpeg.
>> -aspect cli option works correctly.
>>
>> -- 
>> Baptiste COUDURIER
>> Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
>> FFmpeg maintainer                                  http://www.ffmpeg.org
> 
>> diff --git a/ffmpeg.c b/ffmpeg.c
>> index e58e7b5..c85c81b 100644
>> --- a/ffmpeg.c
>> +++ b/ffmpeg.c
>> @@ -351,6 +351,7 @@ static int configure_filters(AVInputStream *ist, AVOutputStream *ost)
>>      AVCodecContext *codec = ost->st->codec;
>>      AVCodecContext *icodec = ist->st->codec;
>>      FFSinkContext ffsink_ctx = { .pix_fmt = codec->pix_fmt };
>> +    AVRational pixel_aspect_ratio;
> 
> I suggest sample_aspect_ratio, for consistency with setsar and
> AVCodecContext (AVFilterLink.pixel_aspect also should be renamed).

Humm, ffmpeg displays PAR for it and I think that in this case I would
prefer naming it pixel_aspect_ratio in AVFilterLink as well.

[...]

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



More information about the ffmpeg-devel mailing list