Network 版 (精华区)
发信人: zzn (爱你到内伤), 信区: Network
标 题: mms协议英文资料(25)
发信站: 哈工大紫丁香 (2003年08月23日10:56:25 星期六), 站内信件
Notes regarding packet lengths and data rates
ASF media files have a fixed packet length (version 1.0). Even if the data
length sent over a network is less than the packet length, padding zeros are
placed in the file to ensure the packet length remains fixed. However, while
a file is being streamed, the streaming server only sends the data and not
the padding. Sending padding in a stream would drastically increase the
overhead and reduce the effective data rate. For this reason, we must
determine what the packet length is in order to reconstruct the file, then we
can apply padding to the packets as we download them. We can then save it as
the original ASF format with padding. One way to do this is by using the
information in the ASF header once its received or another way is by reading
the data held in the server to client command 06. We could use the client
command 06 data if we were downloading a format other than ASF. Some of the
data in the ASF header is effectively sent in this 06 command.
We can roughly calculate the original media packet length by:
Packet length in bytes = size of ASF file divided by the number of packets in
the file.
Or for a better way, data is available in the File header object (see the ASF
header) giving max and min packet lengths. These will be equal for ASF
version 1.0
This simple calculation above works, although it may not be accurate for very
small files like say 10 seconds playing time or less. Below is a table of
pre-recorded data rates and packet lengths. A value given by the calculation
could be approximated to this table, although beware, other bit rates are
also used.
Modem/network rate Actual bit rate (if different) Approx. ASF Packet length
28.8k 22kbps 900 (seems to be the minimum size)
56k 37kbps 947
100k 1280
250k 3200
300k 3840
700k 8960
2000k 25600
You can download broadband media files with a narrow band modem!
Remember that the bit rate is the pre-recorded (maximum) data rate for the
stored media file, and not necessarily the rate of which it can be viewed on
line. Live streaming bit rates can only be as fast as your internet link will
allow, this is due to the nature of real time streaming. You can only empty a
glass of milk so fast by sucking through a thin straw!
However, while downloading, it is possible to download a broadband media file
with a narrow modem stored on a streaming server (not live). This is because
although your modem may be say only 56k, we send no protocol to say that the
data received is not in sync with the server. A real time viewer like media
player would send re-send commands to re-sync. So by not issuing ‘re-send’
packet commands, the media file is effectively ‘buffered’ at the server
before sending (assuming TCP transport protocol is used, note – servers
using UDP would send the stream regardless of modem speed and data would be
lost). Attempting to view (with media player) a broadband file with a narrow
band modem would fail because the viewer software would try to re-sync all of
the time, issuing re-rend commands and thus causing the network to eventually
fail. But our download program does not send these mms re-send commands, and
this allows the stream to keep coming regardless of the actual streaming bit
rate. Of course the file takes longer to download, sucking through a straw
will eventually empty a glass, it just takes longer! We are now not in real
time here, but you do get the file, and its broadband.
--
既然选择了远方,就让我们风雨兼程吧
人生最快乐的事 莫过于
有了目标,并为之奋斗!
※ 来源:·哈工大紫丁香 bbs.hit.edu.cn·[FROM: 202.118.243.49]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:2.282毫秒