npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mb-rrvideo-server

v1.0.14

Published

视频转码服务 - 接收可回溯机请求,执行转码/合并,上传MinIO/本地存储

Readme

mb-rrvideo-server

视频转码服务 - 接收可回溯机请求,执行 rrweb 录屏数据转码/合并,支持上传到 MinIO 或本地存储。

功能特性

  • ✅ V1/V2 版本转码支持(单页面/多页面)
  • ✅ Notify + Pull 模式(按需拉取数据)
  • ✅ 视频合并功能
  • ✅ MinIO/本地存储支持
  • ✅ 任务队列管理
  • ✅ 完整的日志记录

安装

1. 全局安装

npm install -g mb-rrvideo-server

2. 本地安装

npm install mb-rrvideo-server

3. 从源码安装

git clone <repository>
cd mb-rrvideo-server
npm install

4. Docker 部署(推荐生产环境)

Docker 镜像开箱即用,包含所有依赖(Node.js + mb-rrvideo + mb-rrvideo-server + Playwright)。

# 下载 npm 包
npm pack mb-rrvideo-server
tar -xzf mb-rrvideo-server-*.tgz
cd package

# 准备配置文件
cp config.example.json config.json
# 编辑 config.json

# 构建镜像(镜像名:mb-rrvideo-converter)
docker build -t mb-rrvideo-converter:latest .

# 启动服务
docker-compose up -d

# 验证 mb-rrvideo 是否正常
docker-compose exec rrvideo-server rrvideos --version

# 查看日志
docker-compose logs -f

详细的 Docker 部署指南(包括镜像迁移、故障排除等)请查看 DOCKER.md

配置

创建配置文件

cp config.example.json config.json

配置说明

{
  "server": {
    "port": 24203,
    "host": "127.0.0.1"
  },
  "storage": {
    "type": "local",
    "local": {
      "video_dir": "./Video",
      "temp_dir": "./temp"
    },
    "minio": {
      "endpoint": "your-minio-server.com",
      "port": 9000,
      "useSSL": false,
      "accessKey": "your-access-key",
      "secretKey": "your-secret-key",
      "bucket": "record-prod",
      "public_host": "https://your-public-url.com"
    }
  },
  "rrvideo": {
    "speed": 1,
    "skipInactive": true,
    "mouseTail": false
  },
  "convert": {
    "delete_after_upload": true,
    "max_concurrent_tasks": 3
  },
  "log": {
    "level": "INFO",
    "flush_interval": 2000,
    "buffer_max_size": 500
  }
}

