July 26, 2015

Advanced MPEG-TS delivery over UDP via Nimble Streamer

There is wide range of tasks associated with streaming of media content in MPEG-TS over UDP in corporate networks. Nimble Streamer is capable of transmitting stream to multicast network, DVR Storage, transcoder or presentation monitor.

In some cases it is necessary to transmit multiple programs in a single MPEG-TS stream. This activity is often related to private networks (hotel, enterprise), when using a hardware decoder that supports only MPEG-TS as input.

The distinction of Nimble Streamer is the ability to transmux up to 256 RTMP, RTSP and MPEG-TS streams into single multi-program MPEG-TS UDP stream. For each incoming stream the unique PMT PID, Video PID and Audio PID values are assigned. You can take RTMPRTSP and MPEG-TS streams from any sources, transmux them into a single UDP MPEG-TS stream and transmit via multicast.

To use this functionality in your workflow you need to install and configure Nimble Streamer.

Install Nimble Streamer


Sign up for WMSPanel account if you haven't done it yet. Then use this instruction to install Nimble Streamer on your operating system.

Setting up UDP publication


Login to WMSPanel, go to "Nimble Streamer" -> "Live streams settings".

First of all, you should specify Nimble Streamer incoming RTMPRTSP and MPEG-TS streams by following any instruction which sets up those incoming protocols. Please refer to respective digest pages for details. E.g. read about MPEG-TS incoming streams setup or transmuxing RTMP incoming stream.

Now go to the "UDP streaming" tab to set up outgoing UDP stream.


Push the «Add UDP setting» button and specify required parameters.



First require fields are IP (127.0.0.1 in this case) and Port (e.g. 2015) for UDP stream. You may also specify TTL.

In case you need, you may specify Transport Stream ID and Original Network ID.

By clicking on Bind particular local interface you will open additional fields for Local IP and Local Port to bind.

Next you need to specify incoming streams to transmux to MPEG-TS UDP. Enter the name of Source application name and Source stream name; if you start entering existing streams, the UI will propose the autocomplete with those names. The UI will automatically assign PMT PID, Video PID and Audio PID to each stream.

As you enter new app/stream, the UI will add more lines to add more streams.


Parameters PMT PID, Video PID and Audio PID are set automatically for each stream. It is possible to assign these numbers manually, but you must be aware of allowed values. If any stream stops broadcasting, it is excluded from outgoing UDP stream, while the remaining stream numbers stay the same. If you add another incoming stream to existing streams, it will also get appropriate PIDs automatically. So, this feature keeps you worry-free about the whole UDP streaming gets terminated when one or more incoming streams are removed or added.

SDT checkbox opens additional fields for defining Service Description Table, such as Program Number, Service Type, Provider Name and Service Name.

As it was mentioned before, web interface allows to add up to 256 source streams for further transmuxing into single outgoing MPEG-TS UDP stream. Pragmatic constraints depend on media server performance and bandwidth.

Testing the UDP setup


You should already have one or several RTMPRTSP or MPEG-TS streams. For example, you have three streams: stream_low, stream_mid, stream_high.

As these streams are set up, they can be combined into singe outgoing MPEG-TS UDP stream in the "UDP streaming" tab.


Resulting UDP stream will appear in the list.


To test this UDP streaming, open "MPEGTS In" tab ("MPEGTS In" -> "Add UDP stream")


and then specify your UDP stream as a source.


After adding incoming UDP stream, it should appear in the list:


First you see yellow "pending" box, and then after few seconds it becomes green (online).


In the "MPEGTS Out" tab ("MPEGTS Out" -> "Add outgoing stream")


you can choose separate streams by Video PID and Audio PID from your MPEG-TS UDP stream for further streaming.


You can combine Audio PID and Video PID from different PMT PID. 
Resulting streams will be displayed in the list.


After a few seconds all streams become green (synced).

Now if you go to "Nimble Streamer" -> "Live streams" -> "Outgoing streams", you can see, that all your streams are online.


Some useful parameters


You may use a few parameters in Nimble config to change the behavior of MPEGTS processing.

  • mpeg2ts_pat_pmt_msec_interval is a time to retransmit for PAT and PMT tables. By default it's 100 milliseconds.
  • mpeg2ts_pcr_retransmit_msec_interval is a time to retransmit PCR. By default it's 20 milliseconds.
  • mpeg2ts_sdt_msec_interval is a time to retransmit for PAT and PMT tables.
  • mpegts_join_timestamps_enabled - some encoders send their samples split by parts to other samples, and all those parts have the same timestamp. This option allows joining those parts to be processed as one sample. It works on receiving side for AVC and HEVC. It's false by default.
  • udp_so_receive_buffer - If you see any image artifacts or video freeze when receiving content through UDP via MPEG-TS or RTSP, Nimble allows increasing UDP buffer by setting this parameter.

Using constant bitrate (CBR) and mux rate


When you stream from Nimble Streamer via UDP, a variable bitrate is used for output by default. However, in some cases of using DVB/ATSC and other hardware, a lot of ETR101290, CC and PCR errors appear on a regular basis making it hard to use it.


That happens because of large spikes of data which can be seen on this screenshot.

However, using constant bitrate (CBR) you can flatten the bandwidth to pictures like this one.



Read Constant bitrate and mux rate in UDP streaming article to find out more about this technique.

Nimble Streamer has PCR accuracy of 100%. While hardware receivers accept up to 500ns PCR drift, Nimble Streamer produces PCR with 0ns drift. Also, PCR interval is <20 ms while 40ms is acceptable by most hardware. All these values were checked using StreamGuru.


Troubleshooting


It you've set up your UDP streaming according the instructions above and still don't get the stream, check the following cases which might help.

1. TTL

Try increasing TTL for your interface. Make sure it's not less then hop count between your source and your server. You can refer to TTL and Hop articles for more details.

2. Interfaces routing

If your server has 2 or more interfaces that work with different networks, you may need to set up correct routing to properly use them. You can refer to this article for some examples.


That's it. For more information about setting up incoming and outgoing HTTP MPEG-TS streams, please refer to "Transmux MPEG-TS into HLS, RTMP, MPEG-DASH and more via Nimble Streamer" article.

If you have any questions about installing and configuring Nimble Streamer, please contact us.

Related documentation


MPEG2TS processing via NimbleTransmux MPEG-TS into HLS, RTMP, Live Streaming features in NimbleLive Transcoder for Nimble StreamerNimble Streamer control API reference

No comments:

Post a Comment

If you face any specific issue or want to ask some question to our team,
PLEASE USE OUR HELPDESK

This will give much faster and precise response.
Thank you.