6 ms·
You'll be lucky to get to 500 Mbit out per physical machine using 16 cores and streaming to about 2000 users with 75 incoming streams. So that's roughly 5 strea
by DarkShikari 17y ago
You'll be lucky to get to 500 Mbit out per physical machine using 16 cores and streaming to about 2000 users with 75 incoming streams. So that's roughly 5 streams per core.
Why do you have the same computers handling encoding as distribution? That's stupid.
To just multiplex 2000 streams to 40 K viewers with adaptive frame rate you'll need roughly 30 sixteen core machines, note that that does NOT include transcoding yet.
Then your multiplexer is unimaginably inefficient. Last summer I worked for a company that multiplexes live streams for millions of viewers; it is not as hard as you think, especially since you only have to do the work once per channel, not once per user, since all users watching a given channel receive the same stream.
- jacquesm 17y agoI think you are missing what adaptive frame rate is all about...
- DarkShikari 17y agoYou have yet to explain what "adaptive frame rate" actually is in this context. Do you mean that each user receives a different framerate based on the download bandwidth that he has? You really only need a couple framerates to cover all users--and I suspect you mean "bitrate", not "framerate", in this case (though changing the framerate is one effective way to improve the quality of an adaptive bitrate scheme).
- jacquesm 17y agoAdaptive means that based on the connection quality every user receives the maximum quality that their link is capable of while guaranteeing audio delivery with a minimum lag to stay as close to realtime as possible. This means that every user has an individual stream because the connection quality can change very rapidly over short periods of time, they might switch a secondary stream on (or off) for a moment and whatever else can change the quality of the connection. You can't use very large windows because that would mean that if there was a hickup in the line it would take a long time to recover, which would degrade perceived quality. Video is relatively forgiving by the way, the audio is the real kicker, a single packet delivered a little bit too late will instantly cause annoyance whereas with the video you can be a little early or late and it doesn't seem to matter too much. Initial encoding happens on different machines (obviously) but a stream multiplexer that maximizes the end user experience is a lot more complicated than just encoding to a preset selection of rates, after all every keyframe and subsequent updates have their encoding scheme determined by the throughput measured during the transmission of the keyframe(s)+updates just preceding it. For non-live consumption the situation is a lot easier, you can pre-buffer and that takes care of most problems but in live transmissions that is not possible unless you want horrible lag (which does not work when the connection is two way, it screws up the interaction between people).
- DarkShikari 17y agoInitial encoding happens on different machines (obviously) but a stream multiplexer that maximizes the end user experience is a lot more complicated than just encoding to a preset selection of rates, after all every keyframe and subsequent updates have their encoding scheme determined by the throughput measured during the transmission of the keyframe(s)+updates just preceding it. It's really not that difficult; if you have one encode going per-user, you can just reinitialize the encoder's ratecontrol, and if you don't have one per user, you can simply use a short GOP and swap the bitrate at each keyframe, in the same way that H.264 extended profile proposed using Switching Pictures (but in a way that real software actually supports). Of course this latter method requires multiple simultaneous encodes per channel, or an SVC-like system (which almost nobody supports, and for which there aren't any good software implementations anyways). Is it really that important for Justin.TV to have less than one second latency? The vast majority of the site is completely non-latency-critical (from my cursory browsing of it). Heck, the broadcast company I worked for last summer had over 10 second latency and nobody ever complained about that--and that was live television, including sports games and so forth. Plus, if Justin.TV is already doing a scheme like this, surely upgrading to a better, faster encoder is going to decrease, not increase, their CPU load. Video is relatively forgiving by the way, the audio is the real kicker, a single packet delivered a little bit too late will instantly cause annoyance whereas with the video you can be a little early or late and it doesn't seem to matter too much. It sounds as if your buffer size for audio is too small. There is no reason why video or audio should act differently in that regard; in fact, audio should be easier, as losing a video packet will result in a loss of video until the next keyframe, while in audio, every single frame is a keyframe.
- jacquesm 17y agoI think the word 'trivial' means different things to you than it does to me :)
- DarkShikari 17y agoIt is certainly very simple in the general case (you have a video stream, you need to transcode it); it just becomes difficult when you try to do fancier things with it... which is perhaps true of all systems.