[Libav-user] AVFrame to PNG

Nicolas George george at nsup.org
Fri Apr 14 10:41:48 EEST 2023


Gustav González (12023-04-13):
>             ret = sws_scale(sws_ctx, pFrame->data, pFrame->linesize, 0,
> pFrame->height, rgb_frame->data, rgb_frame->linesize);

Hi.

I have not looked at the code carefully, among other reasons because I
am allergic to camelcase and code that writes the types of the variables
in their name, but I can confirm that using sws_scale() is the right
approach.

Another option would have been to use a filter chain: libavfilter
automatically inserts the scale filter to convert between formats. You
could even have used the movie filter to dispense with the demux and
decode code.

Regards,

-- 
  Nicolas George


More information about the Libav-user mailing list