EnoxSoftware / OpenCVForUnity

OpenCV for Unity (Untiy Asset Plugin)
https://assetstore.unity.com/packages/tools/integration/opencv-for-unity-21088
558 stars 175 forks source link

how to open rtsp camera #39

Open HanGaaaaa opened 5 years ago

HanGaaaaa commented 5 years ago

how to open rtsp camera

m0ose commented 6 months ago

I also have a question about this

It opens the camera but then locks up

   capture.open("rtsp://admin:password@192.168.0.13:554/media/video1");
   // Check if the camera is opened
   if (!capture.isOpened())
   {
       UnityEngine.Debug.Log("Camera is not opened!");
       return;
   } else
   {
       UnityEngine.Debug.Log("Camera is opened!");
   }

   Mat mat = new Mat();
   await Task.Delay(1000);
   ////////////// BELOW fails for some reason //////////////
   //capture.grab();
   bool frameRead = capture.read(mat);
   UnityEngine.Debug.Log("frameRead: " + frameRead);

Has anyone figured it out?

EnoxSoftware commented 6 months ago

It is possible to receive rtsp using ffmpeg.dll, although it is Windows-only.

142