The following code can be used to create a file with one video stream:
// Create the profile manager object
hr = CoCreateInstance(CLSID_ltmmWMProfileManager, NULL, CLSCTX_INPROC_SERVER, IID_IltmmWMProfileManager, (void**) &m_pProfMan);
// create an empty profile
hr = m_pProfMan->CreateEmptyProfile(ltmmWMT_VER_7_0, &m_pProf);
// Set the profile name and description
hr = m_pProf->put_Name(L"Video_Stream_test");
hr = m_pProf->put_Description(L"Example code 1");
// add 1 video stream
// see the complete demo to check the AddVideoStream function code.
hr = AddVideoStream(m_pProfMan, m_pProf, 1, CODEC_VIDEO_WMV1, 200000, 320, 240, 25, 0, 4);
hr = m_pConvert->put_WMProfile(m_pProf);
m_pProf->Release();
m_pProfMan->Release();
//Set the target format
m_pConvert->put_TargetFormat(ltmmConvert_TargetFormat_Asf_Compressor_Mux);
// set the source file name
fname = "Hiway_AV.avi";
bstr = fname.AllocSysString();
m_pConvert->put_SourceFile(bstr);
SysFreeString(bstr);
// set the output file name
fname = "Hiway_V.asf";
bstr = fname.AllocSysString();
m_pConvert->put_TargetFile(bstr);
SysFreeString(bstr);
hr = m_pConvert->StartConvert();
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