IIS 启动时流畅地传输低质量
我在 windows azure 上托管一些自适应流视频,我注意到视频一开始以最低的可用比特率开始。这是一个大问题。
我通过在互联网上搜索发现,可以通过挂钩manifestready事件并删除最低比特率然后在一段时间后将它们添加回来来完成一个技巧。 这是有道理的,但我没有看到这样做的示例代码。
我从表达式编码器 4 获取了播放器代码并查看了一下,但找不到在哪里进行更改。
有人有关于改进启动以实现流畅流媒体的更多信息吗?
非常感谢
I m hosting some adaptive streaming video on windows azure and I have noticed that at the beginning the video start with the lowest avaiable bitrate. That is a big issue.
I have seen by searching the internet that a trick can be done by hooking the manifestready event and removing the lowest bitrates and then adding them back after some time.
It make sense but I have seen no sample code of doing that.
I got the player code from expression encoder 4 and had a look but found nowhere where to do the change.
Does someone have more info on improving startup for smooth streaming?
Thank you very much
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您好,我将问题发布到媒体平台播放器论坛并得到了有效的答案。
讨论在这里:http://smf.codeplex.com/discussions/271042
这是我使用的代码:
谢谢
Hello I posted the question to the Media Platform Player forum and got an answer that works.
The discussion is here: http://smf.codeplex.com/discussions/271042
Here is the code I use:
Thank you
正如另一个答案提到的,使用 MMPPF(以前的 Silverlight Media Framework)。功能更齐全的播放器并且相对容易定制(也有视频教程)。
对于比特率 - 是的,平滑流算法是为尽可能最低的延迟启动而设计的 - 因此,在启动时使用最低的比特率/视频块。但是,您可以做您想做的事。
您需要做两件事,首先:
向播放器的 OnMediaPluginRegistered 事件添加处理程序。在这种情况下,请检查它是否是一个
IAdaptiveMediaPlugin
- 您将需要该插件的实例。这是一个示例...一旦完成,等待触发媒体打开事件之一(MediaOpened 或其他事件),您现在可以访问 IAdaptiveMediaPlugin 上名为 SetVideoBitrateRange 的方法(...)。
例如:
这应该给你你需要的东西。
As the other answer mentioned, use MMPPF (previously Silverlight Media Framework). Much more full-featured player and relatively easy to customize (with video tutorials, too).
For the bitrate - yes, the Smooth Streaming algorithm is designed for the lowest latency start possible - therefore, lowest bitrate/video chunk is used on start. However, it is possible to do what you want.
You will need to do 2 things, first:
Add a handler to the player's
OnMediaPluginRegistered
event. In that event, check to see if it's anIAdaptiveMediaPlugin
- you'll need the instance of that plugin. Here's a sample...Once you have that, wait for one of the media open events to fire (MediaOpened or something), and you will now have access to a method on
IAdaptiveMediaPlugin
calledSetVideoBitrateRange(...)
.For example:
That should give you what you need.
尝试使用 Microsoft Media Platform: Player Framework 而不是 Expression Encoder Player - 它具有更高级的逻辑。
Try using the Microsoft Media Platform: Player Framework instead of the Expression Encoder Player - it has more advanced logic.
您可以手动删除服务器端的额外流(低质量流)(需要在那里编辑 xml 文件,而不仅仅是删除物理流文件),或者使用 IIS,它提供了编辑平滑流的工具(假设您安装了相应的扩展,例如通过 Microsoft 平台安装程序应用程序)。您还可以使用 WinMerge 或类似工具来比较您在使用 MS 工具之前保留的剪辑文件夹的副本,以查看当您从平滑流中删除特定(子)流时它会发生什么变化(比较以前和新版本的剪辑) .ism* 文件)
这也很有用,因为有时玩家会低估客户端 CPU 和带宽(有一些可用的自定义版本,可以通过适当地预先编辑一些配置文件来修复 CPU 启发式问题)。也就是说,如果您有一些截屏视频,有时客户端无法获得足够质量的流来读取文本,因此您必须删除质量较低的(子)流,然后它才能正常播放(您开始删除较低的流,然后查看一个它显示 OK)。您还可以配置 TransformManager(或调用相应功能的代码)以不创建质量非常低的版本
you can remove the extra streams (the low quality ones) at the server side either by hand (need to edit the xml files there, not just remove the physical stream files), or use IIS which provides facility to edit smooth streams (assuming you installed respective extension, say via Microsoft Platform installer app). Also you can use WinMerge or similar tool to compare a copy of the clip's folder you kept before using MS tool to see what it changes when you remove a specific (sub)stream from a smooth stream (compare the previous and the new version of the .ism* files)
that is also useful cause sometimes the player underestimates the client CPU and bandwidth (there are some custom versions available that are supposed to fix CPU heuristics issue, by having some config file pre-edited appropriately). That is if you have some screencast, sometimes client don't get stream of enough quality to read the text, so you have to remove lower quality (sub)streams and then it plays fine (you start removing the lower ones and see after which one it shows OK). You can also configure the TransformManager (or your code that calls into the respective functionality) to not create very low quality versions