Part 6 of 8 · 2 min read
Optimisations
Faster, safer and cheaper.
Faster uploads.
- Split the file into GOP chunks on the client. Upload chunks in parallel, and if the connection drops, resume from the last good chunk. A worked example (made up): a 20-minute video in 10-second chunks is 120 chunks. If the upload fails after 45, the client resends only 75.
- Place upload centres near users, using the CDN as the first stop.
- Use queues between steps, so the encoder need not wait for the download step (Level 6). Loose coupling allows parallel work.
Safer uploads. A pre-signed URL is a link that gives time-limited permission to upload one object to one place. The client asks the API server for it, then uploads straight to storage with it. Only allowed users can write, and only to the right place. Amazon S3 uses this name. Azure calls it a shared access signature.
Protecting content. Three options: DRM systems (FairPlay, Widevine, PlayReady), AES encryption with an access policy, and visible watermarks.
Cheaper delivery. Video views follow a long tail: a few videos are watched very often, and many are rarely watched. The book draws four ideas.
- Serve only popular videos from the CDN. Serve the rest from storage servers.
- For rare videos, keep fewer versions, and encode on demand.
- Send videos only to the regions where they are popular.
- Very large firms build their own CDN with internet providers.
A worked example (made up). If 80 per cent of views come from videos on the CDN and 20 per cent are served from cheaper storage servers, the CDN part of the earlier $150,000 a day is 0.8 × $150,000 = $120,000. The saving depends on prices outside the CDN, so measure real viewing patterns before choosing.
Long tail
A long tail is a pattern where a few items get most of the use and a very large number of items get very little.
Example: 5 per cent of videos account for most views, and half of all videos are watched fewer than ten times.
Check yourself: 1. How does chunked upload help when the network drops? 2. What does a pre-signed URL give, and for how long? 3. Why do rare videos not need the CDN?