Contents:
- Transcoding Overview
- Local Transcoding
- Local Distributed Transcoding
- Outsourced Transcoding (requires payment in ETH)
Livepeer Broadcaster can be configured to request that source video content be resized (transcoded) into different frame sizes and frame rates.
Transcoding allows content to be consumed by devices with less-performant network connections (bytes per second).
This chart shows the most common display resolutions, 16:9 formats shown in blue. source: Wikipedia
Transcoding can be performed on the same computer / server running the Livepeer Broadcaster.
- Open a
Terminal
, and run the following command from the folder containinglivepeer
binary:
./livepeer \
-broadcaster \
-orchAddr 127.0.0.1:8935 \
-transcodingOptions P144p30fps16x9,P240p30fps16x9 \
-v 99
-orchAddr
specifies the location of the Orchestrator / Transcoder service on the network-transcodingOptions
specifies frame sizes and frame rates to be transcoded into.-v 99
is the highest level of logging output.
- Open another
Terminal
, and run the following command from the folder containinglivepeer
binary:
./livepeer \
-orchestrator \
-transcoder \
-serviceAddr 127.0.0.1:8935 \
-v 99
-orchestrator
and-transcoder
tell the software to run in Orchestrator and Transcoder modes-serviceAddr
specifies the IP address and port that this service should run on the network-v 99
is the highest level of logging output.
Livepeer Broadcaster is now running with Local Transcoding enabled.
-
Start publishing content as described in the page about publishing and consuming content
-
Inspect the content metadata to see the additional streams available for consumption:
Note: many players of streaming content will dynamically switch between available streams in order to optimise the quality of playback given the available bandwidth.
Transcoding activities can also be distributed across an Orchestrator, and one or more Transcoders.
- Open a
Terminal
, and run the following command from the folder containinglivepeer
binary:
./livepeer \
-broadcaster \
-orchAddr 127.0.0.1:8935 \
-transcodingOptions P144p30fps16x9,P240p30fps16x9 \
-v 99
- Open another
Terminal
, and run the following command from the folder containinglivepeer
binary:
./livepeer \
-orchestrator \
-orchSecret pineapple \
-serviceAddr 127.0.0.1:8935 \
-v 99
-orchSecret
is a way for this Orchestrator to allow Transcoders to authenticate
- Open another
Terminal
, and run the following command from the folder containinglivepeer
binary:
./livepeer \
-transcoder \
-orchSecret pineapple \
-orchAddr 127.0.0.1:8935 \
-v 99
Livepeer Broadcaster is now running with (Local) Distributed Transcoding enabled.
Transcoding services can be purchased directly from individual Orchestrators operating in Livepeer's public Transcoding Marketplace. Services are provided on a pay-as-you-go basis using Ether as currency, and Arbitrum One for payment clearing. Arbitrum One is a Layer 2 Optimistic Rollup on Ethereum.
-
Obtain an RPC endpoint onto Arbitrum, using Alchemy (requires sign-up). Alternatively, run your own Arbitrum RPC endpoint using these instructions.
-
Open another
Terminal
and run the following command:
./livepeer \
-broadcaster \
-network arbitrum-one-mainnet \
-transcodingOptions P144p30fps16x9,P240p30fps16x9 \
-ethUrl {insert RPC endpoint here} \
-pixelsPerUnit 1 \
-maxPricePerUnit 1 \
-v 99
arbitrum-one-mainnet
signifies Arbitrum One network.-ethUrl
is the location of the RPC endpoint e.g. from Alchemy.-pixelsPerUnit
and-maxPricePerUnit
are for setting the maximum price to be paid for Transcoding
- Enter a Passphrase twice:
Note: no characters will appear in the window when typing the passphrase.
The Passphrase will be used to encrypt the Private Key generated by this process. The Private Key will be used to sign transactions for publishing on Ethereum.
-
Enter the Passphrase again to start the Livepeer Broadcaster.
-
Wait until the text
CLI server listening on 127.0.0.1:5935
is displayed in the console:
- Open a
Terminal
, and run the following command from the folder containinglivepeer_cli
binary:
./livepeer_cli -http 5935
-
Send some ETH from your wallet to the
Broadcaster Account
listed underNODE STATS
. -
In
livepeer_cli
, run option11. Invoke "deposit broadcasting funds" (ETH)
This command will deposit some ETH into a smart contract in Livepeer's protocol, which can be spent on Transcoding services.
-
Enter the amount of ETH you would like to deposit into the contract.
-
Enter the amount of ETH you would like to keep in reserve in the contract, and press return.
Livepeer Broadcaster is now running with Outsourced Transcoding on Livepeer, with payment on Ethereum.
You can now stream content into Livepeer Broadcaster, and observe that your content is being transcoded into different formats.
Further details on setting the maximum price to be paid for Transcoding can be found in Livepeer's Broadcaster documentation.
To find out more about Livepeer, go to this 10-minute primer.