Here I put all the things I learnt or built about streaming servers.
Author - Aanis Noor
Organisation - Staqu Technologies
Website - http://staqu.com/
Research and see if we can make our own streaming server.
It should be able to do following things:
Pull RTSP
GET RTSP pushed
Generate RTSP and HLS streams
Store, Export, Play DVR
Return live thumbnail
https://www.wowza.com/blog/rtsp-the-real-time-streaming-protocol-explained
https://gstreamer.freedesktop.org/documentation/gst-rtsp-server/rtsp-server.html?gi-language=c
https://www.kernel.org/doc/html/v4.9/media/v4l-drivers/index.html
https://www.streamingmediaglobal.com/Articles/ReadArticle.aspx?ArticleID=113350
In pull protocols, consumers ask periodically their producers for values. The consumers signal their producers to send values. If there is a value waiting, the producer will send it down, or else it will block and wait to fulfill the demand.
whereas,
In push protocols, the consumers open a connection to the server and keep it constantly active. The producer will send (push) all-new events to the consumers using that single always-on connection. In other words, the producer PUSHes the new events to the consumers.
"Because UDP doesn’t support retransmissions, packet ordering, or error-checking, there’s potential for a network glitch to corrupt the data en route"
whereas,
"TCP requires a three-way handshake when transporting data. The initiator (client) asks the accepter (server) to start a connection, the accepter responds, and the initiator acknowledges the response and maintains a session between either end"
RTSP Requests RTSP uses the following commands, typically sent from the client to the server, when negotiating and controlling media transmissions:
- Options: This request determines what other types of requests the media server will accept.
- Describe: A describe request identifies the URL and type of data.
- Announce: The announce method describes the presentation when sent from the client to the server and updates the description when sent from server to client.
- Setup: Setup requests specify how a media stream must be transported before a play request is sent.
- Play: A play request starts the media transmission by telling the server to start sending the data.
- Pause: Pause requests temporarily halt the stream delivery.
- Record: A record request initiates a media recording.
- Teardown: This request terminates the session entirely and stops all media streams.
- Redirect: Redirect requests inform the client that it must connect to another server by providing a new URL for the client to issue requests to.
- Other types of RTSP requests include ‘get parameter,’ ‘set parameter,’ and ’embedded (interleaved) binary data,’
"HLS video segments are indexed into a media playlist so that the video player understands how to organize the data. A master .m3u8 playlist file must also be created — think of this as the index of indexes — to instruct the player on how to jump between the variant-specific playlists. This is also referred to as the manifest file. Anyone delivering the stream can then distribute the content by embedding the .m3u8 reference URL in a web page or creating an application that downloads the file."