DirectShow.NET示例-加载更好的配置文件 [英] DirectShow.NET sample - load a better profile

查看:125
本文介绍了DirectShow.NET示例-加载更好的配置文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am running the CapWMV sample application of DirectShow.NET.

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

It is loading a very low quality profile in 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);

自述文件

如果必须使用向导,则可以在%windir%\ WMSysPr9.prx中找到它们.

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

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

But when I load another profile, if fails, presumably because I am not connecting an audio stream, as the WindowsMedia Readme doc explains:

最简单(在样本中最常用的一种)是使用 IWMProfileManager :: LoadProfileByID.此方法需要一个Guid, 与%windir%\ WMSysPr9.prx中的条目匹配,并用于 指定输出的各种参数(BPS,视频大小等).

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).

如果配置文件配置了2个流(即音频和视频),则您 必须将音频和视频流都连接到编写器,否则 作家将无法写作.

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)加载更好的配置文件,并连接音频流.

As I'm assuming I can't load a profile from a file with DirectShow.NET, I must load a better profile from WMSysPr9.prx (by a Guid) and connect an audio stream.

在该示例中,我将如何进行这种连接?

How would I go about doing that connection in this sample?

推荐答案

基于GUID的系统"配置文件已弃用.它们是预定义的Windows Media 8配置文件,您只能通过GUID进行引用,而不是通过片段来构建整个配置文件. Windows Media 9没有提供任何预设,因此您应该创建一个空的配置文件并在其中添加流以对其进行设置.

GUID based "system" profiles are deprecated. They are predefined Windows Media 8 profiles which you can reference by GUID only instead of building the entire profile from pieces. Windows Media 9 did not offer any presets so you are supposed to create an empty profile and add streams there settings them up.

系统配置文件:

没有使用Windows Media 9系列编解码器的预定义系统配置文件.您可以通过使用版本8配置文件作为起点来创建自己的Windows Media 9系列配置文件.有关更多信息,请参阅重用流配置.

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指导您创建配置文件

MSDN guides you in profile creation 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.

您可以找到一个代码段

You can find a code snippet here. It is C++, but conversion into C# would be pretty straightforward.

这篇关于DirectShow.NET示例-加载更好的配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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