Coder Social home page Coder Social logo

mmsaki / star-streamer Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 2.0 96.48 MB

HackFS 2023 Hackathon. IPFS — Best Use and libp2p — Best Use.

Home Page: https://star-streamer.vercel.app

License: MIT License

JavaScript 38.12% HTML 26.72% Dockerfile 0.38% Rust 16.06% CSS 13.42% EJS 5.31%
peer-to-peer hackathon p2p streaming video

star-streamer's Introduction

Getting started

pnpm run start
pnpm run rust-peer

streaming

  1. Test streaming with 'node:fs'

    pnpm run stream:base
  2. Create helia stream

    pnpm run stream:helia
  3. Streaming with known cid

    pnpm run stream:cid QmPvt66qGviw7T6r6Qe2Lhpgj6YCpexv8gz7SKXEHq4FD3

Testing

Run

pnpm test

Peer Streaming with hypercore

  1. Convert video into a core

    pnpm run hypercore:convert
  2. Replicate so other peers can also watch it

    pnpm run hypercore
  3. Other peers can join with the core key

    pnpm run hypercore:peer ec429308a714b51a79b583627cc705e6eaf5f6f681a3b7158138ca315dbaea46
    screenshot

Adding movies to ipfs

  1. Create a movie/ direcory and add movie.mp4 and thumbnail.png or .jpg

    mkdir movie
  2. Add and pin movie to ipfs

    ipfs add -r ./movie/
    
    # then
    ipfs pin add QmPzE1...

    Next, You can run ipfs ls QmPzE1rSLhhVvdfyAZkjAuf8KSCxtKbepPZJ99weKFcZHP to see the contents of your movies e.g

    QmVzmsRo6avD1HeBWY3WTUGdqvhya4KK999k77nFZS7i2S 63614462 bigbuck.mp4
    QmcgoEmVE3iSbqGS1Pr5Ad5jASMyGFBLA5wfHKKtb1vSRa 582477   thumbnail.png
    
  3. Next, let's can try stream movies ipfs

Possible Implentations

  1. IPFS Live Streaming by Yurko,Elon, Benedict and Toronto Mesh - Feed video file into the IPFS and distribute content hash
    1. OBS Studio
    2. OpenVPN
    3. Digital Ocean (Host HLS playlist over HTTP)
    4. NGINX with RTMP module (Video source from RTMP server)
    5. FFmpeg (create an HLS stream of chunks)
    6. IPFS (Add to IPFS) - Publish hash to rewrite m3u8 playlist file to IPNS ()
    7. Video.js
    8. Terraform

Additional implementation

You can use FFMpeg to encode Video Stream into chunks and advertise to a gossip network. Possibly an idea to scale the video streaming? - DougAnderson444#7580

  1. Chunk video into mu8 playlist
  2. To announce video chunks to a gossip channel via gossip protocol pubsub

MISC: Append only hyperswarm

  • Create car file

  • Adding swarm to have topics that other peers can join

    pnpm run hyperswarm
    
    # then other peers can join with, able to chat on terminal
    pnpm run hyperswarm (topic)
  • Append only persistent messages storage

    pnpm run hypercore:writer
    # then
    pnpm run hypercore:reader
    
    # writer can send messages to writer

star-streamer's People

Contributors

mmsaki avatar dependabot[bot] avatar

Stargazers

 avatar Nicholas Adams avatar  avatar Russell Dempsey avatar

Watchers

 avatar  avatar

Forkers

dao258 luvnft

star-streamer's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.