Use FFMPEG “avcodec_find_decoder_by_name” to find hardware decoder, GOT NONE!

i use apt install there official ffmpeg with hardware decoder surpport, then i write some code with API “avcodec_find_decoder_by_name”:
AVCodec* vcodec = nullptr;
vcodec = avcodec_find_decoder_by_name(“h264_nvv4l2dec”);
but , i got vcodec is NULL!
but i use ffmpeg -decoders,then i found :
V… h264_nvv4l2dec h264 (nvv4l2dec) (codec h264)
and i use ffmpeg command line,with para: -vcodec h264_nvv4l2dec , it work well!
why the code can’t find the decoder??

Please refer to developer guide and follow Decode Functional Flow for doing programming. It shall work by following the function calls.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.