Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: I built a simple web app for streaming videos (peer-flix.herokuapp.com)
127 points by anxiostial on Oct 5, 2020 | hide | past | favorite | 55 comments



So the idea is that you select a file, create a room and then share the URL with anyone you want to join and then the video is streamed to everyone connected. All communication between occupants is peer to peer, the room creator has the video controls and any action is relayed to all peers. I built this thing in my spare time because it seemed like a fun idea to be able to stream a video file between a group of friends and it is very much a first pass, things will be broken, features missing, etc. I do plan on expanding it further when I have more spare time but please do comment with any feedback, roast it if you like.


https://www.comeover.io/ is similar I take, but only that it is built on top of webtorrent instead.


well so is this haha, yea functionally its basically the same app right now, but like I said though I do want to expand it a lot, this was very much a POC for me.


Excited to see what you build. Is there a way to subscribe to your product updates?


no but maybe I will add a way to subscribe to a mailing list of some sort, might be a good idea, did not really expect this much reception haha.


OP doesn't embed googlesyndication+googletagmanager, so that's a plus for me.


and I never will, promise!


This is a cool idea. I did give it a spin and found that the fidelity between viewers was not all that true. For example, if I pause the video (as the room creator), the video gets paused for other viewers as expected, but not in the same place. In other words, not all viewers are in sync.


yea so there is a "drift threshold" of 2 seconds, and my thinking for this is that instead of having the frames jump around many times when we go out of sync it would be preferable to allow for some difference between peers to reduce the number of times we need to sync up.


During pause you can use that time to drag the forward people (including host) back to the oldest guest so people can "manually sync" if they ever choose to.


Sounds like a cool idea, wish there was a demo room without uploading a file. Can you talk a little bit about how the video is handled on the server? What steps do you take to keep the file secure and protect the privacy of the users?


the server does not actually ever receive any part of the video, it is peer to peer (webrtc).


and regarding a public room, just uncheck the private boolean when creating a room, it will then show up for everyone at: https://peer-flix.herokuapp.com/.

although public rooms are kinda pointless right now because once you close your browser the room is basically dead and is not being cleaned up atm.


You should keep the public rooms up, but show a viewer counter and duration of how long the room has been alive. That way, if someone comes onto the page, they can see if a room has been actively streaming to an audience, which would be less likely to disconnect, versus a room that someone created on a whim that they don't intend on keeping around


Yea I would like to and maybe I will revisit the idea, but the inappropriate content issue has me concerned, so until I have some kind of solution for that I think its more responsible to disable it.


You'd probably just have to have people create accounts, verify that they aren't bots through email and captcha, then wait for them to achieve a certain amount of cred before allowing them to have a public channel. And include a flagging system, of course. And add moderators. So yeah, not exactly a short list of things!


Very useful. Better than using screen-sharing in MS Teams (which has really choppy fps)


Same in Jitsi Meet. One workaround I found for the video choppiness (at the expense of image quality) is to present the video file as a virtual webcam using OBS Studio.

https://github.com/Fenrirthviti/obs-virtual-cam/releases


Not sure if this is the case on all platforms, but didn't OBS just add virtual camera in the most recent version (instead of via plugin)?

I noticed it the other day after an update, but not sure if it's only on the Windows version.


Maybe, if they did that's great!


This is great. Nice work! I built something really similar about 3 years ago, a few months before my 4th child was born. Then I lost interest lol. Super barebones POC https://justwatchwith.me/ The idea was that you could stream videos directly from your machine and watch in sync with remote friends and family, controlling the playback with a pause button. I didn't maintain it for a while after I built the POC because not many of my friends / family were very interested at the time. If I only had more time to improve it..... they probably would've appreciated it more under current circumstances if I continued to work on it lol


cool, and yea I am not sure if people would want something like this at all, it just seemed like a fun idea to me.


Hmm videos don't seem to be working in Firefox. The loading animation with the blue bricks goes on and on and on…

