深圳网站seo 乐云践新,全国企业查询系统官网,本地合肥网站建设,网站设计宽度CLI版本BililiveRecorder非官方使用文档。 概况 本文的CLI使用基于Linux#xff08;Ubuntu 20.04 LTS#xff09;操作系统#xff0c;其他系统请酌情参考。 测试机没有显卡#xff0c;是云服务器。 本文全部操作都在root模式下运行#xff0c;实际生产环境中可能存在安全…CLI版本BililiveRecorder非官方使用文档。 概况 本文的CLI使用基于LinuxUbuntu 20.04 LTS操作系统其他系统请酌情参考。 测试机没有显卡是云服务器。 本文全部操作都在root模式下运行实际生产环境中可能存在安全问题。避免此问题请用非root账户操作并在所有命令前加上sudoUbuntu。
说明
我不是官方人员此文档并非官方文档一切均来源于自己使用的经验。
有错误的话欢迎大家前来指正
基础使用 下载地址Releases · Bililive/BililiveRecorder · GitHub 选择CLI-linux字样的且符合设备架构的直接下载即可。
将下载好的压缩包传送到服务器上解压。
通过cd进入主程序目录。 1
2复制 #添加执行权限
chmod x BililiveRecorder.Cli确认程序可运行完整 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18复制 ./BililiveRecorder.Cli --help#正常输出如下
BililiveRecorder.CliA Stream Recorder For Bilibili LiveUsage:BililiveRecorder.Cli [options] [command]Options:--version Show version information-?, -h, --help Show help and usage informationCommands:r, run path Run BililiveRecorder in standard modep, portable output-path room-ids Run BililiveRecorder in config-less modeconfigure path Interactively configure config.jsontool Run Tools在目标路径载入配置文件这里以/root/Recorder为例需要先创建对应文件夹。 1复制 ./BililiveRecorder.Cli configure /root/Recorder然后进入配置页 1
2
3
4
5
6
7
8复制 List rooms #列出已配置的房间号Add room #添加房间Delete room #删除房间Update room config #更新房间配置Update global config #更新全局配置Update JSON Schema #更新JSON结构Exit and discard all changes #不保存退出Save and Exit #保存退出选择第二项添加房间 1
2
3
4
5
6
7
8
9
10
11复制 #在后面输入房间号live.bilibili.com/后面的数字就是房间号输入0取消
#https://live.bilibili.com/22333522
(type 0 to cancel) Roomid: 22333522#开播时自动录制输入y开启
Enable auto record? [y/n] (y): #添加完成
Room 22333522 added to config
(type 0 to cancel) Roomid:
#输入0回主界面查看已添加的房间 1
2
3
4
5
6
7复制 ╭──────────┬────────────╮
│ Roomid │ AutoRecord │
├──────────┼────────────┤
│ 22333522 │ Enabled │
│ 4033043 │ Enabled │
╰──────────┴────────────╯List rooms在主界面选择Save and Exit即可。
此时就已经完成了基本的配置可以开始运行了。
运行
在目标路径运行./BililiveRecorder.Cli r /root/Recorder。
如果房间号列表里面没有开播的话则输出[房间号] 弹幕服务器已连接否则会输出“接收直播流”。 1
2
3
4
5复制 [17:23:14 INF] [22333522] 连接直播服务器 d1--cn-gotcha04.bilivideo.com 录制画质 10000 (原画)
[17:23:14 INF] [22333522] 弹幕服务器已连接
[17:23:14 INF] [22333522] 开始接收直播流
[17:23:14 INF] [22333522] 新建录制文件 /root/Recorder/22333522-伊万_iiivan/录制-22333522-20211219-172314-451-主播了你.flv
[17:23:14 INF] [4033043] 弹幕服务器已连接此时就开始录制了退出的话就按两次CtrlC。
创建系统服务
创建系统服务vim /etc/systemd/system/brh.service
输入如下内容 1
2
3
4
5
6
7复制 [Unit]
DescriptionBililive Recorder System Services
Afternetwork.target
[Service]
ExecStart./root/BililiveRecorder/linux-x64/BililiveRecorder.Cli r /root/Recorder
[Install]
WantedBymulti-user.target然后可以用systemctl控制该服务。 1
2
3
4
5
6复制 #开启服务
systemctl start brh.service
#停止服务
systemctl stop brh.service
#查看状态和部分日志
systemctl status brh.service