编码器3 SDK问题 [英] Encoder 3 SDK questions

查看:100
本文介绍了编码器3 SDK问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在创建一个测试应用程序,用于将流从网络摄像头/摄像头发布到WMS上的发布点。但是,我无法更改输出格式,如流的质量/编解码器/比特率。我想要使​​用的属性是readonly。或者我做错了什么?


例如:



outputFormat.VideoProfile.Codec = VideoCodec.VC1;


给出错误


错误1属性或索引器'Microsoft.Expression.Encoder.Profiles.VideoProfile.Codec'无法分配 - 它是只读的


但是应该启用/设置outputFormat.VideoProfile.Codec。


另外我如何使用outputFormat.VideoProfile.Bitrate来分配比特率和我可以像编码文件一样分配叠加图像吗?我也试过使用预设,但那些也给我错误,他们是只读的。为了记录,我使用WindowsMediaPublishingPointOutputFormat()。

解决方案

当您使用WindowsMediaPublishingPointOutputFormat时,编解码器已经是VC1所以你不要不需要设置它。如果你想改变比特率,你应该能够做如下的事情。

 outputFormat.VideoProfile.Bitrate = new ConstantBitrate(500); 

您可以在离线模式下叠加图像,但不幸的是,在实时模式下不支持。
问候士丁。


Hi,

I am creating a test application to publish stream from webcam/camera to a publishingpoint on WMS. However I can't change the output format like quality/codec/bitrate of the stream.  The properties that I want to use are readonly. Or am I doing something wrong?

For example this:


outputFormat.VideoProfile.Codec = VideoCodec.VC1;

gives the error

Error 1 Property or indexer 'Microsoft.Expression.Encoder.Profiles.VideoProfile.Codec' cannot be assigned to -- it is read only

But outputFormat.VideoProfile.Codec should be get/set enabled.

Also how can I use outputFormat.VideoProfile.Bitrate to assign a bitrate and can I assign a overlay image like when encoding a file? I also tried to use Presets but those also gives me error that they are read only. For the record I am using WindowsMediaPublishingPointOutputFormat().

解决方案

As you're using WindowsMediaPublishingPointOutputFormat, the codec will already be VC1 so you don't need to set that. If you want to change the bitrate you should be able to do something like the following.

outputFormat.VideoProfile.Bitrate = new ConstantBitrate(500);

You can overlay an image in the offline mode, but unfortunately that isn't supported in live mode.
Regards
Dean.


这篇关于编码器3 SDK问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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