Win7 + H.264编码器+ IMFSinkWriter无法使用Quality VBR编码? [英] Win7 + H.264 Encoder + IMFSinkWriter Can't use Quality VBR encoding?

查看:199
本文介绍了Win7 + H.264编码器+ IMFSinkWriter无法使用Quality VBR编码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过ICodecAPI更改编码器质量属性eAVEncCommonRateControlMode_Quality。

I'm trying to alter the encoder quality property eAVEncCommonRateControlMode_Quality via ICodecAPI.

但是文档中的启动会忽略该设置,该文档说明必须在IMFTransform之前设置属性::调用SetOutputType。

However the setting is ignored as started in the documentation which says the property must be set before IMFTransform::SetOutputType is called.

现在问题是:当我们在接收器编写器上调用SetInputMediaType时,接收器编写器似乎调用了IMFTransform :: SetOutputType,但是如果我们不调用SetInputMediaType我们无法通过sinkWriter.GetServiceForStream来检索ICodecAPI接口
(抛出异常)以更改质量设置......看起来像是一个捕获22.我希望它是我而不仅仅是一个设计缺陷蜜蜂。

Now here is the problem: the sink writer seems to call IMFTransform::SetOutputType when we call SetInputMediaType on the sink writer, however if we don't call SetInputMediaType we can't retrieve the ICodecAPI interface via sinkWriter.GetServiceForStream (throws exception) to change the quality setting..seems like a catch 22. I'm hoping it's me and not just a design flaw in the APIs.

设置quality属性适用于Win8,因为Win8在调用IMFTransform :: SetOutputType后调用时不会忽略它。

Setting the quality property works on Win8, as Win8 does not ignore it when called after IMFTransform::SetOutputType is called.

帮助!!

 

推荐答案

遗憾的是,这与水槽编写器和H264编码器的交互方式存在设计缺陷。 您可以通过在本地注册H264的包装器MFT来解决它。 包装器会将所有调用委托给真正的H264编码器
,除非它在SetOutputType上保持不变,直到配置编解码器属性为止。
This is unfortunately a design flaw with the way the sink writer and the H264 encoder interact.  You could potentially work around it by locally registering a wrapper MFT for H264.  The wrapper would delegate all calls to the real H264 encoder, except it would hold off on SetOutputType until the codec properties were configured.


这篇关于Win7 + H.264编码器+ IMFSinkWriter无法使用Quality VBR编码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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