I have a product that can analyze video after inputting an rtsp url. I would like to use a webcam to stream and feed my product the webcam rtsp. How can I do that?
1 Answers
It will depend on the webcam you are using - most support RTSP but many do not publish the interface to access the stream as they are designed to be used with the webcam's own companion app.
There are some web resources which provide the RTSP urls for common web cams - you may find it hard to find a match as new versions of webcams roll out but it should give you a feel how to try accessing a vendors camera if you have a specific web cam you are testing against. Some examples (at the time of writing):
If you can't find the info for the camera you are using, and you have the companion app, you can also use a network sniffer tool like Wireshark (https://www.wireshark.org) and try to search the traffic for 'rtsp://' pattern.
If you just need to test your app and have access to a raspberry pi with a camera module you can also use this to generate an RTSP stream - there are several approaches for this but one I have found reliable is the v4l2rtspserver server:
There are specific instructions for setting it up on PI (https://github.com/mpromonet/v4l2rtspserver/wiki/Setup-on-Pi) and you can also verify it is working using VLC player on a laptop etc before testing in your specific application.
There are also a small number of test RTSP urls available on the web - the most reliable seem to be the one at this link provided by Wowza (again, link valid at time of writing):

- 24,231
- 1
- 54
- 120
-
1I think the OP was asking for a webcam that's attached to their computer/laptop. Not an IP/network cam. – laggingreflex Sep 23 '21 at 23:31
-
@laggingreflex - Ah, that could be the question. I think it would depend on the product and its architecture. It may not even be necessary to stream via RTSP – Mick Sep 24 '21 at 13:06