[Libav-user] sws_scale - "Warning: data is not aligned!" when using opencv::Mat
Carl Eugen Hoyos
ceffmpeg at gmail.com
Sat Dec 29 12:45:22 EET 2018
2018-12-22 15:33 GMT+01:00, Wodzu <brucedickinson at wp.pl>:
> I would like to kindly ask for help with warning message called from
> sws_scale.
>
>
>
> I am using this code (simplified to show the issue) to convert from
> AV_PIX_FMT_GRAY8 to AV_PIX_FMT_YUV420P:
>
>
>
> void Encoder::Encode(uint8_t *image_data)
>
> {
>
> av_frame_make_writable(frame);
>
> const int linesize[1] = { context->width };
This may be wrong, should likely be "const int linesize[4]".
Same for image_data afaict.
>
> sws_scale(sws_context, &image_data, linesize, 0, context->height,
> frame->data, frame->linesize);
Carl Eugen
More information about the Libav-user
mailing list