mmsaki / star-streamer

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

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

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

https://star-streamer.vercel.app

License:MIT License


Languages

Language:JavaScript 38.1%Language:HTML 26.7%Language:Rust 16.1%Language:CSS 13.4%Language:EJS 5.3%Language:Dockerfile 0.4%