Encoder - Livepeer network
Encoder - Livepeer network
This encoder leverages the Livepeer network in order to do encoding. Using their decentralized network comes with a cheap price so it can be very interesting if your own hardware isn't capable of encoding all your streams.
codec support
Type | Codecs |
---|---|
Video | H264 |
Configuration
The Livepeer network requires an API key to access and an encoding profile must be set up.
Interface
The Livepeer network encoder is much easier to set up through the interface for the first time. Another thing to keep in mind is that you can set multiple profiles to receive a full encoding tree.
Each profile does need a name, resolution and bitrate in order to work. Other settings are optional.
Once everything is set up and the accesstoken is also given you're done setting things up.
Configuration file / API
The following would be an example of how to add MKV In/Out to your stream.
{
"process": "Livepeer",
"target_profiles": [
{
"name": "720p",
"bitrate": 5000000,
"width": 1280,
"height": 720,
"fps": 60,
"gop": "1"
}
],
"access_token": "accesstokenhere",
"custom_url": "https://livepeer.live/api",
"exit_unmask": false,
"leastlive": "false",
"min_viewers": 1,
"inconsequential": false,
"restart_type": "fixed",
"tags_inhibit": []
}
Command line
This would be adding a command to the stream example
.
MistProcLivepeer '{"access_token":"accesstokenhere","source":"example","custom_url":"https://livepeer.live/api","exit_unmask":0,"inconsequential":0,"leastlive":"false","min_viewers":1,"process":"Livepeer","restart_type":"fixed","source":"test","tags_inhibit":null,"target_profiles":[{"bitrate":5000000,"fps":60,"gop":"1","height":720,"name":"720p","width":1280}]}'
Required options
Key | Name | Type | Help / Description | Select Options | Default / Value |
---|---|---|---|---|---|
process | process selector | select | Selects the specific process | Livepeer | |
access_token | Access token | string | Your Livepeer access token | ||
target_profiles | Profiles | sublist | Tracks to transcode the source into |
Required Profile options
Key | Name | Type | Unit | Help / Description |
---|---|---|---|---|
name | Name | str | — | Must be unique within this transcode |
bitrate | Bitrate | int | bit/s, kbit/s, Mbit/s | Target bit rate of the output |
Optional profile options
Key | Name | Type | Default | Unit | Help / Description | Options (if applicable) |
---|---|---|---|---|---|---|
width | Width | int | match source | px | Output width (matches source/aspect if unset) | — |
height | Height | int | match source | px | Output height (matches source/aspect if unset) | — |
fps | Framerate | int | 0 | frames/s | 0 = match input framerate | — |
gop | Keyframe interval / GOP size | str | 0.0 | seconds | “0.0” = match input, “intra” = only keyframes | — |
profile | H264 Profile | select | H264High | — | Encoding profile | High, Baseline, Main, Constrained High |
track_inhibit | Track inhibitor(s) | string | audio=none&video=none&subtitle=none | — | If this selector matches, profile is skipped | — |
Optional process options
Key | Name | Type | Default | Unit | Help / Description | Options (if applicable) |
---|---|---|---|---|---|---|
custom_url | Custom API URL | string | https://livepeer.live/api | — | Alternative API endpoint | — |
hardcoded_broadcasters | Hardcoded broadcasters | string | — | — | Use fixed broadcasters instead of Livepeer gateway | — |
leastlive | Start in the past | bool | false | — | Start as far back as possible instead of live edge | — |
min_viewers | Minimum viewers | int | 0 | — | Transcode only active when ≥ this many viewers | — |
General process options
Key | Name | Type | Default / Value | Unit | Help / Description | Options (if applicable) |
---|---|---|---|---|---|---|
debug | Debug level | debug | — | — | Debug message level for process; inherits from stream setting | — |
exit_unmask | Undo masks on process exit/fail | boolean | false | — | Resets input track masks to defaults when process exits or fails | — |
sink | Target stream | string | — | — | What stream the encoded track should be added to (defaults to source stream) | — |
source | Source stream | string | — | — | Which stream the encoded track should pull from, defaults to the stream the process is added towards | — |
source_mask | Source track mask | select | Keep original value | — | Defines which internal processes have access to source tracks | Everything, Processing tasks, Processing + pushing tasks, Processing + viewing tasks |
target_mask | Output track mask | select | Keep original value | — | Defines which internal processes have access to output tracks | Everything, Viewer, Pushing, Processing, and combinations |
track_select | Source selector(s) | string | audio=all&video=all | — | What tracks to select for input (defaults to all audio and video tracks) | — |
start_control | Process start behaviour | group | — | — | Controls when and how process starts | See below |
start control options
Subkey | Name | Type | Default | Unit | Help / Description | Options (if applicable) |
---|---|---|---|---|---|---|
inconsequential | Inconsequential process | bool | false | — | Process not required for stream to be considered active | — |
restart_delay | Restart delay | uint | 0 | ms | Delay between restarts | — |
restart_type | Restart behaviour | select | fixed | — | What to do when the process exits/fails | fixed, backoff, disabled |
tags_inhibit | Tag inhibitor(s) | inputlist | "" | — | List of tags preventing process start | — |
track_inhibit | Track inhibitor(s) | string | audio=none&video=none&subtitle=none | — | Which tracks inhibit process start | — |