Echo: Day 4
Today, I came across a video by Piyush Garg titled “I Built StreamYard Clone | Code Along — Live Streaming RTMP Application,” where he was building a simple Node.js app. The app takes streams from the frontend through a WebSocket connection, which are then processed live using FFmpeg and transferred to an RTMP application — in this case, YouTube.
The app built in the video sits between the client and the streaming service, which is useful for me since my application will have similar functionality internally.
Get Alwin Sunil’s stories in your inbox
Join Medium for free to get updates from this writer.
My plan for the app is to receive a stream from the client, save it to a storage solution efficiently, and run another service in a Kubernetes (k8s) cluster to deliver live or on-demand videos to users. The implementation for on-demand video is relatively straightforward. You simply push the files to a storage service in parts, create a manifest file for each video, and add the manifest file link to the frontend video player, such as Video.js. The player handles everything like loading the video, buffering, etc. This part is highly scalable because each data chunk is requested via HTTP rather than WebSockets.
Scaling WebSocket connections is harder because, if disconnected, you need to write logic to resume the stream and append it to the previous one, which must be implemented manually.
I need to work on the test app to ensure it works properly with two types of streams: camera and screen. It should also stream the encoded video to an online object storage.
Thanks, that’s all for today!






