What AvPixelFormat i should use for *.png (PNG-24 and PNG-8) image? I am trying to convert from png to PIX_FMT_YUV420P using sws_scale
Edit, code:
avpicture_fill((AVPicture*)m_encode_inpic, (uint8_t*)imagePixels, <WHAT PNG PIXELS FORMAT?>, m_imgInputWidth, m_imgInputHeight); //imagePixels is png bytes
avpicture_fill((AVPicture*)m_encode_outpic, m_encode_outbuffer, PIX_FMT_YUV420P, m_encode_codec_context->width, m_encode_codec_context->height);
av_image_alloc(m_encode_outpic->data, m_encode_outpic->linesize, m_encode_codec_context->width, m_encode_codec_context->height, m_encode_codec_context->pix_fmt, 1);
struct SwsContext* fooContext = sws_getContext(m_videoOutputWidth, m_videoOutputHeight, PIX_FMT_RGB32, m_encode_codec_context->width, m_encode_codec_context->height, PIX_FMT_YUV420P, SWS_FAST_BILINEAR, NULL, NULL, NULL);
sws_scale(fooContext, m_encode_inpic->data, m_encode_inpic->linesize, 0, m_encode_codec_context->height, m_encode_outpic->data, m_encode_outpic->linesize);
Jpeg pixel format is AV_PIX_FMT_YUVJ420P, but what format is for PNG?