RTP Support

 

JMF Documentation


The JMF APIs that support RTP are found in the javax.media.rtp, javax.media.rtp.event, and javax.media.rtp.rtcp packages. The JMF RTP APIs enable you to:

  • Open RTP sessions
  • Receive every incoming stream on the session and create a JMF player using the stream datasource
  • Access receive stream statistics and monitor the session using RTCP information
  • Send outgoing RTP streams from a datasource
  • Access send stream statistics and monitor the session using RTCP information
  • Register Dynamic paylaods with the RTPSessionManager and allow users to plugin their own encodings into RTP along with using JMF's plugin architecture.

The JMF 2.1 FCS Reference Implementation supports:

  • Presenting RTP streams using JMF players.
  • Transmitting RTP streams using JMF processors and data sinks.
  • Presenting and transmitting dynamic RTP payloads.
  • Dynamically switching payload types during a session.
  • Accessing session statistics and monitoring RTCP.
  • Unicast, multicast, and broadcast sessions for both presentation and transmission.
  • Network protocol independence for playback and transmission.

RTP Clients and Servers

RTP Client Requirements

Supported RTP Formats

RTP Server Requirements

* These products were not tested with JMF for this release.

RTP Implementation Notes

The RTPSessionManager is an interface. An implementation of this interface is provided in in com.sun.media.rtp.RTPSessionMgr. You can instantiate this class to access the functionality of the RTPSessionManager API.

JMF Controls for RTP Player

Users have control over the buffer maintained by the rtp receiver. The buffer has two parameters that can be controlled:

  • Length
  • Minimum threshold

The Length is the length of the buffer. When the data in the buffer exceeds this length, the data at the head of the queue (earlier data) is dropped. The Minimum threshold is the jitter buffer before which no data will be forwarded on the rtp datasource. As long as data in the buffer is less than the minimum threshold, data will not be forwarded. The buffer length and minimum threshold are specified in milliseconds.

For RTP, the session manager maintains the following buffer defaults:

  • Audio Buffer Length:
    default 250ms
    max1000ms
     
  • Audio Minimum Threshold:
    default 125ms
    max500ms
     
  • Video Buffer Length:
    default 135ms (2 frames worth of buffer assuming a 15fps stream)
    max270ms (4 frames worth of buffer assuming a 15fps stream)
     
  • Video Minimum Threshold:
    default 0ms
    max0ms

For audio, these values translate to a specific number of audio samples or frames based on the format of the incoming audio stream. For video,the frame rate of the incoming stream is not known by the receiver. In this case, the receiver defaults to a 15fps value when calculating the number of complete video frames that correspond to the buffer and threshold values. For example, if you want the buffer to hold 3 frames of video, you would set the buffer length to 200ms--three frames of a 15fps stream--regardless of the actual stream rate.

In JMStudio, Buffer Control is an option when you select the "Open RTP Session" menu item. When you click on the "Buffer Control for RTP Session" tab, you will see the buffer control component. This control component has text fields that display the current buffer and threshold size on the LHS. You can update the buffer and threshold values by selecting options from the "Update" checkbox group. The 3 choices are "DEFAULT, MAX, User Defined". Selecting User defined enables the text field on the RHS, allowing you to enter specific buffer and threshold values.

Note: You can use the control component of the BufferControl in you own applications. You can get the BufferControl from the session manager by calling getControls("javax.media.control.BufferContr") on the RTPSessionMgr. You retrieve the component by calling BufferControl.getControlComponent().

JMF Controls for RTP Server

Some of the JMF plugins used in packetizing the audio and video into smaller RTP packets export a PacketSizeControl. PacketSizeControl is defined in javax.media.control.PacketSizeControl. This control is used to alter the default packet sizes (packetization interval)of each outgoing RTP packet on the network. The packetization interval determines the minimum end-to-end delay; longer packets introduce less header overhead but higher delay and make packet loss more noticeable.

The default packetization interval for most of JMF's RTP depacketizers are 60ms for audio and about 1000 bytes for video.