The following steps will split a large AVI into 2 smaller files.
C Source
IltmmConvert* pConvert;
CoCreateInstance(&CLSID_ltmmConvert, NULL, CLSCTX_INPROC_SERVER, &IID_IltmmConvert, (void**) &pConvert);
C++ Source
IltmmConvert* pConvert;
CoCreateInstance(CLSID_ltmmConvert, NULL, CLSCTX_INPROC_SERVER, IID_IltmmConvert, (void**) &pConvert);
Note: Pick a compressor when splitting a non-AVI or a non-WAV file to avoid creating two huge uncompressed files.
C Source
BSTR bstr;
bstr = SysAllocString(L"c:\\Source.avi");
IltmmConvert_put_SourceFile(pConvert, bstr);
SysFreeString(bstr);
C++ Source
BSTR bstr;
bstr = SysAllocString(L"c:\\Source.avi");
pConvert->put_SourceFile(bstr);
SysFreeString(bstr);
C Source
double fDur;
IltmmConvert_get_Duration(pConvert, &fDur);
C++ Source
double fDur;
pConvert->get_Duration(&fDur);
C Source
bstr = SysAllocString(L"c:\\Avi1.avi");
IltmmConvert_put_TargetFile(pConvert, bstr);
SysFreeString(bstr);
IltmmConvert_put_SelectionEnd(pConvert, fDur/2);
IltmmConvert_StartConvert(pConvert);
C++ Source
BSTR bstr;
bstr = SysAllocString(L"c:\\Avi1.avi");
pConvert->put_TargetFile(bstr);
SysFreeString(bstr);
pConvert->put_SelectionEnd(fDur/2);
pConvert->StartConvert();
5.Save the second small avi file as follows:
C Source
bstr = SysAllocString(L"c:\\Avi2.avi");
IltmmConvert_put_TargetFile(pConvert, bstr);
SysFreeString(bstr);
IltmmConvert_put_SelectionStart(fDur/2);
IltmmConvert_put_SelectionEnd(pConvert, fDur);
IltmmConvert_StartConvert(pConvert);
C++ Source
bstr = SysAllocString(L"c:\\Avi2.avi");
pConvert->put_TargetFile(bstr);
SysFreeString(bstr);
pConvert->put_SelectionStart(fDur/2);
pConvert->put_SelectionEnd(fDur);
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