Exporting Media Received over RTP
|
|
Problem
Given a source IP address, a source port number, and a duration,
the object is to receive media stream over the network, transcode the
stream to default track formats and generate a resulting file with the
transcoded data.
Solution
A sample application is written. It accepts a source IP address
and port number where the original data comes from; an output URL where the
transcoded data will be saved; and a duration parameter which decides the
amount of input data to be received. The actual algorithm to transcode
the data is rather straight forward:
-
Create an input URL by concatenating source IP address, port number and
content type as follows:
"rtp://SourceIP1:SourcePort1/ContentType1&SourceIP2:SourcePort2/ContentType2".
-
Create a Processor for the input URL.
-
Configure the Processor.
-
Parse the output media locater and based on the file extension, determine
the content descriptor using MimeManager.
-
Set the (output) content descriptor on the Processor.
-
For each track, get its supported formats, and set the first format on that track.
-
Realize the Processor.
-
Obtain the output DataSource and use it in conjuction with the output media
locator to create a DataSink.
-
Start the Processor and DataSink.
-
Wait for MediaTime to reach duration, then close the Processor.
-
Wait for the DataSink's EndOfStreamEvent.
-
Close up the Processor and DataSink.
Some error checking is handled as an example.
|
|
| Requirements |
|
| Platform: |
JDK 1.1.6 or later |
| JMF API: |
2.0 or later |
| Implementation: |
AJ, WPP, SPP * |
* AJ = All Java, WPP = Windows Performance Pack, SPP =
Solaris Performance Pack |
|