I am trying to encode series of images to one video file. I am using code from api-example.c, its works, but it gives me weird green colors in video. I know, I need to conve
I think the problem is most likely that you are using PIX_FMT_RGB8
as your input pixel format. This does not mean 8 bits per channel like the commonly used 24-bit RGB or 32-bit ARGB. It means 8 bits per pixel, meaning that all three color channels are housed in a single byte. I am guessing that this is not the format of your image since it is quite uncommon, so you need to use PIX_FMT_RGB24
or PIX_FMT_RGB32
depending on whether or not your input image has an alpha channel. See this documentation page for info on the pixel formats.