conan-io / conan-center-index

Recipes for the ConanCenter repository
https://conan.io/center
MIT License
950 stars 1.74k forks source link

How to use the nv-codec-headers recipe? #22242

Open JF-Vial opened 9 months ago

JF-Vial commented 9 months ago

What is your question?

Hello! I want to use FFmpeg (through the API, not in command line) with Nvidia HEVC codec. My conanfile.py contains def requirements(self): self.requires("ffmpeg/6.0@local_repository", transitive_headers=True) self.requires("nv-codec-headers/12.1.14.0", transitive_headers=True) And in my code codec = avcodec_find_encoder(AV_CODEC_ID_HEVC); seems to work (although I use a slightly modified recipe for ffmpeg with LGPL-only, i.e. without libx265), but avcodec_open2(context, codec, NULL); causes a "could not find any MFT for the given media type" error. NB: I am on Windows, and the same code works with AV_CODEC_ID_H263P.

JF-Vial commented 9 months ago

I figured that instead of that I should modify the ffmpeg recipe. I added in it a "with_nvcodec" (default set to True) on the model of "with_libx265", with: if self.options.with_nvcodec: self.requires("nv-codec-headers/12.1.14.0") and: opt_enable_disable("ffnvcodec", self.options.with_nvcodec), opt_enable_disable("nvenc", self.options.with_nvcodec), opt_enable_disable("nvdec", self.options.with_nvcodec), But I still get the same error...