Hacker News new | ask | show | jobs
by schott12521 982 days ago
I thoroughly appreciated this article as I've been building a short-form video content streaming service and the performance hasn't been what I expected.

Granted, I knew that my service needs to be able to scale at different bottlenecks, but a lot of "build your own video service!" tutorials start with:

- Build a backend, return a video file

- Build a frontend, embed the video

And that leaves a lot to be desired in terms of performance. I think the actual steps should be:

- Build a backend that consists of:

  - Video Ingestion service

  - Video Upload / Processing Service that saves the video into chunks

  - Build a streaming service that returns video chunks
- Build a frontend that consists of:

  - Build or use a video streaming library that can play video chunks as a stream
Edit: From the author's links, I found this website which is very informative: https://howvideo.works/
7 comments

I helped work on howvideo.works, fun to see it helping people! The world of video is, I'd argue, one of those technical spaces that is extremely iceberg-y. You can get decently far enough using S3 + the HTML5 video tag, which I think creates a perception among some that video is just images but a little bigger, but that couldn't be further from the truth. You can really pick just about any step along the video pipeline from production to playback and go as deep for as many years as you'd like.

This is both a semi-shameless plug and probably a few levels deeper than what you're looking for, but I organize a conference for video developers called Demuxed. The YouTube channel[1] has 8 years worth of conference videos about streaming video (and the 9th year is happening in a couple of weeks). The bullet points you mentioned are definitely covered across a few talks, but it's certainly not in any kind of "how to" format.

[1]: https://youtube.com/demuxed

I'm the writer of the article; I LOVE howvideo.works. It helped me quite a lot when I started working on video processing. I'm still a beginner and always fall back to it when I'm unsure about something fundamental. Thanks for your work. I'll take a look at your YouTube channel.
I'm the writer of the article; thanks for your lovely comment. I skipped many essential parts of the architecture in the article to keep it concise. The following articles will be about the technical implementation of what I discussed in this one.
I've been using commercial streaming services for in app (cloudflare, bunny, vimeo), and found performance & bandwith use terrible. The HLS protocol for iOS doesnt work wel for 5-10 second clips, since it needs 1-4 seconds. Now using compress mp4 with progressive loading. Way better.
> and found performance & bandwith use terrible

Can you explain exactly what you mean?

>> Now using compress mp4 with progressive loading

What exactly does this mean?

> Video Upload / Processing Service that saves the video into chunks

At this point you also need to chose what streaming protocol you want to use. You have mostly two choices, HLS if you want to get things done quick, or MPEG-DASH if you want more control (but you'd need a separate HLS pipeline for iOS anyway…)

> Build or use a video streaming library that can play video chunks as a stream

As someone who's worked on a web streaming player, I'd strongly recommend not to build one but to use an existing one (or, in short: use HLS.js)

>> I've been building a short-form video content streaming service

What does it do?

Right now I'm basically trying to just re-create the TikTok / Youtube Shorts / Instagram Reels experience of infinitely scrolling videos.

Mostly just building for fun though.

I built a similar project, and had great results with cloudflare stream.