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

无法播放多P视频 #49

Closed yejingchen closed 8 years ago

yejingchen commented 8 years ago

系统:Arch,发issue时前刚更新 mpv: 0.15.0,官方源

无法播放B站的多P视频,mpv 一直在提示[cache] Cache is not responding - slow/stuck network connection?,但是带宽是占满的,通过nethogs查看的确是mpv这个进程占用着网速,但是mpv仍然提示网速慢。

在我的系统上一直都可以复现:找一个多P的视频(比如叛逆的鲁鲁修)即可。

终端的输出:

$ bilidan -v http://www.bilibili.com/video/av391459/
DEBUG: Detected mpv version: 0.15.0
INFO: Loading video info...
DEBUG: Fetch: http://api.bilibili.com/view?type=json&id=391459&sign=40276994573249a38d68ad17c3918885&appkey=85eb6835b0a1034e&page=1
INFO: Got video cid: 600819
INFO: Loading video content...
DEBUG: Fetch: http://interface.bilibili.com/playurl?cid=600819&sign=5b293e128a7f61f96785d3c8ee6ee813&appkey=85eb6835b0a1034e
INFO: Got media URLs:
      1: http://cn-jsyz1-dx.acgvideo.com/vg5/9/19/600819-1.flv?expires=1453237200&ssig=G-TXj2vlT64WhGmz-Wu9Cw&oi=3080560680&appkey=85eb6835b0a1034e&or=2061576138&rate=0
      2: http://cn-jsyz1-dx.acgvideo.com/vg5/9/19/600819-2.flv?expires=1453237200&ssig=GpgdVPu6_FyKjlSAg8zpYw&oi=3080560680&appkey=85eb6835b0a1034e&or=2061576138&rate=0
      3: http://cn-jsyz1-dx.acgvideo.com/vg5/9/19/600819-3.flv?expires=1453237200&ssig=C5PCdHDiuYwwaQtzIHzLcg&oi=3080560680&appkey=85eb6835b0a1034e&or=2061576138&rate=0
      4: http://cn-jsyz1-dx.acgvideo.com/vg5/9/19/600819-4.flv?expires=1453237200&ssig=b2smgxcOVkNmiaegFxiVaw&oi=3080560680&appkey=85eb6835b0a1034e&or=2061576138&rate=0
      5: http://cn-jsyz1-dx.acgvideo.com/vg5/9/19/600819-5.flv?expires=1453237200&ssig=c-bkzmNThi8ACRjjjk0FfA&oi=3080560680&appkey=85eb6835b0a1034e&or=2061576138&rate=0
