Microsoft DirectX 9.0

XTLTest Sample

Description

The XTLTest sample is a command-line tool for rendering and previewing video editing projects. This tool renders DirectShow Editing Services (DES) project files.

To enable ASF support in this application, link the project to a Microsoft® Windows Media™ Format (WMF) SDK certificate and define USE_WMF_CERT when you compile the application. See the WMF SDK documentation for instructions on obtaining a certificate.

The DirectShow SDK includes several sample project files. These are located in the Samples\Media folder, and have the file name extension .xtl.

Note   This application requires Internet Explorer 4.0 or later. If it is not present, the application displays the following error message: Unexpected error - DShow not installed correctly. For more information, see IXml2Dex.

Path

Source: (SDK root)\Samples\C++\DirectShow\Editing\Xtltest

User's Guide

This sample application demonstrates the following tasks related to video editing:

Usage

xtltest.exe [switches] input.xtl

By default, the application previews the project. The following command-line switches are supported.

Switch Description
/C No clock. Render the project as quickly as possible, without synchronizing audio and video.
/D Load source files dynamically. For more information, see IRenderEngine::SetDynamicReconnectLevel.
/[double-double] Set the rendering start and stop times. For example, /[3-4] renders one second of the timeline, starting 3 seconds into the project.
/G filename.grf Output a GraphEdit file in .grf format.
/N No rendering. The project is not previewed or rendered to a file. This option is useful for validating the input file, or with the /G switch.
/P [number] Choose an ASF compression profile. Available only if the application is compiled with a WMF SDK certificate.
/P List available ASF profiles. Available only if the application is compiled with a WMF SDK certificate.
/R Activate smart recompression. The application uses the first clip in the timeline for the compression format. Use the /W switch with this option. For more information, see About the Render Engines.
/W filename Render the timeline to a file. The file type is determined by the file extension. The application supports AVI and WAV files. If the application is compiled with a WMF SDK certificate, it also supports ASF files. This option suppresses preview.
/X filename.xtl Save the project as an XML file. The new file is functionally identical to the input file, although the XML tags may differ.

Programming Notes

This sample demonstrates all of the steps required to read an XML project file, and then preview it or output it to a file.

For smart recompression, the application uses the format of the first non-muted source in the timeline. (It will fail if the first souce is an audio file.) The GetFirstSourceOnTimeline function retrieves the first non-muted source. This function demonstrates how to traverse the objects in a timeline. The GetSourceVideoType function retrieves the media type of the first video stream in a source. The application uses this media type when it calls IAMTimelineGroup::SetSmartRecompressFormat to set the recompression format. For more information, see Rendering a Project.

To handle error logging, the application defines a custom class, CErrorReporter. The class exposes the IAMErrorLog interface; however, it is not a true COM object, because it does not correctly handle reference counting. Therefore, the application must create it statically. For more information, see Logging Errors.

If USE_WMF_CERT is defined, the application includes support for writing WMF files. The CKeyProvider class implements the IServiceProvider interface. It calls the WMCreateCertificate function to create the WMF certificates. The helper function ListWMSDKProfiles lists the standard profiles that the WMF SDK provides. For more information, see Windows Media Applications and the Windows Media Format SDK.

Note   If you install the Windows Media 9 Series Format SDK, make sure to compile the DirectX 9.0 version of this sample. Earlier versions of this sample are not compatible with the Windows Media 9 Series Format SDK.

See Also