|
JMF Documentation
This guide describes how to use JMStudio. JMStudio is a stand alone
Java application that uses the JMF 2.0 API to play, capture,
transcode, and write media data. JMStudio also uses the JMF RTP APIs
to receive and transmit media streams across the network.
Get the source for JMStudio
Before you can run JMStudio, you must have JMF 2.1.1 installed. For
information about setting up JMF, see the
Setup
pages.
Running JMStudio
To launch JMStudio, you can run the batch file JMStudio.bat or
invoke:
java JMStudio
If you run JMStudio directly, both the JMF 2.1.1 classes and the JMStudio
classes must be in your classpath.
When JMStudio is launched, just the menu is visible:
Opening a new JMStudio Window
To create a new instance of the JMStudio application, select New Window
from the File menu. A new instance of JMStudio is launched without
affecting the current one. Both applications share the same Java virtual
machine.
Exiting JMStudio
To exit JMStudio, select Exit from the File menu.
Menu Summary
| File | New Window |
Ctrl+N |
Launches a new instance of the JMStudio
application. |
| File | Open File |
Ctrl+O |
Opens a file for playback. |
| File | Open URL |
Ctrl+U |
Opens a URL or MediaLocator for playback. |
| File | Open RTP
Session |
Ctrl+R |
Opens an RTP receive/playback session. |
| File | Capture
|
Ctrl+P |
Opens a dialog from which you can select
a capture device and begin capturing
data. |
| File | Recent URLs
|
|
Opens a menu from which you can select a URL from a list of
URLs recently accessed by JMStudio. |
| File | Close
|
Ctrl+W |
Closes the current Player or Processor. |
| File | Export |
Ctrl+E |
Opens a dialog from which you can transcode
and save media data. |
| File | Transmit |
Ctrl+T |
Opens a dialog from which you can transmit
media data over the network. |
| File | Exit |
|
Terminates the application. |
| Player | Auto
Play |
|
Toggles the auto play state of the current
Player or Processor. When auto play is enabled, the player begins presenting
the media stream automatically. |
| Player | Auto
Loop |
|
Toggles the auto loop state of the current
Player or Processor. When auto loop is enabled, the player automatically
replays the media stream when the end of media is reached. |
| Player | Maintain
Aspect Ratio |
|
Maintains the aspect ratio of the video
window when the JMStudio window is resized. |
| Player | Full
Screen |
Ctrl+F |
Expands the JMStudio window to fill the
entire screen. Click anywhere to restore the JMStudio window to its original
size. |
| Player | Snap
Shot |
Ctrl+S |
Takes a snap shot of the current video frame being displayed. |
| Player | Plug-In
Viewer |
Ctrl+V |
Opens a window that displays the media
processing flow. |
| Player | Capture Controls
|
|
Enables you to control capture parameters. |
Help | About
JMStudio |
Ctrl+H |
Displays an about box that contains the
version number and copyright information for JMStudio. |
| Playing Media Data with
JMStudio |
JMStudio lets you play media streams from
a variety of sources--files, URLs, or RTP transmissions.
Playing a File
To play a file:
-
Select Open File from the File menu.
The Open File dialog is displayed:
-
In the Open File dialog, select the file you
want to play and click OK.
A JMF Player for the selected file is created.
If Auto Play is enabled, the player is started and presentation of the
selected media file begins automatically.
If the format of the file is not supported
by JMF, an error message is displayed.
Playing Media from
a URL or MediaLocator
To play a URL or MediaLocator:
-
Select Open URL from the File menu.
The Open URL dialog is displayed:
-
In the Open URL dialog, enter the URL or MediaLocator
you want to play, for example http://greatmedia.ibm.com/clip1.mov.
-
Click Open.
If the URL exists, and its format is
supported by JMF, a JMF Player for this URL is created and started. If
the URL cannot be found or the format is not supported by JMF, an error
message is displayed. Supported protocols for the JMF 2.1.1 implementation
include HTTP, FTP, and FILE.
You can use the Open URL command to
play any URL or media locator, including RTP media locators. When you use
Open URL to play an RTP stream, the first stream of the RTP session is
played. To use Open URL to play an RTP Stream:
-
Select Open URL from the File menu.
-
In the Open URL dialog, enter the media locator
that identifies the RTP source from which you want to receive the RTP stream.
For example, rtp://mediastreams.ibm.com:49150/audio/1. (See RTP
Media Locator for a description of an RTP-specific media locator.)
-
Click Open.
For more information about playing RTP streams,
see Receiving and Presenting RTP Streams.
The Open URL command is also used
to capture media data. For more information, see Capturing
Media Data with JMStudio.
Replaying a Previous
File or URL
To replay a previously played file or URL,
select Visited URLs from the File menu. A hierarchical menu
is displayed that contains all of the files and URLs previously played
by JMStudio. This list is sorted by media type. When you select a
file or URL from this menu, a new JMF Player is created and started.
This list is maintained across application sessions. The list of visited
URLs is stored in a file called ".JMStudio" in your home directory. The
home directory varies depending on the Java VM that you use. So don't be
surprised if all your visited URLs disappear when you use a different Java
VM. Some common locations are "C:\", "%USERPROFILE%" and "%WINDIR%\Java".
Receiving and Playing
RTP Streams
To receive a media stream using the RTP protocol:
-
Select Open RTP Session from the File
menu. The Open RTP Session dialog is displayed:
-
In the Open RTP Session dialog, enter the
session address in the Address field (eg. 129.144.251.181), enter the port
no. in the Port field (eg. 23450) and select a TTL (Time To Live). This
constitutes the address of the transmitting source (or multicast address
if its a multicast transmission). You can read more about RTP session addresses
in the Programmer's Guide.
The format
of an RTP Media Locator is: rtp://address:port[:ssrc]/content-type/[ttl]
where:
| address |
The IP address of the RTP session |
| port |
The port of the RTP session. |
| ssrc |
SSRC Identifier of the source from which
data is to be received. If ssrc is not specified, the first stream
detected by the RTP Session Manager will be selected as a stream for the
DataSource. |
| ttl |
Time to Live of the RTP session. |
| content-type |
A string defining the data content type.
e.g. video, audio, motion, text, etc. The RTP media handler (Player) will
be created for this specific media type. |
-
After you enter the RTP session address and
port, click the Open button. JMStudio creates an RTP Session Manager
for the specified RTP media location.
JMStudio displays two buttons during an RTP
session: Statistics, and Close RTP Session:
-
Clicking Close RTP Session closes the
RTP Session Manager.
-
Clicking the Statistics button opens
a Participant List window that displays information about the RTP session
participants. This window contains another Statistics button that
displays a window that displays the RTP session statistics.
When RTP packets actually begin to arrive,
a JMF Player is opened to present the RTP media stream. This player has
all of the standard JMF presentation controls
except for the Seek bar, which is not relevant for RTP streams.
For more information about sending and
receiving RTP streams with JMF 2.1.1, see "Receiving and Presenting RTP Media
Streams" in the Java Media Framework API guide.
Controlling
a Media Presentation
While media data is being played, the following
controls are available:
| Play |
Starts presentation of the media data.
If the presentation was paused, playback resumes from the point at which
it was paused. |
| Pause |
Pauses presentation of the media data.
The Play button will resume playback from the point at which it was paused. |
| Step Back / Forward |
Steps back or forward by one frame. If either button is kept pressed,
the action automatically repeats at the rate of two frames per second. |
| Seek |
Sets the media to a new playback position.
You seek by dragging the Seek slider or clicking within the Seek bar. When
the media is playing, the seek does not take effect until the mouse button
is released. When the media is paused, dragging the Seek slider will cause
the video to be continually updated. |
| Mute |
Mutes the audio. The presentation (including
video, if applicable) continues while the audio is muted. Clicking
the Mute button mutes the audio, clicking it again resumes normal audio
playback. |
| Volume |
Right-clicking on the Mute button pops
up a volume slider. This sets the volume level. You can drag the volume
slider to increase or decrease the volume. Dragging to the right increases
the volume. In some situations, the volume slider is unavailable. |
| Information |
Displays the media properties, which contains
information about the media being played, including the JMF version, URL
name, duration, bit rate, video encoding, window size, frame rate, audio
encoding, and audio quality. |
| Zoom |
Right-clicking on the video window displays
a menu from which you can set the image scale. Available options are 1:2
(half size), 1:1 (normal size), 2:1 (double size) and 4:1 (quadruple size). |
| Rate |
Right-clicking on the Information button
displays a menu from which you can set the media playback rate. The rate
can be set to any value from 1/4 of the normal speed up to 8 times the
normal speed. |
| Auto Loop |
Enabling Auto Loop in the Player
menu causes the media to play continuously, restarting each time it reaches
the end of the media. Selecting the auto replay option repeatedly toggles
the replay setting on and off. |
Closing the Current Player
To close the current Player or Processor,
select Close from the File menu. This removes the presentation
controls and closes the current Player.
| Saving a Media Stream to
a File |
JMStudio enables you to transcode a media
stream and write it to a file. Transcoding is the process of converting
a media stream or some of its tracks from one media format to another.
To transcode and save a media file, URL, or captured media stream with
JMStudio:
-
Open the source (File
| Open File or File | Open URL) .
-
Select Export from the File menu.
The Export dialog is displayed:
-
In the Export dialog, set the encoding parameters
for each track that you want to include in the output file.
-
To exclude a track, disable the Enable
Track checkbox.
-
Once you've specified the encoding parameters
for each track you want to write, click Save.
The Save As File dialog is displayed.
-
In the Save as File dialog, enter the name
of the file in which you want to save the transcoded media data.
-
Click OK to write the media file.
| Transmitting a Media Stream |
You can use the JMStudio Transmit command to transcode a media stream
and transmit it across the network using RTP.
-
Select Transmit from the File menu. The Transmit wizard is displayed:
-
Select the source location of the media. You can select a File or a Capture
source.
-
Click on Next to go to the RTP format page and set the
formats of the Audio/Video tracks to be transmitted. You can disable any tracks
that you do not want to transmit.
-
Click on Next to go to the RTP parameters page. Enter the session
address, port, and TTL for each track that you want to transmit.
-
Click on Finish to start the transmission. Click on Back if
you want to change the settings on the previous pages.
For more information about sending and receiving RTP streams with JMF 2.1.1,
see "Receiving and Presenting RTP Media Streams" in the Java Media Framework
API Guide.
JMF supports media capture through special DataSources called Capture
DataSources. To capture media with JMStudio:
Previewing Captured Media Data
JMStudio enables you to monitor the media data as it is captured. To preview
captured media data:
-
Select Capture from the File menu. The Select Capture Device dialog
is displayed:
-
Select the capture device from which you want to preview incoming media
data and the format in which you want to capture the media.
-
Click OK to begin capturing the media.
The JMStudio includes a viewer that displays a graphical overview of
a Processor's tracks and plug-ins. This graph enables you to monitor of
the media flow during playback, capturing, or transcoding.
To open the Plug-In Viewer for the media currently being presented,
select
Plug-In Viewer from the Player menu. This opens the Plug-In
Viewer window, which displays the plug-ins currently loaded and the connections
between them:
To open the Plug-In Viewer for a transcoding processor:
-
Click the info button to open the Processor's information dialog.
-
Select the Misc tab.
-
Select the Plug-In Viewer.
To get information about a specific plug-in, position the mouse pointer
over the box representing that plug-in. The plug-in name and class name
is displayed. While the Processor is active, the flow of media Buffers
between the plug-ins is displayed in green in the plug-in's input and output
boxes, located to the left and to the right of the plug-in. Buffers with
an End of Media flag are shown in red.
To view the parameters of the Buffers that are passed between the plug-ins,
position the mouse over the small boxes to the left or to the right of
the plug-in. The Buffer parameters, including format and length, are displayed
at the bottom of the Plug-In Viewer window.
|