Giter Club home page Giter Club logo

go-livepeer's Introduction

go-livepeer


Go Report Card Discord license Contributions welcome

The Livepeer project aims to deliver a live video-streaming network protocol that is fully decentralized, highly scalable and crypto-token incentivized to serve as the live media layer in the decentralized development (Web3) stack. Read our documentation to learn more about the protocol and its economic incentives.

go-livepeer is a Go implementation of the Livepeer protocol which powers the Livepeer Network. Specifically, go-livepeer contains implementations of Broadcaster, Orchestrator, and Transcoder nodes (roles) in the Livepeer Network ecosystem.

Table of Contents

Requirements

This project requires go and a unix shell.

Getting Started

To get started, clone the repo and follow the installation guide.

Next, follow the guide to set up a private ETH network with the Livepeer protocol deployed.

Contributing

Thanks for your interest in contributing to go-livepeer. There are many ways you can contribute to the project, even for non-developers.

To start, take a few minutes to read the "Contributing to go-livepeer" guide.

We look forward to your pull requests and / or involvement in our issues page and hope to see your username on our list of contributors πŸŽ‰πŸŽ‰πŸŽ‰

Resources

To get a full idea of what Livepeer is about, be sure to take a look at these other resources:

go-livepeer's People

Contributors

ad-astra-video avatar alexkordic avatar chrishobcroft avatar cyberj0g avatar darkdarkdragon avatar dependabot[bot] avatar dob avatar eladmallel avatar eliteprox avatar emranemran avatar ericxtang avatar hjpotter92 avatar iameli avatar j0sh avatar jailuthra avatar kyriediculous avatar leszko avatar mjh1 avatar mk-livepeer avatar oscar-davids avatar rahulbansal16 avatar riccardobiosas avatar rickstaa avatar stronk-dev avatar strykar avatar thomshutt avatar tianhe avatar victorges avatar ya7ya avatar yondonfu 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

go-livepeer's Issues

Relay Node

Add a Relayer struct in BasicNetwork to relay on the messages.

Broadcaster create ABS stream

The broadcaster should keep track of all the transcoding result by creating a new stream that contains a master playlist.

This new stream will be used when viewers request for the ABS stream.

Duplicate nodeID

Someone can potential re-use the same priv/pub keypair to start multiple nodes. What's stopping them from doing such?

Do we have to do a seek for the node's ID at the bootstrap process to make sure no node with the same ID already exists on the network?

Output / Recording Integration

The Livepeer network should be able to output a live stream into a storage solution.

Currently the best way to do it is using the broadcasting software (for example, OBS allows you to broadcast and record at the same time).

But we should also plan to integrate with cloud solutions like Swarm, IPFS, and S3.

BasicStream Race Condition

BasicStream sometimes will give an error EOF.

I suspect this is due to 2 go routines writing and reading the same stream at the same time.

Need to do more testing to figure out what's going on.

create datadir

Should be able to load keys from datadir instead of generating new keys every time.

Async network message handling

Right now messages can get dropped by the networking layer if it's coming too quickly. (See example in basic_network_test.go/TestSubscriber). We could make it faster by spinning off go routines for message handling instead of doing it in a loop.

Video Skipping When Using ffplay

ffplay skips due to the initial delay when video is requested from the network.

A potential fix is to change the logic in livepeer stream, where we request the video first, and don't invoke ffplay until we know the video started on the local node.

PPSPP Integration

Integrate go-ppspp.

Tasks:

  • Separate Livepeer network p2p protocol from video delivery (ppspp) protocol - this means each will have its own handler
  • Implement the VideoNetwork interface

API Package

The node should have a native go API package. This can then be utilized by the http & ipc packages for exposing the API.

Transcoding Job

Add a Transcode Job, following the workflow diagram

The transcoding job does the following:

  • Subscribes to the broadcasted stream
  • Creates new streams based on the transcoding config
  • Make the new streams known to the broadcaster.
  • Does the transcoding operation on each chunk as soon as it becomes available
  • Populate the new streams with transcoded chunks.

Unsubscribe crashes node

Subscribe to a HLS stream, kill the player, wait for the unsubscribe worker to fire, node crashes.

Transcoder Compatibility Tests

This is to ensure the transcoder is running the correct version of ffmpeg on the correct platform. It's important to ensure the transcoder is running the same software as the verifiers, so the output will be able to match in a deterministic way.

This should be an easy challenge/response style workflow - so that when the transcoder comes online, the network is fairly certain there wouldn't be an issue during verification.

Set up gateway + CDN proxy on new toynet

On the old Toynet we had a CDN sitting on top of a public gateway for consuming the streams by ID from our gateway nodes. It would be great to set this up again on the new node.

BasicNetwork

Get broadcaster and subscriber working for basic network

Node Status Reporting

