m13253 / BiliDan

Play videos on Bilibili.com with MPV and Danmaku2ASS
http://m13253.blogspot.com/2014/06/watch-bilibili-with-biligrab-danmaku2ass.html
Other
513 stars 69 forks source link

ubuntu14.0.4上使用报错 #48

Closed MakeHui closed 8 years ago

MakeHui commented 8 years ago

mpv使用的源安装, 不是编译安装的, 求解

INFO: Determining video resolution...
INFO: Video resolution: 1280x720
INFO: Loading comments...
INFO: Invoking Danmaku2ASS, converting to /tmp/tmp-danmaku2ass-zcbxhc_m.ass
INFO: Launching media player...
Invalid value for option framedrop: vo
Valid values are: no yes hard
Error parsing option framedrop (option parameter could not be parsed)
Setting commandline option --framedrop=vo failed.

Exiting... (Fatal error)
m13253 commented 8 years ago

MPV 版本有点太老了。 1、要么升级 MPV 2、要么打开 BiliDan.py 源代码,找到 --framedrop=vo 字样,改成 --framedrop=yes

希望能解决这个问题,如果没解决请告诉我。

MakeHui commented 8 years ago
INFO: Loading comments...
INFO: Invoking Danmaku2ASS, converting to /tmp/tmp-danmaku2ass-ukw2k33i.ass
INFO: Launching media player...
Error parsing option force-media-title (option not found)
Setting commandline option --force-media-title= failed.

版本信息

mpv 0.4.0 (C) 2000-2014 mpv/MPlayer/mplayer2 projects
 built on 2014-06-27T19:01:41
ffmpeg library versions:
   libavutil       52.66.100
   libavcodec      55.52.102
   libavformat     55.33.100
   libswscale      2.5.102
   libavfilter     4.2.100
   libavresample   1.2.0
MakeHui commented 8 years ago
# command_line += ['--force-media-title', video_metadata.get('title', url)]
pass

这个去掉就可以播放了, 标题看不到, 无所谓了

但是还有个问题: 视频缓存的时候容易出错, 重新再获取又行了

[cache] Cache is not responding - slow/stuck network connection?
[cache] Cache keeps not responding.
[cache] Cache keeps not responding.
[cache] Cache keeps not responding.
[cache] Cache keeps not responding.
[cache] Cache keeps not responding.
[cache] Cache keeps not responding.
[cache] Cache keeps not responding.
[cache] Cache keeps not responding.

thx, 感谢解答 :)

m13253 commented 8 years ago

mpv 0.4.0 (C) 2000-2014 mpv/MPlayer/mplayer2 projects

果然是太旧了,两年前的版本。 我因为弄不到这么旧的版本就没有适配。抱歉哈。

[cache] Cache is not responding - slow/stuck network connection?

这个可能是B站最近在坑第三方客户端,故意限制缓冲速度。我正在联系知情的人找解决办法。

既然解决了,那我就关咯。

MakeHui commented 8 years ago
mpv_version_master = tuple(check_env.mpv_version.split('-', 1)[0].split('.'))
mpv_version_gte_0_10 = mpv_version_master >= ('0', '10') or (len(mpv_version_master) >= 2 and len(mpv_version_master[1]) >= 3) or mpv_version_master[0] == 'git'
mpv_version_gte_0_6 = mpv_version_gte_0_10 or mpv_version_master >= ('0', '6') or (len(mpv_version_master) >= 2 and len(mpv_version_master[1]) >= 2) or mpv_version_master[0] == 'git'
mpv_version_gte_0_4 = mpv_version_gte_0_6 or mpv_version_master >= ('0', '4') or (len(mpv_version_master) >= 2 and len(mpv_version_master[1]) >= 2) or mpv_version_master[0] == 'git'

print(mpv_version_master)         # output: ('0', '4', '0')
print(mpv_version_gte_0_10)     # output: True

这里很奇怪了, 按理说是应该返回False的 最终导致低于0.10.0的版本都会被判断为True

纳闷了半天, 原因我直接跪了(Ps: 好几年没碰python了, 忘基础了):

>>> ('0', '4', '0') > ('0', '6')
False
>>> ('0', '4', '0') > ('0', '10')
True

有一个问题: 为何要在低版本的判断中加入对高版本的判断的结果呢? 个人感觉是毫无意义的, 期待您的解答

m13253 commented 8 years ago

有一个问题: 为何要在低版本的判断中加入对高版本的判断的结果呢? 个人感觉是毫无意义的, 期待您的解答

我也不知道我当时为什么这么脑抽

最终导致低于0.10.0的版本都会被判断为True

等我考试结束修一下吧。比较靠谱的解决方法应该是转换成整数再比较(但是要小心带有 git- 字样转换失败)。 等我考试完再修吧,或者如果你能修麻烦帮我修一下。

m13253 commented 8 years ago

不过 MPV 这几个月来开始不用版本号了,所以判断版本新旧已经非常不靠谱了……

MakeHui commented 8 years ago

我MPV的版本号并不是很熟悉, 所以也就不乱改了, 怕弄得别人用不了了就不太好了. 您有时间再改吧, 现在我自己暴力改下能满足自己使用, 估计也没人会用这么低版本的MPV了 ^_^|||