While there are a number of parameters to set and various avcodec API functions for doing that, the only one required at this step is the data pixel format, in our case:Īv_context->pix_fmt = AV_PIX_FMT_YUV420P Initialize avcodec context parameters.Create AVCodecContext context using this decoder as an input argument:ĪVCodecContext* av_context =avcodec_alloc_context3(codec).FFmpeg supports various ways of doing it – by name or by ID as shown:ĪVCodec* codec = avcodec_find_decoder(AV_CODEC_ID_H264) Find suitable decoder such as h264 decoder.Otherwise one need to process the corresponding error and exit. Note: we move to each next step only if the current one has been finalized successfully. Hardware video decoding of h264 via DXVA2 API could be described as the following sequence of actions: Hardware video decoding via FFmpeg/libavcodec on Windows – how to. If you build FFmpeg from sources yourself, please consult FFmpeg Compilation guide. Prebuilt FFmpeg packages available for download already have these options enabled. It means you need configuring and building FFmpeg with the following options:
0 Comments
Leave a Reply. |