Skip to main content

A simple video danmaku processing tool that supports overlaying danmaku files onto videos.

Project description

Video Danmaku

一个简单的视频弹幕处理工具,支持将弹幕文件叠加到视频上。

功能特点

  • 支持多种弹幕文件格式(JSON、ASS、SSA)
  • 支持弹幕颜色和透明度设置
  • 平滑的弹幕滚动效果
  • 命令行界面,使用简单

安装

环境要求

  • Python 3.10 或更高版本

安装步骤

使用 pip 安装:

pip install video_danmaku

使用方法

命令行使用

video-danmaku 输入视频路径 输出视频路径 弹幕文件路径

参数说明

  • 输入视频路径: 要处理的视频文件路径
  • 输出视频路径: 处理后的视频保存路径
  • 弹幕文件路径: 弹幕文件路径(支持 .json、.ass、.ssa 格式)

示例

# 使用 JSON 格式弹幕
video-danmaku input.mp4 output.mp4 danmaku.json

# 使用 ASS 格式弹幕
video-danmaku input.mp4 output.mp4 danmaku.ass

弹幕文件格式

JSON 格式

[
    {
        "text": "弹幕文本",
        "time_stamp": 1.0,
        "color": [255, 255, 255],
        "alpha": 255
    }
]
  • text: 弹幕文本
  • time_stamp: 出现时间(秒)
  • color: RGB颜色值
  • alpha: 透明度(0-255)

ASS/SSA 格式

[Events]
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,0:00:01.00,0:00:05.00,Default,,0,0,0,,弹幕文本

许可证

本项目采用 MIT 许可证 - 详见 LICENSE 文件

致谢

  • OpenCV - 视频处理
  • Pillow - 图像处理
  • Typer - 命令行界面

这份 README.md 文件提供了项目的完整说明,包括安装、使用方法、文件格式说明和开发指南。


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

video_danmaku-0.1.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

video_danmaku-0.1.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file video_danmaku-0.1.0.tar.gz.

File metadata

  • Download URL: video_danmaku-0.1.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.10.15 Windows/10

File hashes

Hashes for video_danmaku-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f1bc7d18695b01533869c31cf042546c7457b082569b4fbff527ba0e7c734a84
MD5 fe2cdb5d4df8fa2a8088b4ac59219632
BLAKE2b-256 01a6ea97a08e0d7dc63c6ef1e09d5a11160fe2b4cdcd724a08462f777b4d1cea

See more details on using hashes here.

File details

Details for the file video_danmaku-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: video_danmaku-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.10.15 Windows/10

File hashes

Hashes for video_danmaku-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 207c6d1e130ebb4997cf01970b52d35e0b798448fe850915e29e01326e8ba092
MD5 ad052af6a1dfa18cac5e15e255345614
BLAKE2b-256 f7900c589ae484f33e431adc0bdeae369fdea0398c692e82bcd94366c78a8843

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page