gpt4 book ai didi

windows-10 - 网络摄像头 MJPG 捕获流在 Windows 10 上不可用

转载 作者:行者123 更新时间:2023-12-02 00:52:15 27 4
gpt4 key购买 nike

在 Windows 10 build 10.1607.14393.10(又名周年纪念版)上,我无法再获取 MJPG 捕获流。过去是 MJPG 和 YUY2 分辨率,现在我在 DirectShow(内核流)和媒体基础中只获得 YUY2,在 IBaseFilter 源连接到任何东西之前,MJPG 将媒体类型转换为 NV12 方式。在具有不同相机的多个系统上进行了尝试。有什么想法可能是错的吗?

     640x480   @30   YUY2
...
640x480 @30 MJPG <- gone
...
DirectShow:
com_t<IAMStreamConfig> sc;
if_failed_return_result(camera_output_pin->QueryInterface(&sc));
int number_of_capabilities = 0;
int capability_size = 0;
if_failed_return(sc->GetNumberOfCapabilities(&number_of_capabilities, &capability_size), -1);
for (int i = 0; i < number_of_capabilities && k < count; i++) {
VIDEO_STREAM_CONFIG_CAPS scc;
assert(sizeof(scc) == capability_size);
AM_MEDIA_TYPE* mt = null;
if_failed_return(sc->GetStreamCaps(i, &mt, (BYTE*)&scc), -1);
...

在 MMF 中:

    640x480   @30   YUY2
...
640x480 @30 NV12 // camera reports MJPG 4cc in USBView and KsStudio

for (int i = 0; k < count; i++) {
com_t<IMFMediaType> type;
if (d->reader->GetNativeMediaType(VIDEO_STREAM, i, &type) != 0) {
break;
}
GUID guid_major_type = {0};
if_failed_return_result(type->GetMajorType(&guid_major_type));
if (guid_major_type == MFMediaType_Video) {
GUID guid_subtype = {0};
if_failed_return_result(type->GetGUID(MF_MT_SUBTYPE, &guid_subtype));
AM_MEDIA_TYPE* amMediaType = null;
if_failed_return_result(type->GetRepresentation(FORMAT_MFVideoFormat, (void**)&amMediaType));
assert(amMediaType->cbFormat == sizeof(MFVIDEOFORMAT));
const MFVIDEOFORMAT* mi = (const MFVIDEOFORMAT*)amMediaType->pbFormat;

最佳答案

作为explained by Mike M from Microsoft ,

So yes, MJPEG and H.264 being decoded / filtered out is the result of a set of features we needed to implement, and this behavior was planned, designed, tested, and flighted out to our partners and Windows Insiders around the end of January of this year. We worked with partners to make sure their applications continued to function throughout this change, but we have done a poor job communicating this change out to you guys. We dropped the ball on that front, so I’d like to offer my apologies to you all.

在 Windows 10 周年更新中,来自网络摄像头的 MJPG 视频由新的帮助服务“Windows Camera Frame Server”捕获,该服务 self 介绍为“使多个客户端能够访问来自摄像头设备的视频帧”。 Mike M 也提到了这一点。

我无法看到多个客户端共享一个摄像头,因为 TopoEdit 的第二个实例给我一个典型的错误:开始播放时出错。由于缺乏硬件资源,硬件 MFT 无法启动流式传输。

然而,MJPG 和 H264 媒体类型确实被过滤掉了,因为平台更新现在声称有责任避免多个客户端同时访问同一台摄像机并且每个客户端都自己解码重复工作的情况。

One of the main reasons that Windows is decoding MJPEG for your applications is because of performance. With the Anniversary Update to Windows 10, it is now possible for multiple applications to access the camera in ways that weren’t possible before. It was important for us to enable concurrent camera access, so Windows Hello, Microsoft Hololens and other products and features could reliably assume that the camera would be available at any given time, regardless of what other applications may be accessing it. One of the reasons this led to the MJPEG decoding is because we wanted to prevent multiple applications from decoding the same stream at the same time, which would be a duplicated effort and thus an unnecessary performance hit.

显然,这种“改进”让很多人感到意外。

更新。检测到可以通过创建如下定义的注册表值在系统范围内禁用使用新 Frame Server 功能的行为。一旦 Media Foundation API 看到这个值,它就会选择一个原始代码路径来直接绕过 Frame Server 与“硬件”(KS 代理)对话。

  • key 名称:
    • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Media Foundation\Platform(64 位应用程序;32 位操作系统中的 32 位应用程序)
    • HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows Media Foundation\Platform(64 位操作系统中的 32 位应用程序)
  • 值名称:“EnableFrameServerMode”REG_DWORD
  • 值:0

关于windows-10 - 网络摄像头 MJPG 捕获流在 Windows 10 上不可用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38786309/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com