All Projects → acgnhiki → blrec

acgnhiki / blrec

Licence: GPL-3.0 license
Bilibili Live Streaming Recorder 哔哩哔哩直播录制

Programming Languages

python
139335 projects - #7 most used programming language
javascript
184084 projects - #8 most used programming language
typescript
32286 projects
HTML
75241 projects
SCSS
7915 projects
powershell
5483 projects

Projects that are alternatives of or similar to blrec

Danmaku
live video comments protocol and platform api
Stars: ✭ 70 (-43.55%)
Mutual labels:  live, danmaku, bilibili
Instagramlive Php
A PHP script that allows for you to go live on Instagram with any streaming program that supports RTMP!
Stars: ✭ 362 (+191.94%)
Mutual labels:  streaming, live
Chartjs Plugin Streaming
Chart.js plugin for live streaming data
Stars: ✭ 310 (+150%)
Mutual labels:  streaming, live
Real Url
获取斗鱼&虎牙&哔哩哔哩&抖音&快手等 58 个直播平台的真实流媒体地址(直播源)和弹幕,直播源可在 PotPlayer、flv.js 等播放器中播放。
Stars: ✭ 3,748 (+2922.58%)
Mutual labels:  streaming, bilibili
HJPlayer
A HTML5 Player, can play flv and hls by Media Source Extension, based on typescript.
Stars: ✭ 149 (+20.16%)
Mutual labels:  streaming, flv
Srs
SRS is a simple, high efficiency and realtime video server, supports RTMP, WebRTC, HLS, HTTP-FLV, SRT and GB28181.
Stars: ✭ 16,734 (+13395.16%)
Mutual labels:  streaming, live
Iptv
Android project for live streaming IPTV
Stars: ✭ 120 (-3.23%)
Mutual labels:  streaming, live
Dplayer
🍭 Wow, such a lovely HTML5 danmaku video player
Stars: ✭ 12,101 (+9658.87%)
Mutual labels:  flv, danmaku
Nginx Rtmp Monitoring
real-time monitoring statistics dashboard for nginx rtmp module
Stars: ✭ 224 (+80.65%)
Mutual labels:  streaming, live
Bilibili Live Barrage
🌈Bilibili_Live_Barrage实时监控B站直播弹幕并发送跟随弹幕
Stars: ✭ 28 (-77.42%)
Mutual labels:  live, bilibili
acfundanmu
AcFun直播API
Stars: ✭ 27 (-78.23%)
Mutual labels:  live, danmaku
Diffy
🎞️💓🍿 Love streaming - It's always best to watch a movie together ! 🤗
Stars: ✭ 37 (-70.16%)
Mutual labels:  streaming, live
tms
tms(toy media server) is a toy media server for myself learning media develop. Just for fun.
Stars: ✭ 29 (-76.61%)
Mutual labels:  streaming, flv
Red5 Server
Red5 Server core
Stars: ✭ 3,008 (+2325.81%)
Mutual labels:  streaming, flv
streaming-pt
Live TV 📺 and Radio 📻 shell scripts from Portugal 🇵🇹.
Stars: ✭ 52 (-58.06%)
Mutual labels:  streaming, live
Pearplayer.js
支持WebRTC的多源多协议混合P2P-CDN的流媒体播放器
Stars: ✭ 512 (+312.9%)
Mutual labels:  streaming, live
yutto
🧊 一个可爱且任性的 B 站视频下载器(bilili V2)
Stars: ✭ 383 (+208.87%)
Mutual labels:  danmaku, bilibili
hello-muiplayer
💡 一款优秀的 HTML5 视频播放器框架
Stars: ✭ 268 (+116.13%)
Mutual labels:  flv, danmaku
Bililiverecorder
B站录播姬 | BiliBili Stream Recorder
Stars: ✭ 746 (+501.61%)
Mutual labels:  flv, bilibili
Hls Vod
HTTP Live Streaming with on-the-fly encoding of any video file for Web/Apple TV/iPhone/iPad/iPod
Stars: ✭ 221 (+78.23%)
Mutual labels:  streaming, live

Bilibili Live Streaming Recorder (blrec)

这是一个前后端分离的 B 站直播录制工具。前端使用了响应式设计,可适应不同的屏幕尺寸;后端是用 Python 写的,可以跨平台运行。

这个工具是自动化的,会自动完成直播的录制, 在出现未处理异常时会发送通知,空间不足能够自动回收空间,还有详细日志记录,因此可以长期无人值守运行在服务器上。

屏幕截图

webapp

terminal

