[FFmpeg-devel] [PATCH] avutil/hwcontext_cuda: fix YUV420P cuda_get_buffer

Marton Balint cus at passwd.hu
Wed May 16 00:07:10 EEST 2018



On Tue, 15 May 2018, Timo Rothenpieler wrote:

> On 15.05.2018 13:37, Marton Balint wrote:
>>> Are you sure it isn't already that way? I tested specially YUV420P and
>>> could not make out any issues.
>>
>> For 4K content linesize[0] is 3840, but linesize[1] becomes 2048 instead
>> of 1920.
>
> That's odd, 2048 seems more correct since it's a multiple of the
> recommended 2048. But I guess the whole yuv420p in nvenc is some weird
> hack on the driver side.
>
>>>
>>> So something like
>>>
>>> frame->linesize[1] = frame->linesize[2] = frame->linesize[0] / 2;
>>> frame->data[2]     = frame->data[1];
>>> frame->data[1]     = frame->data[2] + frame->linesize[2] * ctx->height
>>> / 2;
>>
>> Ok, will use this.
>
> Feel free to push if it works. Don't have access to an nvidia machine
> right now, so can't properly test.

Ok, pushed.

Thanks,
Marton


More information about the ffmpeg-devel mailing list