视频设备的输出格式 [英] Output Format of a Video Device
问题描述
你好,
我是Media Foundation的绝对新手,所以我有一个基本的问题。我试图找出视频设备(我的网络摄像头)的输出格式并在屏幕上打印出来。我想弄清楚主要类型和子类型。所以我想要一些像
{MFMediaType_Video,MFVideoFormat_RGB32}。
这就是我所拥有的:
BYTE * my_name = NULL;
UINT32 size = 0;
// m_ppDevices是一个有效的视频捕获设备(网络摄像头)
m_ppDevices-> GetBlobSize(MF_DEVSOURCE_ATTRIBUTE_MEDIA_TYPE,& size);
my_name = new BYTE [size];
m_ppDevices-> GetBlob(MF_DEVSOURCE_ATTRIBUTE_MEDIA_TYPE,my_name,size,NULL);
std :: cout<< my_name<< std :: endl;
打印出"vids"。这对我的"主要类型"是好的。我只是无法获得子类型。任何帮助将不胜感激。
m_ppDevices是什么类型的界面? 它看起来像是一个IMFA属性,但是你写了一个捕获设备 ?属性存储不是捕获设备。
无论你从哪里得到属性,让我们假设你在那里有正确的商店,你不能只做IMFAttributes-> GetItem来检索子类型视频?代码示例
here 应该这样做,并且 我认为GetBlob只是调用MFGetAttributesAsBlob internaly将属性写入数组,例如纪录片说
here 。如果你想要一个特定的属性,为什么不调用它而不是将所有属性写入数组。
问候
coOKie
Hello,
I am an absolute beginner in Media Foundation so I have a basic question. I am trying to find out the output format of a video device(my webcam) and print it out on screen. I want to figure out the major type and the subtype. So I want something like
{ MFMediaType_Video, MFVideoFormat_RGB32 }.
This is what I have:
BYTE* my_name=NULL; UINT32 size=0; //m_ppDevices is a valid video capture device(webcam) m_ppDevices->GetBlobSize(MF_DEVSOURCE_ATTRIBUTE_MEDIA_TYPE, &size); my_name = new BYTE[size]; m_ppDevices->GetBlob(MF_DEVSOURCE_ATTRIBUTE_MEDIA_TYPE,my_name, size,NULL); std::cout<<my_name<<std::endl;
This prints out "vids". Which is fine for my "Major Type". I just can't get the subtype. Any help would be appreciated.
Hi,
what kind of interface is m_ppDevices ? It looks like it would be an IMFAttributes one, but you wrote its a capture device ? An attribute store is no capture device.
Wherever you got that attributes from, lets assume u got the right store there, couldnt you just do IMFAttributes->GetItem to retrieve the subtype of video ? The code sample here should do it, and i think that GetBlob just calls MFGetAttributesAsBlob internaly to write the attributes into an array like the documentary says here. If u want a specific attribute why not call for it instead of writing all attributes into a array.
regards
coOKie
这篇关于视频设备的输出格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!