功能

  • 自动完成直播录制
  • 同步保存弹幕
  • 自动修复时间戳问题:跳变、反跳等。
  • 直播流参数改变自动分割文件,避免出现花屏等问题。
  • 流中断自动拼接且支持 无缝 拼接,不会因网络中断而使录播文件片段化。
  • flv 文件添加关键帧等元数据,使定位播放和拖进度条不会卡顿。
  • 可选录制的画质
  • 可自定义文件保存路径和文件名
  • 支持按文件大小或时长分割文件
  • 支持转换 flvmp4 格式(需要安装 ffmpeg
  • 硬盘空间检测并支持空间不足自动删除旧录播文件。
  • 事件通知(支持邮箱、ServerChanpushplus
  • Webhook(可配合 REST API 实现录制控制,录制完成后压制、上传等自定义需求)

先决条件

Python 3.8+
ffmpeg、 ffprobe

安装

更新

  • 通过 pip 或者 pipx 安装的用以下方式更新

    pip install blrec --upgrade 或者 pipx upgrade blrec

  • 免安装绿色版

    • 下载并解压新版本
    • 确保旧版本已经关闭退出以避免之后出现端口冲突
    • 把旧版本的设置文件 settings.toml 复制并覆盖新版本的设置文件
    • 运行新版本的 run.bat

卸载

  • 通过 pip 或者 pipx 安装的用以下方式卸载

    pip uninstall blrec 或者 pipx uninstall blrec

  • 免安装绿色版

    删除解压后的文件夹

Docker

环境变量

  • 默认设置文件位置: ENV DEFAULT_SETTINGS_FILE=/cfg/settings.toml
  • 默认日志存放目录: ENV DEFAULT_LOG_DIR=/log
  • 默认录播存放目录: ENV DEFAULT_OUT_DIR=/rec

默认参数运行

sudo docker run -v /etc/blrec:/cfg -v /var/log/blrec:/log -v ~/blrec:/rec -dp 2233:2233 acgnhiki/blrec

命令行参数用法

sudo docker run \
    -v /etc/blrec:/cfg -v /var/log/blrec:/log -v ~/blrec:/rec \
    -dp 2233:2233 acgnhiki/blrec \
    -c /cfg/another_settings.toml \
    --key-file path/to/key-file \
    --cert-file path/to/cert-file \
    --api-key bili2233

使用方法

命令行参数用法

blrec --help

默认参数运行

在命令行终端里执行 blrec ,然后浏览器访问 http://localhost:2233

默认设置文件位置:~/.blrec/settings.toml

默认日志文件目录: ~/.blrec/logs

默认录播文件目录: .

指定设置文件和录播与日志保存位置

blrec -c path/to/settings.toml -o path/to/records --log-dir path/to/logs

如果指定的设置文件不存在会自动创建

命令行参数会覆盖掉设置文件的对应的设置

绑定主机和端口

默认为本地运行,主机和端口绑定为: localhost:2233

需要外网访问,把主机绑定到 0.0.0.0,端口绑定则按照自己的情况修改。

例如:blrec --host 0.0.0.0 --port 8000

网络安全

指定 SSL 证书使用 https 协议并指定 api key 可防止被恶意访问和泄漏设置里的敏感信息

例如:blrec --key-file path/to/key-file --cert-file path/to/cert-file --api-key bili2233

如果指定了 api key,浏览器第一次访问会弹对话框要求输入 api key。

输入的 api key 会被保存在浏览器的 local storage 以避免每次都得输入

如果在不信任的环境下,请使用浏览器的隐式模式访问。

关于 api-key

api key 可以使用数字和字母,长度限制为最短 8 最长 80。

3 次尝试内 api key 正确客户端 ip 会自动加入白名单,3 次错误后则 ip 会被加入黑名单,黑名单后请求会被拒绝 (403)。

黑名单和白名单数以及同时尝试连接的 ip 数量限制各为 100,黑名单或白名单到达限制后不再接受除了白名单内的其它 ip 。

只有重启才会清空黑名单和白名单。

作为 ASGI 应用运行

uvicorn blrec.web:app

或者

hypercorn blrec.web:app

作为 ASGI 应用运行,参数通过环境变量指定。

  • config 指定设置文件
  • out_dir 指定录播存放位置
  • log_dir 指定日志存放位置
  • api_key 指定 api key

bash

config=path/to/settings.toml out_dir=path/to/dir api_key=******** uvicorn blrec.web:app --host 0.0.0.0 --port 8000

cmd

set config=D:\\path\\to\\config.toml & set out_dir=D:\\path\\to\\dir & set api_key=******** uvicorn blrec.web:app --host 0.0.0.0 --port 8000

Webhook

程序在运行过程中会触发一些事件,如果是支持 webhook 的事件,就会给所设置的 webhook 网络地址发送 POST 请求。

关于支持的事件和 POST 请求所发送的数据,详见 wiki。

REST API

后端 web 框架用的是 FastApi , 要查看自动生成的交互式 API 文档,访问 http://localhost:2233/docs (默认主机和端口绑定)。

Progressive Web App(PWA)

前端其实是一个渐进式网络应用,可以通过地址栏右侧的图标安装,然后像原生应用一样从桌面启动运行。

注意:PWA 要在本地访问或者在 https 下才支持。


常见问题

FAQ

更新日志

CHANGELOG


Thanks

JetBrains Logo (Main) logo

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].