Support for RTSP over HTTP #2648
Replies: 2 comments 9 replies
-
If the traffic is valid HTTP, I don't see why it couldn't work. The first spec you linked mentions
This is just wrong, doing so is a protocol violation, and won't work with ASP.NET/YARP. You should be able to check if something like that is happening by looking at a network trace for example. |
Beta Was this translation helpful? Give feedback.
-
I've been looking at this myself. I have a DVR which support ONVIF and exports all 32 chambers (coax) connected on it on the ONVIF response. However, the ONVIF client that I have (Ubiquiti Unifi Protect NVR) expect that each camera to have its own IP (yeah they are wrong and not 100% implementing ONVIF). So, what I was thinking of, is to have an application with YARP which would listen to multiple hosts (DNS, IP, URL path, whatever) and redirect It to a mapped channel on this single DVR, proxying and formatting the parameters in order to make this proxying. All we care right now is the camera feed. Will keep an eye here and report back what I've found while experimenting with YARP in this scenario. |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm looking for solutions to use YARP in contexts where supporting "RTSP over HTTP(S)" is a requirement.
Some short background to this protocol. Apple first published a semi-official specification on how to traverse RTSP/RTP data RFC2326 over firewalls using HTTP tunnels. The specification is now part of ONVIF, a specification used by many IP camera manufactures and Video Management Systems.
Basically the specification uses two long-lived GET and POST HTTP requests to stream media data and perform media control.
The underlying RTSP over HTTP specification requires to open separate communication channels for continously sending and receiving data. For sending media from RTSP server to client the communication channel is opened with a GET request and a response without content-length. For sending media to the server a POST request is used. The specification notes that a content-length must be sent. Most applications use the value 32767 from the example given in the specification. Since http/2 streams may be closed by either side when the content-length has been reached clients shall use a value large enough for the connection life time.
I was not able to get this working with YARP. It seems like the GET request gets stuck in a response-body-copying phase. Typically, there will be NO content data on the GET channel until both the GET and POST channels have been established and a "DESCRIBE" command has been posted on the POST channel.
Is it a lost cause to try to get this playing?
Beta Was this translation helpful? Give feedback.
All reactions