4

For the bit I read YouTube and Vimeo rely on servers powered by some modified libs i guess like libavcodec and tools like ffmpeg in a serious custom build.

Let's assume a transcode to h264 but the same could be applied to other codecs, I think VP8 and VP9 works in the same way.

If I upload 1h video file on their servers, right after the upload i have all the versions ready... pratically like 1 seconds after.

But, if codecs doesn't scale horizontally in a good way unless you want to trade time vs compression (see h264) and I'm pretty sure this websites care about the size of the videos..

Given also that single threads speed are capped by CPU frequency and actual frequency isn't up to 3.5 ghz generally unless they use overclocked servers under liquid nitrogen :D

How the transcode is done so fast?

They use still multithread with a mix of settings, trading on initial file size, custom builds and everything else to have just the files insta-ready to the user and then continue a second transcode with a slow preset that will be swapped as soon this file will be ready? They start to transcode as soon they receive the file stream (aka: during the upload ?)

1

2 Answers 2

5

A common method is split-and-stitch where the file is cut into pieces and sent to multiple servers for transcode. That way you can transcode a file of any length in a fixed amount of time.

Telestreams Episode Engine can do this, but I'm sure Google uses something custom coded.

2
1

I could imagine that they also use hardware supported transcoding. A company like Google certainly has the resources to make custom FPGA transcoders and then transcoding speed gets blazing.

2
  • This could also be an option yeah. For example I guess that the v8 and v9 codecs were designed to scale optimally with their hardware, but regarding the x264 I think that the best pick is slice like a boss, give each slice to a different thread and rejoin the pieces together at the end. Apr 1, 2016 at 8:38
  • 2
    A bit of insight about YouTube internals although quite dated: multimedia.cx/eggs/googles-youtube-uses-ffmpeg Apr 1, 2016 at 9:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.