Video Buffering and Streaming in Chunk Size | Nodejs

Dulal Sandip
1 min readMar 6, 2023

--

Fig : Video Chunk file loaded to 1 MB instead of whole size

How can you create a video streaming buffer like YouTube . In YouTube, you have noticed that the whole video is not downloaded in the browser at once. Only some seconds (10 -20 second) of the video would get downloaded in the browser and more will be downloaded as user continues to watch.

Benefits:

  1. It saves bandwidth. If a file is of 80 MB in size, user can download just 1 MB at start. User can start watching the 1 MB and the next MBs will automatically gets downloaded . User does not have to wait for whole 80 MBs to get downloaded.
Only 1 MB is loaded instead of whole video size

Packages used : Fs Modules and Express

Github Code Attached Below with demo:

--

--

Dulal Sandip
Dulal Sandip

Written by Dulal Sandip

Software Engineer, Chief Technology Officer (CTO), Devops

No responses yet