m13253 / danmaku2ass

Convert comments from Niconico/AcFun/bilibili to ASS format
http://m13253.blogspot.com/2013/11/play-danmaku-offline-danmaku2ass.html
GNU General Public License v3.0
549 stars 90 forks source link

Lifetime of different type of danmaku should be different #10

Closed yangsheng6810 closed 9 years ago

yangsheng6810 commented 9 years ago

When using danmaku2ass, I found out that the lifetime of bottom/top centered comment is the same as that of regular moving ones, which may not be a good idea.

We need lifetime longer than 10 seconds for moving danmaku to be easily read, but this would be too long for centered comments as they will cover up the video for too long. Actually, the life time of bottom/top centered comments varies, depending on their length, the size of the screen, etc. Maybe you can reference a project on Github named ``gdanmaku'' for some ideas of calculating the lifetime.

m13253 commented 9 years ago

I'm interested in it.

Do you have any documents on it?

yangsheng6810 commented 9 years ago

Nope, but the core part regarding the speed/lifetime is as follows

         self.step = min(len(self.text) * 0.03 + 1.2, 8)
         self.interval = 30

where self.step' is the distance travelled everyself.interval', for normal danmaku

and my temporary fix is attached.

P.S. maybe we should use Chinese?

在 2014年11月30日 20:55, Star Brilliant 写道:

I'm interested in it.

Do you have any documents on it?

— Reply to this email directly or view it on GitHub https://github.com/m13253/danmaku2ass/issues/10#issuecomment-64984421.

m13253 commented 9 years ago

可能滚动弹幕应该和静止弹幕有不同的时长吧。 但是,以 Niconico 和 B 站而言,时长和弹幕长度无关。

yangsheng6810 commented 9 years ago

有关,我实际测过。如果你细心注意的话,长弹幕的飞行速度比短弹幕的飞行速度 快,而 且实际被显示的时间也是长弹幕比短弹幕长(从右侧出现到左侧消失的时 间)。

在 2014年11月30日 21:55, Star Brilliant 写道:

可能滚动弹幕应该和静止弹幕有不同的时长吧。 但是,以 Niconico 和 B 站而言,时长和弹幕长度无关。

— Reply to this email directly or view it on GitHub https://github.com/m13253/danmaku2ass/issues/10#issuecomment-64986029.

m13253 commented 9 years ago

且实际被显示的时间也是长弹幕比短弹幕长(从右侧出现到左侧消失的时 间)

默认模式下,滚动弹幕5秒,置顶弹幕3秒。

yangsheng6810 commented 9 years ago

不同大小的屏幕中,滚动弹幕的速度大致一致,因此时间长度不等。可以全屏幕试试。

在 2014年12月01日 23:50, Star Brilliant 写道:

且实际被显示的时间也是长弹幕比短弹幕长(从右侧出现到左侧消失的时
间)

默认模式下,滚动弹幕5秒,置顶弹幕3秒。

— Reply to this email directly or view it on GitHub https://github.com/m13253/danmaku2ass/issues/10#issuecomment-65084007.

m13253 commented 9 years ago

不同大小的屏幕中,滚动弹幕的速度大致一致,因此时间长度不等。可以全屏幕试试。

你没有看到「默认模式」吧?

宽屏模式是8秒/3秒,全屏的时长在设置面板里手工指定。

你可以参考我在 BiliDan 的动态计算时长算法,但是我目前还没有把滚动和非滚动弹幕分开,计划本周末去做。

yangsheng6810 commented 9 years ago

没有找到“默认模式”,怎么找到?//不知道是不是指和“宽屏模式”相对的右侧有面 板的模式?

我速度没有调过,看了一下自己是1.20,大概是默认的?

你给的代码中主要是 'comment_duration': min(max(6.75*video_size[0]/video_size[1]-4, 3.0), 8.0)

其中video_size = (width, height),并按比例调整至height=1080。所以。。对 于大多数16:9和4:3的视频来说,整个公式就是常数8和5了。感觉……还不如直接 用if……

