如何使用 HTTP 流协议传输实时数据。

发布于 2024-11-28 15:31:44 字数 90 浏览 4 评论 0原文

据我所知,流媒体是实时数据传输的行为。 UDP通常与RTP(实时传输协议)一样用于传输实时数据。而HTTP Streaming使用的是TCP,那么它如何保证实时性呢?

As I know, streaming is action that transfer of real-time data. And UDP is usually used for transfer of real-time data as RTP (Real-time transfer protocol). While HTTP Streaming used TCP, so how do it ensure real-time ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

情徒 2024-12-05 15:31:44

对于在客户端上使用输入缓冲区进行流式传输,想象一下 Flash 视频播放器(如 YouTube 的播放器)。一部分内容首先在客户端上缓冲,然后开始播放;如果缓冲区耗尽信息,您必须停下来重新填充缓冲区并继续播放。

您可以将 TCP 用于实时低带宽消耗的应用程序,例如聊天;但是当您需要大量带宽时,它不是最适合的协议,您应该使用 UDP,因为它不是面向连接的(例如 VoD 或有线电视)。

希望这有帮助。

For streaming using input buffers on the client, imagine a flash video player (like youtube's one).. a part of the content is buffered first on the client and then begins to play; if the buffer runs out of information you have to stop to refill the buffer and resume playing.

You can use TCP for low bandwith consumption apps in real time, such as chats; but when you need a lot of bandwith it's not the best suited protocol, you should use UDP because it isn't connection oriented (for example VoD or Cable TV).

Hope this helps.

清醇 2024-12-05 15:31:44

在手册中您获得了所有请求和响应,例如 play

以下示例显示了 Play 请求。

GET /welcome HTTP/1.1
Accept: */*
User-Agent: NSPlayer/12.0.7724.0
Host: SampleServer
X-Accept-Authentication: Negotiate, NTLM, Digest, Basic
Pragma: version11-enabled=1
Pragma: no-cache,rate=1.000,stream-time=0,stream-offset=4294967295:4294967295,packet-num=4294967295,max-duration=0
Pragma: xPlayStrm=1
Pragma: client-id=2338761264
Pragma: LinkBW=2147483647, AccelBW=2147483647, AccelDuration=18000, Speed=91268.055
Supported: com.microsoft.wm.srvppair, com.microsoft.wm.sswitch, com.microsoft.wm.startupprofile
Pragma: playlist-seek-id=64
Pragma: xClientGUID={BFE16E37-55EC-4AE4-A5A9-0B0D307F4B72}
Pragma: stream-switch-count=2
Pragma: stream-switch-entry=ffff:1:0 ffff:2:0 
Accept-Language: en-us, *;q=0.1

以下示例显示了播放响应。

HTTP/1.1 200 OK
Content-Type: application/x-mms-framed
Server: Servername1/9.5.6001.18281
Date: Mon, 08 Mar 2010 18:39:44 GMT
Pragma: no-cache, client-id=2338761264, features="", timeout=60000, AccelBW=3500000, AccelDuration=18000, Speed=5.000
Cache-Control: no-cache, x-wms-content-size=51077, max-age=86399, user-public, must-revalidate, proxy-public, proxy-revalidate
Last-Modified: Tue, 22 Jan 2008 22:54:31 GMT
Etag: "51077"
Transfer-Encoding: chunked
X-StartupProfile: Rate=10,12,15,20,30;MaxBytes=459,459,459,459,459;Time=0,0,0,0,0;StartTime=3290;LastTime=15120;MaxDiffTime=0;MaxDiffSndTime=0;ByteRate=2538,2538,2538,2538,2538;
Supported: com.microsoft.wm.srvppair, com.microsoft.wm.sswitch, com.microsoft.wm.predstrm, com.microsoft.wm.fastcache, com.microsoft.wm.startupprofile

[http://msdn.microsoft.com/en-us/library/cc251235%28v=PROT.10%29.aspx][1]

[1]:http://msdn.microsoft.com/en-us/library/cc251235%28v=PROT.10%29.aspx在此处输入代码在此处输入代码

in the manual you got all the requests and responses, for example play

The following example shows a Play request.

GET /welcome HTTP/1.1
Accept: */*
User-Agent: NSPlayer/12.0.7724.0
Host: SampleServer
X-Accept-Authentication: Negotiate, NTLM, Digest, Basic
Pragma: version11-enabled=1
Pragma: no-cache,rate=1.000,stream-time=0,stream-offset=4294967295:4294967295,packet-num=4294967295,max-duration=0
Pragma: xPlayStrm=1
Pragma: client-id=2338761264
Pragma: LinkBW=2147483647, AccelBW=2147483647, AccelDuration=18000, Speed=91268.055
Supported: com.microsoft.wm.srvppair, com.microsoft.wm.sswitch, com.microsoft.wm.startupprofile
Pragma: playlist-seek-id=64
Pragma: xClientGUID={BFE16E37-55EC-4AE4-A5A9-0B0D307F4B72}
Pragma: stream-switch-count=2
Pragma: stream-switch-entry=ffff:1:0 ffff:2:0 
Accept-Language: en-us, *;q=0.1

The following example shows a Play response.

HTTP/1.1 200 OK
Content-Type: application/x-mms-framed
Server: Servername1/9.5.6001.18281
Date: Mon, 08 Mar 2010 18:39:44 GMT
Pragma: no-cache, client-id=2338761264, features="", timeout=60000, AccelBW=3500000, AccelDuration=18000, Speed=5.000
Cache-Control: no-cache, x-wms-content-size=51077, max-age=86399, user-public, must-revalidate, proxy-public, proxy-revalidate
Last-Modified: Tue, 22 Jan 2008 22:54:31 GMT
Etag: "51077"
Transfer-Encoding: chunked
X-StartupProfile: Rate=10,12,15,20,30;MaxBytes=459,459,459,459,459;Time=0,0,0,0,0;StartTime=3290;LastTime=15120;MaxDiffTime=0;MaxDiffSndTime=0;ByteRate=2538,2538,2538,2538,2538;
Supported: com.microsoft.wm.srvppair, com.microsoft.wm.sswitch, com.microsoft.wm.predstrm, com.microsoft.wm.fastcache, com.microsoft.wm.startupprofile

[http://msdn.microsoft.com/en-us/library/cc251235%28v=PROT.10%29.aspx][1]

[1]: http://msdn.microsoft.com/en-us/library/cc251235%28v=PROT.10%29.aspxenter code hereenter code here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文