How to serve videos like Youtube? Almost instant play and fast seeking
Asked Answered
A

1

6

How to serve videos like Youtube does ? Even if the video is long (almost 2 hours long) and is viewed in HD, it would almost instantly play and seeking to not yet loaded parts are very fast.

I'm using a dedicated server from Rackspace with 100Mb up/down for this test, my ping time is below 50ms to the server. My local internet connection is 10Mb, I could maximize my internet connection when I download something from the server so connection to the server is not the issue here.

I'm trying to emulate this and I've tried Real time streaming using Wowza and Pseudostreaming using the H264 Streaming Module. Neither could compare to how fast Youtube delivers video.

Video test file is MP4 (h.264), 300MB, 2 hours long, total bitrate is set to 500kbps, and JWPlayer as the video player

  • Wowza Streaming (RTMP) - Loading then playing the video is fast, but not as fast as youtube. Seeking is not as fast as well it takes around 5 - 7 seconds to move to the new position and continue playing the video.

  • Pseudostreaming H264 Streaming Module (HTTP) - Loading the video takes a long time since its downloading the video header first before playing it. A 2 hours video has around 2.5MB of MOOV ATOM (video header file) that it needs to download first before it could play. Once it starts playing seeking to not downloaded parts is on par with Wowza but not as fast as Youtube.

What do I need to serve videos with the speed of Youtube? I also need it to buffer/download the video when paused just like Youtube so Real Streaming like Wowza is out.

Pseudostreaming using the H264 Streaming module would have been nice since it does buffer when paused, its just that the initial loading time is very long! Anyway I could remove that initial load time?

What are my other options? I'm open to any other option that I could use in my server.

Abeyta answered 28/5, 2013 at 20:45 Comment(0)
C
0

The way YouTube works is different and they keep on changing the way it works. Doing the reverse engineering on that by capturing the YouTube feeds over wire-shark over last 4 years told me that the pattern is very dynamic. The segmentation is one key, the dual buffer, multiple caching servers and techniques, using the client machine as the buffer render and the functionalities of the player matters a lot. There are many many factors which make YouTube video fast and sleek.

You can emulate the same to some extent but building exactly the same needs loads of efforts and infrastructure.

Cowley answered 2/12, 2014 at 7:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.