I need to decode video but my video player only supports RGB8 pixel format. So I'm looking into how to do pixel format conversion in the GPU, preferably in the decoding process, but if not possible, after it.
I've found How to set decode pixel format in libavcodec? which explains how to decode video on ffmpeg to an specific pixel format, as long as it's suported by the codec.
Basically, get_format()
is a function which chooses, from a list of supported pixel formats from the codec, a pixel format for the decoded video. My questions are:
- Is this list of supported codec output formats the same for all computers? For example, if my codec is for H264, then it will always give me the same list on all computers? (assuming same ffmpeg version of all computers)
- If I choose any of these supported pixel formats, will the pixel format conversion always happen in the GPU?
- If some of the pixel format conversions won't happen in the GPU, then my question is: does
sws_scale()
function converts in the GPU or CPU?