本文介绍了DirectShow-IAMStreamConfig :: SetFormat和ICaptureGraphBuilder2 :: RenderStream的调用顺序在某些摄像机中产生了问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须先配置摄像机的显示分辨率,然后再捕获和处理数据。最初,我是按照以下步骤进行的。

I have to configure my video camera display resolution before capturing and processing the data. Initially I did it as follows.


  1. 创建了所有必要的接口。

  1. Created all necessary interfaces.

添加了相机和渲染器滤镜

Added camera and renderer filters

RenderStream具有捕获和预览PIN类别。

Did RenderStream with Capture and Preview PIN Categories.

然后遍历AM_MEDIA_TYPE结构并设置参数。

Then did the looping through AM_MEDIA_TYPE structures and setting the params.

这适用于很多相机,但有几个相机出现故障。然后,我更改了上面给出的3和4的顺序。也就是说,我在RenderStream之前设置了参数。这次,发生了错误情况,但是SONY VAIO笔记本电脑等中的一些机载相机似乎出现故障。

This worked for a lot of cameras, but a few cameras failed. Then I changed the order of 3 and 4 given above. That is, I did the setting of params before the RenderStream. This time, the error cases went through, but a few On board cameras in SONY VAIO laptop etc seem to fail.

现在,我的问题是


  1. 哪个是最优的获取和设置AM_MEDIA_TYPE参数并运行图形的正确方法?

  1. Which is the optimal and correct method of getting and setting AM_MEDIA_TYPE parameters and running the graph?

如果有不同的摄像头,是否可以指示哪种顺序最适合通过相机的DirectShow界面访问特定的相机,这也将达到我的目的。

If there are different cameras, if I get an indication of which order is the best for a particular camera by going through the camera's DirectShow interfaces, that will also serve my purpose.

请在此帮助我最早的

感谢和问候,

Shiju

推荐答案

IAMStreamConfig :: SetFormat 需要用于在连接和渲染引脚之前设置捕获格式。这样,过滤器的下游子链将使用适当的媒体类型构建。

IAMStreamConfig::SetFormat needs to be used to set capture format before the pin is connected and rendered. This way the downstream subchain of filters is built with proper media types.

这篇关于DirectShow-IAMStreamConfig :: SetFormat和ICaptureGraphBuilder2 :: RenderStream的调用顺序在某些摄像机中产生了问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-04 22:52