Rtsp Connect

0 views
Skip to first unread message

Charise Scrivner

unread,
Aug 4, 2024, 8:25:09 PM8/4/24
to verpobudu
Ihave a number of Foscam Fi2918w cameras that all stream fine using HTTP. I need to change one of them to use RTSP via VLC. I consistently get back an error that says only that it can't open the stream (for example) cvlc 'rtsp://IPADDRESS:88' just produces:

Your "connection refused" error usually means it couldn't connect to the port, rather than a URL path error (which would happen after a successful connection), but the above is worth a shot since it's easy to try.


After that the next thing I'd do is go through the settings on the camera and make sure there isn't something you have to toggle to enable RTSP, and make sure that if the port number is configurable, it matches what you're trying to connect to. Also I believe the default port for RTSP is 554 so you could just cross your fingers and quickly try that on the client side before digging into camera settings.


I had to use the admin user, two other administrator accounts did not work, although using the correct credentials. FI9828W kept asking for them. Nor did mplayer work, no connection problem but just hanging.


VLC is a free and open source cross-platform multimedia player and framework that plays most multimedia files as well as DVDs, Audio CDs, VCDs, and various streaming protocols, You can download the VLC media player from the homepage of the VideoLAN project: and you can install within a few easy steps.


Now in the new RTSP tab you can set the port number and the session (Path) for the stream, finallyclick the Next button. Later you can use the IP address of your PC, the port number and the sessionname to construct the RTSP URL of the VLC stream.


The broadcast will start after some buffering and within a few seconds the VLC media player will display the media correctly although it is possible that at the start you will experience some minor picture errors.


Ozeki camera SDK gives you solutions for constructing RTSP URL from IP address, port numberand session name. The VLC RTSP stream can be accessed with the IP address of the PC.In the following part you will find a simple example for how can you connect to the VLC RTSPstream with one of the simplest demo applications from Ozeki Camera SDK, CameraViewerONVIF.


In the Add Camera Wizard window click the Build URL button, and you can customize the url andthe transport layer protocol (UDP or TCP). The transport layer protocol is very important, if youcan't connect to the stream you can try to switch the protocol.


I have tried various media players, but couldn't stream the file. I know for sure this is not a server problem because I could stream a test video on that server that doesn't require an authentication.

I was surprised that vlc couldn't handle such urls, so I tried mplayer but it couldn't play the streams either.

mpv was the first player in which I managed to play the test video I mentioned above, but I couldn't stream urls of the form I written above. With mpv I tried this command line:


Pass the rtsp:// URL to mplayer on its command line. There are servers out there that serve files containing a rtsp:// URL over HTTP, but then serve content in the MMS protocol. This is for compatibility with some older Microsoft players (my memory is hazy over the details), but it breaks clients that believe that RTSP is RTSP and MMS is MMS. If you obtain an rtsp:// URL that doesn't work at all, try replacing the scheme with mms://.


After your RTSP source is connected, you can view basic video and audio signal information and packet loss statistics for the source under the Status header at the top of the page. Any warnings or errors associated with your RTSP stream are also displayed on this page.


Hi, I wanted to ask, if there is some way co connect my RTSP tapo C200 camera to Prusa connect. When I was searching for it, I only found that there is some way with Docker compose or something like that. But I have really no idea, how something like that can work. Total best would be, if there is some video-instructions. But also, didn't found anything. My case is, that I have the camera in my Lack enclosure and it would be nice, when I have it also in the Prusa Connect interface.


I get your use case, there should be open source projects that try to cover this use case. Basically, docker lets you just download a finished piece of software with all the configs done and run it, however installing docker itself can be intimidating even if it's not really a big deal most of the time. I have not used the specific thing you are talking about tho, so I cannot easily give you the steps, sorry. Usually you can ask the creator of the tool you are trying to use and they might be willing to help you. The feeling of somebody trying to use the thing you made is very rewarding, at least for me.


I went the Docker route. It's just some code that periodically pulls photos off the camera & shoves it to PrusaConnect via a method Prusa supports. You have to learn Docker & either run that on a PC, Pi or something. Learning Docker took me a few hours, but I'm an IT guy & needed to finally learn about it a bit anyway.


