Sun Java Solaris Communities My SDN Account Join SDN
 
Code sample

Receiving Audio and Video using RTP

 

JMF Solutions

Receiving Audio and Video using RTP

Problem
How to receive media over the network using JMF and JMF/RTP.

Solution
AVReceive2 uses the RTPManager API, introduced in JMF 2.1.1, to receive RTP transmissions. AVReceive2 performs the following tasks:
  • Open one RTP session per session address given.
  • Listen for the NewReceiveStreamEvent from the ReceiveStreamListener.
  • Create a JMF Player for each stream received for playback.
The IP address should be the address of the computer which transmits the data; or the multicast/broadcast address if multicast/broadcast is being used for the transmission. The ports should be the same as what's being used by the transmitter.

This sample program can be used in conjunction with JMStudio, the AVTransmit sample or any other RTP compliant transmitter.
 
Requirements
Platform: JDK 1.1.6 or later
JMF API: 2.1.1 or later
Implementation: AJ, WPP, SPP *
Hardware: [optional] Capture card required for live capture.


* AJ = All Java, WPP = Windows Performance Pack, SPP = Solaris Performance Pack
Related Classes
How to run this sample
  1. Download and compile the source file.
  2. Run AVReceive2 and specify the RTP session addresses to receive from.

  3. For example,

    java AVReceive2 129.144.251.182/42050 224.12.23.34/42506

    to simultaneously receive 2 different RTP sessions.
     
Source Code
See Also
  • JMF 2.0 Programmer's Guide