Push a native RTP or MPEG-TS stream with the Wowza Streaming Engine Java API

The following Wowza Streaming Engine™ Java API code example illustrates how to use the RTPUtils function to push an MPEG-TS or native RTP stream out of a Wowza Streaming Engine 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)