- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是 DirectShow 的新手,正在向我的应用程序添加视频流。我研究了很多解决方案(TouchLess、DirectShow.net 等),最终选择了这个 small project on Code Project 没有太多东西,这就是我选择它的原因;我想要一个小的代码库来使用,因为我需要快速实现这个功能。
经过一整天的阅读、试验和调试,我终于让一切正常运行。有一个延迟,这是一个无赖,但我可以稍后再担心。此时我遇到的问题是 the camera is capable of 1280X720 并且我想使用此分辨率。然而,它似乎决心以 640x480 进行捕获。随着我越来越深入地学习如何设置分辨率,我终于想我已经弄清楚了。我还在代码项目页面的评论中找到了作为基础的代码。
经过 6 个小时的尝试,我无法让这台相机更改其分辨率。我没有收到任何错误,从 SetFormat() 返回的 HRESULT 为 0,但相机不会改变分辨率。
粘贴所有内容的代码太多,但我想包括构建图表的部分,因为我认为这就是问题所在。
这是设置图形的代码
void CameraMethods::StartCamera(int camIndex, interior_ptr<int> width,
interior_ptr<int> height)
{
if (g_pGraphBuilder != NULL)
throw gcnew ArgumentException("Graph Builder was null");
IMoniker *pMoniker = GetMoniker(camIndex);
pMoniker->AddRef();
HRESULT hr = S_OK;
// Build all the necessary interfaces to start the capture
if (SUCCEEDED(hr))
{
hr = CoCreateInstance(CLSID_FilterGraph,
NULL,
CLSCTX_INPROC,
IID_IGraphBuilder,
(LPVOID*)&g_pGraphBuilder);
}
if (SUCCEEDED(hr))
hr = g_pGraphBuilder->QueryInterface(IID_IMediaControl, (LPVOID*)&g_pMediaControl);
if (SUCCEEDED(hr))
{
hr = CoCreateInstance(CLSID_CaptureGraphBuilder2,
NULL,
CLSCTX_INPROC,
IID_ICaptureGraphBuilder2,
(LPVOID*)&g_pCaptureGraphBuilder);
}
// Setup the filter graph
if (SUCCEEDED(hr))
hr = g_pCaptureGraphBuilder->SetFiltergraph(g_pGraphBuilder);
// Build the camera from the moniker
if (SUCCEEDED(hr))
hr = pMoniker->BindToObject(NULL, NULL, IID_IBaseFilter, (LPVOID*)&g_pIBaseFilterCam);
// Add the camera to the filter graph
if (SUCCEEDED(hr))
hr = g_pGraphBuilder->AddFilter(g_pIBaseFilterCam, L"WebCam");
// Create a SampleGrabber
if (SUCCEEDED(hr))
hr = CoCreateInstance(CLSID_SampleGrabber, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter,
(void**)&g_pIBaseFilterSampleGrabber);
// Configure the Sample Grabber
if (SUCCEEDED(hr))
hr = ConfigureSampleGrabber(g_pIBaseFilterSampleGrabber);
// Set the resolution - I have NO idea where this should be executed
SetCaptureFormat(camIndex, *width, *height);
// Add Sample Grabber to the filter graph
if (SUCCEEDED(hr))
hr = g_pGraphBuilder->AddFilter(g_pIBaseFilterSampleGrabber, L"SampleGrabber");
// Create the NullRender
if (SUCCEEDED(hr))
hr = CoCreateInstance(CLSID_NullRenderer, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter,
(void**)&g_pIBaseFilterNullRenderer);
// Add the Null Render to the filter graph
if (SUCCEEDED(hr))
hr = g_pGraphBuilder->AddFilter(g_pIBaseFilterNullRenderer, L"NullRenderer");
// Configure the render stream
if (SUCCEEDED(hr))
hr = g_pCaptureGraphBuilder->RenderStream(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video,
g_pIBaseFilterCam, g_pIBaseFilterSampleGrabber, g_pIBaseFilterNullRenderer);
// Grab the capture width and height
if (SUCCEEDED(hr))
{
ISampleGrabber* pGrabber = NULL;
hr = g_pIBaseFilterSampleGrabber->QueryInterface(IID_ISampleGrabber, (LPVOID*)&pGrabber);
if (SUCCEEDED(hr))
{
AM_MEDIA_TYPE mt;
hr = pGrabber->GetConnectedMediaType(&mt);
if (SUCCEEDED(hr))
{
VIDEOINFOHEADER *pVih;
if ((mt.formattype == FORMAT_VideoInfo) &&
(mt.cbFormat >= sizeof(VIDEOINFOHEADER)) &&
(mt.pbFormat != NULL) )
{
pVih = (VIDEOINFOHEADER*)mt.pbFormat;
*width = pVih->bmiHeader.biWidth;
*height = pVih->bmiHeader.biHeight;
}
else
{
hr = E_FAIL; // Wrong format
}
// FreeMediaType(mt); (from MSDN)
if (mt.cbFormat != 0)
{
CoTaskMemFree((PVOID)mt.pbFormat);
mt.cbFormat = 0;
mt.pbFormat = NULL;
}
if (mt.pUnk != NULL)
{
// Unecessary because pUnk should not be used, but safest.
mt.pUnk->Release();
mt.pUnk = NULL;
}
}
}
if (pGrabber != NULL)
{
pGrabber->Release();
pGrabber = NULL;
}
}
// Start the capture
if (SUCCEEDED(hr))
hr = g_pMediaControl->Run();
// If init fails then ensure that you cleanup
if (FAILED(hr))
StopCamera();
else
hr = S_OK; // Make sure we return S_OK for success
// Cleanup
if (pMoniker != NULL)
{
pMoniker->Release();
pMoniker = NULL;
}
if (SUCCEEDED(hr))
this->activeCameraIndex = camIndex;
else
throw gcnew COMException("Error Starting Camera", hr);
}
HRESULT CameraMethods::ConfigureSampleGrabber(IBaseFilter *pIBaseFilter)
{
HRESULT hr = S_OK;
ISampleGrabber *pGrabber = NULL;
hr = pIBaseFilter->QueryInterface(IID_ISampleGrabber, (void**)&pGrabber);
if (SUCCEEDED(hr))
{
AM_MEDIA_TYPE mt;
ZeroMemory(&mt, sizeof(AM_MEDIA_TYPE));
mt.majortype = MEDIATYPE_Video;
mt.subtype = MEDIASUBTYPE_RGB24;
mt.formattype = FORMAT_VideoInfo;
hr = pGrabber->SetMediaType(&mt);
}
if (SUCCEEDED(hr))
hr = pGrabber->SetCallback(new SampleGrabberCB(), 1);
if (pGrabber != NULL)
{
pGrabber->Release();
pGrabber = NULL;
}
return hr;
}
void CameraMethods::SetCaptureFormat(int camIndex, int width, int height)
{
HRESULT hr = S_OK;
IMoniker* pMoniker = GetMoniker(camIndex);
IBaseFilter* pCap;
hr=pMoniker->BindToObject(0,0,IID_IBaseFilter,(void **)&pCap);
if(!SUCCEEDED(hr))
return;
IAMStreamConfig *pConfig = NULL;
if(g_pCaptureGraphBuilder == NULL) // no CaptureGraphBuilder initialised
return;
hr = g_pCaptureGraphBuilder->FindInterface(
&PIN_CATEGORY_CAPTURE, // Preview pin.
0, // Any media type.
pCap, // Pointer to the capture filter.
IID_IAMStreamConfig, (void**)&pConfig);
if(!SUCCEEDED(hr))
return;
int iCount = 0, iSize = 0;
hr = pConfig->GetNumberOfCapabilities(&iCount, &iSize);
// Check the size to make sure we pass in the correct structure.
if (iSize == sizeof(VIDEO_STREAM_CONFIG_CAPS)) {
// Use the video capabilities structure.
for (int iFormat = 0; iFormat < iCount; iFormat++)
{
VIDEO_STREAM_CONFIG_CAPS scc;
AM_MEDIA_TYPE *pmt;
/* Note: Use of the VIDEO_STREAM_CONFIG_CAPS structure to configure a video device is
deprecated. Although the caller must allocate the buffer, it should ignore the
contents after the method returns. The capture device will return its supported
formats through the pmt parameter. */
hr = pConfig->GetStreamCaps(iFormat, &pmt, (BYTE*)&scc);
if (SUCCEEDED(hr))
{
/* Examine the format, and possibly use it. */
if (pmt->formattype == FORMAT_VideoInfo) {
// Check the buffer size.
if (pmt->cbFormat >= sizeof(VIDEOINFOHEADER))
{
VIDEOINFOHEADER *pVih = reinterpret_cast<VIDEOINFOHEADER*>(pmt->pbFormat);
BITMAPINFOHEADER *bmiHeader = &pVih->bmiHeader;
/* Access VIDEOINFOHEADER members through pVih. */
if( bmiHeader->biWidth == width && bmiHeader->biHeight == height &&
bmiHeader->biBitCount == 24)
{
hr = pConfig->SetFormat(pmt);
}
}
}
// Delete the media type when you are done.
DeleteMediaType(pmt);
}
}
}
}
--------------------------------------------------
Filters
--------------------------------------------------
1. Smart Tee
2. MJPEG Decompressor
3. SampleGrabber
4. NullRenderer
5. WebCam
--------------------------------------------------
Connections
--------------------------------------------------
1. [Smart Tee]/(Capture) -> [MJPEG Decompressor]/(XForm In)
Major: MEDIATYPE_Video
Subtype: MEDIASUBTYPE_MJPG
bFixedSizeSamples: TRUE
bTemporalCompression: FALSE
lSampleSize: 921600
cbFormat: 88
Format: FORMAT_VideoInfo
VIDEOINFOHEADER:
rcSource: (0,0,0,0)
rcTarget: (0,0,0,0)
dwBitRate: 221184000
dwBitErrorRate: 0
AvgTimePerFrame: 333333
BITMAPINFOHEADER:
biSize: 40
biWidth: 640
biHeight: 480
biPlanes: 1
biBitCount: 24
biCompression: 0x47504A4D
biSizeImage: 921600
biXPelsPerMeter: 0
biYPelsPerMeter: 0
biClrUsed: 0
biClrImportant: 0
2. [MJPEG Decompressor]/(XForm Out) -> [SampleGrabber]/(Input)
Major: MEDIATYPE_Video
Subtype: MEDIASUBTYPE_RGB24
bFixedSizeSamples: TRUE
bTemporalCompression: FALSE
lSampleSize: 921600
cbFormat: 88
Format: FORMAT_VideoInfo
VIDEOINFOHEADER:
rcSource: (0,0,0,0)
rcTarget: (0,0,0,0)
dwBitRate: 221184221
dwBitErrorRate: 0
AvgTimePerFrame: 333333
BITMAPINFOHEADER:
biSize: 40
biWidth: 640
biHeight: 480
biPlanes: 1
biBitCount: 24
biCompression: 0x00000000
biSizeImage: 921600
biXPelsPerMeter: 0
biYPelsPerMeter: 0
biClrUsed: 0
biClrImportant: 0
3. [SampleGrabber]/(Output) -> [NullRenderer]/(In)
Major: MEDIATYPE_Video
Subtype: MEDIASUBTYPE_RGB24
bFixedSizeSamples: TRUE
bTemporalCompression: FALSE
lSampleSize: 921600
cbFormat: 88
Format: FORMAT_VideoInfo
VIDEOINFOHEADER:
rcSource: (0,0,0,0)
rcTarget: (0,0,0,0)
dwBitRate: 221184221
dwBitErrorRate: 0
AvgTimePerFrame: 333333
BITMAPINFOHEADER:
biSize: 40
biWidth: 640
biHeight: 480
biPlanes: 1
biBitCount: 24
biCompression: 0x00000000
biSizeImage: 921600
biXPelsPerMeter: 0
biYPelsPerMeter: 0
biClrUsed: 0
biClrImportant: 0
4. [WebCam]/(Capture) -> [Smart Tee]/(Input)
Major: MEDIATYPE_Video
Subtype: MEDIASUBTYPE_MJPG
bFixedSizeSamples: TRUE
bTemporalCompression: FALSE
lSampleSize: 921600
cbFormat: 88
Format: FORMAT_VideoInfo
VIDEOINFOHEADER:
rcSource: (0,0,0,0)
rcTarget: (0,0,0,0)
dwBitRate: 221184000
dwBitErrorRate: 0
AvgTimePerFrame: 333333
BITMAPINFOHEADER:
biSize: 40
biWidth: 640
biHeight: 480
biPlanes: 1
biBitCount: 24
biCompression: 0x47504A4D
biSizeImage: 921600
biXPelsPerMeter: 0
biYPelsPerMeter: 0
biClrUsed: 0
biClrImportant: 0
Dump Version: 1.2
Using device: Microsoft® LifeCam Studio(TM)
Interface: USB
Pin Name: Capture
Pin direction: Output
Pin category: Capture
IAMVideoCompression: No
ISpecifyPropertyPages: Yes
IMediaSeeking: Yes
IPinConnection: No
IPinFlowControl: No
IAMDroppedFrames: No
IAMVideoProcAmp: No
IAMVideoControlCaps: 0
Major Type Sub Type Format Type FixedSamples Temporal Compression Sample Size Max Input Size Min Output Size Max Output Size Min-Max FPS Video Standard
Video YUY2 VideoInfo Fixed NotTemporal 614400 640x480 640x480 640x480 7.50-30.00 {none}
Video YUY2 VideoInfo2 Fixed NotTemporal 614400 640x480 640x480 640x480 7.50-30.00 {none}
Video YUY2 VideoInfo Fixed NotTemporal 1843200 1280x720 1280x720 1280x720 7.50-10.00 {none}
Video YUY2 VideoInfo2 Fixed NotTemporal 1843200 1280x720 1280x720 1280x720 7.50-10.00 {none}
Video YUY2 VideoInfo Fixed NotTemporal 1044480 960x544 960x544 960x544 7.50-20.00 {none}
Video YUY2 VideoInfo2 Fixed NotTemporal 1044480 960x544 960x544 960x544 7.50-20.00 {none}
Video YUY2 VideoInfo Fixed NotTemporal 716800 800x448 800x448 800x448 7.50-30.00 {none}
Video YUY2 VideoInfo2 Fixed NotTemporal 716800 800x448 800x448 800x448 7.50-30.00 {none}
Video YUY2 VideoInfo Fixed NotTemporal 460800 640x360 640x360 640x360 7.50-30.00 {none}
Video YUY2 VideoInfo2 Fixed NotTemporal 460800 640x360 640x360 640x360 7.50-30.00 {none}
Video YUY2 VideoInfo Fixed NotTemporal 203520 424x240 424x240 424x240 7.50-30.00 {none}
Video YUY2 VideoInfo2 Fixed NotTemporal 203520 424x240 424x240 424x240 7.50-30.00 {none}
Video YUY2 VideoInfo Fixed NotTemporal 202752 352x288 352x288 352x288 7.50-30.00 {none}
Video YUY2 VideoInfo2 Fixed NotTemporal 202752 352x288 352x288 352x288 7.50-30.00 {none}
Video YUY2 VideoInfo Fixed NotTemporal 153600 320x240 320x240 320x240 7.50-30.00 {none}
Video YUY2 VideoInfo2 Fixed NotTemporal 153600 320x240 320x240 320x240 7.50-30.00 {none}
Video YUY2 VideoInfo Fixed NotTemporal 960000 800x600 800x600 800x600 7.50-20.00 {none}
Video YUY2 VideoInfo2 Fixed NotTemporal 960000 800x600 800x600 800x600 7.50-20.00 {none}
Video YUY2 VideoInfo Fixed NotTemporal 50688 176x144 176x144 176x144 7.50-30.00 {none}
Video YUY2 VideoInfo2 Fixed NotTemporal 50688 176x144 176x144 176x144 7.50-30.00 {none}
Video YUY2 VideoInfo Fixed NotTemporal 38400 160x120 160x120 160x120 7.50-30.00 {none}
Video YUY2 VideoInfo2 Fixed NotTemporal 38400 160x120 160x120 160x120 7.50-30.00 {none}
Video YUY2 VideoInfo Fixed NotTemporal 4147200 1920x1080 1920x1080 1920x1080 5.00-5.00 {none}
Video YUY2 VideoInfo2 Fixed NotTemporal 4147200 1920x1080 1920x1080 1920x1080 5.00-5.00 {none}
Video MJPG VideoInfo Fixed NotTemporal 921600 640x480 640x480 640x480 7.50-30.00 {none}
Video MJPG VideoInfo2 Fixed NotTemporal 921600 640x480 640x480 640x480 7.50-30.00 {none}
Video MJPG VideoInfo Fixed NotTemporal 6220800 1920x1080 1920x1080 1920x1080 7.50-30.00 {none}
Video MJPG VideoInfo2 Fixed NotTemporal 6220800 1920x1080 1920x1080 1920x1080 7.50-30.00 {none}
Video MJPG VideoInfo Fixed NotTemporal 2764800 1280x720 1280x720 1280x720 7.50-30.00 {none}
Video MJPG VideoInfo2 Fixed NotTemporal 2764800 1280x720 1280x720 1280x720 7.50-30.00 {none}
Video MJPG VideoInfo Fixed NotTemporal 1566720 960x544 960x544 960x544 7.50-30.00 {none}
Video MJPG VideoInfo2 Fixed NotTemporal 1566720 960x544 960x544 960x544 7.50-30.00 {none}
Video MJPG VideoInfo Fixed NotTemporal 1075200 800x448 800x448 800x448 7.50-30.00 {none}
Video MJPG VideoInfo2 Fixed NotTemporal 1075200 800x448 800x448 800x448 7.50-30.00 {none}
Video MJPG VideoInfo Fixed NotTemporal 691200 640x360 640x360 640x360 7.50-30.00 {none}
Video MJPG VideoInfo2 Fixed NotTemporal 691200 640x360 640x360 640x360 7.50-30.00 {none}
Video MJPG VideoInfo Fixed NotTemporal 1440000 800x600 800x600 800x600 7.50-30.00 {none}
Video MJPG VideoInfo2 Fixed NotTemporal 1440000 800x600 800x600 800x600 7.50-30.00 {none}
Video MJPG VideoInfo Fixed NotTemporal 311040 432x240 432x240 432x240 7.50-30.00 {none}
Video MJPG VideoInfo2 Fixed NotTemporal 311040 432x240 432x240 432x240 7.50-30.00 {none}
Video MJPG VideoInfo Fixed NotTemporal 304128 352x288 352x288 352x288 7.50-30.00 {none}
Video MJPG VideoInfo2 Fixed NotTemporal 304128 352x288 352x288 352x288 7.50-30.00 {none}
Video MJPG VideoInfo Fixed NotTemporal 76032 176x144 176x144 176x144 7.50-30.00 {none}
Video MJPG VideoInfo2 Fixed NotTemporal 76032 176x144 176x144 176x144 7.50-30.00 {none}
Video MJPG VideoInfo Fixed NotTemporal 230400 320x240 320x240 320x240 7.50-30.00 {none}
Video MJPG VideoInfo2 Fixed NotTemporal 230400 320x240 320x240 320x240 7.50-30.00 {none}
Video MJPG VideoInfo Fixed NotTemporal 57600 160x120 160x120 160x120 7.50-30.00 {none}
Video MJPG VideoInfo2 Fixed NotTemporal 57600 160x120 160x120 160x120 7.50-30.00 {none}
Video {3032344D-0000-0010-8000-00AA00389B71} VideoInfo Fixed NotTemporal 460800 640x480 640x480 640x480 7.50-30.00 {none}
Video {3032344D-0000-0010-8000-00AA00389B71} VideoInfo2 Fixed NotTemporal 460800 640x480 640x480 640x480 7.50-30.00 {none}
Video {3032344D-0000-0010-8000-00AA00389B71} VideoInfo Fixed NotTemporal 1382400 1280x720 1280x720 1280x720 7.50-15.00 {none}
Video {3032344D-0000-0010-8000-00AA00389B71} VideoInfo2 Fixed NotTemporal 1382400 1280x720 1280x720 1280x720 7.50-15.00 {none}
Video {3032344D-0000-0010-8000-00AA00389B71} VideoInfo Fixed NotTemporal 783360 960x544 960x544 960x544 7.50-30.00 {none}
Video {3032344D-0000-0010-8000-00AA00389B71} VideoInfo2 Fixed NotTemporal 783360 960x544 960x544 960x544 7.50-30.00 {none}
Video {3032344D-0000-0010-8000-00AA00389B71} VideoInfo Fixed NotTemporal 537600 800x448 800x448 800x448 7.50-30.00 {none}
Video {3032344D-0000-0010-8000-00AA00389B71} VideoInfo2 Fixed NotTemporal 537600 800x448 800x448 800x448 7.50-30.00 {none}
Video {3032344D-0000-0010-8000-00AA00389B71} VideoInfo Fixed NotTemporal 345600 640x360 640x360 640x360 7.50-30.00 {none}
Video {3032344D-0000-0010-8000-00AA00389B71} VideoInfo2 Fixed NotTemporal 345600 640x360 640x360 640x360 7.50-30.00 {none}
Video {3032344D-0000-0010-8000-00AA00389B71} VideoInfo Fixed NotTemporal 152640 424x240 424x240 424x240 7.50-30.00 {none}
Video {3032344D-0000-0010-8000-00AA00389B71} VideoInfo2 Fixed NotTemporal 152640 424x240 424x240 424x240 7.50-30.00 {none}
Video {3032344D-0000-0010-8000-00AA00389B71} VideoInfo Fixed NotTemporal 152064 352x288 352x288 352x288 7.50-30.00 {none}
Video {3032344D-0000-0010-8000-00AA00389B71} VideoInfo2 Fixed NotTemporal 152064 352x288 352x288 352x288 7.50-30.00 {none}
Video {3032344D-0000-0010-8000-00AA00389B71} VideoInfo Fixed NotTemporal 115200 320x240 320x240 320x240 7.50-30.00 {none}
Video {3032344D-0000-0010-8000-00AA00389B71} VideoInfo2 Fixed NotTemporal 115200 320x240 320x240 320x240 7.50-30.00 {none}
Video {3032344D-0000-0010-8000-00AA00389B71} VideoInfo Fixed NotTemporal 720000 800x600 800x600 800x600 7.50-30.00 {none}
Video {3032344D-0000-0010-8000-00AA00389B71} VideoInfo2 Fixed NotTemporal 720000 800x600 800x600 800x600 7.50-30.00 {none}
Video {3032344D-0000-0010-8000-00AA00389B71} VideoInfo Fixed NotTemporal 38016 176x144 176x144 176x144 7.50-30.00 {none}
Video {3032344D-0000-0010-8000-00AA00389B71} VideoInfo2 Fixed NotTemporal 38016 176x144 176x144 176x144 7.50-30.00 {none}
Video {3032344D-0000-0010-8000-00AA00389B71} VideoInfo Fixed NotTemporal 28800 160x120 160x120 160x120 7.50-30.00 {none}
Video {3032344D-0000-0010-8000-00AA00389B71} VideoInfo2 Fixed NotTemporal 28800 160x120 160x120 160x120 7.50-30.00 {none}
Video {3032344D-0000-0010-8000-00AA00389B71} VideoInfo Fixed NotTemporal 3110400 1920x1080 1920x1080 1920x1080 7.50-7.50 {none}
Video {3032344D-0000-0010-8000-00AA00389B71} VideoInfo2 Fixed NotTemporal 3110400 1920x1080 1920x1080 1920x1080 7.50-7.50 {none}
Pin Name: Video Camera Terminal
Pin direction: Input
Pin category: {3EBC7959-3310-493B-AA81-C7E132D56F71}
IAMVideoCompression: No
ISpecifyPropertyPages: Yes
IMediaSeeking: No
IPinConnection: No
IPinFlowControl: No
IAMDroppedFrames: No
IAMVideoProcAmp: No
IAMVideoControlCaps: 0
Major Type Sub Type Format Type FixedSamples Temporal Compression Sample Size
最佳答案
您将它放在正确的位置 - 在 AddFilter 已经在图形中之后,但在其输出引脚连接之前。如果您的 HRESULT 成功,那么您可能期望更改格式,但可能会有异常(exception),例如下游过滤器不接受此媒体类型,他们从一开始就开始协商。
您没有在此处显示您的 ConfigureSampleGrabber,因此可能是您想要的这种媒体类型不被用于制作过滤器图的样本采集器接受以尝试替代媒体类型和/或中间过滤器(例如解码器)。
您实际上可以做一些事情。
关于directshow - 无法使 IAMStreamConfig.SetFormat() 与 LifeCam Studio 一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7383372/
我目前正在处理 Windows Media Foundation。但是,由于 Microsoft H.264 解码器的一些问题和一些缺少自定义格式的解码器,我想知道是否可以直接使用 CLSID 实例化
IMediaEvent 和 IMediaEventEx 没有说明图中哪个过滤器发送了检索到的 DirectShow 事件。有什么办法可以找到这些信息。特别是对于图中的过滤器之一发送 EC_ERRORA
我已经阅读了 DirectShow 上的 MSDN 文档,但它仍然令人困惑。我觉得我需要更多关于对象的上下文:图形、图钉、过滤器...等。谷歌搜索并没有给我太多的工作。我需要什么才能理解 Direct
正如我刚刚发现的那样,友好的名称不能保证是唯一的。如果我可以从该标识符实例化过滤器而无需枚举它们,则可加分。 最佳答案 可以通过 WaveOutId 识别包装 WaveOut 设备的渲染器过滤器。那些
我想捕获当前帧及其前一帧以进行分析并生成一个新帧来显示。是说我必须写一个变换DirectShow过滤器吗?但我是 DirectShow 的新手。我被MSDN的大量文档弄糊涂了。所以我想知道是否有任何简
enter code here我必须动态停止和启动 Video Renderer Filter。在不创建新图表的情况下,使用“普通”直接展示架构是不可能的。但是使用 GMFBridge 似乎是可能的。
在网上搜索了几个小时后,我非常想找到解决方案。我已经在 DirectShow 中启动并运行 OGG Theora 解码器,它输出 YV12 和 YUY2 颜色模型。 现在,我想为这个输出制作一个 RG
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引起辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the he
长篇故事: 有一个 H264/MPEG-4 源 我可以用 RTSP 协议(protocol)连接这个源。 我可以使用 RTP 协议(protocol)获取原始 UDP 数据包。 然后将这些原始 UDP
这可能是一个愚蠢的问题,但我很难概念化我需要在这里做什么......过去我使用 DirectShow 连接到相机并使用源过滤器捕获 AVI,AVI多路复用器、压缩过滤器、运行图表等……小菜一碟。在这种
我有一些自定义 DirectShow 过滤器(用于编码/解码/多路复用/多路分离)。 我想在 Media Foundation 上将它们用作 MFT。 我听过一些人说: “微软声称所有 DirectS
我做了一个简单的图表来编写 MKV 文件。但我不想使用文件编写器。我想使用 SampleGabber 并使用简单的程序获取流。问题是我从 Matroska muxer 以外的任何地方获取数据!(我该怎
我正在使用使用 DirectShow 库的 WPF 应用程序,它可以很好地抓取图像或记录实时提要,但我希望最终用户不应该看到任何网络摄像头正在拍照,即我想要用户不应看到正在呈现来自网络摄像头的提要的图
我应该写一个直接显示过滤器 从实时源获取输入(视频、音频)。 它应该将数据(视频,音频:已编码)提供给解码器过滤器 MyCustomDirectShowSourceFilter ---> Decode
我在从 DirectShow 筛选器图表编辑器连接到远程图表时遇到问题。当我运行创建直接显示图形的应用程序时,在我的 Windows XP 计算机上,图形显示在远程图形列表中,但在 Windows 7
什么是微软的 DirectShow ,以及它与以下内容有何关系: 编解码器? 容器? 编解码器和容器之间的确切区别是什么? 最佳答案 用简单的英语: 编解码器是一种算法和/或代码,可将音频或视频从 R
我开发了一个使用 DirectShow 从外部设备捕获视频的 Windows 应用程序。图像分辨率为 640x480,未经压缩保存的视频尺寸非常大(大约每秒 27MB)。 我的目标是尽可能地减小这个大
我正在尝试用 C# 制作一个允许用户录制视频的网络摄像头应用程序。我一直在使用 DirectShow.Net 来预览网络摄像头并拍摄快照。但需要能够在预览网络摄像头的同时捕捉视频和音频。我尝试过的一件
我已经找了很长时间,但是找不到解决方案。 如何从USB(符合Directshow规范)输入设备捕获音频并直接传递到PC扬声器(“音频渲染器”)? 我相信这不是一项艰巨的任务,但是我确实在网络上找不到任
我正在从我的应用程序执行 VLC 以从 DirectShow 音频捕获设备捕获和编码。 VLC 通过 STDOUT 将编码数据发送到我的应用程序。我需要一种枚举 DirectShow 音频捕获设备的方
我是一名优秀的程序员,十分优秀!