Code Monkey home page Code Monkey logo

project-lightspeed's Introduction

Logo

Project Lightspeed

Stars Badge Forks Badge Pull Requests Badge Issues Badge GitHub contributors License Badge

A self contained OBS -> FTL -> WebRTC live streaming server. Comprised of 3 parts once configured anyone can achieve sub-second OBS to the browser livestreaming

View Demo · Report a Bug · Request Features

Table of Contents

  1. About The Project
  2. Discord
  3. Getting Started
  4. Usage
  5. Streaming From OBS
  6. Help
  7. Roadmap
  8. Bugs
  9. Contributing
  10. License
  11. Contact
  12. Acknowledgements

About The Project

Project Lightspeed is a fully self-contained live streaming server. With Lightspeed you will be able to deploy your own sub-second latency live streaming platform. The Lightspeed repository contains the instructions for installing and deploying the entire application. So far, Lightspeed includes an ingest service, broadcast service via webRTC and a web application for viewing. Lightspeed is however completely modular. What this means is that you can write your own web app, ingest server or broadcast server.

How It Works

Lightspeed Ingest listens on port 8084 which is the port used by the FTL protocol. Upon receiving a connection it completes the FTL handshake and negotiates a port (this is currently bugged however and defaults to 65535). Once the negotiation is done Lightspeed WebRTC listens on the negotiated port (in the future Lightspeed WebRTC will listen on the loopback interface so the ingest has more control on what packets we accept) and relays the incoming RTP packets over WebRTC. Lightspeed React communicates via websocket with Lightspeed WebRTC to exchange ICE Candidates and once a connection is established the video can be viewed.

Diagram

Here is a diagram that outlines the current implementation and the future implementation that I would like to achieve. The reason I want the packets relayed from Ingest to WebRTC on the loopback interface is so that we have more control over who can send packets. Meaning that when a DISCONNECT command is recieved we can terminate the UDP listener so that someone could not start sending packets that we do not want

Lightspeed Diagram

Built With

  • Rust
  • Golang
  • React

Components

Discord

We now have a Discord server! This is a great way to stay up to date with the project and join in on the conversation! Come stop by!

Getting Started

In order to get a copy running you will need to install all 3 repositories. There are installation instructions in each repo however I will include them here for the sake of simplicity.

Prerequisites

In order to run Lightspeed, Golang, Rust, and npm are required. Additionally the Rust repo requires a C compiler. If you get a linker cc not found error then you need to install a C compiler.

Installation

Clone Repository

git clone https://github.com/GRVYDEV/Project-Lightspeed

Build Ingest Server

cd ingest
cargo build

Build WebRTC Server

Using go get

Warning: Deprecated method (relies on outdated repository)

export GO111MODULE=on
go get github.com/GRVYDEV/lightspeed-webrtc

Using git

cd webrtc
export GO111MODULE=on
go build

Frontend (Based on React.JS)

cd frontend
npm install

Community Installation (Warning: Outdated. Uses deprecated repositories)

Some of our awesome community members have written their own installers for Lightspeed. Here are links to those!

Note: If you want to make a custom installer do so in the /contrib folder and submit a PR. Please make sure to include a README on how to use it!

Usage

Lightspeed Ingest

cd ingest
cargo run --release

Lightspeed WebRTC

Using go get

Warning: Deprecated method (relies on outdated repository)

lightspeed-webrtc --addr=XXX.XXX.XXX.XXX

Using git

cd webrtc
go build
./lightspeed-webrtc --addr=XXX.XXX.XXX.XXX
Arguments
Argument Supported Values Defaults Notes
--addr A valid IP address localhost This is the local Ip address of your machine. It defaults to localhost but should be set to your local IP. For example 10.17.0.5 This is where the server will listen for UDP packets and where it will host the websocket endpoint for SDP negotiation
--ip A valid IP address none Sets the public IP address for WebRTC to use. This is especially useful in the context of Docker
--ports A valid UDP port range 20000-20500 This sets the UDP ports that WebRTC will use to connect with the client
--ws-port A valid port number 8080 This is the port on which the websocket will be hosted. If you change this value make sure that is reflected in the URL used by the react client
--rtp-port A valid port number 65535 This is the port on which the WebRTC service will listen for RTP packets. Ensure this is the same port that Lightspeed Ingest is negotiating with the client
--ice-servers A comma separated list of hosts none List of ICE / STUN servers used by WebRTC for setting up the network connection with the clients

