How to push a native RTP or MPEG-TS stream using RTPUtils API

The following example code illustrates how to use the RTPUtils function to push an MPEG-TS or native RTP stream out of a Wowza media server instance. The stream can be sent out over UDP unicast or multicast.

MPEG-TS out:

To start the stream:
RTPPushPublishSession rtpPullSession= RTPUtils.startRTPPull(appInstance, streamName, true, dstAddress, dstPort, false);

Session Description Protocol (SDP) data is here:
rtpPullSession.getSDPData()

To stop the stream:
RTPUtils.stopRTPPull(rtpPullSession);

Native RTP out:

To start the stream:
RTPPushPublishSession rtpPullSession= RTPUtils.startRTPPull(appInstance, streamName, false, dstAddress, dstAudioPort, dstVideoPort, true);

Session Description Protocol (SDP) data is here:
rtpPullSession.getSDPData()

To stop the stream:
RTPUtils.stopRTPPull(rtpPullSession);

Where:

  • appInstance – Application instance of source stream
  • streamName – Name of source stream
  • dstAddress – Destination IP address of the stream (the IP address of the set-top box or a multicast address)
  • dstPort – The port to which you want to send the stream (MPEG-TS)
  • dstAudioPort – The port that will receive the audio stream (native RTP)
  • dstVideoPort – The port that will receive the video stream (native RTP)

Originally Published: 10-03-2010.

If you're having problems or want to discuss this article, post in our forum.