valkjsaaa / auto-bilibili-recorder

Automatically record, burn danmaku, and transcode Bilibili live streams
GNU General Public License v3.0
324 stars 37 forks source link

flv视频录制长度小于对应XML文件时间长度 #53

Open AceEcho opened 1 year ago

AceEcho commented 1 year ago

使用版本为3b9ac86,没有进行任何修改(不是我pr的那版)。使用的record_config.yaml文件仅包含了房间号,没有任何其他config。

录制结束后,一共有两段视频,第一段是正常开播到下播,时长为5565.564,另一段是一段8秒左右的关播月读结尾。

ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "3012597-20230129-160250-428.flv"# 
5565.564000

但是第一段视频对应的xml弹幕文件中最后两条弹幕时间戳为5572和5575,都超出了第一段视频的长度,导致后续merge得到的弹幕时间戳出现矛盾。第二段视频中出现的唯一一条弹幕的时间戳本来是3.6左右,5565+3.6 < 5572,也就是后发生的弹幕的时间戳出现在了前面导致danmaku_tools报错,没有生成ass文件。

第一段视频中时间戳大于视频长度的几条弹幕:

<d p="5567.681,1,25,5566168,1674984938198,0,1261402599,0" user="肥喵面包糠" raw="[[0,1,25,5566168,1674984938198,1674980613,0,&quot;3e0372e6&quot;,0,0,0,&quot;&quot;,0,&quot;{}&quot;,&quot;{}&quot;,{&quot;mode&quot;:0,&quot;show_player_type&quot;:0,&quot;extra&quot;:&quot;{\&quot;send_from_me\&quot;:false,\&quot;mode\&quot;:0,\&quot;color\&quot;:5566168,\&quot;dm_type\&quot;:0,\&quot;font_size\&quot;:25,\&quot;player_mode\&quot;:1,\&quot;show_player_type\&quot;:0,\&quot;content\&quot;:\&quot;寸什么?还没说完呢\&quot;,\&quot;user_hash\&quot;:\&quot;1040413414\&quot;,\&quot;emoticon_unique\&quot;:\&quot;\&quot;,\&quot;bulge_display\&quot;:0,\&quot;recommend_score\&quot;:3,\&quot;main_state_dm_color\&quot;:\&quot;\&quot;,\&quot;objective_state_dm_color\&quot;:\&quot;\&quot;,\&quot;direction\&quot;:0,\&quot;pk_direction\&quot;:0,\&quot;quartet_direction\&quot;:0,\&quot;anniversary_crowd\&quot;:0,\&quot;yeah_space_type\&quot;:\&quot;\&quot;,\&quot;yeah_space_url\&quot;:\&quot;\&quot;,\&quot;jump_to_url\&quot;:\&quot;\&quot;,\&quot;space_type\&quot;:\&quot;\&quot;,\&quot;space_url\&quot;:\&quot;\&quot;,\&quot;animation\&quot;:{},\&quot;emots\&quot;:null}&quot;},{&quot;activity_identity&quot;:&quot;&quot;,&quot;activity_source&quot;:0,&quot;not_show&quot;:0}],&quot;寸什么?还没说完呢&quot;,[1261402599,&quot;肥喵面包糠&quot;,0,0,0,10000,1,&quot;&quot;],[24,&quot;猫闷台&quot;,&quot;桃井最中Monaka&quot;,22637920,1725515,&quot;&quot;,0,6809855,1725515,5414290,3,1,692437895],[11,0,6406234,&quot;&gt;50000&quot;,0],[&quot;&quot;,&quot;&quot;],0,0,null,{&quot;ts&quot;:1674984938,&quot;ct&quot;:&quot;F0E21B4A&quot;},0,0,null,null,0,70]">寸什么?还没说完呢</d>
<d p="5572.850,1,25,16777215,1674984943071,0,128005553,0" user="ココ思う" raw="[[0,1,25,16777215,1674984943071,-1640862654,0,&quot;dec84c69&quot;,0,0,0,&quot;&quot;,1,{&quot;bulge_display&quot;:1,&quot;emoticon_unique&quot;:&quot;room_3012597_21692&quot;,&quot;height&quot;:162,&quot;in_player_area&quot;:1,&quot;is_dynamic&quot;:0,&quot;url&quot;:&quot;http://i0.hdslb.com/bfs/live/86346025126bbb6e9f0162428c83e3d150ee9cd4.png&quot;,&quot;width&quot;:162},&quot;{}&quot;,{&quot;mode&quot;:0,&quot;show_player_type&quot;:0,&quot;extra&quot;:&quot;{\&quot;send_from_me\&quot;:false,\&quot;mode\&quot;:0,\&quot;color\&quot;:16777215,\&quot;dm_type\&quot;:1,\&quot;font_size\&quot;:25,\&quot;player_mode\&quot;:1,\&quot;show_player_type\&quot;:0,\&quot;content\&quot;:\&quot;这个好喵\&quot;,\&quot;user_hash\&quot;:\&quot;3737668713\&quot;,\&quot;emoticon_unique\&quot;:\&quot;room_3012597_21692\&quot;,\&quot;bulge_display\&quot;:1,\&quot;recommend_score\&quot;:6,\&quot;main_state_dm_color\&quot;:\&quot;\&quot;,\&quot;objective_state_dm_color\&quot;:\&quot;\&quot;,\&quot;direction\&quot;:0,\&quot;pk_direction\&quot;:0,\&quot;quartet_direction\&quot;:0,\&quot;anniversary_crowd\&quot;:0,\&quot;yeah_space_type\&quot;:\&quot;\&quot;,\&quot;yeah_space_url\&quot;:\&quot;\&quot;,\&quot;jump_to_url\&quot;:\&quot;\&quot;,\&quot;space_type\&quot;:\&quot;\&quot;,\&quot;space_url\&quot;:\&quot;\&quot;,\&quot;animation\&quot;:{},\&quot;emots\&quot;:null}&quot;},{&quot;activity_identity&quot;:&quot;&quot;,&quot;activity_source&quot;:0,&quot;not_show&quot;:0}],&quot;这个好喵&quot;,[128005553,&quot;ココ思う&quot;,0,0,0,10000,1,&quot;&quot;],[],[0,0,9868950,&quot;&gt;50000&quot;,0],[&quot;&quot;,&quot;&quot;],0,0,null,{&quot;ts&quot;:1674984943,&quot;ct&quot;:&quot;9A71EB0C&quot;},0,0,null,null,0,7]">这个好喵</d>
<d p="5575.060,1,25,5566168,1674984945967,0,355030808,0" user="不仅仅是一根萝卜" raw="[[0,1,25,5566168,1674984945967,-199169839,0,&quot;092f384a&quot;,0,0,0,&quot;&quot;,1,{&quot;bulge_display&quot;:1,&quot;emoticon_unique&quot;:&quot;room_3012597_444&quot;,&quot;height&quot;:162,&quot;in_player_area&quot;:1,&quot;is_dynamic&quot;:1,&quot;url&quot;:&quot;http://i0.hdslb.com/bfs/live/93e0ce8b5a6ad57f77414323c60de760e056960f.png&quot;,&quot;width&quot;:162},&quot;{}&quot;,{&quot;mode&quot;:0,&quot;show_player_type&quot;:0,&quot;extra&quot;:&quot;{\&quot;send_from_me\&quot;:false,\&quot;mode\&quot;:0,\&quot;color\&quot;:5566168,\&quot;dm_type\&quot;:1,\&quot;font_size\&quot;:25,\&quot;player_mode\&quot;:1,\&quot;show_player_type\&quot;:0,\&quot;content\&quot;:\&quot;喝茶\&quot;,\&quot;user_hash\&quot;:\&quot;154089546\&quot;,\&quot;emoticon_unique\&quot;:\&quot;room_3012597_444\&quot;,\&quot;bulge_display\&quot;:1,\&quot;recommend_score\&quot;:8,\&quot;main_state_dm_color\&quot;:\&quot;\&quot;,\&quot;objective_state_dm_color\&quot;:\&quot;\&quot;,\&quot;direction\&quot;:0,\&quot;pk_direction\&quot;:0,\&quot;quartet_direction\&quot;:0,\&quot;anniversary_crowd\&quot;:0,\&quot;yeah_space_type\&quot;:\&quot;\&quot;,\&quot;yeah_space_url\&quot;:\&quot;\&quot;,\&quot;jump_to_url\&quot;:\&quot;\&quot;,\&quot;space_type\&quot;:\&quot;\&quot;,\&quot;space_url\&quot;:\&quot;\&quot;,\&quot;animation\&quot;:{},\&quot;emots\&quot;:null}&quot;},{&quot;activity_identity&quot;:&quot;&quot;,&quot;activity_source&quot;:0,&quot;not_show&quot;:0}],&quot;喝茶&quot;,[355030808,&quot;不仅仅是一根萝卜&quot;,0,0,0,10000,1,&quot;&quot;],[21,&quot;帕清姬&quot;,&quot;眞白花音_Official&quot;,21402309,1725515,&quot;&quot;,0,1725515,1725515,5414290,0,1,401480763],[9,0,9868950,&quot;&gt;50000&quot;,0],[&quot;&quot;,&quot;&quot;],0,0,null,{&quot;ts&quot;:1674984945,&quot;ct&quot;:&quot;67540AB1&quot;},0,0,null,null,0,56]">喝茶</d>
</i>

不清楚为什么视频结束录制之后继续抓取了十秒左右的弹幕。以下为录制得到的xml源文件以及合并的文件。 XMLs.zip

另附上录制的log log.txt

AceEcho commented 1 year ago

上述录制问题导致danmaku_tools报错的补充信息: https://github.com/valkjsaaa/danmaku_tools/issues/10#issue-1561327544