Skip to main content

Faster conversion for larger Danmaku to Ass format

Project description

danmakuC

Faster conversion for larger Danmaku to Ass format. Core conversion part is written in C++ while with user-friendly Python api and cli (working on it...).

Why danmakuC?

While Danmaku2ASS and biliass provides a great tool to convert danmaku to ass format, the conversion of large danmaku is incredibly slow since it's a heavy CPU bound task for Python🥲. danmakuC refactor those two repos and provide a much faster C++ implementation to speed up conversion. Let's see how fast it is:

test_dm.bin (218 comments) test_dm_large.bin (59,003 comments)
Danmaku2ASS/biliass 0.0105 s 47.0650 s
danmakuC 0.0009 s 0.2077 s

Results are obtained in M1 arm64 chip mac with python3.10, danmaku file is downloaded from bilibili by bilix.

As you can see, over 100 times faster in large conversion. For video with more viewer and comments (like movie and tv play), a fast tool like danmakuC is just what you need✊.

Install

Currently, author only build py3.9 and py3.10 whl for macOS11 arm64 platform for version 0.1a0, in the specific platform you can use

pip install danmakuC==0.1a0

Usage

Working on more feature including cli and xml conversion...

from danmakuC.utils import proto2ass

with open("test_dm_large.bin", "rb") as f:
    ass_text = proto2ass(f.read(), 1920, 1080)

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

danmakuC-0.1a0-cp310-cp310-win_amd64.whl (169.5 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

danmakuC-0.1a0-cp310-cp310-macosx_11_0_arm64.whl (131.1 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

danmakuC-0.1a0-cp39-cp39-win_amd64.whl (168.4 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

danmakuC-0.1a0-cp39-cp39-macosx_11_0_arm64.whl (131.2 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

Supported by

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