This example shows how to access the ltmmWMScript object, using it to create script commands when converting to WMV video.
Set the convert source, target and target format as follows:
IltmmConvert_put_SourceFile(pConvert, L"source.avi");
IltmmConvert_put_TargetFile(pConvert, L"target.wmv");
IltmmConvert_put_TargetFormat(pConvert, ltmmConvert_TargetFormat_WMV_Mux);
pConvert->put_SourceFile(L"source.avi");
pConvert->put_TargetFile(L"target.wmv");
pConvert->put_TargetFormat(ltmmConvert_TargetFormat_WMV_Mux);
Call the convert object to retrieve the target filter as follows:
IUnknown *pUnk;
IltmmConvert_GetSubObject(pConvert, ltmmConvert_Object_TargetFilter, &pUnk);
IUnknown *pUnk;
pConvert->GetSubObject(ltmmConvert_Object_TargetFilter, &pUnk);
Retrieve the ltmmWMScript interface as follows:
IltmmWMScript *pWMScript;
IUnknown_QueryInterface(pUnk, &IID_IltmmWMScript, (void**)&pWMScript);
IUnknown_Release(pUnk);
IltmmWMScript *pWMScript;
pUnk->QueryInterface(&IID_IltmmWMScript, (void**)&pWMScript);
pUnk->Release();
Add a header script at 5.0 seconds as follows:
IltmmWMScript_AddHeaderScript(pWMScript, L"caption", L"Test Caption", 5.0);
pWMScript->AddHeaderScript(L"caption", L"Test Caption", 5.0);
Clean up the ltmmWMScript object as follows:
IUnknown_Release(pWMScript);
pWMScript->Release();
Start the conversion as follows:
IltmmConvert_StartConvert(pConvert)
pConvert->StartConvert();
To see how to handle script commands during playback, see Processing Script Commands During Windows Media Video Playback.
Language | Example |
---|---|
C | IltmmWMScript HeaderScripts |
C++ | IltmmWMScript HeaderScripts |
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
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.