Lightspeed React

You should then configure the websocket URL in config.json in the build directory. If you are using an IP then it will be the public IP of your machine if you have DNS then it will be your hostname.

Note: The websocket port is hardcoded meaning that Lightspeed-webrtc will always serve it on port 8080 (this may change in the future) so for the websocket config it needs to be ws://IP_or_Hostname:8080/websocket

You can host the static site locally using serve which can be found here

Note: your version of serve may require the -p flag instead of -l for the port

cd frontend
npm run build
serve -s build -l 80

The above will serve the build folder on port 80.

View Lightspeed in your web browser by visiting http://hostname or http://your.ip.address.here


Docker

Install Docker and docker-compose.

See the .env file to configure per your needs. At minimum, you need to set WEBSOCKET_HOST. The stream key will be generated automatically on boot, and change each restart, unless you set a static one.

Development

Use docker-compose up to start all containers at once and monitor the logs. When you are happy it is working you can move to running detached.

Run Detached (background)

Use docker-compose up -d to start all containers detached to have them run in the background.

Use docker ps to verify uptime, port forwarding, etc.

You can also use docker-compose logs -f to follow the logs of all the containers, and press CTRL + C to stop following but leave the containers running.

Build Images manually

For development purposes you can choose to build the containers locally instead of Docker Hub. Uncomment the build: and context: directives in the docker-compose.yml

git clone https://github.com/GRVYDEV/Project-Lightspeed
---
./Project-Lightspeed  # Monorepo Root
   frontend/
   ingest/
   webrtc/

Run docker-compose build to build the local container images. If you change the source code you will need to run again. You can run rebuild an individual container via docker-compose build lightspeed-webrtc.


Streaming From OBS

By default, since we are using the FTL protocol, you cannot just use a Custom server. You will need to edit your services.json file. It can be found at:

  • Windows: %AppData%\obs-studio\plugin_config\rtmp-services\services.json
  • OSX: /Users/YOURUSERNAME/Library/Application\ Support/obs-studio/plugin_config/rtmp-services/services.json

Note: Not all versions of Linux have access to OBS with the FTL SDK built in. If you are on Linux and you cannot stream to Lightspeed this may be the issue.

Paste the below into the services array and change the url to either the IP or the hostname of your Project Lightspeed server

Note: for the url it is not prefaced by anything. For example, given an IP of 10.0.0.2 you would put "url": "10.0.0.2" You do not need to indicate a port since the FTL protocol always uses 8084

{
    "name": "Project Lightspeed",
    "common": false,
    "servers": [
        {
            "name": "SERVER TITLE HERE",
            "url": "your.lightspeed.hostname"
        }
    ],
    "recommended": {
        "keyint": 2,
        "output": "ftl_output",
        "max audio bitrate": 160,
        "max video bitrate": 8000,
        "profile": "main",
        "bframes": 0
    }
},

NOTE: You do not need to specify a port.

After restarting OBS you should be able to see your service in the OBS settings Stream pane. (Special Thanks to Glimesh for these instructions)


Stream Key

We are no longer using a default streamkey! If you are still using one please pull from master on the Lightspeed-ingest repository. Now, by default on first time startup a new streamkey will be generated and output to the terminal for you. In order to regenerate this key simply delete the file it generates called hash. In a Docker context we will work to make the key reset process as easy as possible. Simply copy the key output in the terminal to OBS and you are all set! This key WILL NOT change unless the hash file is deleted.