关键配置项:

  • server.port: 服务端口(默认 24203)
  • server.host: 监听地址(0.0.0.0 表示监听所有网卡)
  • storage.type: 存储类型(localminio
  • storage.local.video_dir: 视频存储目录
  • storage.local.temp_dir: 临时文件目录
  • storage.minio.*: MinIO 配置(如果使用 MinIO)
  • rrvideo.speed: 播放速度(1 表示正常速度)
  • rrvideo.skipInactive: 是否跳过不活跃时间
  • rrvideo.mouseTail: 是否显示鼠标轨迹
  • convert.delete_after_upload: 上传后是否删除本地文件
  • convert.max_concurrent_tasks: 最大并发任务数
  • log.level: 日志级别(DEBUG, INFO, WARN, ERROR)
  • log.flush_interval: 日志刷新间隔(毫秒)
  • log.buffer_max_size: 日志缓冲区大小(条数)

运行

普通运行

# 全局安装后
rrvideo-server

# 或使用 npm
npm start

# 或直接运行
node src/index.js

PM2 运行(推荐生产环境)

安装 PM2

npm install -g pm2

启动服务

pm2 start ecosystem.config.js

常用命令

# 查看状态
pm2 status

# 查看日志
pm2 logs rrvideo-server

# 重启服务
pm2 restart rrvideo-server

# 停止服务
pm2 stop rrvideo-server

# 删除服务
pm2 delete rrvideo-server

# 开机自启
pm2 startup
pm2 save

更新

全局安装更新

npm update -g mb-rrvideo-server
pm2 restart rrvideo-server

本地安装更新

npm update mb-rrvideo-server
pm2 restart rrvideo-server

从源码更新

git pull
npm install
pm2 restart rrvideo-server

日志

日志目录结构

logs/
├── convert/          # 转码日志
│   └── YYYY-MM-DD/
│       └── {record_id}_{action}_{timestamp}.log
├── merge/            # 合并日志
│   └── YYYY-MM-DD/
│       └── {merge_id}_{action}_{timestamp}.log
└── server/           # 服务器日志
    └── YYYY-MM-DD/
        └── server_{timestamp}.log

查看日志

# 查看最新转码日志
tail -f logs/convert/$(date +%Y-%m-%d)/*.log

# 查看最新合并日志
tail -f logs/merge/$(date +%Y-%m-%d)/*.log

# 查看 PM2 日志
pm2 logs rrvideo-server

# 查看 PM2 错误日志
pm2 logs rrvideo-server --err

API 接口

统一接收接口(推荐)

POST /Convert/receiveRequestByRecordIdAct
Content-Type: application/json

# V1 转码请求
{
  "type": "convert",
  "record_id": "10000",
  "record_no": "10000",
  "order_unique": "ORDER123",
  "source": "system",
  "pull_data_url": "https://your-server.com/Api/api/getRecordDataByRecordId",
  "callback_url": "https://your-server.com/Api/api/receiveEndNotify",
  "start_convert": 1
}

# V2 转码请求(多页面)
{
  "type": "convert",
  "record_id": "R20260206112323XXXXX",
  "record_no": "R20260206112323XXXXX",
  "tasks": [
    {
      "record_page_id": "1",
      "record_page_no": "P001"
    },
    {
      "record_page_id": "2",
      "record_page_no": "P002"
    }
  ],
  "pull_data_url": "https://your-server.com/Api/api/getRecordDataByRecordId",
  "callback_url": "https://your-server.com/Api/api/receiveEndNotify",
  "request_id": "REQ_R20260206112323XXXXX_1738838400"
}

# 合并请求
{
  "type": "merge",
  "record_id": "R20260206112323XXXXX",
  "record_no": "R20260206112323XXXXX",
  "merge_id": "MERGE_123",
  "videos": [
    "https://cdn.example.com/video1.mp4",
    "https://cdn.example.com/video2.mp4"
  ],
  "output": "Video/2026/02/06/merged.mp4",
  "format": "mp4",
  "method": "concat",
  "callback_url": "https://your-server.com/Api/api/receiveMergeNotify",
  "callback_data": {
    "record_id": "R20260206112323XXXXX",
    "record_no": "R20260206112323XXXXX"
  }
}

直接转码接口(兼容旧版)

POST /convert
Content-Type: application/json

# 参数同上

直接合并接口(兼容旧版)

POST /merge
Content-Type: application/json

# 参数同上

健康检查

GET /
GET /health

# 响应
{
  "result_code": 0,
  "message": "rrvideo-server is running"
}

故障排除

服务无法启动

  1. 检查端口是否被占用:lsof -i :3000
  2. 检查配置文件是否正确:node test-config.js
  3. 查看错误日志:pm2 logs rrvideo-server --err

转码失败

  1. 检查 mb-rrvideo 是否已安装:rrvideos --version
  2. 检查输入数据格式是否正确
  3. 查看转码日志:logs/convert/YYYY-MM-DD/*.log

上传失败

  1. 检查 MinIO 配置是否正确
  2. 检查网络连接
  3. 检查存储空间是否充足

内存不足

  1. 增加系统内存
  2. 减少并发任务数
  3. 启用 delete_after_upload 选项

依赖

  • Node.js >= 16.0.0
  • mb-rrvideo(需要全局安装或在 PATH 中可用)
  • MinIO(可选,如果使用 MinIO 存储)

安装 mb-rrvideo:

npm install -g mb-rrvideo

License

MIT