For now, the camera stream can be reached only by the phone app. (Called tapo in my case). There is also created some camera profile (name and password.) Iam running the prusalink on rpi zero directly attached to the Einsy board. (Mk3S+). So I cannot reach the rpi with ssh or any other remote control. So, do I have to install some other 3rd party software? Or do everything online. Thanks.


If you have raspberry pi zero (non 'w' model) then you would need to add usb splitter and usb ethernet dongle or some other wireless device access to the rpi, but frankly speaking, getting `rpi zero w` would be just much better option.


or take the SD card out, put it into your computer, put a file called "ssh" (no extension, no nothing, just ssh) on the SD card (only the boot partition shows up in windows, if in linux, it will be called bootfs) put the card back, you have SSH enabled.


So, I enable the ssh on the rpi zero 2w. Then there are the commands on that Github page you sent. What is the order, I should write them down? Do I have install Docs and commits first? Or edit the ffmpeg file? My next question is, from where I can get the fingerprint? On the Prusaconnect page is only the token code.


First of all: Thank you so much for providing the instructions and script! I got my Logitech C920 to work with a Raspberry Pi Zero 2!I'm using fswebcam as you suggested in your usb.dist. As I'm pretty new to this, is there any way to get an RTSP stream out of this configuration that I could use in Homebridge (running on a separate Raspberry) to get a video stream into my HomeKit environment? I'm trying to set up ffmpeg but can't get it to work... ;(


If you want to make a streaming then I suggest using mediamtx , example of running it with USB camera -connect-camera-script/stream.mediamtx/ but that may need additional adjustments depending on the camera capabilities.


Also notice that if that will work then you may need to switch the scripts sending snapshots to consume remote stream with ffmped and not fswebcam, because only one app can use the device at once, so stop sending screenshots before trying to adjust the setup.


Hi, thanks for sending me down this path. Everything is working like a charm. I'm using a Raspberry Pi Zero 2 with a Logitech C920. I've installed Mediamtx and also your Prusa Connect script on the same Pi Zero. On top of that I'm using the RTSP stream to integrate the camera with HomeKit via the Homebridge (which is running on another machine).


To connect an IP camera with RTSP, the correct RTSP path of a camera must be found first. This information is often found from camera vendors. If the vendor does not provide this information, information for most cameras can be found at the Camera Connection Database.


Note: Tapo Care works best with one of the NVR or microSD card recordings, not both. At this point, the NVR recording will be disabled if Tapo Care and microSD card recording both work. To restart recording on the NVR, remove the microSD card from the camera. Please refer to TP-Link FAQ for more information.


But fortunately there are some cloud based services that can do this job for us. One of the best is IPCamLive. This service can receive RTSP/H264 video stream from an IP Camera and can broadcast it to the viewers. IPCamLive has Flash/HTML5 video player component that will display the video on PC, MAC, tablet or mobile. The greatest thing is that this site generates the needed HTML snippet for embedding the live video like this:


I was looking for something very similar the other day (view my IP cam's RTSP video feed on a simple html page without any fancy ActiveX plugins). It is based on ffmpeg, NodeJS, NGINX (not mandatory but useful) and Node Media Server.


The description in the link is detailed and easy to follow, but I still had some tweaks to deal with before I got it to work (regarding endpoints on the NodeJS server). I asked Re-stream RTSP from IP cam with Node Media Server to http/ws and display it with html and received a good answer.


If you want to stream RTSP directly to web page, then I am afraid your only option is to use an ActiveX control viewer that comes with the camera. This is a direct connection IP Cam -> Viewer, and should really be the fastest. Not sure why you having issues; Axis ActiveX works pretty good for me.


However, this option is not really bandwidth-efficient and you can not serve multiple concurrent viewers (most of IP Cams have 10 viewers limit). The better option is to upload a single RTSP stream to centrally-hosted streaming server, which will convert your stream to RTMP/MPEG-TS and publish it to Flash players/Set-Top boxes.


Note: The above snippet uses the rtsp url format that is supported by my IP camera. So you need to get the same for your camera. You can get this information by consulting your camera vendor support. Also keep in mind that I tested it on Chrome (using an activeX plugin for Chrome) and other browsers (including mobile phone browsers) might not be supported.

3a8082e126
Reply all
Reply to author
Forward
0 new messages