Timeout and try catch
Hello, great library! I am trying to do two things by using it. The first one, is to set a max-timeout of rtsp.Client read() function. I mean I am trying to make it try until X seconds and assume the stream is down after those X seconds.
The second one, is to detect a wrong stream url. The following snippet is running with a wrong URL and port but still gives "FOUND" output. Shouldn't it return "NOT FOUND"?
import rtsp
try:
client = rtsp.Client(rtsp_server_uri = 'rtsp://DNA:[email protected]:12345', verbose=True)
client.read()
client.close()
print("FOUND")
except:
print("NOT FOUND")
Good suggestions. I think they are both doable. The read() function is asynchronous so it might be good to have a general timeout when constructing the Client, and an optional parameter to read() could overwrite that as well.
Check for URL is also a great idea.
I think these are essentially the same as #1 , but good to hear someone else still wants it. I'll try to get to it when I can.