UMSMoviePlayer provides a high-level interface to allow application software to play movie files with synchronous audio to an AIXwindows window and an available audio device. Methods such as load, play, scan and record provide a high-level interface similar in function to controls on audio and video entertainment equipment. The movie file formats supported by UMSMoviePlayer depend on the available implementations of UMSMovieFileReader and UMSVideoDecoder classes as well as the audio format types supported by the UMSAudioDevice being used.
Ultimedia Services provides implementations of UMSVideoDecoder for Ultimotion Matinee, Motion JPEG, RTV2.0, and Indeo 2.1. UMSAVIMovieFileReader supports RIFF AVI movie files that have 1:1 Audio/Video interleave with or without audio preroll. All UMSAudioDevice implementations support PCM, A-law, and mu-law audio data types. Example programs for using UMSMoviePlayer are in the /UMS/install/Examples directory.
To learn more about the movie player, see:
For introductory information, see Programming with Media Handler Objects.
Movie player methods include player controls, media play controls, audio device controls, media attribute controls, and media monitoring controls.
Player controls include:
|Opens audio device.
|Closes audio device.
|Returns file name and device alias.
|Returns current player state.
|Returns the current AIXwindows display ID and window ID.
|Sets AIXwindows display ID and window ID for video frame display.
|Releases AIXwindows window back to application.
|Returns the AIXwindows window color map ID used.
Media play controls include:
|Returns the current time format.
|Returns the current setting of the repeat flag.
|Plays media from current position to end of file.
|Similar to play but stops at given position.
|Seeks to location in file.
|Cues media for play.
|Steps forward or backward.
|Freezes video while continuing to play audio.
|Scans forward through video frames only.
|Scans to position in media.
|Sets the time format to milliseconds or frames.
|Enables or disables repeated play.
Audio device controls include:
|Returns the current volume setting.
|Returns the current balance setting.
|Returns the audio device inputs and outputs aliases.
|Enables setting of shared device-specific parameters.
|Disables setting of shared device-specific parameters.
|Returns the current master settings mode.
|Returns the specific audio device class.
|Returns the path to the audio device in use.
|Returns the pathname of the master_exec executable.
Media attribute controls include:
|Sets speed as a percentage of normal play rate.
|Sets the audio track to play.
|Returns the video compression method used.
|Returns the location of the nearest I frames.
|Returns the normal width and height of the video frames.
|Returns normal play rate.
|Returns current play rate.
|Returns number of bits per sample for audio data.
|Returns audio data format.
|Returns the sample rate.
|Returns the current position in the media.
|Returns the data length of the media.
|Returns the current file format alias.
|Returns the number of channels in the next frame of audio data.
|Returns the number of bits per sample of audio data.
|Returns the current video format type.
|Sets the output image width and height.
Media monitoring controls include:
|Sets or clears one of 20 possible cuepoints.
|Sets position-advise event interval.
|Specifies which events to return.
|Returns the current event mask.
|Gets the next event.
|Determines whether an event is available.
|Returns file descriptor for event communication.
The movie file formats supported by UMSMoviePlayer depend on the available implementations of UMSMovieFileReader and UMSVideoDecoder classes as well as the audio format types supported by the UMSAudioDevice being used. Ultimedia Services provides implementations of UMSVideoDecoder for Ultimotion Matinee, Motion JPEG, RTV2.0, and Indeo 2.1. UMSAVIMovieFileReader supports RIFF AVI movie files that have 1:1 Audio/Video interleave with or without audio preroll. All UMSAudioDevice implementations support PCM, A-law, and mu-law audio data types. The object set can be extended by you if you have access to SOM development environment. UMSMoviePlayer makes use of new class implementations that are properly implemented and configured in the configuration file.
The following can influence how well the movie player plays the movie:
For instance, in an Ultimotion Matinee AVI file, if there are few I frames in the file, seeking to position in a file can appear slow because the movie player occasionally needs I frames to reconstruct complete video frames. When you seek to a position, the movie player seeks the nearest I frame before the position and begins reconstructing the images.
The number of frames per second used when creating the movie file also affects movie playback. During playback of a movie created at 30 frames per second, the movie player must navigate to the next frame, extract the video and audio data, decompress the video frame, and send it to an AIXwindows window for display while trying to synchronize the playback of the audio with the video. This must occur 30 times per second while leaving enough CPU cycles for other work. Other factors such as CPU speed and system load also influence how the movie can be played.
The movie player needs an AIXwindows window to display the video frame. It relies on the application to initialize the AIXwindows display and to create a window that has a width and height suitable for image display in each frame. After creating the window, pass the window ID to the movie player with set_window so that the movie player can manage the repair of the window on exposure events. When you want to manage the window, request the movie player to release_window.
To play a movie file, do the following:
The open_audio and close_audio methods allow applications to intelligently use the audio resources on your system. The audio device on your system can or cannot be shareable between more than one application at a time. The open_audio and close_audio methods enable applications to decide whether to use the audio device during playback. Not all movies have an audio track, and there are occasions where hearing the audio during playback is either not desirable or not possible. If open_audio is not successful, the application can decide to continue playing only the video frames since the movie player does not require the audio device to play a movie.
The movie player provides scan, step, and freeze methods, which emulate VCR-like controls. Also included is the set_speed_factor method used for fast and slow motion effects during playback.
|This method displays the video frames, without discarding any frames, at the highest possible rate attainable on your system. During a scan, the audio is not presented.
|This method allows you to step forward or backward N frames at a time. Negative frame counts move backward in the media while positive counts move forward. A step of 0 displays the current video frame again.
|This method allows you to freeze the current frame while continuing to play the audio track.
|This method can be used for fast- and slow-motion effects during playback. The speed factor is a percentage of the normal speed (the speed at which the media was recorded). Fast-forward effects can also be achieved by successively seeking the next I frame and using a step of 0 to display the frame.
For introductory information, see Programming with Media Handler Objects.