另:全屏下,速度是一定的,但时长不一定。电脑带的两个屏幕一个24寸一个14 寸,开同一个视频明显时常不一样。

又及:期待您的更新!

在 2014年12月02日 00:21, Star Brilliant 写道:

不同大小的屏幕中,滚动弹幕的速度大致一致,因此时间长度不等。可以全
屏幕试试。

你没有看到「默认模式」吧?

宽屏模式是8秒/3秒,全屏的时长在设置面板里手工指定。

你可以参考 BiliDan https://github.com/m13253/BiliDan/blob/e61ab20b18ed870ef00cb57f44b43c93dfcf81f2/bilidan.py#L168 的动态计算时长算法,但是我目前还没有把滚动和非滚动弹幕分开,计划本周末 去做。

— Reply to this email directly or view it on GitHub https://github.com/m13253/danmaku2ass/issues/10#issuecomment-65089445.

m13253 commented 9 years ago

没有找到“默认模式”,怎么找到?//不知道是不是指和“宽屏模式”相对的右侧有面板的模式?

我说的就是没有面板的模式。因为我的中文实在不太好所以不知道怎么说它。

我速度没有调过,看了一下自己是1.20,大概是默认的?

那大概就是默认的(吧……) :sweat:

感觉……还不如直接用if……

因为有视频介于 4:3 和 16:9 这两者之间……

另:全屏下,速度是一定的,但时长不一定。

是的。显然是那样。另外这和弹幕配置里的「全屏同步大小」有关。如果打开,就变成时长一定了。

我还没有打算去做「速度一定」的功能,因为要改的代码太多而我现在挤不出那么多时间重构。但是我会考虑加一个固定弹幕的时长选项。即使加这个选项也要考虑再三,因为已经有一些别的项目在使用 Danmaku2ASS 的引擎,如 BiliDown、Biligrab、BiliDan 等的后端弹幕支持。

另外,如果你需要 Linux / OS X 下在线看 B 站弹幕的话,请考虑试试 Bilidan,有在线缓冲功能并调用 Danmaku2ASS 来渲染弹幕,而且会根据以上所述的算法来自动设置某些参数。

yangsheng6810 commented 9 years ago

对api的稳定性非常理解。

速度一定感觉其实在实际中影响不太大,因为生成的时候屏幕分辨率已经被加入考虑了。我提出来主要是觉得可以用这个计算时长。

我会试试bilidan看。暂时先用着自己糙快猛的改版。

再次感谢您的作品 2014年12月2日 上午12:54于 "Star Brilliant" notifications@github.com写道:

没有找到“默认模式”,怎么找到?//不知道是不是指和“宽屏模式”相对的右侧有面板的模式?

我说的就是没有面板的模式。因为我的中文实在不太好所以不知道怎么说它。

我速度没有调过,看了一下自己是1.20,大概是默认的?

那大概就是默认的(吧……) [image: :sweat:]

感觉……还不如直接用if……

因为有视频介于 4:3 和 16:9 这两者之间……

另:全屏下,速度是一定的,但时长不一定。

是的。显然是那样。另外这和弹幕配置里的「全屏同步大小」有关。如果打开,就变成时长一定了。

我还没有打算去做「速度一定」的功能,因为要改的代码太多而我现在挤不出那么多时间重构。但是我会考虑加一个固定弹幕的时长选项。即使加这个选项也要考虑再三,因为已经有一些别的项目在使用 Danmaku2ASS 的引擎,如 BiliDown、Biligrab、BiliDan 等的后端弹幕支持。

另外,如果你需要在线看 B 站弹幕的话,请考虑试试 Bilidan https://github.com/m13253/BiliDan,有在线缓冲功能并调用 Danmaku2ASS 来渲染弹幕,而且会根据以上所述的算法来自动设置某些参数。

— Reply to this email directly or view it on GitHub https://github.com/m13253/danmaku2ass/issues/10#issuecomment-65095677.

m13253 commented 9 years ago

在 9fc40a0db731fe699d3a30c5bc3055c87ed7c135 中已修复。 BiliDan 也更新了。 请测试。