Skip to content

MemeLabs/strims

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


A cute gopher eating popcorn

strims

distributed live streaming

headless service

streaming

connecting remote peers

headless service

  1. Generate a self signed root certificate using the instructions in /hack/tls

  2. Copy hack/svc/config.sample.yaml to hack/svc/config.yaml

  3. Create a user profile

    $ cd /workspaces/strims
    $ go run ./cmd/svc add-profile -config ./hack/svc/config.yaml -username dev -password secret
    2022/06/01 13:48:18 74880235203461122
    2022/06/01 13:48:18 DnLta2pK2GlRLHTobM2jKecX/XNqD4OGDjwWSOs0o7s=
  4. Copy the id and auth key into config.yaml in session/headless like so:

    headless:
       - id: 74880235203461122
         key: DnLta2pK2GlRLHTobM2jKecX/XNqD4OGDjwWSOs0o7s=
  5. Run svc with live reloading using npm

    $ npm run dev:svc

    Take note of the path from the line ws vnic listener starting - you'll need it to connect to the headless service from the ui.

    2022-06-01T13:54:33.545Z        DEBUG   vnic/ws_native.go:43    ws vnic listener starting       {"path": "/0408549bb2971e6051c11c1caafbbd2b0f88b6937d0bf608f6d1a2d4c237a0f8"}
    
  6. Run the webpack dev server

    $ npm run dev:web

    on Windows depending on the directory permissions this may throw an error, if this happens execute the command from the error message then retry the run command.

    Error: Command failed: git rev-parse HEAD ...
    
    $ git config --global --add safe.directory /workspaces/strims
  7. In the web ui at https://0.0.0.0:8080 click new login and enter the username and password you used in the add-profile command.

  8. Toggle the advanced advanced options and enter wss://0.0.0.0:8083/api or the IP of your dev machine or localhost.

    on Windows, this address might have to be set as be wss://localhost:8083/api.

streaming

  1. Create a network

  2. In video ingress, toggle enable and click save changes

  3. Click channels at the bottom of the ingress form

  4. Enter a title for your stream, select your network from the dropdown, and click create channel.

    on Windows, the RTMP address for this channel ingress should be rtmp://0.0.0.0:1935/live

  5. In the channels table click the menu icon to the right of the ingress url and click copy stream key

  6. In OBS stream settings, choose Custom... from the service dropdown. Enter rtmp://0.0.0.0:1935/live for the server and paste the stream key you copied from the channel list.

    on Windows, this address should be rtmp://127.0.0.1:1935/live

  7. In OBS output settings set the keyframe interval to 1 and the bitrate to 6000kbps

  8. Close OBS settings and click start streaming

  9. Click the strims icon to exit settings and click the network gem in the left nav. click the stream thumbnail in the network directory to watch the stream.

This stream is looped back through the headless service's frontend api. Continue to connect a remote peer and watch the stream via p2p.

connecting remote peers

  1. In the web ui while logged into your headless server open the networks list in settings.

  2. In the networks table click the menu icon to the right of the certificate expiry and choose create invite.

  3. In the invite form click create invite

  4. Create or log into a browser profile in the web ui.

  5. From the add network menu in the networks list in settings choose add invite code, paste the invite code, and click join network

  6. In bootstrap settings create a bootstrap client using the path from the headless service log earlier eg wss://0.0.0.0:8083/0408549bb2971e6051c11c1caafbbd2b0f88b6937d0bf608f6d1a2d4c237a0f8

  7. Find the stream thumbnail in the network directory