opencv_contrib icon indicating copy to clipboard operation
opencv_contrib copied to clipboard

Opencv and Video_Codec_SDK_11.1.5 jointly compile and hard decode the video stream.

Open fjk123456 opened this issue 2 years ago • 4 comments

System information (version)
  • OpenCV => 4.5.5
  • Operating System / Platform => Windows 64 Bit
  • Compiler => Visual Studio 2019
  • Video_Codec_SDK_11.1.5
  • CUDA -- 12.0
  • RTX A6000
Detailed description

I mixed and compiled python-opencv, which has realized the hard decoding of rtmp. However, if I change rtmp to http, it will report an error. At the same time, after I change rtmp protocol from h264 to h265, the video cannot be decoded. 1、Does mixed compilation not support h265 protocol? 2、What's the big difference between http and rtmp? Why did you report it wrong directly?

Steps to reproduce

to add code example fence it with triple backticks and optional file extension .py reader = cv2.cudacodec.createVideoReader(rtmp)

Issue submission checklist
  • [ ] I report the issue, it's not a question
  • [ ] I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
  • [ ] I updated to the latest OpenCV version and the issue is still there
  • [ ] There is reproducer code and related data files: videos, images, onnx, etc

fjk123456 avatar Jul 10 '23 10:07 fjk123456

I mixed and compiled python-opencv

What do you mean by "mixed"?

Can you read from your video source with cv::VideoCapture()?

cudawarped avatar Jul 10 '23 10:07 cudawarped

I mixed and compiled python-opencv

What do you mean by "mixed"?

Can you read from your video source with cv::VideoCapture()?

It can use cpu to decode streaming media of various protocols.

fjk123456 avatar Jul 10 '23 10:07 fjk123456

I mixed and compiled python-opencv, which has realized the hard decoding of rtmp. However, if I change rtmp to http, it will report an error. At the same time, after I change rtmp protocol from h264 to h265, the video cannot be decoded. 1、Does mixed compilation not support h265 protocol? 2、What's the big difference between http and rtmp? Why did you report it wrong directly?

Are you saying:

  1. You compiled opencv python bindings?
  2. You were able to stream from h264 via an rtmp url using cudacodec::VideoReader?
  3. You were not able to stream h265 via an rtmp url using cudacodec::VideoReader?
  4. You could not stream via a http url using cudacodec::VideoReader?

cudacodec::VideoReader uses cv::VideoCapture to stream from network sources. Can you try to stream via cv::VideoCapture instead and additionaly post any errors you recieve when you try to stream from either cudacodec::VideoReader or cv::VideoCapture.

cudawarped avatar Jul 10 '23 11:07 cudawarped

I mixed and compiled python-opencv, which has realized the hard decoding of rtmp. However, if I change rtmp to http, it will report an error. At the same time, after I change rtmp protocol from h264 to h265, the video cannot be decoded. 1、Does mixed compilation not support h265 protocol? 2、What's the big difference between http and rtmp? Why did you report it wrong directly?

Are you saying:

  1. You compiled opencv python bindings?
  2. You were able to stream from h264 via an rtmp url using cudacodec::VideoReader?
  3. You were not able to stream h265 via an rtmp url using cudacodec::VideoReader?
  4. You could not stream via a http url using cudacodec::VideoReader?

cudacodec::VideoReader uses cv::VideoCapture to stream from network sources. Can you try to stream via cv::VideoCapture instead and additionaly post any errors you recieve when you try to stream from either cudacodec::VideoReader or cv::VideoCapture.

yes, yes, you are right. Maybe there is something wrong with what I just said.

fjk123456 avatar Jul 10 '23 11:07 fjk123456