How to parse an RTSP request and response headers?

I am developing an RTSP server and creating two request / response TRTSPRequest named TRTSPRequest and TRTSPResponse , similar to TWebRequest and TWebResponse , but specific to RTSP. I have a feeling that I am reinventing the wheel again and that there is a much easier way that I can take here. I created 400 lines of code to create this server, and most of them simply parse request headers.

Is there something in Delphi XE2 / Indy 10 I can repeat use that can parse RTSP headers for me? Or am I stuck to make out all of this myself?

Since RTSP is very similar to HTTP, can I use HTTP request / response objects? Or is it confused by the structure of the RTSP?

For example, can I use IdHTTPHeaderInfo.pas and configure it for RTSP and call it IdRTSPHeaderInfo.pas ?

According to RFC 2326 ...

Easy to parse: RTSP can be parsed by standard HTTP or MIME parsers.

and

HTTP-friendly: Where appropriate, RTSP reuses HTTP concepts so that existing infrastructure can be reused. This infrastructure includes PICS (Internet Content Selector Platform [15,16]) for mapping tags to content. However, RTSP doesn’t just add HTTP methods, since the manager In most cases, continuous media requires server state.

So how do I do this?

+4
source share
1 answer

At this point, I can only offer useful documentation and libraries,

look at LIVE555 C ++ streaming media texts , which include full source code and examples of the correct implementation / assembly of basic clients and RTSP servers, this is without a doubt one of the few websites that contain the same valuable information about the RTSP standard.

Unfortunately, all this is in C ++, but this should not stop you from checking their incredibly well-documented code, as well as examples that differ from the basic principle of RTSP communication between client and server in more complex cases.

Another way would be to manage the openRTSP command-line tool so that you can use it with your Delphi application.

There seems to be no easy way around this at the moment, most if not all Delphi wrappers / translations for such streaming libraries are not free and quite expensive

Good luck.

+4
source

Source: https://habr.com/ru/post/1481846/


All Articles