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

    The following code snippet illustrates how to use the RTPUtils function to push an MPEG-TS or native RTP stream out of a Wowza media server. 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 (either 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 to which you want to send the audio stream (native RTP)
    • dstVideoPort: the port to which you want to send the video stream (native RTP)



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