logo NodeSeekbeta

(已支持 arm 架构)写了一个跑在闲置小鸡上的开源项目:bilive - 7 x 24 小时无人监守录制、渲染弹幕、识别字幕、自动切片上传、综合多种模态模型、兼容超低配机器

  • 牛逼啊

  • @timerring #54
    好的哥,用 biliup-rs 登录的cookies.json放在 src/utils下,然后再用bilitool login再登录一次就好了是吧,谢谢哥

  • @autumn #62 是的,按照 README 流程就没问题,README 是最新版。docs 是上一个版本 v0.2.9 的,我正在更新 docs,一会 commit 一版。

  • 好用,但是暂时没有gpu的镜像,简单的做了个支持gpu的,给需要的小伙伴一个参考

    1. mkdir docker_data && cd docker_data && git clone https://github.com/timerring/bilive && cd bilive
    2. nano Dockerfile:
      FROM superlinear/python-gpu:3.10-cuda11.8 # numba不支持3.11,不要修改版本
      
      # 设置工作目录
      WORKDIR /app
      
      # 安装系统依赖
      RUN apt-get update && apt-get install -y \
      	ffmpeg \
      	git \
      	gcc \
      	procps \
      	lsof \
      	curl \
      	vim \
      	&& apt-get clean \
      	&& rm -rf /var/lib/apt/lists/*
      
      COPY requirements.txt /app
      
      # 安装Python依赖
      RUN pip install --no-cache-dir -r requirements.txt
      
      # 设置环境变量
      ENV BILIVE_PATH=/app
      
      # 添加启动脚本
      COPY entrypoint.sh /entrypoint.sh
      RUN chmod +x /entrypoint.sh
      
      # 暴露blrec管理页面端口
      EXPOSE 2233
      VOLUME /app
      
      # 设置启动命令
      ENTRYPOINT ["/entrypoint.sh"]
      
    3. nano entrypoint.sh
      #!/bin/bash
      
      ./record.sh && ./scan.sh
      
      python -m src.upload.upload
      
    4. nano docker-compose.yaml
      services:
        bilive:
      	build: .
      	#user: "1001:1001"
      	ports:
      	  - "65004:2233"
      	volumes:
      	  - ./:/app
      	network_mode: bridge
      	restart: unless-stopped
      	deploy:
      	  resources:
      		reservations:
      		  devices:
      			- driver: nvidia
      			  count: all # Request all GPUs
      			  capabilities: [gpu] # Ensure GPU capability
      
    5. mkdir Videos
    6. docker compose up -d

    查看下日志,docker compose logs -f,类似于下面这种就ok:

    bilive-1  | kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
    bilive-1  | success
    bilive-1  | kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
    bilive-1  | success
    bilive-1  | [INFO] - [2025-03-17 08:08:30,414 bilive upload] - Empty queue, wait 2 minutes and check again
    
  • 大佬,收藏了

  • 牛逼

  • @Siamese7 #64 非常感谢佬,主要最近在忙着做弹幕渲染的迭代,打算下个版本 v0.3.0 做 GPU 的 docker image 来着。

    因为我目前的方式说实话不算 docker 的最佳实践,因为 docker 应该是 stateless 的,所以下个版本打算把配置和录制的文件挂载出来,防止服务挂了丢失,同时也方便 k8s 监控。

    如果佬愿意的话这份 gpu 的配置可以提个 PR,我验证没问题就 merge。

  • 哈哈。之前关注过,我现在用的 danmukurender,支持更多平台

  • 太牛了

  • @timerring #67 我这个目前还有点问题😂,没法上传视频,remux成功后,在upload阶段ffprobe步骤有bug,目前不清楚是我自己这个镜像问题还是啥。upload阶段的deal的文件名和remux完后文件名不一致

    runtime/blrec-20250317-080830.log
    
    [2025-03-17 09:01:27,385] [INFO] [helpers] [22907643] Deleted '/app/Videos/22907643/22907643_20250317-08-59-33.flv'
    [2025-03-17 09:03:23,915] [INFO] [stream_recorder_impl] [22907643] Video file completed: '/app/Videos/22907643/22907643_20250317-09-01-26.flv'
    [2025-03-17 09:03:23,916] [INFO] [raw_danmaku_dumper] [22907643] Raw danmaku file completed: '/app/Videos/22907643/22907643_20250317-09-01-26.jsonl'
    [2025-03-17 09:03:23,917] [INFO] [danmaku_dumper] [22907643] Danmaku file completed: '/app/Videos/22907643/22907643_20250317-09-01-26.xml'
    [2025-03-17 09:03:24,045] [INFO] [stream_recorder_impl] [22907643] Video file created: '/app/Videos/22907643/22907643_20250317-09-03-24.flv'
    [2025-03-17 09:03:24,049] [INFO] [raw_danmaku_dumper] [22907643] Raw danmaku file created: '/app/Videos/22907643/22907643_20250317-09-03-24.jsonl'
    [2025-03-17 09:03:24,051] [INFO] [danmaku_dumper] [22907643] Danmaku file created: '/app/Videos/22907643/22907643_20250317-09-03-24.xml'
    [2025-03-17 09:03:24,925] [INFO] [postprocessor] [22907643] Remuxing '/app/Videos/22907643/22907643_20250317-09-01-26.flv' to '/app/Videos/22907643/22907643_20250317-09-01-26.mp4' ...
    [2025-03-17 09:03:25,190] [INFO] [postprocessor] [22907643] Successfully remuxed '/app/Videos/22907643/22907643_20250317-09-01-26.flv' to '/app/Videos/22907643/22907643_20250317-09-01-26.mp4'
    
    upload/upload-20250317.log
    
    [INFO] - [2025-03-17 09:07:54,406 bilive upload] - deal with /app/Videos/22907643/22907643_2025-03-17-09-01-.mp4
    [ERROR] - [2025-03-17 09:07:54,525 bilive upload] - The read_append_and_delete_lines called failed, the files will be reserved. error: Command '['ffprobe', '-v', 'quiet', '-print_format', 'json', '-show_format', '/app/Videos/22907643/22907643_2025-03-17-09-01-.mp4']' returned non-zero exit status 1.
    [INFO] - [2025-03-17 09:07:54,525 bilive upload] - wait for 20 seconds
    [INFO] - [2025-03-17 09:08:14,557 bilive upload] - deal with /app/Videos/22907643/22907643_2025-03-17-09-01-_slice.flv
    [ERROR] - [2025-03-17 09:08:14,674 bilive upload] - The read_append_and_delete_lines called failed, the files will be reserved. error: Command '['ffprobe', '-v', 'quiet', '-print_format', 'json', '-show_format', '/app/Videos/22907643/22907643_2025-03-17-09-01-_slice.flv']' returned non-zero exit status 1.
    

你好啊,陌生人!

我的朋友,看起来你是新来的,如果想参与到讨论中,点击下面的按钮!

📈用户数目📈

目前论坛共有72271位seeker

🎉欢迎新用户🎉