Streamkey example

Help

This project is still very much a work in progress and a lot of improvements will be made to the deployment process. If something is unclear or you are stuck there are two main ways you can get help.

  1. Discord - this is the quickest and easiest way I will be able to help you through some deployment issues.
  2. Create an Issue - this is another way you can bring attention to something that you want fixed.

Roadmap

I will be fleshing out the roadmap in the coming days. As of right now I want to get this to a point where it is as close to other live streaming services as possible. If there are any features that you want to see then feel free to suggest them!

See the open issues for a list of proposed features (and known issues).

Bugs

I am very from perfect and there are bound to be bugs and things I've overlooked in the installation process. Please, add issues and feel free to reach out if anything is unclear. Also, we have a Discord.

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch: git checkout -b feature/AmazingFeature
  3. Commit your Changes: git commit -m 'Add some AmazingFeature'
  4. Push to the Branch: git push origin feature/AmazingFeature
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Garrett Graves - @grvydev

Project Link: https://github.com/GRVYDEV/Project-Lightspeed

Acknowledgements

project-lightspeed's People

Contributors

cmaddick avatar crowdedlight avatar enigmacurry avatar grvydev avatar johnmclear avatar lunaphied avatar mensinda avatar nitrag avatar r4rdsn avatar spoopytim avatar taq5z6ee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

project-lightspeed's Issues

[v2] Create web SDK

Create a SDK to make it easier for folks to build their own websites with Lightspeed

  • NPM Package
  • static host

Request: Diagram of how each component interacts with the other

If you're like me and have a very basic understanding of OBS, FTL, WebRTC, etc, it would be very helpful to see how each Lightspeed component interacts with the other.

From what I could gather, the diagram looks something roughly like this: OBS <--> Ingest <--> WebRTC <---> React client

If not, then that should illustrate the need for a diagram :D

WHIP Support

Lets implement WHIP support that will open up the possibilities in terms of sending video into lightspeed. This will allow any valid WHIP clients to send video to be broadcasted.

Future: Static site streams

On the static site allow multiple people to stream for free with a limit of 30 minutes. This will come after we implement multi-streaming functionality. In the meantime we can have a test stream running there for demonstration purposes.

Refactor to use Ion-SFU

Right now we are just using Pion for the WebRTC transports. We can leverage Ion SFU to take advantage of their relay logic that will hopefully help with quality of delivery

Can't get Video Stream over network (public domain)

I patch the webrtc with the pr for wss

and add a SSL Cert.

All looks great, Websocket commucation is loaded, but the Video Stream isn't shown.

Used the docker-compose file with my modifed webrtc version.

Video framerate is very low, image doesn't update often

Hello!

First of all, thanks for this project. I think it's gonna be awesome. But, at the moment, I am having a problem.

I have set up Lightspeed on a digitalocean droplet using the Ubuntu installer, and everything seems to be "working", but the video is very choppy. See below video; I am watching a youtube video on the left and the right shows how it looks in lightspeed.

lightspeed.mp4

Here is a screenshot of my OBS options:

obs64_2021-01-14_04-37-39

And the output resolution is set to 1080p.

I am using Chrome 87.4280.141 and OBS 26.1.1.

Feature: Static Marketing Website

I would love it if someone created a static website that explains about Project Lightspeed and also provides links to the repositories etc. I have a bunch of other things I need to work on right now so I wont be able to get to this for a little bit

Firefox and Edge Problems

Hey,
does anyone have Problems with Playback in Firefox and Microsoft Edge? The problem appears for me in the Docker-compose installation and with the shell script. Currently, I am running the Docker Compose version.

With firefox, I get some really weird problems. In a Windows machine with version 72.0.1 installed the stream and website run just fine. When I try to run this on an Ubuntu Machine with the Firefox version 86.0 installed I can't load the stream it just trying to reconnect to the Websocket. In the Browser console it shows the error "the connection to ws://my_ip_adresse:8080/websocket was interrupted, while the page was being loaded." and "Socket encountered an error". Closing Socket.

