[FFmpeg-devel] [PATCH 2/2] Add sample_aspect_ratio fields to vsrc_buffer arguments. This fixes aspect handling in ffmpeg This is based on a patch by baptiste

Mike Scheutzow mike.scheutzow
Fri Feb 4 17:11:00 CET 2011


Stefano Sabatini wrote:
> On date Thursday 2011-02-03 16:42:29 -0500, Mike Scheutzow encoded:
>> Mans Rullgard wrote:
>>> From: Michael Niedermayer <michaelni at gmx.at>
>>> --- a/ffmpeg.c
>>> +++ b/ffmpeg.c
>>> @@ -2845,6 +2855,10 @@ static void opt_frame_aspect_ratio(const char *arg)
>>>         ffmpeg_exit(1);
>>>     }
>>>     frame_aspect_ratio = ar;
>>> +
>>> +    x = vfilters ? strlen(vfilters) : 0;
>>> +    vfilters = av_realloc(vfilters, x+100);
>>> +    snprintf(vfilters+x, x+100, "%csetdar=%f\n", x?',':' ', ar);
>>> }
>>> static int opt_metadata(const char *opt, const char *arg)
>> 1. This will fail to compile if CONFIG_AVFILTER == 0
>>
>> 2. The user's attempt to set DAR may be silently ignored.
> 
> Simpler variant of this, forces the user to use setdar if libavfilter
> is enabled.

This suggestion is better than only partially fixing -aspect.

Mike Scheutzow



More information about the ffmpeg-devel mailing list