[Libav-user] Issue with hardware decoding of H265 video stream via QSV

Vivekanand sendtovivekanand at gmail.com
Tue May 19 11:27:28 EEST 2020


I am trying to decode H265 frames in hardware (QSV) via ffmpeg (3.4.7) on
Intel CPU. Following command works perfectly on terminal ( OS : CentOS):

* build/lin_x64/bin/ffmpeg  **-c:v hevc_qsv -load_plugin hevc_hw **-hwaccel
qsv -i <h265-video-name> -f null -*

I am trying to re-produce similar behaviour (H265 hardware decoding) via
program (C++) but I am unable to do so. I am not able to find code snippet
that sets (-hwaccel qsv) option via program.

Command above sets 3 parameters :

   1. *-c:v hevc_qsv *
   codec = avcodec_find_decoder_by_name("*hevc_qsv*");

*-load_plugin hevc_hw *    int ret1 = av_dict_set(&opts, "*load_plugin*", "
   *hevc_hw*", 0);

   and later on passing this to :
   int ret2 = avcodec_open2(avctx, codec, &*opts*);

*-hwaccel qsv  <Need snippet demonstrating this setting>*

I am not able to set *-hwaccel qsv *via program, need code snippet
demonstrating same (-hwaccel qsv)

Current program gives following error :
      [hevc_qsv @ 0x15d1530] Error initializing the MFX video decoder:
invalid video parameters (-15)

Sample code and video can be downloaded for link below :  (README has some
more information about code. As a end goal, attached program is supposed to
decode H265 frames using intel QSV)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20200519/e352b668/attachment.html>

More information about the Libav-user mailing list