In the container logs, it shows the message "lightspeed-webrtc | could not set remote description: unable to start track, codec is not supported by remote"

In Microsoft Edge, the page isn't working at all. In the console it shows"SCRIPT65536: The Argument isn't optional." pointed on line 260 in http://url/static/node-modules/react-dom/cjs/react-dom.production.min.js.
Docker logs:
lightspeed-react | my_ip_adresse - - [22/Mar/2021:08:14:23 +0000] "GET /static/js/2.6b14339e.chunk.js.map HTTP/1.1" 200 452018 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/18.17763" "-"

Feature: Quality Picker

A QoL thing we're all used to is automatic and or manual quality selection.
At the expense of encoding additional video feeds a selection menu that lets the user choose which quality they want to use eg. 480, 720, 1080p etc etc.

Feature: Discord Integration

Would be great to use this for streaming for private Discord servers, I would need:

  • Synchronised live Discord chat using webhooks to send messages to an existing channel from the web interface and a bot to read them (unless you have a better method).
  • Authentication through Discord guild, a bot checks if a user is a member of the guild before allowing access to chat and stream.
  • List of currently watching members, like a list of profile icons at the bottom.

For all this frontend stuff I use this currently: https://github.com/streamnight/StreamNight
Doesn't include a solution for encoding and distributing video though so its' not as self-contained as yours could be.

Looks very promising best of luck to you :D

OBS implementation instructions

As per obsproject/obs-studio#3834 , it's now possible to use OBS's custom stream output/service to push an FTL protocol feed directly (without needing to modify the "services.json" file as per current README). This only works on recent OBS releases following the PR merge, so old instructions should probably remain as well, but the integrated method is obviously a lot more convenient so that should probably be mentioned first

Documentation Rework

Lets work on the documentation!

We need step-by-step installation for a basic setup with more advanced config options for expanding on the basic setup, as well as more straightforward and organised contribution guidelines.

Below is the structure that would be ideal. Feel free to suggest anything that needs adding or changing.

  • Logo
  • Badges (Discord, CI Status, Stargazers, License, PR's, Issues, Contributers)
  • Tagline
  • Table of Contents
  • Introduction
    • About
    • Use Cases & Architecture
    • Roadmap
  • Getting Started
    • Prerequisites
    • Project Structure
    • Instructions
  • Configuration
    • Environment Variables
    • Port Mappings / Firewall
    • Config File
    • CLI Usage
    • Additional Notes
  • Contributing
    • Links to other documents (PULL-REQUESTS.md, CONTRIBUTING.md, LICENSE.md)
    • Contribution Steps
  • Acknowledgements

For each point make sure that it follows these guidelines

  • Is concise and to the point (Exceptions include anything under Introduction)
  • Is gramatically correct
  • Uses good-looking markdown (where applicable)

Feedback on the setup

I wanted to get this running locally for fun. Had a few snafus so just providing feedback to perhaps help the readme's. (Unfortunately I don't have the time to make the changes myself.)

  • meta: Getting everything up and running on localhost/127.0.0.1 seems like the first step, so perhaps all the docs/defaults should start you there, before you deploy things
  • the ws port is hardcoded, but I didn't expect that. Might as well add some comments in wsUrl.js to indicate that 8080 is hardcoded as the ws port in ls-webrtc
  • in the services.json i tried http://localhost and http://localhost:8084 and rtmp://127.0.0.1 and none worked. finally just tried 127.0.0.1 and it worked. your docs kinda suggest "just" the IP but since it was different then the rest of the server urls in services.json i wasn't sure. also i was surprised there was no port indicated here.
  • in my already locally installed version of serve (6.4.9) the port flag is is -p not -l. shrug.
  • i still don't really understand how the injest server communicates with lightspeed-webrtc (is it the 65534 port i saw in the source?).. but tbh a user probably doesn't need to understand this bit 😛
    . It just stood out since I was manually matching up IPs and ports across the other parts, and this one seemed to work automagically.
    • can ls-webrtc output a log entry when it is 'connected' to the injest server? would be nice just to confirm that bit is working.
  • the "View demo" link in all 4 readmes don't point to what i expected. :) in -injest, it just points to the root of -injest. even the project-ls readme it just points to itself. I wouldn't really call that a "demo", more just the "Project Overview" perhaps.. or "overview documentation". but i certainly preferred using the aggregated docs instead of visiting each. ;)

