opencv_contrib
opencv_contrib copied to clipboard
How to adapt cv::cuda::VideoWriter for Linux?
System information (version)
- OpenCV => 4.5.3
- Operating System / Platform => Ubuntu 18.04
- Compiler => gcc 7
Detailed description
cv::cuda::VideoWriter (doc) is only available for Windows, but I would like to use it on Linux.
What is the reason for the lack of Linux support? nvcuvenc does exist in Linux, so would it be possible to make a Linux-compatible version? What would be the amount of work needed to do so? Is it just changing some nvidia function calls to fit their linux version or is there more to it?
I have implemented a cv2.VideoWriter-like class in my module here https://github.com/shaliulab/ffmpeg-gpu-benchmark.
You should be able to encode videos with your GPU using this class, by replacing all the instances of cv2.VideoWriter with cv2cuda.VideoWriter. This is the only way I found of making use of my Nvidia GPU from Python in Linux