The only thing I see on the JS console is "asm.js type error: initializer of exported object literal must be name of function" but I suppose this is not it?


yea so I should have clarified, when a room creator closes the tab, the room is basically dead, anyone who enters will never connect or see anything. This basically makes public rooms completely useless so I may remove them for now (possibly forever).


I love the idea. I have a ton of questions. How would you prevent someone from sharing explicit, harmful or illegal content? Or is this an “anything goes” sort of platform? Is there chat functionality with room participants?

Also I wonder if a similar sort of platform exists for Live events/Sports? Sort of like watching a live sporting event (NBA, champions league) with friends in a chat room?


There is nothing preventing bad content atm, and I may look into this, but with it being largely client side (peer to peer) I have a feeling that will be tricky and obviously anyone knowing what they are doing could get around the safeguards.

There is no chat functionality but yea that is very high on my list of todos.

Not sure, I have never come across anything like that but I feel like its something people would like, especially considering most people have been locked in doors more often than usual lately.


is this uses torrents, does that mean there's a possibility i might get a notice for uploading illegal content if i watch like a marvel movie i uploaded with just a couple of my friends?


Quite unlikely, as it actually uses WebTorrent. WebTorrent runs over WebRTC, which means it's significantly harder for your ISP to detect it as a torrent.


its pretty unlikely since these aren't public torrents, but either way please don't do that.


> but either way please don't do that.

And would it be ok if I had bought the DVD?


Ran into no support for mobile devices? Out of interest, what’s the technical challenge governing what seems to be an allowlist of screen resolutions you support?

“Apologies, unfortunately this application does not support your screen resolution (yet).“


I believe it is largely time related, I did not want a broken UI and prefer adaptive UIs, I will look into adding mobile support at some point.


This! I think we are needing something similar to podcasts for video, that will remove the incumbent players (youtube) from being the sole owners of the video content and instead they are one of many distributors.


curious what you mean by that? can’t you already either use existing video or download your videos? what about IG, tiktok, etc? feels like short-form video is pretty ubiquitous these days


I tried joining this one https://peer-flix.herokuapp.com/3ef2c597-f30b-49ac-bdcc-bac7...

but nothing is happening just 2 blue boxes spinning ?


[copied from another answer]

yea so I should have clarified, when a room creator closes the tab, the room is basically dead, anyone who enters will never connect or see anything. This basically makes public rooms completely useless so I may remove them for now (possibly forever).


Do you have a lot of experience working with WebRTC/WebTorrents? I would appreciate if you'd reach out via my company email (listed in my profile). I can't find any contact information for you on your page.


This is pretty fancy, I looked around and it's straight forward too. Do you think you'll explore the idea of sync viewing and chats so on so forth?


Thanks, so what do you mean by sync viewing? right now everyone is synced to the room creator, which is the only user with controls, and obviously it is super simple / restricted but works for a POC.

Yes, very much, chat is probably the next big feature I would tackle.


Good job, it works pretty well. I see you are using WebRTC and WebTorrent, so I assume that this scales well, do you have any stats you can share?


I deployed it a few hours ago so sorry no haha but yea it is almost entirely peer to peer so it should. I don't really have any kind of analytics in place anyways.


What's your experience been like with WebRTC? I've been playing games and watching shows with Jitsi and Discord with friends. The lower latency is fantastic.

I've been looking for a self hosted (or p2p) solution for streaming to a large audience e.g. Twitch but with WebRTC instead of HLS/DASH/rtmp. Are you aware of anything like that?


Your Question: > I've been looking for a self hosted (or p2p) solution for streaming to a large audience e.g. Twitch but with WebRTC instead of HLS/DASH/rtmp. Are you aware of anything like that?

My Answer: You have PeerTube, which you can self-host.

