gpt4 book ai didi

c# - DirectShow.NET 示例 - 加载更好的配置文件

转载 作者:太空宇宙 更新时间:2023-11-03 10:54:18 25 4
gpt4 key购买 nike

我正在运行 DirectShow.NET 的 CapWMV 示例应用程序。

它正在 Capture.cs 中加载质量非常低的配置文件:

// Windows Media Video 8 for Dial-up Modem (No audio, 56 Kbps)
// READ THE README for info about using guids
Guid cat = new Guid(0x6E2A6955, 0x81DF, 0x4943, 0xBA, 0x50, 0x68, 0xA9, 0x86, 0xA7, 0x08, 0xF6);

自述文件说

if you MUST use guids, you can find them defined in %windir%\WMSysPr9.prx.

但是当我加载另一个配置文件时,如果失败,可能是因为我没有连接音频流,正如 WindowsMedia 自述文档解释的那样:

The easiest (the one used most commonly in the samples) is to use IWMProfileManager::LoadProfileByID. This method takes a Guid, which gets matched with the entries in %windir%\WMSysPr9.prx, and is used to specify various parameters of the output (BPS, video size, etc).

If the profile is configured with 2 streams (ie Audio & video), you MUST connect both an audio and a video stream to the writer, or the writer will fail to write.

因为我假设我无法使用 DirectShow.NET 从文件加载配置文件,所以我必须从 WMSysPr9.prx(通过 Guid)加载更好的配置文件并连接音频流。

我将如何着手在这个示例中建立连接?

最佳答案

基于 GUID 的“系统”配置文件已弃用。它们是预定义的 Windows Media 8 配置文件,您可以仅通过 GUID 引用它们,而不是从多个部分构建整个配置文件。 Windows Media 9 不提供任何预设,因此您应该创建一个空的配置文件并在其中添加流进行设置。

System Profiles :

There are no predefined system profiles that use the Windows Media 9 Series codecs. You can create your own Windows Media 9 Series profile by using a version 8 profile as a starting point. For more information, see Reusing Stream Configurations.

MSDN 指导您创建配置文件 here :

The basic steps in creating and/or modifying profiles are:

  • Create an empty profile, or load an existing profile to edit.
  • Configure each of the streams, if required, based on supported profile data retrieved from the codec that will be used to encode the stream.
  • Configure mutual exclusion, if needed.
  • Configure bandwidth sharing, if needed.
  • Set the priority of the streams in the file, if required.

你可以找到一个代码片段here .它是 C++,但转换为 C# 会非常简单。

关于c# - DirectShow.NET 示例 - 加载更好的配置文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20074243/

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