anyway..

nice job on all this. it was fun to get going. :)

Screen Shot 2021-01-04 at 3 55 21 PM

Info: Discord Server is now LIVE! Demo video is also now LIVE!

Hey guys!
I went ahead and made a Discord server so we have a better place for bug fixing and technical support. I will be looking for some moderators so if you are interested feel free to join and message me! Also if you are having any trouble please join the server and I will do my best to help you work through it!

Edit: I also finally made a demo video! The demo link now works on all 4 repositories!

Edit Edit: I uploaded the wrong video so right now there is no sound. New one is uploading right now!

Server

WebRTC Stream not playing on IOS 15+

Attempts so far:

  • Multiple phones
  • Experimental WebRTC settings in safari

With this we can assume that its a problem related to IOS 15
Confirmed to work on M1 Macbook

This is the common error between all devices
image

External Information
OvenMediaEngine managed to fix this issue but the solution seems a bit random, it seems to have something to do with tcp packets being fragmented due to bad threading
The issue in question: AirenSoft/OvenMediaEngine#517
The solution: AirenSoft/OvenMediaEngine@e3ba399

New Logo

So the current logo is not awful however I would like to incorporate a logo from the community! If you are a logo designer and would like to put one together I would really appreciate it! I would prefer to keep the current color but I am open to all ideas!

lightspeed-ingest error, stream fails to load

receive this error once instructions were followed + software installled

"10:21:28 [ERROR] Invalid attribute command. Attribute parsing failed. Key was "GET / HTTP/1.1\r\nHost", Value was ""

static page is served on port 90, not sure if that changes other factors?

very new to tthis

later errrors:

"10:25:24 [ERROR] There was a socket reading error
10:25:24 [ERROR] Nothing received from the frame
10:25:55 [ERROR] There was an error Io(Custom { kind: Other, error: "bytes remaining on stream" })
10:25:55 [ERROR] Nothing received from the frame
"
not sure if a concern.

thanks!

install script error

the injest server compiles fine but the webrtc one errors.. when using the script or just 'go build'

  • cd Lightspeed-webrtc
  • git checkout main
    Already on 'main'
    Your branch is up to date with 'origin/main'.
  • GO111MODULE=on
  • go build
    main.go:15:2: cannot find package "github.com/GRVYDEV/lightspeed-webrtc/ws" in any of:
    /usr/lib/go-1.10/src/github.com/GRVYDEV/lightspeed-webrtc/ws (from $GOROOT)
    /root/go/src/github.com/GRVYDEV/lightspeed-webrtc/ws (from $GOPATH)
    main.go:16:2: cannot find package "github.com/gorilla/websocket" in any of:
    /usr/lib/go-1.10/src/github.com/gorilla/websocket (from $GOROOT)
    /root/go/src/github.com/gorilla/websocket (from $GOPATH)
    main.go:18:2: cannot find package "github.com/pion/interceptor" in any of:
    /usr/lib/go-1.10/src/github.com/pion/interceptor (from $GOROOT)
    /root/go/src/github.com/pion/interceptor (from $GOPATH)
    main.go:19:2: cannot find package "github.com/pion/rtp" in any of:
    /usr/lib/go-1.10/src/github.com/pion/rtp (from $GOROOT)
    /root/go/src/github.com/pion/rtp (from $GOPATH)
    main.go:20:2: cannot find package "github.com/pion/webrtc/v3" in any of:
    /usr/lib/go-1.10/src/github.com/pion/webrtc/v3 (from $GOROOT)
    /root/go/src/github.com/pion/webrtc/v3 (from $GOPATH)

