更改采样的视频大小 [英] Changing sampled video size

查看:115
本文介绍了更改采样的视频大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用DirectShow库(.NET)捕获视频,我有一个模拟设备通过BNC输出视频,我将其连接到FrameGrabber硬件( http://www.videohome.com.tw/eng/products-detail.php?p_id=72&level1_id= 18 )通过USB连接到我的计算机,有人告诉我模拟设备以720x576输出视频,但是在FrameGrabber确实支持720x576的站点上却以640x480输出视频。

I am capturing a video using DirectShow Library (.NET), I have an analog device that outputs video through BNC, I connected it to a FrameGrabber hardware (http://www.videohome.com.tw/eng/products-detail.php?p_id=72&level1_id=18) connecting through USB to my computer, I was told that the analog device outputs the video at 720x576, however I get the video at 640x480, at the site it says the FrameGrabber does support 720x576.

为简单起见,我尝试执行DxLogo示例中接下来描述的内容(我使用的是自定义方式,现在还不确定为什么-可能会更改为使用Capture从DxLogo)和我得到的程序结果相同,只是认为这将是更好的代码参考。

For the purpose of simplicity, I tried to do what's described next in the DxLogo sample (I am using something a bit more custom, not really sure why now - may change to use the Capture from the DxLogo) and I get the same result as my program would, just thought it would be a better code reference.

我发送了Capture类以720 x 576显示,它进入并在IAMStreamConfig上执行SetFormat,返回0(成功) ,但是当调用RenderStream方法时,它返回:-2147024809并失败。我找不到太多有关发生这种情况的信息。

I sent the Capture class to display in 720 x 576, it goes in and does SetFormat on IAMStreamConfig, which returns 0 (success), however when the RenderStream method is called, it returns: -2147024809 and fails. I couldn't find too much information on why that happens.

在我的其他代码中,我使用了GetNumberOfCapabilities,当使用GetStreamCaps遍历它们时,我发现了720x576,我使用它对IAMStreamConfig进行了SetFormat操作,但成功完成了,但是从RenderStream获得了相同的操作。

In my other code, I used GetNumberOfCapabilities and when going over them using GetStreamCaps I found one that is 720x576, I did SetFormat to the IAMStreamConfig using it and it succeeded, but got the same from RenderStream.

推荐答案

当前/默认捕获模式是640x480,而无需更改它就可以捕获视频并获得640x480。因此,您需要使用 IAMStreamConfig :: SetFormat 更改捕获模式$ c> 以获得720x576,看来您正在尝试中,但您似乎还选择了帧捕获驱动程序宣传的某些格式,因此不再被接受。您需要检查格式(媒体类型详细信息),也许那里出了点问题(尤其是表明隔行内容),或者只是构建自己的正确媒体类型并通过 IAMStreamConfig :: SetFormat 通话。

The current/default capture mode is 640x480 and without changing it you capture video and you get it 640x480. So you need to change capture mode using IAMStreamConfig::SetFormat to get 720x576, and it seems you are trying it out but it also looks like you pick some format advertised by frame grabber driver and it was not accepted further. You need to inspect the format (media type details), perhaps something is wrong there (esp. it's indicating interlaced content), or just build your own proper media type and pass it with IAMStreamConfig::SetFormat call.

这篇关于更改采样的视频大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