We should be able to peak into what's happening on a Livepeer node. Information we would like to have:

  • Network info (# of peers, # of active streams, bandwidth usage, current network interfaces)
  • Video info (Broadcasting videos, all the video streams, all the video buffers, transcoding jobs)
  • Eth info (Transcoder stake, transcoder stats, token balance, current round, current cycle)

Segmenter Timeout

Sometimes the segmenter times out, but the RTMP connection seems to be still up. The broadcaster now has no idea the stream is no longer working anymore.

We should have a graceful fallback strategy, possibly try to re-create the stream if the RTMP stream is still coming in.

Re-subscribe to the same stream not working

This is because we are not cleaning up the state in the subscriber correctly.

To reproduce:

  • set up a broadcaster and a subscriber
  • view the video through the subscriber by using ffplay
  • kill ffplay
  • try to view again
  • get a 500 error

Readme

Description: A description of your project follows. A good description is clear, short, and to the point. Describe the importance of your project, and what it does.

Table of Contents: Optionally, include a table of contents in order to allow other people to quickly navigate especially long or detailed READMEs.

Installation: Installation is the next section in an effective README. Tell other users how to install your project locally. Optionally, include a gif to make the process even more clear for other people.

Usage: The next section is usage, in which you instruct other people on how to use your project after they’ve installed it. This would also be a good place to include screenshots of your project in action.

Contributing: Larger projects often have sections on contributing to their project, in which contribution instructions are outlined. Sometimes, this is a separate file. If you have specific contribution preferences, explain them so that other developers know how to best contribute to your work. To learn more about how to help others contribute, check out the guide for (setting guidelines for repository contributors)[https://help.github.com/articles/setting-guidelines-for-repository-contributors/].

Credits: Include a section for credits in order to highlight and link to the authors of your project.

License: Finally, include a section for the license of your project. For more information on choosing a license, check out GitHub’s licensing guide!

IPC Interface

The Livepeer daemon should be able to communicate with other local processes through IPC.

Password management

Need a better way to handle the eth password. Take a look at unlock account in Geth.

Transcoder Video Validation

Transcoders should be able to validate they are running the correct version of FFMPEG, and the output is "to-spec" with the protocol.

The naive strategy here would be to have a few test video segment input/output pairs as "gold standard", and the transcoders would run transcoding on those to make sure they are using the right software.

This is NOT a bullet-proof solution. I'm interested in hearing other ideas.

Livepeer Token Faucet

Can be a very basic smart contract + command line tool right now, the point is to have an easy way to get some test Livepeer token.

Add New Network Message for Master Playlist

To support ABS, broadcaster should keep track of all the transcoded streams, and when asked, return a master playlist with all the streams / bitrate information. This requires a new network message type.

Transaction Gas Adjustment

During testing, we'll get this error sometimes: exceeds block gas limit, especially when calling verify() very rapidly.

How do we adjust the gas per transaction in this case?

Resource Cleanup After Stream Ends

The HLSMux, Stream, and Subscriber stays around after the stream ends (receiving a FinishStreamMsg). We should clean it up.

This is non-trivial because we don't know if the stream exists somewhere else in the network. Of course, a simple solution would be to remember the ended stream state for some time, and automatically refuse connection if it's requested.

Media Server Add Master Playlist Support

The mediaserver should ask the network for a master playlist when receiving a request and there isn't a local master playlist already.

It should also return a special error if it detects the request is for a media-playlist that's contained in a local master-playlist. This way we don't have to go to the network, and the mediaserver will know to ask for the media-playlist.

CDN-based Video Broadcasting

Make sure videos can be consumed from a centralized gateway node / page

Open source the player page so anyone can run a gateway node / page

Add a paragraph in the tutorial on how to set up a gateway node / page

New Network Message for Master Playlist

To support ABS, broadcaster should keep track of all the transcoded streams, and when asked, return a master playlist with all the streams / bitrate information. This requires a new network message type.

Peer Optimization

We want to keep track of the peers, especially when we lose connectivity.

Response from the libp2p team:

For this, you can create a network notifee that receives notifications about peers connecting and disconnecting to your node. The notifee interface is here: https://github.com/libp2p/go-libp2p-net/blob/master/interface.go#L156 And then to subscribe for those notifications, call swarm.Notify(nn) (https://github.com/libp2p/go-libp2p-swarm/blob/master/swarm.go#L355). With that, you can implement your own logic on managing the number of peer connections you have. In ipfs right now we don't yet set any limits with regards to number of connections as we havent determined a good heuristic on what a 'useful' peer is. We are going to be working on that for ipfs pretty soon, but you should be able to implement such logic for yourself pretty easily.

We can also keep track of the bandwidth of the swarm by use a "bandwidth metrics collector" when creating the swarm. https://github.com/libp2p/go-libp2p-swarm

Eth Account Setup For Node

A node has to have a Eth account.

The node should take

  • a -transcoder flag to declare that it wants to be a transcoder
  • a -maxprice flag to declare the advertised max price
  • a -gethipc flag to specify where the geth.ipc file is

If the node is started with -transcoder=true flag, then it monitors the local ethereum node for transcoding jobs. It starts transcoding when a job is assigned to it.

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.