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 - 命令行界面



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.1.tar.gz (5.8 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.1-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: video_danmaku-0.1.1.tar.gz
  • Upload date:
  • Size: 5.8 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.1.tar.gz
Algorithm Hash digest
SHA256 7310fca63eb77b101f80ee1a6bc641d646fc967739666d4732beec051de083b8
MD5 19676c92bf6b3eca82029fd4ff44770c
BLAKE2b-256 a08997bb9f429ca4a2218a43d99f70fe4066cff15856da81704388a53a5a905d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: video_danmaku-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aa1d21f403e79cedfe1afa2c16724683f403ef395628ef6cd600d662f416b690
MD5 9d108490c13c47ba22949358ee3ecadc
BLAKE2b-256 97a13f23e5c4d776b52146739618da2336fbe611488772a32a30b50ab3ae8d0c

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