Process XML Danmaku File from BililiveRecorder
Project description
Bilibili Live Danmaku Tools 哔哩哔哩直播弹幕处理工具
本工具可用于处理 B站录播姬 产生的弹幕 XML。具体功能有:
- 分切 弹幕 XML
- 合并 弹幕 XML
- 分析 弹幕 XML 中的弹幕数量以及礼物价格
- 分析 弹幕 XML 中的高能点(主要用于生成录播)
安装
pip3 install danmaku_tools
典型使用例子
合并
根据 flv 文件的长度合并 XML
python3 -m danmaku_tools.merge_danmaku video_1.xml video_2.xml video_3.xml --video_time ".flv" --output video_combined.xml
经常和类似这样的视频合并命令同时使用
echo "file video_1.flv\n file video_2.flv" > video.input.txt
ffmpeg -f concat -safe 0 -i video_input.txt video_combined.flv
根据 XML 开始时间合并 XML
python3 -m danmaku_tools.merge_danmaku video_1.xml video_2.xml video_3.xml --output video_combined.xml
剪切
从 123.45 秒开始剪切 XML
python3 -m danmaku_tools.cut_danmaku --start_time 123.45 video_input.xml --output video_output.xml
从 123.45 秒到 567.89 开始剪切 XML
python3 -m danmaku_tools.cut_danmaku --start_time 123.45 --end_time 567.89 video_input.xml --output video_output.xml
经常和类似这样的视频剪切命令同时使用
ffmpeg -ss 123.45 -to 567.89 -i video_input.flv video_output.flv
分析流水
python3 -m danmaku_tools.analyze_danmaku video.xml
输出如下:
弹幕:46541条
醒目留言:15294.0元
礼物:7366.440000000309元
大航海:10116.0元
大航海类别:{'舰长': 41, '提督': 1}
总流水 32776.44000000031元
分析高能
python3 -m danmaku_tools.danmaku_energy_map video.xml `# 输入 XML 文件` \
--graph video.he.png `# 高能进度条 png` \
--he_map he_list.txt `# 高能列表` \
--sc_list sc_list.txt `# 醒目留言列表` \
--sc_srt sc.srt `# 醒目留言字幕` \
--he_time he_time.txt `# 最高能时间点` \
--he_range he_range.txt `# 最高能时间段`
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
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for danmaku_tools-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b097b1a431d7e147bd3905fa4dd62711ea6a7ad29f7159fe9435428a264bf70 |
|
MD5 | a0a2c95ef29bc35cbbd80c489c839ff7 |
|
BLAKE2b-256 | 32d77be0a7fa5b424f7dc9dd5dbb4fb307a319d9ad9ae8f5b570a3ea1a006bba |