关于流媒体,像 Skype 这样的程序如何工作?
当 Skype 等程序将视频从一个用户传输到另一个用户(反之亦然)时,通常是如何实现的?
客户端 A 是否将流传输到服务器,然后服务器将其发送给客户端 B?
还是直接从客户端A发送到B?
如果我的观点有偏差并且这些都不正确,请随时纠正我。
When programs such as Skype streams video from a user to another and vice versa, how is that usually accomplished?
Does client A stream to a server, and server sends it to client B?
or does it go directly from client A to B?
Feel free to correct me if i am way off and none of those is correct.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Skype 比这复杂得多,因为它是点对点的,这意味着您的流可能会通过几个其他 Skype 客户端传输,充当多个服务器。 Skype 没有为此配备庞大的中央系统。 Skype 始终跟踪可以将流传输到的多个位置,因此,如果其中一个位置消失(Skype 客户端消失),它将继续通过另一台服务器/Skype 客户端发送。此操作非常高效,您不会注意到中断。
Skype is much more complicated than that, because it is Peer to Peer, meaning that your stream may travel through several other skype clients, acting as several servers. Skype does not have a huge central system for this. Skype always keeps track of multiple places that it can deliver your stream to, so that if one of these places disappear (that Skype client disappears), then it will continue sending through another server/skype-client. This is done so efficiently, that you don't notice the interruption.
基本上,这就是它的实现方式。
1)使用可以获得的最佳压缩对视频/音频进行编码。采用有损压缩和大量锯齿来丢弃不可用的视频和音频部分。就像消除背景嘶嘶声
2)将视频/音频打包到数据包中并在其上放置时间戳。数据包通常是数据报。
3) 将数据包直接发送到目的地。使用最合适的路线。您不必以相同的方式发送所有数据包。如果可能的话,使用多条路线。 P2P 网络通常使用许多路由到同一目的地
4) 在目的地上重新编码。如果包装太旧,请将其扔掉。如果数据包丢失,请不要担心,因为为时已晚。
5)加入视频回来并尽可能地填补缺失的帧。
Basically , this is how its achieved.
1) encode video / audio using the best compression you can get. Go lossy compression and plenty of aliasing to throw away portions of video and audio which is not usable. Like removing background hiss
2) pack video / audio into packets and put a timestamp on them. The packets are usually datagrams.
3) send packets directly to destination. Use the most appropriate route. You dont have to send all packets the same way. Use many routes if possible. P2P networks often use many routes to the same destination
4) re-encode on the destination. If a packet is too old , throw it away. If packets are lost , dont bother about it since its too late.
5) join the video back and fill in the missing frames the best you can.