Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

regarding streaming, how does a program like skype work?

Tags:

stream

skype

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.

like image 360
sqram Avatar asked Oct 08 '09 06:10

sqram


2 Answers

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.

like image 183
Lars D Avatar answered Dec 11 '22 07:12

Lars D


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.

like image 42
Andrew Keith Avatar answered Dec 11 '22 07:12

Andrew Keith