## JMStudio User's Guide

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.

Contents

- Getting Started

- Running JMStudio
- Opening a New JMStudio Window
- Exiting JMStudio
- Menu Summary

- Playing Media Data with JMStudio

- Playing a File
- Playing a URL
- Replaying a Previous File or URL
- Receiving and Playing RTP Media Streams
- Controlling the Presentation
- Closing the Current Player

- Saving a Media Stream to a File
- Transmitting Media Streams via RTP
- Capturing Media Data with JMStudio

- Previewing Captured Media Data

- Using the Plug-In Viewer
- Known Limitations

Getting Started

Before you can run JMStudio, you must have JMF 2.0 Beta 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.0 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 | 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 Preview | Ctrl+P | Enables you to monitor media data as it is captured.
File | Capture Controls |  | Enables you to control capture parameters.
File | Save As | Ctrl+A | 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 | Close Player | Ctrl+W | Closes the current Player or Processor.
File | Visited URLs |  | Opens a menu from which you can select a URL from a list of URLs recently accessed by JMStudio.
File | New Window | Ctrl+N | Launches a new instance of the JMStudio application.
File | Plug-In Viewer | Ctrl+V | Opens a window that displays the media processing flow.
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.
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:

1. Select Open File from the File menu. The Open File dialog is displayed:

2. 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:

1. Select Open URL from the File menu. The Open URL dialog is displayed:

2. In the Open URL dialog, enter the URL or MediaLocator you want to play, for example `http://greatmedia.ibm.com/clip1.mov`.
3. 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.0 Beta 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:

1. Select Open URL from the File menu.
2. 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.)
3. Click Open.

For more information about playing RTP streams, see Receiving and Playing 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:

1. Select Open RTP Session from the File menu. The Open RTP Session dialog is displayed:

2. 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.

3. 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.0, 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:

1. Open the source (File | Open File or File | Open URL) .
2. Select Save As from the File menu. The Save As dialog is displayed:

3. In the Save As dialog, set the encoding parameters for each track that you want to include in the output file.
4. To exclude a track, disable the Enable Track checkbox.
5. Once you've specified the encoding parameters for each track you want to write, click Save.
6. In the Save as File dialog, enter the name of the file in which you want to save the transcoded media data.
7. Click OK/Save 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.

###

1. Select Transmit from the File menu. The Transmit wizard is displayed:

2. Select the source location of the media. You can select a File or a Capture source.
3. Click on Next. This will take you to the page where you can select the format of the Audio/Video tracks to be transmitted. You can disable tracks that you do not wish to transmit.

4. Click on Next to move on to the RTP parameters page. Enter the session address, port and TTL for each track that you wish to transmit.

5. Click on Finish to start the transmission. You can also click on Back if you wish to make changes in the previous pages.

For more information about sending and receiving RTP streams with JMF 2.0, see "Receiving and Presenting RTP Media Streams" in the Java Media Framework API Guide.

Capturing Media Data

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:

1. Select Capture Preview from the File menu. The Capture Preview dialog is displayed:

2. Select the capture device from which you want to preview incoming media data and the format in which you want to capture the media.

Using the Plug-In Viewer

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 File 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:

1. Click the info button to open the Processor's information dialog.
2. Select the Misc tab.
3. 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.

Copyright © 1995-99 Sun Microsystems, Inc.
All Rights Reserved