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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for danmakuC-0.1a0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d0cda9e373036ae6b67ba077ba04670cd97e52b300b6ec4520f7fe81f6f0035 |
|
MD5 | 447f4a6a898616d406e9ca87bc7c2114 |
|
BLAKE2b-256 | ce2cd6cbc12bd7a058b7ed0e95bbacd83aacbb891af6f80c3f5c55099191f634 |
Hashes for danmakuC-0.1a0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 671e86d44e62c32eb10e05fe969094923478c8a2ef9cc21c6a2d9eaa84c6f11e |
|
MD5 | 159f5378fe8176bc9f656c251b69ba18 |
|
BLAKE2b-256 | 9119b9be0a1117cb7f79a25971a4d688b25d972ecca27a8127d71c483ef60652 |
Hashes for danmakuC-0.1a0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c73ea5dcd3346c38b127ae7e801932590cafc4de43f3094c48a168462416454 |
|
MD5 | bb2a42982fa90e955df756ba3202d53a |
|
BLAKE2b-256 | ae561af195db71e06821647bc020db49e425a5ce1130ba43698e8fe736c21b3e |
Hashes for danmakuC-0.1a0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30a12d6db87a8f7c60f544ebe14d64f5e9916e014cf524867f612b5144c5ad76 |
|
MD5 | e53321a2255af4496f17c8108b1b5aea |
|
BLAKE2b-256 | fcb263770aabb1517173283db010b24e25c08e19339d1ea5cf037b7ff17ec9a0 |