Its all going very well but we have one issue:
- If a VP9 (or VP8) file is created using ffmpeg4, from png files with alphas, we get a video file (webm) with alpha internally.
Code: Select all
ffmpeg -i image_seq%03d.png -qmin 0 -qmax 50 -crf 5 -b:v 1M output.webm
- The report from this CLI indicates that an alpha has been generated.
- Sample webm videos with alpha can be found on this page: https://simpl.info/videoalpha/
- However on playing back we only get teh RGB and do not get the alpha unless we override the codec to be 'libvpx'. (same behaviour can be demonstrated in CLI version of ffplay).
More specifically:
We get the FormatContext from the file using AVFormatContext and the stream AVStream from that FormatContext.
Then from the AVStream we get the 'codecpar' param (AVCodecParameters ).
From the AVCodecParameters we can examine the codec_id (167 is VP9) and other useful params like 'bits_per_coded_sample'.
Interestingly these values seem correct for streams like H264 (codec_id=27) at 24 bits but are marked as 0 for the VP9 codec. Leading me to think this is not the correct place to find the proper values.