服务器

添加服务器

Agent 部署说明

添加服务器后,复制 API Key 到执行端运行:

pip install -r requirements.txt
python -m agent.agent \
  --master-url https://主控地址:8000 \
  --api-key 你的API密钥

Agent 会自动发现 nginx-rtmp / SRS,并按心跳间隔上报状态。

RTMP 服务部署参考

最小化配置示例,可直接用于生产。部署后确保 API 端点可由 Agent 本机访问。

nginx-rtmp

RTMP 块(nginx.conf 末尾)
rtmp {
    publish_time_fix on;
    max_connections 300;
    chunk_size 4096;
    max_message 1M;
    sync 1024ms;

    server {
        listen 1935 so_keepalive=on;

        application live {
            live on;
            record off;
            buffer 30s;
            wait_key on;
            wait_video on;
            drop_idle_publisher 30s;
        }
    }
}
Stat API(http 块内,仅监听本地)
server {
    listen 127.0.0.1:18880;

    location /stat {
        rtmp_stat all;
    }

    location /control {
        rtmp_control all;
    }
}

写入 nginx vhost 目录后,执行 nginx -s reload 生效。

SRS

srs.conf(带优化参数)
listen 1935;
max_connections 1000;
daemon off;

vhost __defaultVhost__ {
    publish {
        mr off;
    }

    play {
        gop_cache on;
        queue_length 30;
    }
}

http_api {
    enabled on;
    listen 127.0.0.1:1985;
    crossdomain on;
}

http_server {
    enabled on;
    listen 127.0.0.1:8080;
}

stats {
    network 0;
}

启动示例:./objs/srs -c srs.conf

服务器列表

暂无服务器,请先添加。