Cross-platform Development Using Indeo® Video Interactive
Introduction
Indeo® video is Intel's digital video software technology for compressing and playing video on desktop computers. It is a key ingredient for creating video for your application that can be used across platforms. Read this document if you are a multimedia software developer who wishes to incorporate the same video files in an application running under either QuickTime* or Video for Windows*. This paper is divided into the following major sections:
Desktop Video Environments
Desktop Video Environments
QuickTime for Windows and QuickTime for the Macintosh use the same file format. A QuickTime for Windows video can play on the Macintosh after adding resources, although a QuickTime for the Macintosh video cannot play on a Windows-based PC. However, if you use a QuickTime for Windows-formatted video, it is possible to play the same Indeo video file on both platforms from a single hybrid CDROM. Microsoft freely licenses the Video for Windows version 1.1 runtime software by means of major on-line information services such as CompuServe*. Apple makes QuickTime for Windows runtime files available from a number of sources of the same major on-line services. Developers who ship products incorporating QuickTime for Windows must pay a license fee to Apple.
Creating Cross-Platform Indeo Video Files
Creating cross-platform Indeo video compressed files entails more than simply ensuring that a Macintosh file is readable on the PC. For example, you can assert palettes in several ways from a single Indeo video file under QuickTime, QuickTime for Windows, or Video for Windows. In addition, audio sampling rates and audio interleaving are slightly different on the PC and Macintosh and can degrade playback performance when not addressed properly. This section explores these and other issues in detail and provides the knowledge and tools necessary for the full benefits of Indeo video technology.
Capturing Video and Audio Data
To make an Indeo video movie file captured in one format playable in another format, you must convert the file. For example, an .AVI movie cannot play under QuickTime or QuickTime for Windows until it has been converted to the QuickTime MooV file format. Similarly, a QuickTime movie cannot play under Video for Windows until it has been converted to the .AVI format. The Macintosh and PC platforms have file system differences not specific to multimedia files. The following sections detail differences in the structure of these two file systems and how these differences affect cross-platform Indeo video development.
File System Differences On the PC, information in a file is stored as one continuous stream of bytes. On the PC, many file name extensions are reserved by convention to identify the type of information contained within the file. Thus, the .AVI extension is reserved for Video for Windows movies, and the .MOV extension for QuickTime is reserved for Windows movies. A movie player application may reject a file whose extension does not indicate the type of data it expects. On the Macintosh, the file system maintains two 4-character signatures in each file: the file type and the file creator.
After a file is moved from the PC to the Macintosh, its file type and file creator must be set appropriately. Many utilities exist to perform this operation. You can use a utility called MakeItMooV* specifically to set the file signature for QuickTime MooV files. This shareware utility is distributed with all Indeo video QuickTime codec releases. If you are developing a portable application, establish and use a consistent file-naming convention to indicate whether a given file has already undergone conversion. Give uppercase 8.3 file names to movies destined for inclusion on a cross-platform CD-ROM. Similarly, limit folder names on the Macintosh to eight characters. Finally, avoid duplicating files. Placing your movie files in two locations, one for the PC and another for the Macintosh, reduces the space on a CDROM by half. To avoid this, use file aliases to refer to movie files on the Macintosh side of a cross-platform CDROM. Figures 1 and 2 show graphic representations of a hybrid CDROM disc. Figure 1 shows the Macintosh structure, and Figure 2 shows the PC structure. In the Macintosh representation, movie files appear to be in the Macintosh folder. The files reside in the Windows folder; the Macintosh folder contains only aliases. However, when the user double-clicks on a file alias, the operating system points to the real file. Figure 1. Macintosh Folder View of Hybrid CDROM Structure
Meanwhile, the PC representation shows no files in the Macintosh directory. Figure 2. DOS Directory View of Hybrid CDROM Structure
Differences in Audio
Standards
Sample size. Two standard sample sizes exist: 8-bit samples and 16-bit samples. Unsurprisingly, the larger samples have a better signal-to-noise ratio and therefore give better results. (They also occupy twice as much storage.) You can use 8-bit audio samples for loud music such as rock without noticeable quality degradation, but for quiet music or spoken material, use 16-bit samples. Interleaving. Video for Windows interleaves on a frame basis, while QuickTime interleaves on a time basis. Under Video for Windows, interleave audio with video data at a ratio of one-to-one (one frame of video for each sample of audio). For QuickTime files, interleave audio with video data at a ratio of one half second of sound for one half second of video, regardless of the frame rate. This is the QuickTime default. The following steps reinterleave video files using either MoviePlayer 2.0 (included in the QuickTime 2.0 Developer's CD) or Movie Converter* 1.0 (included with the QuickTime Starter Kit).
Converting QuickTime to Video for Windows
On the Macintosh, a MooV file can refer to data stored in other MooV files. This saves disk space and it can happen when movies are created by cutting and pasting from other movies. To make a MooV file portable, you must replace all references to data in external files with an actual copy of the referenced data. This process is required not only when moving QuickTime files to the PC, but also when moving movies from one Macintosh to another. A MooV file on the Macintosh contains the actual video and audio streams in the data fork and all of the organizing information (such as headers, indexes, sizes, media information) in the resource fork. However, for portability, Apple defined a single-fork form of the MooV format in which the resource information is stored immediately after the audio and video data in the data fork, and the resource fork is empty. Such files play just as well as two-forked files. This process is referred to as flattening the file. The PC creates the equivalent of Macintosh self-contained, single-forked files that the Macintosh treats as PC files. (A drag-and-drop utility named MakeItMooV, bundled with Indeo video for Macintosh, changes the file type as necessary for the Macintosh to treat these as Macintosh video files). But you must ensure that QuickTime files created on the Macintosh are self-contained and single-forked before they can be compressed or played on the PC. You begin the conversion process on the Macintosh and finish it on the PC. You can flatten a movie file on the Macintosh using various video editing applications such as Video Fusion or Adobe Premiere. With Video Fusion 1.5 or later:
With Adobe Premiere, execute the File > Export... Flatten Movie command. Various playback utilities, such as MoviePlayer 2.0 and Movie Converter 1.0, can also flatten a Macintosh movie file:
The Video for Windows Converter utility from Microsoft includes this conversion capability as shipped but does not support Indeo video Raw or compressed MooV files. After you've flattened the file, move it to the PC and change its format from MooV to .AVI. You can do so by recompressing the movie in Adobe Premiere*, but if the video has already been compressed, another compression will degrade image quality. Utilities such as TrMooV* and SmartVid can convert between .AVI and MooV formats without recompression. To convert a MooV format file with TrMooV:
The file format is converted, the video is not recompressed, and the audio and video data are correctly interleaved. TrMooV has the following limitations:
To convert a MooV format file with SmartVid:
SmartVid converts the file and opens it. For more information on using SmartVid, see the document entitled Using The SmartVid Conversion Utility. SmartVid does not convert the audio interleaving. To do so, open the converted file with a video editing application and use the application's audio interleave options. SmartVid converts only files captured in Indeo video Raw or compressed with Indeo video Release 3.2. If a custom palette is attached to the MooV format file, it is removed from the converted file.
Converting Video for Windows to QuickTime
QuickTime and QuickTime for Windows perform best when playing movies that have QuickTime audio interleaving. Therefore, when converting .AVI format files to MooV format, check the resultant audio interleaving, using a Macintosh-based tool such as MovieAnalyzer* to do so. For example, select MovieAnalyzer's Info Graph Playability (zG) menu item to check audio interleaving. A message window opens, containing messages about potential playback problems. Audio interleave may be among these messages. If audio interleave is a problem, save the movie to a new file name on the Macintosh using MovieConverter 1.0.
Managing the Indeo Video Palette in Cross-Platform Development
The following discussion provides techniques for creating a single Indeo video file that can play with optimal quality under QuickTime environments. For a complete discussion of Indeo video palettes, including a discussion of palettes in the Video for Windows environment, see Using Palettes With Indeo Video. An Indeo video file playing in QuickTime on an 8-bit color monitor may not necessarily look as good when playing in QuickTime for Windows on an 8-bit color monitor. To improve playback quality under QuickTime for Windows, you can use QuickTime tools on the Macintosh to optimize the MooV file. By default, QuickTime dithers the Indeo video file during playback to the currently asserted palette. The video will play best if this is the system palette. SetMovieColorTable and MakeMovieColorTable are two tools available with the QuickTime 2.0 developer's kit that allow you to associate a specific palette with a movie file. Depending on the specific details of the video content, this can improve performance and image quality, but you will have to experiment with your specific video file under QuickTime to determine if it does. Under QuickTime for Windows, it is the responsibility of the playback application to assert the desired palette. This can be the Indeo video 236color default palette, or one you have optimized for the application. Debabelizer* is a popular application for creating palettes. Create your palette with no more than 236 colors, because the first ten and last ten entries in the 256-color palette are reserved for Windows. QuickTime for Windows 2.0 offers the ability to associate a palette with a specific movie file, which the playback application then asserts when playing that file. For optimal QuickTime for Windows playback, attach the default Indeo video palette. The Indeo video decompressor runs faster and image quality is better.
Creating Hybrid CD-ROM Discs
When using hybrid CD-ROM mastering software, take care that inconsistencies between platforms do not cause problems:
Cross-Platform Development Scenarios
Scenario 1: Capture and Compress on Macintosh
The Indeo video file is now suitable for playing on a Windows machine using QuickTime for Windows. It is also ready to be pressed onto a hybrid CD-ROM playable on either a Macintosh or a PC.
Scenario 2: Capture on Macintosh and Compress on PC
The MooV file is now suitable for use on a cross platform CD-ROM.
Scenario 3: Capture and Compress on PC
Scenario 4: Capture on PC and Compress on Macintosh
At this point, the Indeo video .MOV file is ready to be played in Quick Time for Macintosh or Windows.
Conversion Utilities
SmartVidSmartVid does not convert audio interleaving or sample rates. If you are converting from QuickTime to Video for Windows format, convert the audio interleave on Windows using VidEdit or Premiere. When converting from Video for Windows format to QuickTime format, convert both audio parameters using MoviePlayer 2.0 on the Macintosh. TrMooVTrMooV is useful for converting files in either direction on a PC. TrMooV has batch conversion abilities and also takes care of the audio interleave.
VfW Converter 1.1
AVI to QT 1.0 This utility has two advantages over SmartVid:
Using this second method, you can make a .AVI file playable on both Video for Windows and QuickTime. Such files are different from cross-platform QuickTime files. Cross-platform QuickTime files result in a single file playable on both platforms. Cross-platform Video for Windows files consist of a stub QuickTime file containing pointers to the video and audio data in the .AVI file. The size of the stub QuickTime file is usually between 10-30 KB. NOTE: Version 1.0 of AVI to QuickTime and version 1.1 of the VfW Converter contain a bug that prevents them from creating properly converted Indeo video compressed files. This issue should be resolved in the next releases of these utilities. In the meantime, these two utilities can be patched using ResEdit as described below. The following steps allow Video for Windows Converter and AVI to QT Utility to convert files compressed with Indeo video.
You can use the steps above to support files compressed with Indeo video Release 3.1 or Indeo video Raw. For Indeo video Release 3.1:
For Indeo video uncompressed:
For more infomation, contact www.apple.com and www.microsoft.com.
|
* Legal Stuff © 1997 Intel Corporation