Network 版 (精华区)
发信人: zzn (爱你到内伤), 信区: Network
标 题: mms协议英文资料(29)
发信站: 哈工大紫丁香 (2003年08月23日10:57:02 星期六), 站内信件
‘Switch’ Elements or Stream ID values in command data (see command 33 to
Server)
Switches, as I have decided to call them, select which stream ID to send.
Some switches control audio, others video. How to decide which stream
switches to select depends what bandwidth is available.
Switches enable different multiple bit rate media streams. Saved media files
(like WMV and ASF) can be encoded with multiple sample rates. The reason for
this is when you connect to a streaming server, the player can request the
most suitable bit rate based on your modem speed. The best match is found in
order to stream the media within the bandwidth of your connection. Media
Player requires you to enter your modem or network speed on installation, and
that is why.
Selecting the best bit rate is especially important for UDP streaming as its
data flow is unchecked, where as TCP can be buffered to some degree at the
server and its packets are only sent when allowed to by the viewer. If the
selected stream bit rate was too high for a given available bandwidth, UDP
would certainly fail. Also, TCP would probably fail at some point due to
packets arriving too late. TCP packets have a ‘time to live’ data field, so
if not received in time, they are disregarded.
Multiple bit rate files can also be multiple frame rate files. Or even a
combination of frame and bit rates to best suit audience bandwidth needs.
Most encoded files are only 2 streams, 1 for audio and 1 for a video (single
rate) stream. Others can have up to 10 streams, all with different rates.
Data in the ASF header MBR Object tells us what we need. By scanning for all
these stream rates within the object data, we can extract what stream bit
rates are available in the media. There may be any number of stream values,
all with different stream ID’s, we must count them all and then decide what
to stream based on this information against what modem / network is available.
If no MBR object is available, we can only stream 1 video and 1 audio rate.
This is called single rate streaming.
Below shows what bytes are used in a single switch element. Values are in
little endian format.
Switch elements (or stream elements) are always 6 bytes long.
FF FF flags - always as shown at the start.
01 00 The stream ID of the switch.
02 00 State, 02 = OFF and 00 = ON.
This example shows: Stream ID number 1 is the stream and has the State of OFF.
Normally stream ID has the following assignments:
01 = Audio stream.
02, 04, 05, 06 = Video bit rate streams. Scripts used for still images can
also be streamed.
An interesting point – even if we select only 1 stream, the server may send
the relevant streams anyway, so with this, we can send for example FFFF 0100
0000 (one audio stream), the server may still send 2 streams with video and
audio. It appears that the server decides what is necessary to stream, even
if the player gets the selection wrong. A default streaming selection
perhaps. Its probably not a good idea to rely on this, it has been known for
the server to send the wrong streams under these conditions. Selecting the
wrong streams may increase the bandwidth required over the network. Better to
request the correct streams rather than just the default setting.
--
在这里倾听夜暗的歌声/冥冥中谁奏响沉寂百年的古琴/我又看见夏日里美丽的黄昏/
白天奔忙于生活的人/傍晚就三三两两走到一起:/是南方 这样的温暖时常发生
路草长满街道/幸与不幸 从不同的着落点退出/他们 错过记忆里的某件事/
仿佛一只只岩鹰/方向改变了 身体仍在憧憬中/越过一座座灰色的城市
※ 来源:·哈工大紫丁香 bbs.hit.edu.cn·[FROM: 202.118.243.49]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:3.567毫秒