使用DirectShow的视频录制分辨率 [英] Video recording resolution using DirectShow

查看:126
本文介绍了使用DirectShow的视频录制分辨率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在DirectShow中录制时,如何更改视频的屏幕分辨率?因为我有一个8百万像素的网络摄像机,用于视频录制,但是保存视频后,当我观看视频时,其播放方式就像使用1.3兆像素的摄像机录制的一样。

How do i change the screen resolution of a video while recording in directshow? because I have a 8 Mega-pixel web camera, which I use for video recording but after the video is saved, when I view the video, it plays like it was recorded using a 1.3Megapixel camera.

推荐答案

您需要使用 IAMStreamConfig 接口。一些MSDN为您提供线索:

You need to use IAMStreamConfig interface. Some MSDN leads for you:

配置视频输出格式(Windows)


要配置捕获设备的输出格式,应用程序
应该使用pmt参数中IAMStreamConfig :: GetFormat
返回的AM_MEDIA_TYPE结构。

To configure a capture device's output format, an application should use the AM_MEDIA_TYPE structure returned by IAMStreamConfig::GetFormat in the pmt parameter.

IAMStreamConfig :: GetFormat方法(Windows)


如果引脚已连接,则此方法返回该引脚的格式
当前正在使用。否则,该方法将为下一个引脚连接返回引脚首选的
格式
。如果您已经调用
IAMStreamConfig :: SetFormat方法来设置格式,则GetFormat返回
相同的格式。如果不是,则返回销的首选格式列表
中的第一种格式,由IPin :: EnumMediaTypes
方法确定。

If the pin is connected, this method returns the format that the pin is currently using. Otherwise, the method returns the pin's preferred format for the next pin connection. If you have already called the IAMStreamConfig::SetFormat method to set the format, GetFormat returns the same format. If not, it returns the first format in the pin's list of preferred formats, as determined by the IPin::EnumMediaTypes method.

更多:

  • how to change OutPut Pin Size & ColorSpace/Compression in DirectShow
  • How can i Programmatically set a Directshow Filters' options?
  • DirectShow - Order of invocation of IAMStreamConfig::SetFormat and ICaptureGraphBuilder2::RenderStream creates issues in some video cameras

此外,由于具有后处理功能,您的网络摄像头可能具有较低的视频流分辨率,而仍具有较高的拍摄分辨率。

Also, your webcam might have lower resolution for video streaming, and high for taking still thanks to post-processing capabilities.

这篇关于使用DirectShow的视频录制分辨率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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