C Source
IltmmCapture* pCapture;CoCreateInstance(&CLSID_ltmmCapture, NULL, CLSCTX_INPROC_SERVER, &IID_IltmmCapture, (void**)&pCapture);
C++ Source
IltmmCapture* pCapture;CoCreateInstance(CLSID_ltmmCapture, NULL, CLSCTX_INPROC_SERVER, IID_IltmmCapture, (void**) &pCapture);
C Source
IltmmDevices* pDevices;// get an interface into video devices collectionIltmmCapture_get_VideoDevices(pCapture, &pDevices);// select the first video deviceIltmmDevices_put_Selection (pDevices, 0);// release collectionIUnknown_Release(pDevices);
C++ Source
IltmmDevices* pDevices;// get an interface into video devices collectionpCapture->get_VideoDevices(&pDevices);// select devicepDevices->put_Selection(0);// release collectionpDevices->Release();
C Source
BSTR bstr;// create a string containing the target file pathbstr = SysAllocString(L"c:\\target.mpg");// assign the target file path to the capture objectIltmmCapture_put_TargetFile (pCapture, bstr);// free the stringSysFreeString(bstr);
C++ Source
BSTR bstr;// create a string containing the target file pathbstr = SysAllocString(L"c:\\target.mpg");// assign the target file path to the capture objectpCapture->put_TargetFile (bstr);// free the stringSysFreeString(bstr);
C Source
long index;IltmmCompressors* pCompressors;// select the MS MPEG-4 Video CodecIltmmCapture_get_VideoCompressors(pCapture, &pCompressors);bstr = SysAllocString(L"@device:sw:{33D9A760-90C8-11D0-BD43-00A0C911CE86}\\Microsoft MPEG-4 Video Codec V2");IltmmCompressors_Find(pCompressors, bstr, &index);SysFreeString(bstr);if(index >= 0)IltmmCompressors_put_Selection(pCompressors, index);IUnknown_Release(pCompressors);// select the MP3 audio video compressorIltmmCapture_get_AudioCompressors(pCapture, &pCompressors);bstr = SysAllocString(L"@device:cm:{33D9A761-90C8-11D0-BD43-00A0C911CE86}\\85MPEG Layer-3");IltmmCompressors_Find(pCompressors, bstr, &index);SysFreeString(bstr);if(index >= 0)IltmmCompressors_put_Selection(pCompressors, index);IUnknown_Release(pCompressors);
C++ Source
IltmmCompressors* pCompressors;long index;// select the MS MPEG-4 Video CodecpCapture->get_VideoCompressors (&pCompressors);bstr = SysAllocString(L"@device:sw:{33D9A760-90C8-11D0-BD43-00A0C911CE86}\\Microsoft MPEG-4 Video Codec V2");pCompressors->Find (bstr, &index);SysFreeString(bstr);if(index < 0){// compressor isn't registeredpCompressors->Release ();return E_FAIL;}pCompressors->put_Selection (index);pCompressors->Release();// select the MP3 audio video compressorpCapture->get_AudioCompressors (&pCompressors);bstr = SysAllocString(L"@device:cm:{33D9A761-90C8-11D0-BD43-00A0C911CE86}\\85MPEG Layer-3");pCompressors->Find (bstr, &index);SysFreeString(bstr);if(index < 0){// compressor isn't registeredpCompressors->Release ();return E_FAIL;}pCompressors->put_Selection (index);pCompressors->Release();
C Source
IltmmCapture_EditGraph(pCapture); C++ Source
pCapture->EditGraph(); C Source
IltmmTargetFormats* pTargetFormats;IltmmTargetFormat* pTargetFormat;IltmmCapture_get_TargetFormats(pCapture, &pTargetFormats);// retrieve collection itemIltmmTargetFormats_Item(pTargetFormats, 0, &pTargetFormat);// assign the required Mux// this case: AVIbstr = SysAllocString(L"@device:sw:{083863F1-70DE-11D0-BD40-00A0C911CE86}\\{E2510970-F137-11CE-8B67-00AA00A3F1A6}");IltmmTargetFormat_put_Mux(pTargetFormat, bstr);SysFreeString(bstr);// assign the optional SinkSubType// this case: MEDIASUBTYPE_Avibstr = SysAllocString(L"{E436EB88-524F-11CE-9F53-0020AF0BA770}");IltmmTargetFormat_put_SinkSubType(pTargetFormat, bstr);SysFreeString(bstr);// assign an optional Sink// this case: defaultbstr = SysAllocString(L"");IltmmTargetFormat_put_Sink(pTargetFormat, bstr);SysFreeString(bstr);IUnknown_Release(pTargetFormat);
C++ Source
IltmmTargetFormats* pTargetFormats;IltmmTargetFormat* pTargetFormat;pCapture->get_TargetFormats(&pTargetFormats);// retrieve collection itempTargetFormats->Item(0, &pTargetFormat);// assign the required Mux// this case: AVIbstr = SysAllocString(L"@device:sw:{083863F1-70DE-11D0-BD40-00A0C911CE86}\\{E2510970-F137-11CE-8B67-00AA00A3F1A6}");pTargetFormat->put_Mux(bstr);SysFreeString(bstr);// assign the optional SinkSubType// this case: MEDIASUBTYPE_Avibstr = SysAllocString(L"{E436EB88-524F-11CE-9F53-0020AF0BA770}");pTargetFormat->put_SinkSubType(bstr);SysFreeString(bstr);// assign an optional Sink// this case: defaultbstr = SysAllocString(L"");pTargetFormat->put_Sink(bstr);SysFreeString(bstr);pTargetFormat->Release();
C Source
// set rate to 30 fpsIltmmCapture_put_UseFrameRate(pCapture, VARIANT_TRUE);IltmmCapture_put_FrameRate(pCapture, 30.0);// you should check with their particular compressor which frame rates are supported.
C++ Source
// set rate to 30 fpspCapture->put_UseFrameRate(VARIANT_TRUE);pCapture->put_FrameRate(30.0);// you should check with their particular compressor which frame rates are supported.
C Source
// start runningIltmmCapture_StartCapture(pCapture, ltmmCapture_Mode_VideoAndAudio);
C++ Source
// start runningpCapture->StartCapture(ltmmCapture_Mode_VideoAndAudio);
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