> PeerTube is software that you install on a web server. It allows you to create a video hosting website, so you can create your "homemade YouTube". The difference to YouTube is that it's not intended to create a huge platform centralizing videos from the whole world on a single server farm (which is horribly expensive). On the contrary, PeerTube's concept is to create a network of multiple small interconnected video hosting providers.

- From PeerTube's FAQ(verbatim except for a few minor grammar errors)

> PeerTube has 3 main adventages: 1) An open code (transparency) under a free/libre license (ethic, respect and community-driven development); 2) A federation of interconnected hosting providers (so more video choices wherever you go to see them); 3) Peer-to-peer broadcasting – and therefore viewing – (so no slowing down when a video becomes viral).

- From PeerTube's FAQ: What are the main advantages of PeerTube?

On the specifics of the live streaming features, albeit vague:

https://joinpeertube.org/roadmap

Apparently Framasoft(the organization behind PeerTube) is planning to implement the live streaming feature once they hit $60,000 USD in funding. However, keep in mind that this is a new feature that hasn't come out yet, and if and when it comes out the first time, it will be a work-in-progress. They are currently below funding goals for step 4 of the roadmap, aka the live streaming feature. Donations may or may not be tax deductible, depending on the jurisdiction in which you live.

What is PeerTube:

> PeerTube is software that you install on a web server. It allows you to create a video hosting website, so you can create your "homemade YouTube". The difference to YouTube is that it's not intended to create a huge platform centralizing videos from the whole world on a single server farm (which is horribly expensive). On the contrary, PeerTube's concept is to create a network of multiple small interconnected video hosting providers. - From PeerTube's FAQ(verbatim except for a few minor grammar errors)

A more descriptive explanation of PeerTube here: https://en.wikipedia.org/wiki/PeerTube

FAQ: https://joinpeertube.org/faq Documentation: https://docs.joinpeertube.org/

____________

Framasoft is the parent organization of Peertube. It maintains the source code for PeerTube and several other projects. It's also based in France(important if you want to send tax-deductible donations to Framasoft).

Website on the parent organization: https://framasoft.org/en/association/

> The Framasoft association is a 1901 not-for-profit association whose character of general interest authorizes a tax deduction. Which shows its willingness to stay an association on a human scale (less than forty members, less than ten permanent staff) ___________

Sorry for the crappy formatting, I wasn't sure how to format the information optimally.


Wow, thanks for the info dump. I got really excited that they had somehow figured out how to do WebRTC with their P2P model in a way that scaled to >10 viewers. Unfortunately I looked at their roadmap description and it said it uses HLS with a one-minute delay:

"

The biggest challenge of live streaming on PeerTube is to get the live stream to be peer-to-peer. After extensive testing, we believe this is possible.

By using the HLS technology that has been built into the PeerTube video player since version 1.3, we believe we can create a live stream with one minute of lag between streamers and viewers.

We want to lay the technological foundation for this live stream feature, so this first version of PeerTube Live will be minimalist. There will be no stream captation tools, no built-in chat, no react emojis...

However, we want to make sure that once the live stream is over, the video will be processed and added to the creator's channel, with every requirement for proper federation checked."

https://joinpeertube.org/roadmap#more


WebTorrent creator here :) Cool use of WebTorrent!


oh wow thank you, you created an awesome library, I feel kind of bad only giving you praise in a comment on my show hn post, but keep up the great work!


How long after sharing this with hacker news did it take for one of us to name their public room "penis"?


it was within the first hour


Can you detail the technology stack a little more? Like how you are using webrtc and webtorrent?


Yeah, this is fancy.


thanks.


Open source?


no but probably will be, mostly not making it public right now because it isn't a pretty project to look at atm.


If you could not use WebTorrent, how would you have built this?


It would have certainly been a lot of work to do that custom, but I would have used webrtc for that as well. I certainly would not have implemented a torrent client myself, which is something that is nice to have as a library, because adding support for creating a room with a magnet uri instead of a local file would be trivial now.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: