HOOPS AVI Integration
Audio Video Interleave, also known as AVI, is a multimedia container format introduced by Microsoft as part of its Video for Windows technology. AVI files can contain both audio and video data in a file container that allows synchronous audio-with-video playback. The AVI HIO component supports the export of AVI within HOOPS.
To use this integration, then follow the steps below to use the HOOPS/HIO component:
Create a hio_plugins directory in your application's working directory.
- Copy the hio_avi.hio file found in <hoops>/bin/<platform>/hio_plugins/hio_avi to the hio_plugins directory created in the previous step.
- Run your application.
During startup, when HOOPS/MVO finds the AVI HIO component in your application's path, it will perform the following steps:
- Load in the necessary Video For Windows libraries.
- Create the appropriate output handlers.
- Register both handlers and the associated file extensions to the HIOManager.
Once the AVI HIO component is successfully loaded, your application will be able to export AVI files without having to recompile HOOPS. To utilize any further services available in the implementation of the AVI output handler, you must integrate directly the handler as described in Integrating Directly with the AVI Output Handler.
With the AVI HIO component, you can export animations created in HOOPS to a stand alone container that can be played on a wide variety of platforms. There some key output options that need to be set when exporting an animation to AVI. First, use the methods HOutputHandlerOptions::WindowWidth and HOutputHandlerOptions::WindowHeight to specify the dimensions of the resulting AVI file. Then create an instance of AVIExportInfo. Within this structure, you can specify the start and end time for your animation via AVIExportInfo::starttick and AVIExportInfo::endtick, respectively. Finally, use the AVIExportInfo::resolution data member to specify how many milliseconds per frame. Once you have populated this structure, set HOutputHandlerOptions::m_pExtendedData to point to it. The following sample code creates an AVI file whose dimensions are 320 x 240 and runs at 30 frames per second.
If you want to rebuild the AVI HIO component, simply open the hio_avi_<version>.vcxproj project located in the <hoops>/Dev_Tools/hoops_hio/hio_avi/source. Once the project is built, an .hio file will be created.
In this section, we will outline the steps involved in integrating your HOOPS-based application directly with the HOOPS implementation of the AVI output handler. First, ensure that you have the Windows Platform SDK installed on your system. Once all the binaries are installed in your path, please follow the steps below:
- Add files HIOUtilityAVI.h/.cpp to your project. These files are located in the Dev_Tools /hoops_hio/hio_avi/source directory of your HOOPS installation. Refer to hio_avi_<version>.vcxproj in Dev_Tools/hoops_hio/hio_avi/source directory.
- In your debug/release build, you should to vfw32.lib which is the primary Video For Windows library.
Once you have completed the above steps, you do not need to rely on the AVI HIO component anymore. Please remove the associated .hio file from the hio_plugins directory in your application's working directory. Note that in a direct integration, you must register HIOUtilityAVI as an output handler with the HIOManager so that the HBaseModel write functions can recognize that the AVI file format is supported.
For more information on HOOPS/MVO file input/output architecture, please see the section File Input/Output and the I/O Manager of the HOOPS/MVO Programming Guide.
You should be able to export AVI files from your application with code similar to this:
Our integration is supported on all Microsoft Windows Platforms.
In Release 19, the AVI HIO component required the Video For Windows technology which is part of the Windows Platform SDK.