Lightspeed-React issues

Hello,
I have managed to follow everything in the installation guide and have Lightspeed-ingest working and i think Lightspeed-webRTC.
However after serving Lightspeed-React i cannot connect to the page and just get a "This Page cannot be reached" message.
I have changed the config.json wsURL to ws://10.0.0.36:8080/websocket and have opened ports on ufw . However from another machine it will not display the site.
If i add the port 8443 onto the end then sometimes it does load a blank dark grey site but nothing appears on it.
Can someone help with getting this working.

I am running Lightspeed-React on a Ubuntu 20.04 machine and running OBS and trying to access the site on a windows 10 machine.

Feature: Multiple streams/channels

Title is really self descriptive. Would be really cool to have the ability to make multiple feeds available.

Fantastic work so far @GRVYDEV, I've been looking for something like this for a while!

Feature: Remote Desktop Control

Request Desktop Control

One feature I think would be neat, but not sure how easy or hard it would be to implement, is to have a VNC like experience with keyboard and mouse control.

Docker + Docker Compose

Docker + Docker Compose

The project deployment needs to be simplified with a docker and docker-compose structure. We need a pull request to address adding this as a first class support model.

Cool Project But it has 2 or 3 issues that I encountered

I followed the instructions on the docker-compose setup.

My first Issue I noticed was stuttering in the video. It didn't happen all the time but it was noticable.

My second issue was with audio. It worked out of the box for me, however my friend couldnt get audio to work whatso ever

My third issue I encountered was that when I had 2 users already viewing the stream a third one failed to display anything.
dev console in chrome

I am running chrome version: 88.0.4324.190

obs encoder settings
obs audio settings

howto: can not see stream on the web page

Hi, I setup the three compents on one PC and I succeeded to push the stream to the ingest(connected log) from the OBS.
ws ip is changed to the LAN ip of this PC in src/wsUrl.js.
But when I refresh the 80 web(by access the PC LAN IP), nothing happens.

Listening to port 8084

Hey there,
first of all, thank you for posting this project.
When I am starting the "cargo run --release" command my terminal stucks at the Message "Listening on port 8084". Is it a Network Problem or am I the Problem.

Video stuttering issues, any recommendations?

Hey there, I absolutely love this project! My friends and I are using it as a potential replacement for Discord Nitro, as the free streaming quality of Discord is really really bad.

The one issue we have is stuttering in the stream. Every couple seconds, there's like a quarter-second stutter in the video feed. Playing around with OBS Output settings, it seems like a higher bitrate actually lowers the amount of stuttering. Changing the keyframe interval didn't seem to do anything.

What are the possible ways of fixing this? For example, could an option be added to increase the stream delay to reduce stuttering? Right now we're getting like 250ms stream delay, but we'd be fine with up to like 750ms probably.

Security Issue: default stream key?

Hey,

i'm not sure if i do understand that right, but if the stream key has a default value (in this case 123456789-aBcDeFgHiJkLmNoPqRsTuVwXyZ123456),
wouldn't it be a security issue if it is not changed before hosting Lightspeed?

I mean, if i would know some IPs that are running your software, i could easiely use the default key just to try to connect?

Maybe a random generated key (or one handled by a docker environment label) would be better?

Ubuntu installer script assumes some components are not already installed

The Ubuntu installer script does not just install project lightspeed, it also installs the package manager version of nginx (and certbot if TLS option is chosen) and overwrites any existing setup/configuration on the system that someone might have.

Lost my whole nginx configuration because there was no warning, it just went and overwrote it, I thought I was installing lightspeed :)

Please make this optional so that if anyone attempts this script on not a fresh system, their existing configs don't get silently obliterated

Also, when certbot realized my domain was already set up, it hit a snag and the installation script didn't complete.

