This example shows how to access the ltmmWMScript object, using it to create script commands when converting to WMV video.
C Source
IltmmConvert_put_SourceFile(pConvert, L"source.avi");
IltmmConvert_put_TargetFile(pConvert, L"target.wmv");
IltmmConvert_put_TargetFormat(pConvert, ltmmConvert_TargetFormat_WMV_Mux);
C++ Source
pConvert->put_SourceFile(L"source.avi");
pConvert->put_TargetFile(L"target.wmv");
pConvert->put_TargetFormat(ltmmConvert_TargetFormat_WMV_Mux);
C Source
IUnknown *pUnk;
IltmmConvert_GetSubObject(pConvert, ltmmConvert_Object_TargetFilter, &pUnk);
C++ Source
IUnknown *pUnk;
pConvert->GetSubObject(ltmmConvert_Object_TargetFilter, &pUnk);
C Source
IltmmWMScript *pWMScript;
IUnknown_QueryInterface(pUnk, &IID_IltmmWMScript, (void**)&pWMScript);
IUnknown_Release(pUnk);
C++ Source
IltmmWMScript *pWMScript;
pUnk->QueryInterface(&IID_IltmmWMScript, (void**)&pWMScript);
pUnk->Release();
C Source
IltmmWMScript_AddHeaderScript(pWMScript, L"caption", L"Test Caption", 5.0);
C++ Source
pWMScript->AddHeaderScript(L"caption", L"Test Caption", 5.0);
C Source
IUnknown_Release(pWMScript);
C++ Source
pWMScript->Release();
6.Start the conversion as follows:
C Source
IltmmConvert_StartConvert(pConvert)
C++ Source
pConvert->StartConvert();
For the complete C example, refer to IltmmWMScript HeaderScripts Example for C.
For the complete C++ example, refer to IltmmWMScript HeaderScripts Example for C++.
To see how to handle script commands during playback, see Processing Script Commands During Windows Media Video Playback.
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document