Streaming Audio/Video
The original solution code given here can be found at the JMF site.
Note that due to limitations of the JMF 2.1 implementation, audio and video are not in tight synchronization.
The AVTransmit class takes three parameters in the constructor - the source locator, the destination IP address and a base destination port number for all the media tracks.
The source locator can be -
a file name such as "file:/C:/media/speech.mov",
an http locator such as "http://mediacentral.com/speech.avi",
or a capture datasource such as "javasound://8000"
The IP address should be the IP address of the computer that should receive your transmission. If you want all the computers on your subnet to receive the transmission, then use 255 as the last number in your IP address. For example, "129.130.131.132" can be used for a point to point transmission and "129.130.131.255" can be used for all computers that are on your subnet. Consult your system administrator if you're not sure what these IP addresses mean. You can also refer to the JMF RTP documentation in the JMF Programmer's Guide for more information on RTP transmission and reception.
The base Port number can be any port number that is not in use by any other service on your computer. For example, you can use "22222". Make sure that it is an even number. Once again, refer to the Programmer's Guide. The first media track will be transmitted from the base port number. The next track will go to base port number plus 2 and so on.
The sample program can be used as a utility class as well as standalone. There is a main method that takes three command line parameters. If all goes well, the media will be sent out for 300 seconds and then the application will exit. This 300 seconds limit is because there is no GUI that allows you to specify when to stop the transmission.
Where to go now
1. Download and compile the Source Files.
The Files are also here (locally)
2. Run AVTransmit with the required 3 command line parameters For example,
java AVTransmit file:/avmedia.mov 129.144.251.182
42050
3. Or write your own little program that uses the AVTransmit class to create, start and stop an RTP transmit session.
4. Since the media tracks are transmitted in multiple sessions, you'll need to use one Player per track on the receive side. Using JMStudio, you can start multiple Players from the "File" menu using the "New Window" item. Then use the "Open URL..." item to open one RTP session per track. The URL to use is:
rtp://
Where
5. Read the documentation, download the Java Media Framework 2, compile the programs and Extend them in some useful applicable method and voila - a completed project.
JMF 1.02
To contact Author: Email:
[email protected].Java Development Toolkits
The Java Development Toolkits Versions: 1.1x can be found at here.
The Java 2 Development Toolkit ver. 1.2.2 can be found at here.
The Java 2 Development Toolkit ver. 1.3 can be found at here.Java Media Framework
Here are some Windows 95/98 versions of the Java media Framework that I have saved locally for downloading.
JMF 1.1
JMF 1.1 (Java Version - cross platform)
JMF 2.0 Early Access
JMF 2.0 Early Access (Java Version - cross platform)
JMF 2.0
JMF 2.1