Danmaku(XML) to ASS Converter
High-performance XML to ASS subtitle converter. Transform Bilibili/AcFun danmaku into high-quality, collision-free subtitles for Potplayer, IINA, VLC, and Movist.
Danmaku XML → ASS Converter
Convert Bilibili / AcFun danmaku XML to collision-free ASS subtitles for VLC, PotPlayer, IINA.
Common Problems
How do I convert a Bilibili .xml danmaku file to ASS?
Paste the XML or upload the .xml exported by BBDown or you-get, set the resolution and font size to match your video, and convert. Save the resulting .ass next to the video with the same base filename so the player loads it automatically.
Why is my danmaku timing wrong or shifted after converting?
Bilibili's p attribute stores the appearance time as relative seconds from the start of the video, not as a HH:MM:SS timecode. Converting straight from the original XML keeps timing correct; problems usually start when the XML was hand-edited or merged from a different cut of the video.
How do I stop danmaku from overlapping and stacking?
Enable track-based collision handling when converting. The tool places each comment in a lane and delays reuse of that lane until the prior comment has scrolled off, which keeps dense sections readable instead of letting dozens of comments overprint each other.
How do I load the ASS danmaku in IINA, mpv, or PotPlayer?
Put the .ass file in the same folder as the video and give it the same base name (episode01.mp4 + episode01.ass) for auto-loading, or add it manually via Subtitle → Add/Load. mpv users can also pass --sub-file=episode01.ass on the command line.
Why do some comments scroll when they should stay fixed at the top or bottom?
Bilibili encodes position in p[1]: 1-3 scroll, 4 is bottom-fixed, 5 is top-fixed. A converter that treats every entry as scrolling will animate them all. This tool keeps modes 4 and 5 anchored with the correct alignment tag instead of applying a move.
Workflow
What is Danmaku(XML) to ASS Converter?
Video downloaders like BBDown, you-get, and Jijidown save Bilibili comments as a separate .xml file — a long list of <d p="...">comment text</d> entries. But IINA, mpv, VLC, and PotPlayer can't render that XML at all; drop it on a video and nothing happens. This converter turns the danmaku XML into an ASS subtitle track those players do understand, while fixing the two things hand-conversion always gets wrong: the timing (each comment's time is a relative offset in seconds, not a timecode) and overlap (hundreds of comments at the same moment stacking on top of each other).
How to use Danmaku(XML) to ASS Converter
Paste the XML or drop the .xml file in. Before converting, set three things that actually change the result: (1) Resolution — match it to your video (1920×1080, 1280×720…); ASS positions are absolute to a canvas (PlayResX/PlayResY), so a mismatch makes text float or clip. (2) Font size — 36 for 1080p, 28 for 720p is a good start. (3) Scroll duration — 8s reads comfortably; lower it when comments pile up. Convert, then save the .ass with the SAME base name as the video (movie.mp4 → movie.ass) in the same folder and the player auto-loads it.
Example
Input (Bilibili XML):
<d p="12.53,1,25,16777215,1699...">前方高能</d>
p[0]=12.53 start sec p[1]=1 scroll p[2]=25 font p[3]=16777215 color (white)
Output (ASS):
[Script Info]
PlayResX: 1920
PlayResY: 1080
[Events]
Dialogue: 0,0:00:12.53,0:00:20.53,R2L,,0,0,0,,{\move(1920,64,-260,64)}前方高能
Note: ASS color is &HBBGGRR (byte-reversed), so RGB 0xFFFFFF stays FFFFFF, but red 0xFF0000 becomes &H0000FF.Use Cases
1. Watch a downloaded Bilibili episode in IINA or mpv on macOS with the original scrolling comments intact.
2. Burn danmaku into a release with ffmpeg (-vf "ass=movie.ass") to share where the player can't load external subtitles.
3. Convert huge comment dumps (50k+ entries) locally, without uploading a viewer's watch history to a third-party server.
4. Keep top/bottom fixed comments (mode 4/5) anchored instead of letting them scroll — useful for lyric or sign-style danmaku.
5. Archive a live broadcast's chat as a permanent, greppable .ass file.
FAQ
Why won't VLC or IINA show my .xml danmaku?
Those players only render subtitle formats (ASS/SRT/SSA), not Bilibili's XML comment schema. The XML has to be converted to ASS first — that's what this tool does, mapping each <d> entry to a Dialogue line with the right timing and motion.
The comments appear but the timing is off — why?
In Bilibili XML the first number in p is the appearance time in seconds relative to the video start, not an absolute HH:MM:SS timecode. Converting straight from the original XML keeps timing correct; drift usually means the XML was hand-edited or the danmaku and video are different cuts.
How does collision avoidance work?
Each scrolling comment is assigned to a horizontal track (lane). The tool computes how long a string of a given length takes to cross the screen and won't reuse a lane until the previous comment has cleared, so dense sections stay readable instead of overprinting.
My danmaku look too big or off-screen on a 4K file — how do I fix it?
Set the converter's resolution to match the video and scale the font down. ASS positions are relative to PlayResX/PlayResY; if that canvas is 1080p but the video is 2160p, the player upscales everything 2×.