Converting Cutlists to Timelines
Microsoft DirectShow 9.0 |
Converting Cutlists to Timelines
This article describes how to convert an existing cutlist application to Microsoft® DirectShow® Editing Services (DES).
Cutlists were a feature in earlier versions of DirectShow that provided limited support for non-linear editing. As of Microsoft® DirectX® 8.0, cutlists are no longer supported. A feature-for-feature conversion to DES should be straightforward to implement. At the very least, you will see the following benefits:
- Support for heterogeneous sources.
- Support for compressed sources.
- Automatic conversion of frame rates.
- Support for stretching video to fill the frame, or to create a letterbox.
- Support for slow- and fast-motion audio and video.
- Better support for audio gaps (silence).
Moving beyond cutlists, you can add features such as project persistence, compositing of multiple tracks, effects, transitions, and poster frames.
A typical cutlist application performs the following steps:
- Create separate cutlists for the video and audio streams (IStandardCutList).
- For each source file, create a video file clip, audio file clip, or both (IFileClip).
- From each file clip, create one or more cuts (IAMCutListElement). Add them to the cutlists.
- Create a cutlist graph builder (ICutListGraphBuilder).
- Add each cutlist to the cutlist graph builder.
- Optionally, set the output file name.
- Render and play the graph.
The equivalent steps in DES are:
- Create a timeline (IAMTimeline).
- For each video and audio stream in the final production, create one group (IAMTimelineGroup).
- Add one or more tracks (IAMTimelineTrack) to each group.
- Create source objects (IAMTimelineSrc) and add them to the tracks.
- Create a render engine (IRenderEngine).
- Add the timeline to the render engine.
- Render and play the graph.
To highlight some of the differences:
File clips: In DES, there is no object equivalent to the file clip. A source object is roughly equivalent to a cut. As with cuts, more than one source object can refer to the same source file.
Media type: With cutlists, there are two distinct file-clip objects for audio and video. Each has its own CLSID. In DES, the group's media type determines the source object's media type.
File output: There is no direct equivalent in DES to the ICutListGraphBuilder::SetOutputFileName method. File output is somewhat more complicated in DES. However, you gain a great deal of control over the format and compression type. For more information, see Writing a Project to a File.
Modifying projects: With cutlists, you can add new cuts, but you cannot modify or remove cuts. With DES, you can add, remove, rearrange, or modify source objects. For more information, see Managing Video Editing Projects.