Posted: . At: 8:59 AM. This was 3 years ago. Post ID: 15502
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.


How video transcoding works on Twitch.tv.


The Twitch video sharing website uses free software such as FFmpeg to transcode user video files.

Twitch.tv video transcoding flowchart.
Twitch.tv video transcoding flowchart.

There is also a lot of other software such as Varnish Proxy, which is a web accelerator for content-heavy sites. But most of the power of Twitch is due to a CDN that helps deliver such a huge amount of video content globally. Other competing websites cannot even compete with Twitch, they have such a massive amount of bandwidth. Nginx is used as the webserver, this is very high performance as a web server for such a bandwidth-heavy site. I do wonder how much the Twitch site is making compared to how much they spend on hosting and bandwidth. But there must be advertising to make back some income. The few big streamers do earn the site money compared to all of the countless other streamers that do not even have any viewers. Why even bother streaming if you do not have any viewers in the first place? The Twitch site also uses NetDB. NetDB Network tracking database (NetDB) utilises the LAMP (Linux, Apache, MariaDB and Perl) stack for scraping and storing your network information in a centralised location. That is a smart way to keep track of the layout of the network. It makes perfect sense for such a large site with a large network.

Also, they seem to be using a Jax REST API video system, this might be for handling video streams. Rabbit MQ is used as well. This is an open-source message broker, this would handle the chat messages by stream viewers. HLS is used to handle streaming video. HTTP Live Streaming (HLS) is a protocol that segments media files for optimization during streaming. HLS enables media players to play segments with the highest quality resolution that is supported by their network connection during playback. This optimises the video streamed to viewers, making sure that they get the best quality video depending upon the quality streamed by the streamer in the first place. Coupled with RTMP. RTMP splits the data stream into fragments of which the size is negotiated dynamically between the client and the server. This enables the transmission of higher amounts of data, effectively lowering the latency of the stream to about 5 seconds. This ensures the best quality video possible is delivered to the stream viewers. I guess they really are worth a billion dollars.


1 thought on “How video transcoding works on Twitch.tv.”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.