Live data from Hacker News

Video streaming at scale with Kubernetes and RabbitMQ

alexandreolive.medium.com

41–50 of 100 posts

Re: Video streaming at scale with Kubernetes and RabbitMQ

#41

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 t…

Something like this? https://github.com/streamlinevideo/streamline

Re: Video streaming at scale with Kubernetes and RabbitMQ

#42
post #37
post #24

I built a similar video pipeline, not on Kubernetes but using EC2 instances for those hungry FFMPEG encoder. The system differ in that it was not user generated video content. It was coming from the cameras in our fitness studio. Here is the article if anyone intereste to read about: https://dev.to/dvliman/building-a-live-streaming-app-in-cloj...

awesome article! curious -- why clojure?

Because CS Degree

Re: Video streaming at scale with Kubernetes and RabbitMQ

#43
post #37
post #24

I built a similar video pipeline, not on Kubernetes but using EC2 instances for those hungry FFMPEG encoder. The system differ in that it was not user generated video content. It was coming from the cameras in our fitness studio. Here is the article if anyone intereste to read about: https://dev.to/dvliman/building-a-live-streaming-app-in-cloj...

awesome article! curious -- why clojure?

No specific reason. It could have been built in any language. It was just the language we were using and enjoyed at that time.

Re: Video streaming at scale with Kubernetes and RabbitMQ

#44
post #28

Earlier quoted context omitted.

Kubernetes loves stateless services. Zero wrong with moving RabbitMQ or a database outside of it.

Except kubernetes has a whole storage provisioning system that gives you redundancy and automatic failover, if you’re going to the trouble of running kubernetes why not just run your whole infra on it? I run https://atomictessellator.com solo, using kubernetes, and my database, Minio object store, application servers, quantum workers, everything is all on kubernetes, it’s self healing and much simpler to run all the…

What happens when your storage detaches from your k8s cluster? Your services start 503ing, hopefully, because you didn't design your system thinking that k8s == 100% uptime.

Re: Video streaming at scale with Kubernetes and RabbitMQ

#45
post #28

Earlier quoted context omitted.

Except kubernetes has a whole storage provisioning system that gives you redundancy and automatic failover, if you’re going to the trouble of running kubernetes why not just run your whole infra on it? I run https://atomictessellator.com solo, using kubernetes, and my database, Minio object store, application servers, quantum workers, everything is all on kubernetes, it’s self healing and much simpler to run all the…

What happens when your storage detaches from your k8s cluster? Your services start 503ing, hopefully, because you didn't design your system thinking that k8s == 100% uptime.

Anybody can invent random problems ad nauseam - that doesn’t prove anything.

I’m not claiming that it’s totally bullet proof, I never said that - I’m saying that if you had a kubernetes cluster anyway why not benefit from its abilities? Especially when the alternative is single node, single points of failure, which is clearly inferior.

The "what if the storage detaches" argument could easily apply to the single node VMs too, in which case the outcome would be a total system failure.

We are discussing the contrast between the articles architecture and running everything on K8s ... and I'm saying that running everything on K8s is clearly better

Re: Video streaming at scale with Kubernetes and RabbitMQ

#46

I have to ask, why bother with Kubernetes and all the associated config and pain? Why not just start a new spot instance? I can’t see any reason for Kubernetes in this architecture even though it’s the title of the post. Also personally I wouldn’t use rabbitmq … it’s pretty heavyweight… there’s lots of lightweight queues out there. Overall this architecture looks like it could be simplified. Also, the post doesn’t me…

Why do you say RabbitMQ is heavyweight? What queues do you consider more lightweight and what would be your go-to in a situation like this?

Re: Video streaming at scale with Kubernetes and RabbitMQ

#47
post #25

Fuck K8. You literally don't need it. Maybe he needs it because he's building on google cloud. AWS is easier, but you can do it with anything. The basic steps are: 1. Upload the file somewhere 2. Transcode it 3. Put the parts somewhere 4. Serve the parts You should really transcode everything into HLS. It's 2023, and everything that matters supports it. If you want 4k you can use HLS or the other thing (which I keep…

Not one mention of MPEG-DASH

Re: Video streaming at scale with Kubernetes and RabbitMQ

#48
We’ve built a similar pipeline architecture for our product. One key thing I’ll mention is that we’re using Shaka-streamer which is a python wrapper around Shaka-packager (which in turn is a wrapper around ffmpeg). We queue our transcode jobs into a redis queue, and use k8s to scale the transcode workers based on queue volume. Lastly, as a few folks have mentioned, we have an experimental on-prem transcoding cluster with consumer grade HW that is pretty cheap.

If you’re interested in working on transcoding I’d highly recommend taking a look at Shaka-packager/streamer.

Re: Video streaming at scale with Kubernetes and RabbitMQ

#49
post #47
post #25

Fuck K8. You literally don't need it. Maybe he needs it because he's building on google cloud. AWS is easier, but you can do it with anything. The basic steps are: 1. Upload the file somewhere 2. Transcode it 3. Put the parts somewhere 4. Serve the parts You should really transcode everything into HLS. It's 2023, and everything that matters supports it. If you want 4k you can use HLS or the other thing (which I keep…

Not one mention of MPEG-DASH

I believe thats what "or the other thing (which I keep forgetting the acronym for)." was referring to.

Re: Video streaming at scale with Kubernetes and RabbitMQ

#50
post #25

Fuck K8. You literally don't need it. Maybe he needs it because he's building on google cloud. AWS is easier, but you can do it with anything. The basic steps are: 1. Upload the file somewhere 2. Transcode it 3. Put the parts somewhere 4. Serve the parts You should really transcode everything into HLS. It's 2023, and everything that matters supports it. If you want 4k you can use HLS or the other thing (which I keep…

I would like to know what the costs come out to per minute of video encoded and how many outputs they're getting in order to compare this to something like Media Convert (AWS), Google Transcode or something dedicated like Mux.

For reference Google Transcoder is about $0.13 per minute of encoding (at four resolutions). Mux is at $0.032 / min, AWS Media Convert $0.0188.

I should note I know Mux's pricing well, use them a lot, happily. It gets a bit confusing with Google and Media Convert because I'm not sure how these costs map to the resulting bitrate renditions that get created and I've not got the time for a deeper dive to get a more straight apples to apples comparison (ignore scale discounts)

[1] https://cloud.google.com/transcoder/pricing

[2] https://www.mux.com/pricing/video

[3] https://aws.amazon.com/mediaconvert/pricing/

Post reply on HN