React not Connecting to Websocket Host

This may be related to other issues, but I didn't see the specific error that I was getting.

Mine is being run in docker-compose through Portainer (Portainer handles .env files a bit differently). I can get OBS to connect to the ingest server, I can reach the react page, but pressing play does nothing.

The webrtc logs show only Waiting for RTP Packets and not any connection.

In the browser console I am seeing the below errors. The font one is obvious and has PR waiting to fix it. The other issue I see is React trying to reach the webRTC host on the wrong address and port.

Loading failed for the <script> with source “https://kit.fontawesome.com/99754263de.js”. [10.10.10.210:8888:1:1](http://10.10.10.210:8888/)

Firefox can’t establish a connection to the server at ws://localhost:8080/websocket. [SocketContext.jsx:11:16](http://10.10.10.210:8888/static/js/context/SocketContext.jsx)
  Socket encountered error. Closing socket. [SocketContext.jsx:106:14](http://10.10.10.210:8888/static/js/context/SocketContext.jsx)
    onerror SocketContext.jsx:106

Any thoughts as to what is going on here?

.env file

WEBSOCKET_HOST=10.10.10.210
WEBSOCKET_PORT=8088
WEB_PORT=8888
INGEST_PORT=8084
STREAM_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

compose file

version: '3'

services:
  ingest:
    image: projectlightspeed/ingest
    #Uncomment below to build locally
#    image: lightspeed-ingest
#    build:
#      context: ./ingest
#      dockerfile: Dockerfile
    env_file: 'stack.env'
    restart: on-failure
    ports:
      - "8084:8084"
  
  react:
    image: projectlightspeed/react
    #Uncomment below to build locally
#    image: lightspeed-react
#    build:
#      context: ./frontend
#      dockerfile: Dockerfile
    env_file: 'stack.env'
    restart: on-failure
    ports:
      - "8888:80"

  webrtc:
    image: projectlightspeed/webrtc
    #Uncomment below to build locally
#    image: lightspeed-webrtc
#    build:
#      context: ./webrtc
#      dockerfile: Dockerfile
    env_file: 'stack.env'
    command: ["lightspeed-webrtc", "--addr=0.0.0.0", "--ip=10.10.10.210", "--ports=20000-20100", "run"]
    restart: on-failure
    ports:
      - 8088:8080 # WebRTC
      - 65535:65535/udp # RTP
      - 20000-20100:20000-20100/tcp # WebRTC PeerConnection
      - 20000-20100:20000-20100/udp # WebRTC PeerConnection UDP

Feature: Payments / SuperChats?

I see a lot of similar projects popping up and I'm still trying to brainstorm the best route to take for a SuperChats alternative for self-hosted streams. How can participants help the artist? OBS plugins? All ideas welcome :)
Thanks!

Hosting the Streaming server in an offline environment

Hey There,
I am having some troubles with hosting this project in an offline environment. I am using the Docker method, but manually built, because of the background image. Besides, this I changed nothing in the config.
My issue is that the Website tries to connect to fonts.googleapis.com and kit.fontawesome.com. I was trying to download the char sets from Google and implement it local to the website, but I failed. I'm not really experienced in web development. I feeling a little bit lost...
Is there an easy way to fix this problem? 

About the .env file, least to know princible.

I try with my docker-compose files to explicitly give them only the environment variables they need.

Which of the environment variables is needed for which container?

I try to use the .env file only for keys/passwords :)

This is an awesome project :)

build error

I unfortunately have too little experience with rust, can someone help me further

THX

Build on Ubuntu 20.04.1 LTS
rustc 1.43.0

#> cargo build
...
...
Compiling tokio-stream v0.1.1
Compiling tokio-util v0.6.0
error[E0277]: the trait bound std::io::IoSlice<'_>: std::marker::Copy is not satisfied
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-util-0.6.0/src/lib.rs:189:30
|
189 | let mut slices = [IoSlice::new(&[]); MAX_BUFS];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait std::marker::Copy is not implemented for std::io::IoSlice<'_>
|
= note: the Copy trait is required because the repeated element will be copied