INFO: Determining video resolution...
DEBUG: Executing: ffprobe -icy 0 -loglevel repeat+warning -print_format json -select_streams v -show_streams -timeout 60000000 -user-agent 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.2) Gecko/20100101 Firefox/6.0.2 Fengfan/1.0' -- 'http://cn-jsyz1-dx.acgvideo.com/vg5/9/19/600819-1.flv?expires=1453237200&ssig=G-TXj2vlT64WhGmz-Wu9Cw&oi=3080560680&appkey=85eb6835b0a1034e&or=2061576138&rate=0'
INFO: Video resolution: 1920x1080
INFO: Loading comments...
DEBUG: Fetch: http://comment.bilibili.com/600819.xml
INFO: Invoking Danmaku2ASS, converting to /tmp/tmp-danmaku2ass-o1o1rdmm.ass
WARNING: Invalid comment: <d p="135.47700500488,1,25,16777215,1440501458,0,D46a51a2,1150877945"/>
WARNING: Invalid comment: <d p="180.89700317383,1,25,16777215,1440501567,0,D46a51a2,1150884819"/>
INFO: Launching media player...
DEBUG: Compare mpv version: 0.15.0 >= 0.10
DEBUG: Compare mpv version: 0.15.0 >= 0.6
DEBUG: Compare mpv version: 0.15.0 >= 0.4
DEBUG: Executing: mpv --autofit 950x540 --cache-file TMP --framedrop vo --http-header-fields 'User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.2) Gecko/20100101 Firefox/6.0.2 Fengfan/1.0' --force-media-title '【合集】Code Gease 反叛的鲁鲁修 第一季【1080P】【SOSG】' --merge-files --no-video-aspect --sub-ass --sub-file /tmp/tmp-danmaku2ass-o1o1rdmm.ass --vf 'lavfi="fps=fps=60:round=down"' -- 'http://cn-jsyz1-dx.acgvideo.com/vg5/9/19/600819-1.flv?expires=1453237200&ssig=G-TXj2vlT64WhGmz-Wu9Cw&oi=3080560680&appkey=85eb6835b0a1034e&or=2061576138&rate=0' 'http://cn-jsyz1-dx.acgvideo.com/vg5/9/19/600819-2.flv?expires=1453237200&ssig=GpgdVPu6_FyKjlSAg8zpYw&oi=3080560680&appkey=85eb6835b0a1034e&or=2061576138&rate=0' 'http://cn-jsyz1-dx.acgvideo.com/vg5/9/19/600819-3.flv?expires=1453237200&ssig=C5PCdHDiuYwwaQtzIHzLcg&oi=3080560680&appkey=85eb6835b0a1034e&or=2061576138&rate=0' 'http://cn-jsyz1-dx.acgvideo.com/vg5/9/19/600819-4.flv?expires=1453237200&ssig=b2smgxcOVkNmiaegFxiVaw&oi=3080560680&appkey=85eb6835b0a1034e&or=2061576138&rate=0' 'http://cn-jsyz1-dx.acgvideo.com/vg5/9/19/600819-5.flv?expires=1453237200&ssig=c-bkzmNThi8ACRjjjk0FfA&oi=3080560680&appkey=85eb6835b0a1034e&or=2061576138&rate=0'
Playing: edl://%159%http://cn-jsyz1-dx.acgvideo.com/vg5/9/19/600819-1.flv?expires=1453237200&ssig=G-TXj2vlT64WhGmz-Wu9Cw&oi=3080560680&appkey=85eb6835b0a1034e&or=2061576138&rate=0;%159%http://cn-jsyz1-dx.acgvideo.com/vg5/9/19/600819-2.flv?expires=1453237200&ssig=GpgdVPu6_FyKjlSAg8zpYw&oi=3080560680&appkey=85eb6835b0a1034e&or=2061576138&rate=0;%159%http://cn-jsyz1-dx.acgvideo.com/vg5/9/19/600819-3.flv?expires=1453237200&ssig=C5PCdHDiuYwwaQtzIHzLcg&oi=3080560680&appkey=85eb6835b0a1034e&or=2061576138&rate=0;%159%http://cn-jsyz1-dx.acgvideo.com/vg5/9/19/600819-4.flv?expires=1453237200&ssig=b2smgxcOVkNmiaegFxiVaw&oi=3080560680&appkey=85eb6835b0a1034e&or=2061576138&rate=0;%159%http://cn-jsyz1-dx.acgvideo.com/vg5/9/19/600819-5.flv?expires=1453237200&ssig=c-bkzmNThi8ACRjjjk0FfA&oi=3080560680&appkey=85eb6835b0a1034e&or=2061576138&rate=0
[cache] Cache is not responding - slow/stuck network connection?
[cache] Cache is not responding - slow/stuck network connection?
[cache] Cache is not responding - slow/stuck network connection? # 按下Q键
[file-cache] unexpected EOF
[ffmpeg/demuxer] flv: Could not find codec parameters for stream 0 (Video: none, none): unknown codec
[ffmpeg/demuxer] Consider increasing the value for the 'analyzeduration' and 'probesize' options
[ffmpeg/demuxer] flv: Could not find codec parameters for stream 1 (Audio: none, 0 channels): unknown codec
[ffmpeg/demuxer] Consider increasing the value for the 'analyzeduration' and 'probesize' options
[lavf] av_find_stream_info() failed
EDL: Could not open source file 'http://cn-jsyz1-dx.acgvideo.com/vg5/9/19/600819-2.flv?expires=1453237200&ssig=GpgdVPu6_FyKjlSAg8zpYw&oi=3080560680&appkey=85eb6835b0a1034e&or=2061576138&rate=0'.

Exiting... (Quit)
$
yejingchen commented 8 years ago

刚刚发现这个问题可能跟 https://github.com/m13253/BiliDan/issues/47 是同一个原因,可是那里提到这只会发生在 2014 年的视频之前,可是我在看2015年的多P视频也会如此

m13253 commented 8 years ago

这个问题我已经了解。正如你看到的那样,我已经联系了 MPV 方面进行修复。 我不知道那边有没有修复好,如果修复好的话,升级到最新版 MPV 就能立即起效。

m13253 commented 8 years ago

Solution by @Goshin :

I've met this problem few months ago, and I found controlling the buffer size would be helpful.

Just specify the --cache, --cache-backbuffer, --cache-secs options in the command line for Mpv. It will restrain the buffering of the not playing segments when limited buffer filled in. Refer to https://github.com/Goshin/Yatto/blob/master/src/yatto.py#L144,L145 Official manual: https://mpv.io/manual/stable/

Note that the Mpv needs to fetch the video header of every segment to tell or estimate the playback duration, so the short wait in the beginning is necessary.