Hi,
I’ve initialized VideoWriter using the constructor
VideoWriter outputVideo(NAME, ex, outputfps, Sout, videowriterParams);
where videowriterParams is
std::vector videowriterParams = { VIDEOWRITER_PROP_IS_COLOR, static_cast(true), VIDEOWRITER_PROP_HW_ACCELERATION, VIDEO_ACCELERATION_ANY};
With this initialization, on a Windows machine with intel graphics, I see that it uses acceleration for the video encoding.
But on a Linux box, where I wanted the software to use ffmpeg and the nvidia h264_nvenc codec, even after setting the environment variable via
export OPENCV_FFMPEG_WRITER_OPTIONS=“video_codec;h264_nvenc”
I find that libx264 or something like that is being used, not accelerated.
I’ve checked running ffmpeg on commandline with -c:v h264_nvenc does work.
OpenCV version on the Linux box is 4.6.0.
(I had also tried with opencv 4.11.0 as an AppImage, that did not work, then I tried local compile also.)
What am I missing here? How can I make my program use videowriter and use h264_nvenc?
The relevant code is at