[FFmpeg-devel] [PATCH v3] avfilter/vf_zoompan: fix shaking when zooming
Robert Deibel
deibel.robert at googlemail.com
Tue Jan 28 17:05:21 EET 2020
On 28.01.20 15:46, Paul B Mahol wrote:
> On 1/28/20, Robert Deibel <deibel.robert at googlemail.com> wrote:
>> On 27.01.20 16:44, Paul B Mahol wrote:
>>> On 1/27/20, Robert Deibel <deibel.robert at googlemail.com> wrote:
>>>> - y = *dy = av_clipd(*dy, 0, FFMAX(in->height - h, 0));
>>>> - var_values[VAR_Y] = *dy;
>>>> - y &= ~((1 << s->desc->log2_chroma_h) - 1);
>>>> -
>>>> - out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
>>>> + out = ff_get_video_buffer(outlink, overscaled_w, overscaled_h);
>>> This is wrong. outlink->w/h should be used always, otherwise outlink
>>> w/h differs from frame w/h.
>>>
>> So how should I create a video buffer? I tried av_frame_alloc + setting
>> width, height and format + av_frame_get_buffer, but this resulted in a
>> heavy performance impact. Apart from the fact, that I can't get the
>> correct data copied.
>>
>> Also, if it's not allowed to pass other w/h why is it even possible? Or
>> is it only a problem if I use the outlink? Could I request a buffer from
>> the inlink with the modified sizes?
> Frame w/h should be exactly same as outlink w/h.
> Otherwise output will not have always same w/h.
> Why are you changing w/h at all?
The idea was to build a slightly larger frame than output to compensate
for rounding errors and crop it to the correct size afterwards.
More information about the ffmpeg-devel
mailing list