dactylroot/rtsp

None frames are not caught

Closed this issue · 1 comments

Hi
I have an RTSP camera which is secured with a username and password. This causes the connection to fail with the error

Failed to connect to source rtsp://192.168.1.221:554/11.
---------------------------------------------------------------------------
error                                     Traceback (most recent call last)
<ipython-input-10-8bc6cd52214b> in <module>
----> 1 client.read().show()

~/anaconda3/lib/python3.6/site-packages/rtsp/__init__.py in read(self)
     55     def read(self):
     56         """ Return most recent frame as Pillow image. Returns None if none have been retrieved. """
---> 57         return self._capture.read()
     58 
     59     def preview(self):

~/anaconda3/lib/python3.6/site-packages/rtsp/cvstream.py in read(self)
    149         self._latest = frame
    150         self._stream.release()
--> 151         return Image.fromarray(cv2.cvtColor(self._latest, cv2.COLOR_BGR2RGB))
    152 
    153     def preview(self):

error: OpenCV(3.4.2) /Users/travis/build/skvark/opencv-python/opencv/modules/imgproc/src/color.hpp:253: error: (-215:Assertion failed) VScn::contains(scn) && VDcn::contains(dcn) && VDepth::contains(depth) in function 'CvtHelper'

This issue indicates there is no frame data, which could be caught, and an appropriate exception raised.

Hi,

What exception do you want to use here? Would no frame data indicate failed authentication?

Else let's close this issue, it seems you found how to use your credentials in the connection string.