欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

wowza doc of multi-bitrate streaming 博客分类: 技术 wowza multi-bitrate

程序员文章站 2024-02-12 14:27:10
...

http://www.wowza.com/forums/content.php?36-How-to-publish-and-play-a-live-stream-(RTMP-or-RTSP-RTP-based-encoder)

 

关于如何实现流媒体的multi-bitrate播放,文档中并没有完整的描述,只是告诉你如何配置。

文档提到:你需要有一个能从一个视频流中编码出多种码率的编码器。

写道
Multi-bitrate live streaming to Flash, Apple iOS devices and Silverlight requires that you have an encoder that can generate multiple bitrate streams from the same source that are properly key-frame aligned.

 然后用SMIL文件来描述码率配置。

 

但什么例子也没有,什么样的encoder满足key-frame aligned?客户端怎么做?

有点参考性的是帖子的回复,第二页回复的最后有位venoushcz用H.264,mp3

写道
I use FMLE, h.264 and MP3:

<encode>
<video>
<format>H.264</format>
<datarate>500;200;100;</datarate>
<outputsize>768x432;512x288;512x288;</outputsize>
<advanced>
<profile>Main</profile>
<level>4.0</level>
<keyframe_frequency>4 Seconds</keyframe_frequency>
</advanced>
<autoadjust>
<enable>false</enable>
<maxbuffersize>1</maxbuffersize>
<dropframes>
<enable>false</enable>
</dropframes>
<degradequality>
<enable>false</enable>
<minvideobitrate></minvideobitrate>
<preservepfq>false</preservepfq>
</degradequality>
</autoadjust>
</video>
<audio>
<format>MP3</format>
<datarate>96</datarate>
</audio>
</encode>

I stream to origin server. It is connected to edge server. I can stream each of the substreams to the demo player succesfully so the config origin - edge should be OK. I created the setup for the o-e multibitrate as you described in the post.

my live1.stream etc. files contain just the link to the origin server as you described:

rtmp://originsrv:1935/LIVESTREAM/livestream1

 似乎能行

 

因为我没有亲手写过flash中camera encode,不太了解这些环节,

还是等需要介入时把代码拿来看看。

 

另外,2010年的时候有人说flash不能做h.264编码,到了2011年9月就有人在回复中指出最新的flash已经提供了支持。确实如此,我们前段时间修改为h.264后带宽节省了很多。

写道
Originally Posted by cnynracer1
“Thanks Roger. Yes I understand Flash player doesn't encode in H.264, but I am curious if we can do this without asking our users to download a plugin such as this.“

The latest (pre-release - coming soon - honestly ;-) ) does a nice job of encoding with H.264.

Get it here: http://labs.adobe.com/downloads/flashplayer11.html

It takes some fiddling to get flash building in your dev environment:
Flex instructions here: http://www.youtube.com/watch?v=LlME1tUrDTo
Flash Professional CS5.5 instructions here: http://forums.adobe.com/message/3906794#3906794

Here are some snippets for your flash code that will effect the changes:
Code:
// Settings for H.264 - this is all there is to it. Sadly no AAC :-(
var h264Settings:H264VideoStreamSettings = new H264VideoStreamSettings();

h264Settings.setProfileLevel(H264Profile.BASELINE, H264Level.LEVEL_2);
nsPublish.videoStreamSettings = h264Settings;
I"ve used this successfully with some Xuggler code that I fire off from a module to post process streams for IOS availability. This could have been done as a distinct server, but I felt it better to manage one app than two.

 可见跟对一个技术流派是多么重要。。。

 

从以上可以推测出,我们可以在客户端做multi-bitrate encode,也可以在服务器上做,具体如何实施还需要详细论证,需要匹配不同的业务场景,由于编码是个CPU密集型运算,client-origin-edge各自的负载能力需要仔细测试和规划。

相关标签: wowza multi-bitrate