Quantcast
Channel: Softvelum news: Nimble Streamer, Larix Broadcaster and more
Viewing all articles
Browse latest Browse all 436

Processing RTMP and RTSP pull streams per request

$
0
0
Live streaming of video over Internet gives a high load on the communication channels. To reduce channels load, and to increase robustness of live streaming the load balancing techniques are used (read the "HLS, DASH and Icecast streaming load balancing" article for details).

Configure pull RTMP only for requested streams

During origin and edge servers configuration for RTMP streams you can use 2 types of restreaming:
  1. Publish RTMP stream from an origin (or encoder) to an edge server.
  2. Edge server can pull RTMP streams. You need to specify IP or hostname of origin server (or encoder).
For RTSP protocol the settings are performed using the same techniques.

You can read more detailed information about the creating of your live streaming network in the "Building RTMP live streaming network via Nimble Streamer" article. In current article we are going to show how to decrease network load by setting up RTMP streams pull by request via Nimble Streamer.


Bandwidth optimization


In large networks not all your streams are requested by all users all the time. But all of these streams continue to be pulled from origin server, that is why fee for the traffic is continuously consumed. 
Nimble Streamer allows to optimize usage of bandwidth via setting up RTMP and/or RTSP streams to be pulled only if users request these streams.

For example, large content providers can offer thousands of media URL of live video, but only part of them will be requested by users at certain periods of time.

The same approach is relevant when using CCTV cameras which transmit video streams over RTSP protocol. Usually in this case only about 20-30 cameras are displayed on the monitor, but overall cameras count may be several hundreds (i.e. for the systems like "Safe town").

Setup procedure


You can perform the advanced Live pull settings setup via Nimble Streamer. This setup allows you to pull only those streams which are requested by viewers and also you can configure media server to pull any streams for the certain application.

To perform these settings go to "Nimble Streamer" -> "Live streams settings" -> "Live pull settings" and click the "Add RTMP URL" button.



Specify the pulled  live video URL in the appeared dialog. You can specify fallback URL (optional). Specify the "Output application" and "Output stream" fields, and also specify the "Idle time" value. If the viewer has stopped watching, the stream will be pulled for this period of time. 



This configuration can significantly save the bandwidth if your streams are rarely used. At the same time latency, associated with the resumption of the stream, will not exceed 200 ms. If your streams are constantly demanded, the inclusion of this function will not give the advantages. For more details about live streaming latency please read the "Achieving low latency for live streaming using Nimble Streamer" blog article.

You can setup receiving of any RTMP or RTSP streams by checking the "Dynamic stream name" and specifying only application name in the Primary URL  (i.e. rtmp://remotehost:1935/live). In this case, any stream belonging to the specified application (e.g., live) is pulled from a source and is processed as described above. This allows you to specify the entire set of possible streams, which greatly simplifies the configuration.



After configuring the server first user requesting the video over HLS or RTMP, initiates pull session.

Security settings


However, you should be very careful when using dynamic stream names. The application could have several hundreds of streams (e.g. video cameras), and not all of these streams need to pull from the source.
This creates the risk that users can force media server to pull a huge amount of streams by their actions. It can cause of unnecessary using of bandwidth  and computing resources. In order to prevent the use of such scenario, you can create the WMSAuth rule, which allows to take and to play only those streams that the user is allowed to access. For more information about restricting access by the stream name please read the "Hotlink protection with stream-based signature" article.

Related documentation

Обработка произвольных RTMP и RTSP потоков по запросу

Viewing all articles
Browse latest Browse all 436

Trending Articles