'ffmpeg encoding prores_ks mov with alpha in C code

I try to encode a png sequence to a prores 4444 video with alpha channel in C language to get the same result as the cli's, the cli I run with:

ffmpeg -i /%5d.png -map 0:v -pattern_type sequence -c:v prores_ks -profile:v 4 -pix_fmt yuva444p10le movie.mov

I code with C language settings as:

 cctx->profile = FF_PROFILE_PRORES_4444;
 cctx->pix_fmt = AV_PIX_FMT_YUVA444P10LE;
 cctx->codec_id = AV_CODEC_ID_PRORES;
 cctx->codec_tag = MKTAG('a','p','4','h');

The video encoded by cli can import with the alpha channel into Adobe Premiere successfully.

I put a color video in the background, pic as cli encode screenshot

but the video encoded by C lang cant read alpha channel, display as a black background

pic as C encode screenshot).

I guess the reason is that the cli encoding using codec with prores_ks, but the c code only with the prores codec, but I can't find any where to set the prores_ks in code.

Or any other reason will bring this issue?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source