danmaku2ass/README.md

116 lines
4.4 KiB
Markdown
Raw Normal View History

2013-09-20 17:02:22 +08:00
Danmaku2ASS
===========
What is it?
-----------
Danmaku2ASS converts comments from Niconico/Acfun/Bilibili to ASS format so that you can play it with any media player supporting ASS subtitle.
This software is free software released under GPL 3 license. There is no warranty to the extent permitted by law.
How to use it?
--------------
First, you will have to get the XML or JSON file from Niconico/Acfun/Bilibili, many software can help you get it. For example, [you-get](https://github.com/soimort/you-get) and [nicovideo-dl](http://sourceforge.jp/projects/nicovideo-dl/).
Then, execute `danmaku2ass`. You can see further instructions below.
Example usage
-------------
2013-09-20 17:06:28 +08:00
```sh
./danmaku2ass -o foo.ass -s 1920x1080 -fn "MS PGothic" -fs 48 -a 0.8 -dm 5 -ds 5 foo.xml
2013-09-20 17:06:28 +08:00
```
2013-09-20 17:02:22 +08:00
2013-10-03 19:48:45 +08:00
Name the output file with same basename but different extension (.ass) as the video. Put them into the same directory and most media players will automatically load them. For MPlayer, you will have to specify `-ass` option.
2013-09-20 17:02:22 +08:00
Make sure that the width/height ratio passed to `danmaku2ass` matches the one of your original video, or text deformation may be experienced.
You can also pass multiple XML/JSON files and they will be merged into one ASS file. This is useful when watching danmakus from different website at the same time.
2013-10-13 14:46:26 +08:00
Screenshot
----------
![5 Centimeters Per Second with Danmaku2ASS](screenshot.jpg)
Video: _5 Centimeters Per Second_
Source: http://www.bilibili.tv/video/av135209/
2015-01-28 22:29:28 +08:00
Players for a specific site
---------------------------
If you prefer to watch videos on a specific site listed below with a media player, you can check these projects, which usually provide online streaming features:
- Bilibili.tv: [BiliDan](https://github.com/m13253/BiliDan), (MPV Player, FFmpeg, Linux, OS X, (unstable on) Windows), officially supported by Danmaku2ASS contributer
- Bilibili.tv: [BiliGui](https://github.com/marguerite/BiliGui), (MPV Player, Ruby, Qt4, FFmpeg, Linux)
2015-01-28 22:31:49 +08:00
- Bilibili.tv: [Biligrab](https://github.com/cnbeining/Biligrab), (Aria2, Python2, FFmpeg, OS X, (unstable on) Linux)
2015-08-29 17:20:41 +08:00
- Bilibili.tv: [MoonPlayer](https://github.com/coslyk/moonplayer), (MPlayer, Qt4, Linux, Windows)
2015-01-28 22:29:28 +08:00
Please [submit your work](https://github.com/m13253/danmaku2ass/issues) if you have made a better one!
2013-09-20 17:02:22 +08:00
Command line reference
----------------------
```
usage: danmaku2ass.py [-h] [-o OUTPUT] -s WIDTHxHEIGHT [-fn FONT] [-fs SIZE]
[-a ALPHA] [-dm SECONDS] [-ds SECONDS] [-p HEIGHT] [-r]
2013-09-20 17:02:22 +08:00
FILE [FILE ...]
positional arguments:
FILE Comment file to be processed
optional arguments:
-h, --help show this help message and exit
-o OUTPUT, --output OUTPUT
Output file
-s WIDTHxHEIGHT, --size WIDTHxHEIGHT
Stage size in pixels
-fn FONT, --font FONT
Specify font face [default: Helvetica]
2013-09-20 17:02:22 +08:00
-fs SIZE, --fontsize SIZE
2013-11-24 15:37:59 +08:00
Default font size [default: 25]
2013-09-20 17:02:22 +08:00
-a ALPHA, --alpha ALPHA
Text opacity
-dm SECONDS, --duration-marquee SECONDS
Duration of scrolling comment display [default: 5]
-ds SECONDS, --duration-still SECONDS
Duration of still comment display [default: 5]
2013-09-20 17:02:22 +08:00
-p HEIGHT, --protect HEIGHT
Reserve blank on the bottom of the stage
2013-09-30 23:51:31 +08:00
-r, --reduce Reduce the amount of comments if stage is full
2013-09-20 17:02:22 +08:00
```
FAQ
---
2013-09-20 17:07:19 +08:00
### The text is moving laggy. / The text is slightly blurred.
2013-09-20 17:02:22 +08:00
Most ASS renderers render ASS subtitles at the same resolution as the video. This is probably because the video is at low resolution or framerate.
2013-12-08 00:40:32 +08:00
If you use MPlayer, you can add options similar to `-vf scale=1920:1080` (change the values as you wish).`
2013-11-27 23:55:46 +08:00
2013-09-20 17:02:22 +08:00
### I would like to render the danmakus into the video.
Use `ffmpeg`:
2013-09-20 17:06:28 +08:00
```sh
ffmpeg -i foo.flv -vf ass=foo.ass -vcodec libx264 -acodec copy foo-with-danmaku.flv
```
2013-09-20 17:02:22 +08:00
Change the parameters as you like.
### Danmaku2ASS gave me some warnings of 'Invalid comment'.
This is probably because of comment styles that are not recognized by Danmaku2ASS. This is mostly normal. However, if you think that Danmaku2ASS missed some important things, please feel free to submit an issue.
### Is there a GUI?
Currently no. But there will soon be one made of Gtk+ 3. If you would like to help me, please contact with me.
2013-09-20 17:07:19 +08:00
Contributing
------------
2013-09-20 17:02:22 +08:00
Any contribution is welcome. Any donation is welcome as well.