I am working on a project which streams video/audio through RTSP using VLC Media Player plugin. I would like to provide an option to scan the network for RTSP cameras. I'm sure this will consist of querying a list of all network devices, and testing for port 554. All this I can take care of. However, once I have gotten this far, how do I test the device through port 554 to make sure it's a valid RTSP camera?
I'm assuming there should be something in Winsock
to be able to do this, but how should I test a socket connection and make sure it's a valid RTSP stream which I can connect to? Whatever method is used, I shouldn't have to attempt to connect via RTSP to each using any sort of authentication, I'm looking for a lower-level way of determining if the port 554 is actually providing an RTSP stream.
Best Answer
There is no reliable way to scan network for available RTSP streams. You can still do a great searching considering the following:
OPTIONS
RTSP command should be good enough for a test, you can use interactive RTSP tool to see how it works. There are no guarantees of any kind anyways since devices might require that you authenticate.You have most chances with
OPTIONS
to receive back anything meaningful anyway.DESCRIBE
might already require that you log in, you might have to authenticate even forOPTIONS
. Still you have RTSP response that assumes that something exists over there.To issue a successful
DESCRIBE
command and receive meaningful results, you need to know resource URI on the device which is not always obvious. Better vendors (who are obviously a minority) support incoming requests flexibly, other assume the client is aware of device specific. For example,Note that without knowing magic
ch0_unicast_secondstream
you don't get anything making much sense from the device.