Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout and try catch #27

Open
analyserdmz opened this issue Oct 29, 2022 · 2 comments
Open

Timeout and try catch #27

analyserdmz opened this issue Oct 29, 2022 · 2 comments

Comments

@analyserdmz
Copy link

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")
@dactylroot
Copy link
Owner

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.

@dactylroot
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants