How is possible for YouTube and Vimeo transcode so fast?
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.