跳转到主要内容
Ugh I hate this page. I think its best to move everything to quickstart and have this be a comprehensive flag overview

TL;DR 配置

如果您只想要一个可用的视频网关,请使用以下命令:
Replace with your locally running orchestrator http address.
Off-Chain Video Gateway
livepeer -gateway \
  -network offchain \
  # Minimum required video flags
  -rtmpAddr=0.0.0.0:1935 \
  -httpAddr=0.0.0.0:8935 \
  -transcodingOptions=P240p30fps16x9,P360p30fps16x9 \
  # You will need to add your local orchestrator address if you are running off-chain
  -orchAddr=<ORCHESTRATOR_ADDRESSES> #comma separated list of orchestrator addresses
  # Example: -orchAddr=http://192.168.1.100:8935,http://192.168.1.101:8935
  # You can also use a JSON file: -orchAddr=/path/to/orchestrators/orchestrators-portal.json
/snippets/assets/logos/Livepeer-Logo-Symbol-Theme.svg
OVERVIEW
/snippets/assets/logos/Livepeer-Logo-Symbol-Theme.svg
用于视频转码的网关 在传统视频转码中,网关 摄取视频流通过 RTMPHTTP,对它们进行分段, 并将转码工作分配给 Orchestrators

Code Reference

go-livepeer/core/livepeernode.go

关键配置标志

必需的标志

-gateway
boolean
默认值:"false"
必填
Enable Gateway mode
-network
string
默认值:"offchain"
Set to the blockchain network for production gateways arbitrum-one-mainnet
-orchAddr
string
默认值:"none"
必填
Set to http://<ORCHESTRATOR_IP>:<PORT> to connect to orchestrators

网络配置

-rtmpAddr
string
默认值:"127.0.0.1:1935"
Set to 0.0.0.0:1935 to allow external RTMP connections
-httpAddr
string
默认值:"127.0.0.1:8935"
Set to 0.0.0.0:8935 to allow external HLS/API access

转码配置

-transcodingOptions
string
默认值:"P240p30fps16x9,P360p30fps16x9"
Set to path/to/transcodingOptions.json to use a custom transcoding configuration

额外的链上标志

添加这些标志以进行链上配置。参见 On-Chain Setup Guide 详细信息。
-network
string
默认值:"offchain"
-maxPricePerUnit
int
默认值:"0"
-ethUrl
string
默认值:"none"
必填
-ethAcctAddr
string
默认值:"leave empty to auto-create"
-ethPassword
string
默认值:"leave empty to auto-create"
-ethKeystorePath
string
默认值:"leave empty to auto-create"
/snippets/assets/logos/Livepeer-Logo-Symbol-Theme.svg
FULL CONFIGURATION GUIDE
/snippets/assets/logos/Livepeer-Logo-Symbol-Theme.svg

综合配置指南

配置方法

安装后,您有三种方式来配置您的 Livepeer 网关:
  • 命令行标志(最常用)
  • 环境变量(前缀为 LP_)
  • 配置文件(纯文本键值格式)

配置示例

以下示例展示了最常用的配置方法。
.
livepeer -gateway \
  -network offchain \
  -transcodingOptions=${env:HOME}/.lpData/offchain/transcodingOptions.json \
  -orchAddr=0.0.0.0:8935 \
  -httpAddr=0.0.0.0:9935 \
  -v=6
Create docker-compose.yml
# 1. Create a basic docker-compose.yml
cat > docker-compose.yml << EOF
version: '3.9'
services:
  gateway:
    image: livepeer/go-livepeer:master
    ports:
      - 1935:1935  # RTMP ingest
      - 8935:8935  # HLS/API
    volumes:
      - gateway-data:/root/.lpData
    command: |
      -gateway
      -network arbitrum-one-mainnet
      -rtmpAddr=0.0.0.0:1935
      -httpAddr=0.0.0.0:8935
      -orchAddr=https://orchestrator.example.com:8935
      -transcodingOptions=P240p30fps16x9,P360p30fps16x9,P720p30fps16x9
      -ethUrl <YOUR_RPC_URL> \
      -ethAcctAddr <YOUR_ETH_ADDRESS> \
      -ethPassword <YOUR_PASSWORD> \
      -ethKeystorePath <KEYSTORE_PATH> \
      -maxPricePerUnit 1000

volumes:
  gateway-data:
EOF
Start the Gateway
Start the gateway
# 2. Start the gateway
docker-compose up -d
livepeer -gateway \
  -network arbitrum-one-mainnet \
  -ethUrl=<YOUR_RPC_URL> \
  -ethAcctAddr=<YOUR_ETH_ADDRESS> \
  -ethPassword=<YOUR_PASSWORD> \
  -ethKeystorePath=<KEYSTORE_PATH> \
  -maxPricePerUnit=1000 \
  -orchAddr=<ORCHESTRATOR_ADDRESSES> \
  -monitor=true

转码选项 JSON

Livepeer 支持通过 JSON 配置文件进行转码选项的设置。-transcodingOptions 标志。 transcodingOptions.json 文件让您能够精确控制编码梯度。 此文件是自定义配置文件,包含一个渲染对象数组,定义了您的网关将为每个传入流生成的渲染(分辨率 + 比特率) 将产生的渲染(分辨率 + 比特率)。 它会覆盖默认的内置梯度(例如,P240p30fps16x9 等)。
transcodingOptions.json example
[
  {
    // required
    "bitrate": 1600000,
    "width": 854,
    "height": 480,
    // optional
    "name": "480p0",
    "fps": 0,
    "profile": "h264constrainedhigh",
    "gop": "1"
  },
  {
    // required
    "bitrate": 3000000,
    "width": 1280,
    "height": 720,
    // optional
    "name": "720p0",
    "fps": 0,
    "profile": "h264constrainedhigh",
    "gop": "1"
  },
  {
    // required
    "bitrate": 6500000,
    "width": 1920,
    "height": 1080,
    // optional
    "name": "1080p0",
    "fps": 0,
    "profile": "h264constrainedhigh",
    "gop": "1"
  }
]

注意

  • JSON 配置仅适用于转码选项,而不适用于其他网关标志
  • 文件必须包含符合指定结构的有效 JSON
  • 除 width、height 和 bitrate 外,所有字段均为可选
  • 您可以将 JSON 配置与其他命令行标志混合使用

Next Step: Pricing Configuration

Configure pricing for your gateway.

完整配置标志参考

关键更改

OptionRecommended ChangeWhy

网络配置

OptionDefaultRecommendedDescription

转码设置

OptionDefaultWhen to ChangeDescription

生产注意事项

OptionRecommended SettingUse Case
Last modified on March 1, 2026