Technical note

Livego配置笔记

官网

二进制下载

启动

./livego

INFO[2020-08-18T16:55:13+08:00] HLS server enable....
INFO[2020-08-18T16:55:13+08:00] HTTP-FLV listen On :7001
INFO[2020-08-18T16:55:13+08:00] HTTP-API listen On :8090
INFO[2020-08-18T16:55:13+08:00] RTMP Listen On :1935
INFO[2020-08-18T16:55:13+08:00] HLS listen On :7002

获取channelkey

访问 http://localhost:8090/control/get?room=movie 获取一个房间的 channelkey(channelkey用于推流,movie用于播放)

curl http://localhost:8090/control/get?room=movie
rfBd56ti2SMtYvSgD5xAV0YU99zampta7Z7S575KLkIZ9PYk

推流

通过RTMP协议推送视频流到地址 rtmp://localhost:1935/{appname}/{channelkey} (appname默认是live)

ffmpeg -re -i test.mp4 -c copy -f flv rtmp://127.0.0.1:1935/live/rfBd56ti2SMtYvSgD5xAV0YU99zampta7Z7S575KLkIZ9PYk

播放

配置

./livego  -h
Usage of ./livego:
      --api_addr string       HTTP管理访问监听地址 (default ":8090")
      --config_file string    配置文件路径 (默认 "livego.yaml")
      --flv_dir string        输出的 flv 文件路径 flvDir/APP/KEY_TIME.flv (默认 "tmp")
      --gop_num int           gop 数量 (default 1)
      --hls_addr string       HLS 服务监听地址 (默认 ":7002")
      --hls_keep_after_end    Maintains the HLS after the stream ends
      --httpflv_addr string   HTTP-FLV server listen address (默认 ":7001")
      --level string          日志等级 (默认 "info")
      --read_timeout int      读超时时间 (默认 10)
      --rtmp_addr string      RTMP 服务监听地址 (默认 ":1935")
      --write_timeout int     写超时时间 (默认 10)