by Maria Ingold
Imagine a world in which personal computers greet their users with the blare of trumpets, let them look at a sound and manipulate it, play a music CD without ever turning on the stereo, and receive video help on an application without adding any extra hardware. World of the future? No – all these capabilities are provided today by OS/2TM 2.1 and its built-in multimedia support.
Previously the separate Multimedia Presentation Manager/2 (MMPM/2) product, this multimedia architecture is now included in OS/2 2.1. The multimedia architecture takes full advantage of OS/2 2.1 – it includes both audio and video applications, has an application programming interface (API) that provides hardware independence to application software, and is extensible for the future.
Provided with OS/2 2.1 Multimedia are a set of audio and video applications that serve two purposes: they provide immediate multimedia functionality to the user of OS/2 2.1, and they provide examples of what can be accomplished using the MMPM/2 architecture as a programming base.
MMPM/2 has already been used as the base architecture for Ultimedia Builder/2TM , Ultimedia Perfect Image/2TM , and Video InTM . These products work together or separately to extend the multimedia production capabilities of OS/2 2.1.
OS/2 2.1 Multimedia Audio
The OS/2 2.1 Multimedia base audio applications are composed of:
- CD Player
- Digital Audio Player/Recorder/Editor
- Macros for Lotus and Excel
- MIDI Player
- System Sounds
The CD Player (with the music CD of your choice) provides capabilities similar to those on a home stereo, and works with all OS/2 2.1-supported CD-ROM drives. The standard functions of playing, cueing, ejecting, skipping tracks, displaying current track, and displaying time into track, plus advanced functions – editing tracks out of a play sequence, automatic play, repeat, and shuffle – are present (Figure 1).
Figure 1. CD Player
In addition to these normal functions, the software CD Player provides the ability to catalog a CD’s title, and to display that title whenever the CD is loaded. There is also a software eject button; if a CD is ejected, a graphic appears, instructing the user to insert a CD (Figure 2).
Figure 2. Insert a CD graphic
Digital transfer of data from the CD-ROM through a sound card is possible if the card supports CD quality, (16 bit stereo at 44.1 kHz), and if the CD-ROM is able to stream digital data. This enables the CD-ROM to use the Digital Signal Processor (DSP) on the card, since the DSP on the card may be better than the CD-ROM’s own internal DSP. The CD audio output is then piped out the card’s speaker jack, thus maintaining a higher quality of sound.
Digital Audio (Figure 3) enables playing, recording, and editing of a waveform file. A waveform is the digital representation of audio (sound waves). A sound wave is analog and therefore continuous; it needs to be encoded by taking discrete samples of the wave.
Figure 3. Digital Audio
Of these various encoding methods, Digital Audio plays Pulse Code Modulation (PCM), Adaptive Differential Pulse Code Modulation (ADPCM), A-Law, and Mu-Law. Supported file formats include RIFF Wave and Creative Labs Voice Files (VOC). The Workplace ShellTM (WPS) feature of dragging and dropping a waveform file onto the application is also supported. RIFF Wave PCM files can be displayed graphically, so in addition to playing or recording into the whole file, selected ranges of the file can be played, recorded into, or edited.
Digital Audio supports recording in either stereo or mono, at a sampling rate of 11.025 kilohertz (kHz), 22.05 kHz, or 44.1 kHz (voice, music, and CD quality respectively), with a sampling precision of 8- or 16-bit. If the sound card does not support a particular capability, the option to do this in Digital Audio will not be available.
Since some sound cards do not provide all the capabilities mentioned here, Digital Audio enables audio-quality conversions for PCM files by selecting the entire file, copying it into the clipboard, changing the audio parameter settings, and pasting the original into a new file.
Because PCM files can be displayed graphically, cut, copy, and paste of an entire file, or selected regions, are done much like an editor. In addition to these features, special effects such as mix from file or clipboard, volume change, speed change (comparable to monster and chipmunk), fade, reverb, reverse, and echo can be applied to the whole, or a part of, the file.
The Lotus and Excel Macros add audio enablement to a spreadsheet. These macros are available for 16-bit versions of both Lotus 1-2-3 and Excel as well as for the 32-bit version of Lotus 1-2-3. With this audio capability, numeric information can be clarified by recording comments into the cells, which can then be played back. When the macro is started, it adds an “Audio” option to the menu bar, from which play and record can be selected.
The record option brings up a small graphical recorder, and audio can be added from the microphone, using the record button, or pasted in from the clipboard by selecting paste from the system-menu pulldown. The mini-recorder is useful for quick comments, while pasting is advantageous because the Digital Audio application can be used to record the file, and then to add effects to it.
The MIDI (Musical Instrument Digital Interface) player allows playback of MIDI files from a selected position. The MIDI player is actually a generic media player that can dynamically change its device type, depending on the type of file that is loaded. The device type determines if record and other options are enabled (Figure 4).
Figure 4. MIDI Player
System Sounds allow waveform files to be associated to different system events. This is both fun and educational – a favorite song clip could be played on startup, or audio help can be associated to actions, such as the shredder announcing that “This file will be obliterated if it is dropped here.” System Sounds also recognizes files created using the Tune Editor, which outputs DOS beeps at the appropriate frequency. Using this enables system sounds to play through the computer’s speaker, even if there is no sound card (Figure 5).
Figure 5. System Sounds
Except for the Tune Editor, the one thing common to all these audio applications is that they need to be played through an audio card in order to be heard. The three boards supported by MMPM/2 are the Creative Labs Sound BlasterTM series (SB), the IBM Audio Capture and Playback AdapterTM (ACPA or M-Audio), and the Media Vision Pro Audio Spectrum 16TM (PAS 16). Figure 6 summarizes this information.
|Card||8-Bit||16-Bit||Stereo||Mono||11.025 kHz||22.050 kHz||44.100 kHz|
|SB Pro 16||X||X||X||X||X||X||X|
Figure 6. Attributes of Audio Cards Supported by OS/2 Multimedia
The PAS 16 also supports simultaneous playback of MIDI and wave audio. All SB (Version 2.0 or higher) and SB Pro adapters are supported.
Additionally, multimedia-enabled REXX provides command-line or batch-file support for playing and recording sound, and for playing movie files. For example, a useful application would be adding the playback of an audio clip to the end of a compiled batch file to let the programmer know when the compilation is done.
OS/2 2.1 Multimedia Video
The OS/2 2.1 MMPM/2-based applications that provide video support are:
- Digital Video Player
- Video In Recorder
- AVI File Utility
- Ultimedia Builder/2
- Ultimedia Perfect Image/2
Available as part of OS/2 2.1, the Digital Video Player plays software motion video movies. Because this playback is done in software, no additional video hardware is required. This means that anyone using an OS/2 2.1-based computer has the capability to play video.
When playing a movie, the generic media player interface is used as a control panel, and the movie is displayed in a separate playback window. This window’s system menu contains several additional video-specific menu options. Under “Movie info”, information is given about the file name, compression type, frame size, frame rate, data rate, and running time. Additionally, Double Size and Half Size are available on most SVGA and XGATM systems. These options, for example, would make a 320 x 240 movie play at 640 x 480 or 160 x 120 by adding or removing pixels respectively (Figure 7).
Figure 7. Digital Video Player
OS/2 2.1 software motion video uses the standard Audio Video Interleaved (AVI) file format. This format arranges audio and video data within a file. To conserve file space, this data can be compressed, and then rapidly decompressed for playback.
Algorithms that do this type of compression / decompression are called CODECs. UltimotionTM and IndeoTM are those currently supported by OS/2 2.1 Multimedia.
While the OS/2 2.1 Digital Video Player can play movies, it cannot create, capture, or modify them. To do this, Video In, the most recent MMPM/2 based product, provides the Video In Recorder and the AVI File Utility. To create a movie, certain parameters have to be set before recording can take place.
The dimensions of the movie, or the frame size, are specified by width times height in pels. The maximum size is hardware-dependent, for example, 640 x 480 pels. The frame size of the movie is usually set as a ratio of these dimensions, say 2:1 or 320 x 240 pels.
The frame rate is the number of frames per second (FPS) that are captured for playback. The actual rate of playback depends, however, on the processing capabilities of the system, as well as the complexity of the CODEC used to create the movie.
The data rate needed for single-speed CD-ROMs, 150 KBS, is the data rate achieved when recording a 320 x 240 pel movie at 15 FPS with 64K colors.
Movies can be recorded in two ways: frame-step or real-time. Since frame-step capture steps through the video source frame by frame, the CODEC can spend more time analyzing the data. Therefore, better quality, compression, and data rate are achieved. Source input for frame-stepped capture must be either a computer-controlled device (such as a laserdisk) or an AVI file. Laserdisk support is provided for the Pioneer LaserdiscTM models LD-V4200, LD-V4300D, LD-4400, and LD-V8000.
Frame-step recording from a source AVI file makes it possible to change the compression type of the data. Changing the compression type allows the conversion from one CODEC to another; for example, Indeo to Ultimotion. Furthermore, it enables the compression of a “raw”, or uncompressed video file, as well as the creation of a raw file from an existing movie. This capablility is useful for editing together movies of different types, and for creating high quality compressed movies from raw video or animation.
Real-time capture is done from a live video source (such as a videotape device or camcorder) via line in, and it compresses the image immediately. Since less time is spent analyzing the source, the frame size and frame rate are typically smaller in order to achieve the same data rate as a video made using frame-step compression. This type of compression is ideal for situations that require video content to be captured in real time for immediate playback.
While recording, the video or audio source may be monitored to ensure that the correct video sequence is being captured. The video monitor can be used to reflect adjustments in brightness, color, contrast, and tint to be made to the recorded video. It is also possible to isolate a rectangular portion of the monitor video for video capture by drawing this region directly on the monitor video window. This image-cropping can also be useful during bitmap capture. Here, the Video In Recorder captures the image in the monitor window, or inside the monitor window’s crop region, into the 24-bit RGB OS/2 bitmap format.
After recording, the Video In Recorder can be used to edit the video by marking regions to be cut, copied or pasted into the same video or other video files (Figure 8).
Figure 8. Video In Recorder
Since the actual video compression is done in software, only a simple “frame-grabber” card is necessary to capture the image. The video capture devices that are currently supported are the Creative Labs Video BlasterTM , IBM Video Capture Adapter/ATM (VCA), Jovian Super Video Input AdapterTM (SuperVIA), Jovian Quick Video Input AdapterTM (QuickVIA), New Media Graphics Super Video WindowsTM , Samsung Video MagicTM , and the Sigma Designs WinMovieTM. The attributes of these cards are listed in Figure 9.
|Video Capture Adapter||MC||NTSC||Composite, RGB, S-Video||640 x 480|
|Video Capture Adapter/A||MC||PAL||Composite, RGB, S-Video||640 x 480|
|SuperVIA||MC, ISA||NTSC||Composite, S-Video||640 x 480|
|SuperVIA||MC, ISA||PAL||Composite, S-Video||640 x 560|
|QuickVIA||ISA||NTSC||Composite, S-Video||320 x 240|
|QuickVIA||ISA||PAL||Composite, S-Video||320 x 240|
|WinMovie||ISA||NTSC||Composite, S-Video||320 x 240|
|WinMovie||ISA||PAL||Composite, S-Video||320 x 240|
|Video Blaster||ISA||NTSC, PAL||3-Composite||1024 x 768|
|Super Video Windows||ISA||NTSC, PAL||3-Composite||1024 x 768|
|Video Magic||ISA||NTSC, PAL||3-Composite||1024 x 768|
Figure 9. Video Capture Device Attributes
The AVI File Utility is also included in the Video In product. This utility provides the ability to browse AVI file information, to manipulate the interrelation of audio and video within the AVI file, and to compose an animation from a series of images.
As an AVI file browser, the AVI File Utility can view information within the file, such as the header, the chunk id and length, the index, and status. The utility enables viewing of all these at once, or isolating the view to just those of interest (Figure 10).
Figure 10. AVI File Utility
During capture, audio and video are recorded separately, and then interleaved when the file is saved to form an AVI file. With this utility, the audio can be split from the video; audio can be merged into the video; the interleave ratio of video to audio chunks can modified; and the skew between audio and video can be changed. Splitting audio from video and merging audio into video can be used together or separately to create silent movies or soundtracks, or to modify or change the audio associated with a movie.
An ideal movie has one chunk of video to one audio chunk, a 1:1 interleave ratio. If a movie has a 1:1 interleave ratio, the skew between audio and video chunks can be changed so that the audio is stored before the corresponding video in the AVI file.
This helps to ensure that the audio buffers will remain full as the movie plays, and that frames are not dropped as a result of trying to maintain audio continuity.
In addition to AVI file manipulation, the AVI File Utility enables the creation of “raw” AVI movie files, or animations, from a series of images. These images need to be of equal size, and can be any combination of the supported image types. This includes the image types supported by MMPM/2 in OS/2 2.1, and those supplied by Perfect Image/2. The images and any pauses are placed in the order to be recorded and the frame rate is specified. From this, a “raw” AVI file is generated. Compression can be achieved by bringing this raw file in as source input for the record-from-file capability in the Video In Recorder. If desired, a soundtrack can then be added by using the AVI File Utility. Thus, a full animation could be created using bitmaps that are output from animating packages, bitmaps created from the Video In Recorder, bitmaps altered using Perfect Image/2, or any number of other places.
Going Further with OS/2 2.1 Multimedia
OS/2 2.1 Multimedia, with its ability to fully utilize the OS/2 2.1 architecture, and its support of Workplace Shell functions, such as drag-and-drop, enables the user to immediately extend his or her everyday operations into the realm of multimedia. Video In, with the Video In Recorder, and AVI File Utility applications provide the ability to create the video material to be used by the OS/2 2.1 Multimedia.
To go beyond these capabilities, Ultimedia Builder/2, and Ultimedia Perfect Image/2 , which are both MMPM/2-based products, enable the integration of audio, image and video to create presentations, and the ability to edit images, respectively.
The OS/2 2.1 Toolkit, which includes the OS/2 2.1 Multimedia toolkit, in conjunction with the Video In multimedia toolkit additions, has header files and libraries needed to program new OS/2 2.1 multimedia applications or extensions to the MMPM/2 architecture. Usable samples and corrosponding C-language code give examples for programmers to follow.
Not only does OS/2 2.1 Multimedia provide multimedia applications for use today – MMPM/2 ensures extension of multimedia into the future!
IBM Audio Capture and Playback Adapter, IBM Video Capture Adapter/A, OS/2, Ultimedia Builder/2, Ultimedia Perfect Image/2, Ultimotion, Video In, Workplace Shell, and XGA are trademarks of International Business Machines Corporation
Indeo is a trademark of Intel Corporation
Creative Labs Sound Blaster, and Creative Labs Video Blaster are trademarks of Creative Labs, Inc.
Media Vision Pro Audio Spectrum 16 is a trademark of Media Vision
Pioneer Laserdisc is a trademark of Pioneer Electronic Corporation
Jovian Super Video Input Adapter, and Jovian Quick Video Input Adapter are trademarks of Jovian Logic Corporation
New Media Graphics Super Video Windows is a trademark of New Media Graphics
Samsung Video Magic is a trademark of Samsung Electronics Co., Ltd.
Sigma Designs WinMovie is a trademark of Sigma Designs Corporation
|ACPA||IBM Audio Capture Play Back Adapter|
|ADPCM||Adaptive Differential Pulse Code Modulation|
|AVI||Audio Video Interleaved is a file format, which arranges audio and video data chunks in a file.|
|CODEC||Compressor Decompressor. The algorithm by which an image is compressed and decompressed. This may be done in hardware and/or software.|
|DSP||Digital Signal Processor.|
|FPS||Frames per second.|
|ISA||Industry Standard Architecture|
|Interleave||In this context, the combining and synchronizing of audio and video data.|
|KBS||Kilobytes per second.|
|kHz||kilohertz. Thousands of cycles per second.|
|MC||Micro Channel architecture|
|MIDI||Musical Instrument Digital Interface|
|MMPM/2||Multimedia Presentation Manager /2|
|NTSC||National Television Systems Committee, the television standard for the United States.|
|PAL||Phase Alternating Line, a European television standard.|
|pels||Also referred to as pixels. Both acronyms were derived from the words “picture element”. This is the smallest element on the display which can be independently given both color and intensity.|
|PAS||Pro Audio Spectrum|
|PCM||Pulse Code Modulation|
|Raw Movie||An uncompressed AVI movie file.|
|RIFF||Resource interchange file format|
|SVGA||Super Video Graphics Adapter/Array|
|S-VIA||Jovian Super Video Input Adapter|
|VCA||IBM Video Capture Adapter|
|Waveform||A waveform is the digital representation of audio (sound waves).|
|XGA||eXtended Graphics Array adapter|
IBM Multimedia Presentation Manager/2 Application Programming Guide, Release 1.1., IBM Corporation, 1993.
Ultimedia Video In User’s Guide, Release 1.0., IBM Corporation, 1993.