11 ms·
Show HN: Boltstream – Self-hosted full end-to-end live video streaming platform
- artfulhippo 6y agoHave you performed any load testing or measured performance and scalability?
- darig 6y ago> Have you performed any load testing or measured performance and scalability? Considering this software enables "Pay-per-minute" private video sessions, you could probably find better phrasing than "load testing".
- gruez 6y agoWouldn't it be mostly IO bound? A 10 Mbit/s stream would equal to 100 viewers on a 1Gbit connection, which you can probably handle with even a 1-2 core VPS. The primary consideration would be your transit/server provider and how well peered they are in relation to your viewers.
- deleted 6y ago[deleted]
- corobo 6y agoIf you're chucking it out as you get it aye, but chances are you're going to need to do a bit of transcoding aren't you?
- VWWHFSfQ 6y agoThis is really great. I've seen so many of these "self-hosted live video streaming" sites show up here and this is the first one that show the actual backend code. Usually they're just web frontends to some video streaming website. Questions: -[0] How widely deployed is this stack (specifically nginx rtmp/vod) around the live-streaming industry? -[1] You listed under the Feature that it support "Pay-per-view" and "Pay-per-minute" -- how exactly is that enforced if the playback is just regular HLS? (Are you checking every single request for a .TS segment in Django?) -[2] VOD/Recording is really cool but has enormous storage costs. How does BoltStream handle the long-term storage of streams? Edit: re [1] It looks like there's a somewhat sophisticated mechanism [here](https://github.com/benwilber/boltstream/blob/master/ansible/roles/nginx/files/nginx.conf#L54 https://github.com/benwilber/boltstream/blob/master/ansible/...) that's just checking the requests for the encryption key instead of every single request for the MPEG-TS segment. This is awesome though. Thanks for sharing it!
- spenczar5 6y ago[0] RTMP is common; `nginx-rtmp` is not common in industry to my knowledge. RTMP ingest is a pretty different task from HTTP reverse proxying. Wowza used to be the common software that was used. Twitch moved off of Wowza and wrote their own ingest stack when I worked there.
- ta123523567 6y agoFacebook live (https://engineering.fb.com/2015/12/03/ios/under-the-hood-broadcasting-live-video-to-millions/ https://engineering.fb.com/2015/12/03/ios/under-the-hood-bro...) and several others use nginx-rtmp. It's fairly common in china as well from what I've seen. RTMP is still the best protocol for publishing live streams IMO, and in my experience http-flv blows HLS out of the water for < 1 sec latency. The protocol is old but at least you aren't 15 seconds behind the action.
- ddorian43 6y agonginx-rtmp hasn't seen a commit in 3 years, kinda unmaintained.
- jawngee 6y agoThere are well maintained forks.
- bronco21016 6y agoI admit I do the same thing when looking at projects. When was the last commit? Is that the best measure though? For something like this maybe there doesn’t need to be any more activity?
- spenczar5 6y agoFB live says there that they use a modified version of nginx-rtmp for delivery. I don’t know about ingest. I still think RTMP is a tough choice for delivery. I winder if they are still doing that, 5 years later? I would be surprised, but maybe. There are lots of ways to make HLS run at much less than 15 seconds. With some clever tricks, a cooperative player, and good network conditions, it can be under 0.5s. Hitting 2-4s latency is relatively straightforward. The strategies here are sometimes bundled under the term “LHLS,” and Apple’s LLHLS incorporates some (not all, grrr) of them.
- dayjah 6y agoSerendipity is great! I was literally thinking about this today with a view to improving the personal training space. I’ve a few friends who are personal trainers, they all complain about the “zoom centric” solution where by as a client you dial in to a zoom call, and have to move a phone, iPad, whatever, around a bunch so the PT can see you. My mates have suggested that what they really want is to be able to select from a range of views while a client performs some maneuver. While this doesn’t solve the upstart cost (multiple cameras, bandwidth, etc), it’s cool that it does solve the “hard part” of working out how to stream to some common end point that allows the viewer (the PT) to select the best view.
- keyle 6y agoIt's a chicken and egg problem where there is not much point in building your own whizbang streaming platform and have no one come to it. Twitch is getting increasingly ad-nnoying and you can _ad_ barely _ad_ watch _ad_ it _ad_ an _ad_ ymore. That said that's still where you get the viewers and that's what people will pick. The ad-revenue sharing being the carrot here which will probably mean it's going to be successful for a lot longer.
- reificator 6y agoI run an adblocker but I'm sympathetic to Twitch's plight here. Or at least I was until they started interrupting streams in the middle of the action with no human input to show ads. When the broadcaster clicks the ad button, it's a good time to run ads. They're probably taking a break anyway, there's nothing critical or even interesting happening, so watching some ads is fine. But randomly interrupting in the middle of a conversation or right as the good part hits to show an ad shows that the Twitch management no longer understands or gives a shit about their platform.
- codetrotter 6y agoThey probably found that people streaming were not clicking the button often enough.
- minot 6y agoIt is amazing how fast these things change. Less than a decade ago when asked about ads and sustainability, the folks at Justin tv said the cost per stream viewer isn’t very high and one ad every hour more than covers all costs. Granted this was before high definition high frame rate became the norm but still...
- bryanrasmussen 6y agoless than a decade ago I was making almost half as much money per month as I make now and it was totally ok, now I can barely get by on what I'm making, where there may not be inflation of the economy there may still be inflation of our wants - not to say that is the complete reason for the increase of ads, only a contributing factor.
- HHC-Hunter 6y agoThis is really needed right now, thank you for making this! More self hosted solutions people! Less centralized things.
- killingtime74 6y agoGreat project!
- killingtime74 6y agoReally great project to decentralise video
- 2Gkashmiri 6y agoPeertube is getting live streaming capability.... actually you can check it right now on https://live.canard.tube/videos/watch/5e7b916e-c5b5-4996-a970-cf106967fe32 https://live.canard.tube/videos/watch/5e7b916e-c5b5-4996-a97... The p2p part of it is the real nice deal and these guys are actually making something good here.
- InitEnabler 6y agoYea, I'm looking forward to that feature. If they can implement that with a peer to peer stream that would be great.
- 2Gkashmiri 6y agoP2p is already a thing and is working much better than expected. https://framacolibri.org/uploads/default/original/2X/9/9530ffc5c61bbd97a38e5282197edbeafbf815ad.pn https://framacolibri.org/uploads/default/original/2X/9/9530f... Here is some peer watching a stream (in french) and look at the stats.
- m3adow 6y ago404s for me.
- 2Gkashmiri 6y agohttps://framacolibri.org/t/fonctionnalite-live-retour-dutilisation/10070/46 https://framacolibri.org/t/fonctionnalite-live-retour-dutili... Its in French but you can understand the screenshots.
- mrtweetyhack 6y agowonder how peertube is doing
- eli_front 6y agoHow secure do you think Twitch (Amazon), Facebook Gaming (Facebook), and Youtube Live (Google) are at the top of the streaming world? We’ve recently seen Mixer (Microsoft) fall, and it feels like the creators are the only thing keeping these platforms great, so what’s stopping a new streaming platform from rising above all the others other than the creator’s fear of losing stability? Why couldn’t a new streaming service with a great user acquisition strategy fully take over? This industry doesn’t feel stable at the moment, but when has the video content industry been stable.
- lovehashbrowns 6y agoThere are so many things. First, the network effect. Going from an established platform to a new one means you lose a lot of viewers that aren't going to switch and the potential to gain new ones since the other platform is new. Secondly, well-established payment methods such as Twitch Prime which provide a lot of revenue for streamers on Twitch. Third, existing contracts with Twitch. Fourth, streaming platforms are incredibly expensive to create, maintain, and promote. They will not be profitable for a long, long time, on top of requiring mountains of cash to start. And finally, users "get used" to a specific platform, e.g. Twitch chat, and it's difficult to break these emotional attachments.
- holler 6y ago> Fourth, streaming platforms are incredibly expensive to create, maintain, and promote. They will not be profitable for a long, long time, on top of requiring mountains of cash to start. I agree with that and unless you have founders who possess the required expertise + motivation, it will be expensive. > And finally, users "get used" to a specific platform, e.g. Twitch chat, and it's difficult to break these emotional attachments. Yes and no, I think if you build a quality product, people will try it, and if it works and is delightful, they'll come back. Look at TikTok.
- lovehashbrowns 6y ago> Yes and no, I think if you build a quality product, people will try it, and if it works and is delightful, they'll come back. Look at TikTok. TikTok is different because you can work on maintaining an audience on something like Instagram and also at the same time try to build an audience on TikTok, even if their social networks are different. If you are in a contract with Twitch, you cannot stream anywhere else. You are either staying on Twitch and your uses are staying where they are used to the community, or you go to another platform with a different community, different chat and chat emotes, different subscription system, etc. What I often see cited from people not wanting to leave Twitch is the Twitch emotes and the way chat works on Twitch. For example, Facebook isn't anonymous so chat tends to be more serious and less meme-y. Youtube has a far superior player with live rewind, takes less computer resources, and has access to far more viewers than Twitch; but it has an inferior chat with no Twitch emotes. So Twitch viewers are reluctant to make the switch full-time. That said, YouTube has the best chance to take out Twitch. Google just needs to make a better chat and improve discoverability. Twitch streamers that switch to YouTube, either by choice or by force, can still make a living there. To add: I know of one streamer that streams on Facebook for their income and streams on Twitch to maintain their old community there and to hopefully take more viewers to Facebook. But they are not gaining income from Twitch because they are not under contract. And that is a grind. It's not something for the average person.
- michaelmarkell 6y agoMaybe I can latch on to this thread to ask a question — has anybody here had any experience with publishing streams from the browser directly, rather than using something like OBS? Current thinking is I could use the MediaRecorder API to capture browser content and then push it to a server for broadcast with a tool like Boltstream. But, I’ve heard some people say it’s a bad idea to try this, and to stick with non-browser options.
- contrahax 6y agoStreamyard does this, works pretty well but less customization available right now.
- michaelmarkell 6y agoThanks for the tip!
- bobthebuilders 6y agoThe main thing is that the browser is more sandboxed and less performant than native, and for video streaming it might matter(particularly GPU wise/dual PC).
- Ceezy 6y agoNice!
- sim_card_map 6y agoStrange to see a python backend for such a performance critical application.
- jyap 6y agoIt doesn’t do anything performance critical. nginx-rtmp-module Handles the media streaming. Use something else like ffmpeg to stream.
- spenczar5 6y agoCool! Some thoughts from a former Twitch engineer: - Probably the hardest part of running these things is managing outbound bandwidth costs. You'll need to either limit inbound bitrate or transcode video down to a manageable rate, or else you'll quickly spend a lot of money on shipping 4k video for people. - Right now, your nginx hosts both do ingest and playback, if I understand it right. You might want to separate the two. It makes maintenance easier, and it lets you scale much better - right now, a single stream probably maxes out on viewership based on the CPU capacity of the single nginx host that is ingesting the stream, transcoding it, and delivering it. If you have multiple nginx hosts which could deliver the already-transcoded stream, you could scale much better. - Please don't keep using RTMP. RTMP is so stateful that it's pretty hard to manage, it doesn't have a spec, it doesn't have implementations on many devices, and its security is, uh, _weak_. Big players are forced to keep using it because telling their broadcasters to change is hard, but you don't have that problem. You might consider accepting an alternative modern protocol. - You'll almost certainly need admin and moderation tools soon. Expect lots of pirate streams, as well as some horrific content. You can't run a live streaming platform without admin tools. - Beware DDoS attacks. This setup looks very, very, very easy to take down, as-is...
- toomuchtodo 6y ago> Please don't keep using RTMP. ... You might consider accepting an alternative modern protocol. What would you recommend as an alternative modern protocol to RTMP for shipping video between a broadcast endpoint and transcoding/distribution infra?
- deleted 6y ago[deleted]
- fastocloud 6y agoSorry, but it is baby solution please compare with https://github.com/fastogt/fastocloud https://github.com/fastogt/fastocloud and on Github limited version. Good luck.
- deleted 6y ago[deleted]
- franga2000 6y agoThis comment alone makes me think twice about using whatever it is that you're "selling", but more importantly, what are you actually selling? The github page looks impressive, but the giant "PRO" links make me worried. They don't actually link anywhere useful, so I'm left wondering if this is another one of those "we open-sourced our backend but if you want to actually use it without a year's worth of reverse-engineering, give us a huge sack of money for the rest of the stack". Hardly comparable to an end-to-end solution.
- fastocloud 6y agoWe have 2 versions, community and PRO, yes we have paid organizations who use PRO versions. Also we have free clients who use community versions. We professionals and our clients who use PRO paid, but we started from opensource some times ago, that's why github version limited.
- corobo 6y agoYour pricing options need an accountant to decode them. If they were simpler I'd be um-ing and ah-ing over testing it out right now rather than posting this comment
- simplecto 6y agoThis is very interesting. I setup a hacky nginx-rtmp thing to mimic some aspects of restream.io, as well as running a 24x7 live stream on a side project. It does work, but the hand-editing of configs means it does not drive easily. This space is starting to heat up, and I would like to take the best open-source projects as well as the paid versions out there (dacast, wowza, etc) and do a full-on comparison. I'm in the market for this software (and I'm not shy of paying).
- shmerl 6y ago> Playback via standard HLS Why HLS instead of DASH + MSE? Isn't HLS Apple only?
- oplav 6y agoSafari supports HLS natively, but hls.js is a widely used library that support HLS via MSE. https://github.com/video-dev/hls.js/ https://github.com/video-dev/hls.js/
- echelon 6y agoI have some questions for people in this field. Is there a good way to broadcast to Twitch, YouTube, and Reddit simultaneously? Is it a bad idea to target multiple communities? How expensive is it to run your own single-tenant stream on your own website? Is that a bad idea? Are users revolting on Twitch against the ads and RIAA take downs? Or is it unlikely to ever be unseated?
- corobo 6y ago> Is there a good way to broadcast to Twitch, YouTube, and Reddit simultaneously? Yes (disc: I dunno about reddit, do they have livestreams? haha I had no idea) restream.io is one service that does this, or you can configure your own nginx-rtmp > Is it a bad idea to target multiple communities? Probably, the way you're suggesting. Find your niche and stream on the site they use. You'll look like you're talking to nobody most of the time unless your users gather in one place. Viewers (ok, it's me) don't like it when you answer a question from someone and can't see what the question was. At least factor that in if you go down this path - re-state the question > How expensive is it to run your own single-tenant stream on your own website? Almost zero because nobody will watch it > Is that a bad idea? Not really but it might be a waste of time > Are users revolting on Twitch against the ads and RIAA take downs? Nah everyone else has forgotten and moved on. At the least folks don't care enough for there to be an uproar about it > Or is it unlikely to ever be unseated? Twitch unseated? On the heading they're on now, probably. Literally all they need to do is stop ads and push subs and they'll be locked in for generations. A single sub is worth like 2500 ad views and people gift them in 5s, 10s, 20s like it's going out of style.. what are they even doing with this ad focus? The only ads I even see are ads for Amazon Prime shows I've already watched anyway! Who's even paying for these??
- Wouter33 6y agoLot's of people are using restream.io. Good solution to stream to multiple places at the same time. Doing you own single-tenant stream is hard to manage and scale in general.
- reggieband 6y ago> How expensive is it to run your own single-tenant stream on your own website? This is a function based on the number of viewers. The ingest and transcoding/transmuxing can be thought of as a fixed cost (and in many cases is free) and those operational expenses become rounding errors once the number of viewers surpasses a certain size. The real cost is egress (bandwidth leaving edge servers) and to a much lesser extent mid-gress (the cost of moving bytes between servers, e.g. from an origin to regional distribution server). > Is that a bad idea? Almost certainly a bad idea from a financial perspective. You have a bad bargain here. Either you have so few viewers that the bandwidth is manageable (i.e. no revenue) or so many viewers that there is literally no way for you to afford the bandwidth. If there is a goldilocks zone in the middle it is probably a tiny sliver. You have to have the perfect number of viewers and revenue with very little margin for error. I remember one popular Twitch streamer (sodapoppin) was doing a QA with viewers where he addressed the question. He had hired some people to figure out the costs of setting up his own streaming server and it didn't work out financially for him. Other streamers have investigated it as well (Destiny?) and came to the same conclusion. If those top streamers can't make it work financially, I doubt anyone can to be honest.
- 7357 6y agoThank you.
- deleted 6y ago[deleted]
- TrevizeGP 6y agoSlightly connected: Does anyone found a good way to distribute HLS segments to multiple servers in almost real time? Let's say you have a setup with Nginx managing input RTMP and producing HLS segments in a local directory and you want those distributed to different "edge" servers. I can think of using inotify + rsync or pushing into an object store and let in handle replication (not sure if it would be fast enough?). For various reasons (and for now) I would like to skip pushing them into S3 and use Cloudflare/Cloudfront.
- OpuRahman 6y agoYou'll almost certainly need admin and moderation tools soon. Expect lots of pirate streams, as well as some horrific content. You can't run a live streaming platform without admin tools.
- jaequery 6y agoAnyone ever tried an app BIGO live? I always wondered how their videos can load and play so quickly, almost milliseconds in most cases.