error: aborting due to previous error

For more information about this error, try rustc --explain E0277.
error: could not compile tokio-util.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed

Info: The Future of FTL

Hi there!

I was crawling through everything around the tech used in Lightspeed.
I even found obsproject/obs-studio#3881 by @GRVYDEV

As I am somewhat a packaging freak I brought FTL to Arch Linux today with the AUR package obs-studio-ftl.
To get this upstream into Arch I planned to upstream my changes needed for packaging in OBS: obsproject/obs-studio#4018

But looking at comments in my PR, as well as this PR it seems as if FTL is going to be removed soon-ish from OBS, as it is unmaintained and there are competing protocols trying to achieve the same goals.

Therefore I want to propose to move away from FTL to SRT, which could be a really good replacement, that's already supported in OBS through ffmpeg.

To be honest this is really a bummer as Lightspeed is really amazing software. But building on a wonky foundation would probably make maintaining this more and more difficult over time.

There are a few SRT protocol libraries on crates.io. Notably srt-rs which procides bindings for the aforementioned SRT library.

Now I haven't researched anything regarding codecs and how easy the SRT -> WebRTC "translation" will be. I might add more details later

Feature: Chat

Chat and Communication

Can we build in real time communication using NodeBB? I'm thinking if you can find a way to sync up the time of the comments and the time of the live stream, you could keep everything in sync with something like Influx.

Webrtc Exception: RTP header size insufficient

Windows 10: When pressing "Start Streaming" in OBS the Lightspeed-webrtc crashes with the following exception:

$ lightspeed-webrtc.exe --addr=localhost
Waiting for RTP Packets
panic: size 12 < 16: RTP header size insufficient
goroutine 1 [running]:
main.main()
C:/Users/User/go/pkg/mod/github.com/!g!r!v!y!d!e!v/[email protected]/main.go:103 +0x867

Followed the instructions for installation and usage (ingest, webrtc and react running). IP adress 'localhost' in 'services.json' and as '--addr' parameter of webrtc. OBS->Settings->Stream->Service "Project Lightspeed' like seen in the screenshot. Ingest seems to be working and prints:

Listening on port 8084
Hashes match!
Client connected!
Protocol Version: 0.9
Vendor Name: OBS Studio
Vendor Version: 25.0.4
Video Codec: H264
Video Height: 720
Video Width: 1280
Audio Codec: OPUS

grafik

Feature: 10-bit HEVC + OPUS streaming

Right now, it's possible to stream (to for example youtube or twitch) by encoding a video in advance and steaming with ffmpeg -re -i input.mkv -c copy -f flv rtmp://{url}. However, right now, twitch (for example) only supports 8-bit h.264 and AAC. Youtube, in a sort of unofficial way, also allows streaming with HEVC (I think with HLS) but it transcodes the video so the quality is usually worse than h.264 on twitch anyways.

For the best possible quality, it would be amazing if lightspeed could support 10-bit (or even 8-bit would be an upgrade) HEVC streaming with the OPUS audio codec. Opus is, right now, the best lossy audio codec, and can reach transparency at pretty low bitrates (much lower than AAC can anyway, even with the apple AAC encoder, not to mention opusenc also generally encodes faster than the AAC encoders out there).

React frontent doesn't auto-start with system/docker, only webrtc/ingest do (maybe intentional?)

After doing docker-compose up -d and rebooting the machine, on startup, only webrtc and ingest are running.

Doing docker container ls -a lists all 3, with the status for webrtc and ingest being Up n seconds, where as react has Exited (0) n minutes ago.

running sudo docker start <react container ID> or docker-compose restart starts it up with no issues, and it's exit code 0, so there's no issue with actually running the container. It does, however, still close immediately on reboot.

Is this intentional, is it expected that a user would serve the frontend themselves, or a bug?

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.