opencv_contrib icon indicating copy to clipboard operation
opencv_contrib copied to clipboard

How to adapt cv::cuda::VideoWriter for Linux?

Open Bycob opened this issue 4 years ago • 1 comments

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?

Bycob avatar Sep 20 '21 08:09 Bycob

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

antortjim avatar Mar 01 '22 14:03 antortjim