Video-on-Demand (VOD) workflow
Varun Gujarathi
Posted on September 24, 2024
Video-on-demand (VOD) streaming allows users to access pre-recorded video content at any time, providing a flexible and convenient way to consume media. Platforms live Netflix, Prime Video, YouTube are best examples of VOD. In this article, we will explore how VOD differs from live streaming, the process of resumable HTTP uploads, the role of encoding and segmentation, and how videos are served via HLS when requested by users.
How VOD Differs from Live Streaming
While both VOD and live streaming deliver video content to users, they have distinct differences:
Content Availability:
- VOD: The video content is pre-recorded and stored on servers. Users can access the content at any time, starting and stopping playback as they wish.
- Live Streaming: The video content is streamed in real-time as it happens. Users watch the stream live, and interaction is limited to the current broadcast.
Ingestion and Processing:
- VOD: Videos are uploaded, encoded, and stored before being made available to users.
- Live Streaming: The video is captured, encoded, and streamed live to viewers with minimal delay.
Resumable HTTP Uploads
Resumable HTTP uploads are crucial for efficiently uploading large video files to a VOD platform. They enable users to upload files in chunks, allowing uploads to resume from where they left off if interrupted.
Initiating the Upload:
- The client requests an upload URL from the server. The server provides an upload URL and a unique upload ID.
Uploading Chunks:
- The client uploads the video in smaller chunks (e.g., 5MB each).
- Each chunk is sent with metadata, including the upload ID and the byte range of the chunk.
Handling Interruptions:
- If the upload is interrupted (e.g., due to network issues), the client can resume by sending a request with the upload ID and the byte range of the last successfully uploaded chunk.
Completing the Upload:
- Once all chunks are uploaded, the client sends a request to finalize the upload.
- The server assembles the chunks into a complete video file.
Libraries and tools like Tus and the Resumable.js library facilitate resumable uploads, providing built-in support for chunking, retries, and resume functionality.
Encoding and Segmentation
Once a video is uploaded to a VOD platform, it undergoes encoding and segmentation before being made available for streaming.
Serving Videos via HLS/DASH
When a user requests a VOD video, it is served via HTTP Live Streaming (HLS) or Dynamic Adaptive Streaming over HTTP (DASH), using adaptive bitrate streaming.
Conclusion
Video on Demand (VOD) streaming provides users with the flexibility to access pre-recorded content at their convenience. By leveraging resumable HTTP uploads, efficient encoding, and segmentation processes, and delivering content via HLS, VOD platforms can offer high-quality, adaptive streaming experiences. Understanding the workflow and system design behind VOD is crucial for building a robust and scalable streaming platform.
Posted on September 24, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.