Skip to main content

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

TypeCodecs
VideoH264

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. image

Once everything is set up and the accesstoken is also given you're done setting things up. image

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

KeyNameTypeHelp / DescriptionSelect OptionsDefault / Value
processprocess selectorselectSelects the specific processLivepeer
access_tokenAccess tokenstringYour Livepeer access token
target_profilesProfilessublistTracks to transcode the source into

Required Profile options

KeyNameTypeUnitHelp / Description
nameNamestrMust be unique within this transcode
bitrateBitrateintbit/s, kbit/s, Mbit/sTarget bit rate of the output

Optional profile options

KeyNameTypeDefaultUnitHelp / DescriptionOptions (if applicable)
widthWidthintmatch sourcepxOutput width (matches source/aspect if unset)
heightHeightintmatch sourcepxOutput height (matches source/aspect if unset)
fpsFramerateint0frames/s0 = match input framerate
gopKeyframe interval / GOP sizestr0.0seconds“0.0” = match input, “intra” = only keyframes
profileH264 ProfileselectH264HighEncoding profileHigh, Baseline, Main, Constrained High
track_inhibitTrack inhibitor(s)stringaudio=none&video=none&subtitle=noneIf this selector matches, profile is skipped

Optional process options

KeyNameTypeDefaultUnitHelp / DescriptionOptions (if applicable)
custom_urlCustom API URLstringhttps://livepeer.live/apiAlternative API endpoint
hardcoded_broadcastersHardcoded broadcastersstringUse fixed broadcasters instead of Livepeer gateway
leastliveStart in the pastboolfalseStart as far back as possible instead of live edge
min_viewersMinimum viewersint0Transcode only active when ≥ this many viewers

General process options

KeyNameTypeDefault / ValueUnitHelp / DescriptionOptions (if applicable)
debugDebug leveldebugDebug message level for process; inherits from stream setting
exit_unmaskUndo masks on process exit/failbooleanfalseResets input track masks to defaults when process exits or fails
sinkTarget streamstringWhat stream the encoded track should be added to (defaults to source stream)
sourceSource streamstringWhich stream the encoded track should pull from, defaults to the stream the process is added towards
source_maskSource track maskselectKeep original valueDefines which internal processes have access to source tracksEverything, Processing tasks, Processing + pushing tasks, Processing + viewing tasks
target_maskOutput track maskselectKeep original valueDefines which internal processes have access to output tracksEverything, Viewer, Pushing, Processing, and combinations
track_selectSource selector(s)stringaudio=all&video=allWhat tracks to select for input (defaults to all audio and video tracks)
start_controlProcess start behaviourgroupControls when and how process startsSee below

start control options

SubkeyNameTypeDefaultUnitHelp / DescriptionOptions (if applicable)
inconsequentialInconsequential processboolfalseProcess not required for stream to be considered active
restart_delayRestart delayuint0msDelay between restarts
restart_typeRestart behaviourselectfixedWhat to do when the process exits/failsfixed, backoff, disabled
tags_inhibitTag inhibitor(s)inputlist""List of tags preventing process start
track_inhibitTrack inhibitor(s)stringaudio=none&video=none&subtitle=noneWhich tracks inhibit process start