acgnhiki / blrec

Bilibili Live Streaming Recorder 哔哩哔哩直播录制
GNU General Public License v3.0
583 stars 40 forks source link

关于录制 HLS 流和签名过期的问题 #50

Closed Genteure closed 2 years ago

Genteure commented 2 years ago

刚才看这个 issue 回复 的时候想到问题

你有测试过录制时长超过 1 小时后会怎么样吗? 直播流地址的链接有效期只有 1 个小时,过期后是否需要重新获取? 重新获取直播流地址后不就只有二压流了吗?

acgnhiki commented 2 years ago

没有具体测试研究过,据观察好像只要保持连接 keepalive (不断网并保持 m3u8 请求) ,即使 url 超过有效期也可以录制到下播。 keepalive 失效了, url 超过有效期再请求就 403 或 404 了,重新获取的直播流链接就是二压流的了。 hls 也就比 flv 对网络波动的影响好了些吧,网络太差也是会原画不保。。。

Genteure commented 2 years ago

时间戳好像通常表达的含义是生成签名的时间,不是过期时间。 实际的过期时间是时间戳再加上在 CDN 服务商那里设置的一个时长。 所以实际上直播流有效期应该是超过一个小时的?具体是多长时间不清楚,回头可以测试一下,我只测试了一个小时。

华为云直播文档 阿里云直播文档 腾讯云直播文档

acgnhiki commented 2 years ago

expires 就是失效时间,刚好一小时。

[2022-04-25 12:33:37,475] [INFO] [base_stream_recorder] [21927742] Got live stream url: 'http://d1--cn-gotcha103.bilivideo.com/live-bvc/367670/live_510100897_27417968.m3u8?expires=1650864877&len=0&oi=2028336756&pt=android&qn=10000&trid=100304361020c85c4ef681ce6cad7d9547bd&sigparams=cdn,expires,len,oi,pt,qn,trid&cdn=cn-gotcha103&sign=6253e30b5e1fc10df9f972cb2ae099bb&sk=e6dc08f553097d93a991c3ade5d3ad60&p2p_type=8192&src=57349&sl=1&free_type=0&flowtype=1&machinezone=ylf&pp=srt&source=onetier&order=1&site=117e18fdf897d705ea4cb56b7db76242'
[2022-04-25 13:34:37,492] [WARNING] [hls_stream_recorder] [21927742] HTTPError('403 Client Error: Forbidden for url: http://d1--cn-gotcha103.bilivideo.com/live-bvc/367670/live_510100897_27417968.m3u8?pt=android&free_type=0&sign=6253e30b5e1fc10df9f972cb2ae099bb&len=0&alitime=1650861217.799&flowtype=1&source=onetier&machinezone=ylf&site=117e18fdf897d705ea4cb56b7db76242&pp=srt&sigparams=cdn,expires,len,oi,pt,qn,trid&expires=1650864877&sk=e6dc08f553097d93a991c3ade5d3ad60&oi=2028336756&src=57349&_aliauth=bd6f1bf1c627c745774624321abd9f85&_alisec=eb814f2a9bc53e0763c7ed7836f349f3&order=1&p2p_type=8192&qn=10000&sl=1&cdn=cn-gotcha103&trid=100304361020c85c4ef681ce6cad7d9547bd')
In [11]: datetime.fromtimestamp(1650864877)
Out[11]: datetime.datetime(2022, 4, 25, 13, 34, 37)

目前测试过的情况只有 HLS(fmp4) url 过期不会 403 可以一直录下去,HLS(ts) url 过期必定 403 。

但是支持 HLS(fmp4) 的直播间很少,而且刚开播时都没有 fmp4 的,要等会才有。

感觉现在 HLS 没什么必要搞了。。。

acgnhiki commented 2 years ago

3 号直播间录的 HLS(fmp4), url 过期了不会 403。

21927742 直播间只有 HLS(ts),url 过期了就 403 了。

[2022-04-25 12:33:33,213] [INFO] [recorder] [23058] Started recording
[2022-04-25 12:33:33,213] [DEBUG] [hls_stream_recorder] [23058] Segment data feeder thread started
[2022-04-25 12:33:33,213] [DEBUG] [hls_stream_recorder] [23058] Stream processor thread started
[2022-04-25 12:33:33,213] [INFO] [base_stream_recorder] [23058] Getting the live stream url... qn: 10000, format: fmp4, api platform: android, use alternative stream: False
[2022-04-25 12:33:33,215] [INFO] [application] Successfully enabled recorder for task 23058
[2022-04-25 12:33:33,322] [INFO] [base_stream_recorder] [23058] Adopted the stream format (fmp4) and quality (10000)
[2022-04-25 12:33:33,322] [INFO] [base_stream_recorder] [23058] Got live stream url: 'http://c1--cn-gotcha208.bilivideo.com/live-bvc/854391/live_11153765_9369560/index.m3u8?expires=1650864873&len=0&oi=2028336756&pt=android&qn=10000&trid=10078034e7cb0f1c4dee99c2d2f3a7d78814&sigparams=cdn,expires,len,oi,pt,qn,trid&cdn=cn-gotcha208&sign=40fb899cad89aee3adce4ed8d2a0e15e&sk=f0109e41e7f7cbb7cf89db09602a919a&p2p_type=8192&src=57349&sl=2&free_type=0&flowtype=1&machinezone=ylf&pp=rtmp&source=onetier&order=1&site=1d3c7e7ac1cbee23245b7fbed0b59b77'
[2022-04-25 12:33:33,516] [DEBUG] [stream_remuxer] [23058] Starting stream remuxer...
[2022-04-25 12:33:33,517] [DEBUG] [stream_remuxer] [23058] Started stream remuxer
[2022-04-25 12:33:33,532] [DEBUG] [stream_processor] [23058] Processing the 1th stream...
[2022-04-25 12:33:34,084] [DEBUG] [stream_processor] [23058] frame rate: 60.0, video frame interval: 17
[2022-04-25 12:33:34,087] [WARNING] [stream_processor] [23058] Timestamp jumped, updated delta: -1916695006
last tag: AudioTag(filtered=False, tag_type=<TagType.AUDIO: 8>, data_size=4, timestamp=0, stream_id=0, offset=459, body=249a7248, sound_format=<SoundFormat.AAC: 10>, sound_rate=<SoundRate.F_44KHZ: 3>, sound_size=<SoundSize.SAMPLES_16BIT: 1>, sound_type=<SoundType.STEREO: 1>, aac_packet_type=<AACPacketType.AAC_SEQUENCE_HEADER: 0>)
current tag: VideoTag(filtered=False, tag_type=<TagType.VIDEO: 9>, data_size=116122, timestamp=1916695023, stream_id=4092399, offset=478, body=ec1139fe, frame_type=<FrameType.KEY_FRAME: 1>, codec_id=<CodecID.AVC: 7>, avc_packet_type=<AVCPacketType.AVC_NALU: 1>, composition_time=33)
[2022-04-25 12:33:34,163] [INFO] [base_stream_recorder] [23058] Video file created: '/mnt/w/bilibili_live_test/23058 - 3号直播间/blive_23058_2022-04-25-123334.flv'
[2022-04-25 12:33:34,164] [DEBUG] [raw_danmaku_dumper] [23058] Started dumping raw danmaku
[2022-04-25 12:33:34,165] [DEBUG] [danmaku_dumper] [23058] Started dumping danmaku
[2022-04-25 12:33:34,165] [DEBUG] [stream_processor] [23058] New file: /mnt/w/bilibili_live_test/23058 - 3号直播间/blive_23058_2022-04-25-123334.flv
[2022-04-25 12:33:34,166] [INFO] [raw_danmaku_dumper] [23058] Raw danmaku file created: '/mnt/w/bilibili_live_test/23058 - 3号直播间/blive_23058_2022-04-25-123334.jsonl'
[2022-04-25 12:33:34,166] [DEBUG] [stream_processor] [23058] The flv header has been copied
[2022-04-25 12:33:34,167] [INFO] [danmaku_dumper] [23058] Danmaku file created: '/mnt/w/bilibili_live_test/23058 - 3号直播间/blive_23058_2022-04-25-123334.xml'
[2022-04-25 12:33:34,167] [DEBUG] [stream_processor] [23058] Transfering meta tags...
[2022-04-25 12:33:34,169] [DEBUG] [stream_processor] [23058] Meta tags have been transfered
[2022-04-25 12:33:34,170] [DEBUG] [stream_processor] [23058] Transfer the first data tag: VideoTag(filtered=False, tag_type=<TagType.VIDEO: 9>, data_size=116122, timestamp=17, stream_id=4092399, offset=478, body=ec1139fe, frame_type=<FrameType.KEY_FRAME: 1>, codec_id=<CodecID.AVC: 7>, avc_packet_type=<AVCPacketType.AVC_NALU: 1>, composition_time=33)
[2022-04-25 12:33:34,170] [DEBUG] [stream_processor] [23058] Transfering tags... timestamp delta: -17
[2022-04-25 12:33:34,171] [DEBUG] [stream_processor] [23058] 1 tags have been transfered
[2022-04-25 12:33:34,172] [DEBUG] [stream_processor] [23058] The first data tag has been transfered
[2022-04-25 12:33:34,173] [DEBUG] [stream_processor] [23058] Transfering tags until complete...
[2022-04-25 12:33:34,184] [DEBUG] [stream_processor] [23058] Transfering tags... timestamp delta: -17
[2022-04-25 12:33:35,961] [INFO] [application] Enabling recorder for task 21927742...
[2022-04-25 12:33:35,962] [DEBUG] [postprocessor] [21927742] Started postprocessor
[2022-04-25 12:33:35,962] [DEBUG] [recorder] [21927742] Started recorder
[2022-04-25 12:33:35,963] [INFO] [recorder] [21927742]
================================== User Info ==================================
user name        : AI艾灵
gender           : 女
sign             : 一个爱唱歌的AI主播,24小时直播那种。Q群:373884858  舰长群:1104053716
uid              : 510100897
level            : 6
---------------------------------- Room Info ----------------------------------
title            : 叮——您的AI点歌机已上线!
cover            : https://i0.hdslb.com/bfs/live/new_room_cover/c70c4f8ddd1dd036e2c04d6a76e8d5f8b6a69e6f.jpg
online           : 1,871
live status      : LIVE
live start time  : 2022-04-06 10:35:30
room id          : 21927742
short room id    : NULL
area id          : 371
area name        : 虚拟主播
parent area id   : 9
parent area name : 虚拟主播
tags             : AI歌姬,虚拟主播,歌姬,唱歌,人工智能,国风,舞见
description      :
25小时直播的AI点唱机(不是)
亲密度体系【初见-么么-抱抱-贴贴】已正式上线!
专属问候,主动献词,点歌置顶......更多福利等你来解锁哦
每个等级都要神秘权限等你解锁!
本月上舰送艾灵定制玩偶抱枕!
有什么想听的歌,艾灵酱有什么不足之处都可以说哦~
艾灵QQ群:876019510
快来找我玩吧!
===============================================================================

[2022-04-25 12:33:35,964] [DEBUG] [danmaku_dumper] [21927742] Changed stream recorder
[2022-04-25 12:33:35,965] [DEBUG] [raw_danmaku_dumper] [21927742] Changed stream recorder
[2022-04-25 12:33:35,965] [DEBUG] [recorder] [21927742] Changed stream recorder to HLSStreamRecorder
[2022-04-25 12:33:35,965] [DEBUG] [raw_danmaku_dumper] [21927742] Enabled raw danmaku dumper
[2022-04-25 12:33:35,966] [DEBUG] [raw_danmaku_receiver] [21927742] Started raw danmaku receiver
[2022-04-25 12:33:35,966] [DEBUG] [danmaku_dumper] [21927742] Enabled danmaku dumper
[2022-04-25 12:33:35,966] [DEBUG] [danmaku_receiver] [21927742] Started danmaku receiver
[2022-04-25 12:33:35,966] [DEBUG] [base_stream_recorder] [21927742] Starting stream recorder...
[2022-04-25 12:33:35,967] [DEBUG] [hls_stream_recorder] [21927742] Stream recorder thread started
[2022-04-25 12:33:35,967] [DEBUG] [base_stream_recorder] [21927742] Started stream recorder
[2022-04-25 12:33:35,967] [DEBUG] [hls_stream_recorder] [21927742] Segment fetcher thread started
[2022-04-25 12:33:35,968] [DEBUG] [hls_stream_recorder] [21927742] Segment data feeder thread started
[2022-04-25 12:33:35,968] [INFO] [recorder] [21927742] Started recording
[2022-04-25 12:33:35,968] [DEBUG] [hls_stream_recorder] [21927742] Stream processor thread started
[2022-04-25 12:33:35,968] [INFO] [base_stream_recorder] [21927742] Getting the live stream url... qn: 20000, format: fmp4, api platform: android, use alternative stream: False
[2022-04-25 12:33:35,971] [INFO] [application] Successfully enabled recorder for task 21927742
[2022-04-25 12:33:36,251] [INFO] [base_stream_recorder] [21927742] The specified stream format (fmp4) is not available, falling back to stream format (ts).
[2022-04-25 12:33:36,252] [INFO] [base_stream_recorder] [21927742] Getting the live stream url... qn: 20000, format: ts, api platform: android, use alternative stream: False
[2022-04-25 12:33:36,363] [INFO] [base_stream_recorder] [21927742] The specified stream quality (20000) is not available, will using the original stream quality (10000) instead.
[2022-04-25 12:33:37,364] [INFO] [base_stream_recorder] [21927742] Getting the live stream url... qn: 10000, format: ts, api platform: android, use alternative stream: False
[2022-04-25 12:33:37,474] [INFO] [base_stream_recorder] [21927742] Adopted the stream format (ts) and quality (10000)
[2022-04-25 12:33:37,475] [INFO] [base_stream_recorder] [21927742] Got live stream url: 'http://d1--cn-gotcha103.bilivideo.com/live-bvc/367670/live_510100897_27417968.m3u8?expires=1650864877&len=0&oi=2028336756&pt=android&qn=10000&trid=100304361020c85c4ef681ce6cad7d9547bd&sigparams=cdn,expires,len,oi,pt,qn,trid&cdn=cn-gotcha103&sign=6253e30b5e1fc10df9f972cb2ae099bb&sk=e6dc08f553097d93a991c3ade5d3ad60&p2p_type=8192&src=57349&sl=1&free_type=0&flowtype=1&machinezone=ylf&pp=srt&source=onetier&order=1&site=117e18fdf897d705ea4cb56b7db76242'
[2022-04-25 12:33:37,535] [DEBUG] [hls_stream_recorder] [21927742] playlist changed to variant playlist: http://d1--cn-gotcha103.bilivideo.com/live-bvc/367670/live_510100897_27417968.m3u8?pt=android&free_type=0&sign=6253e30b5e1fc10df9f972cb2ae099bb&len=0&alitime=1650861217.799&flowtype=1&source=onetier&machinezone=ylf&site=117e18fdf897d705ea4cb56b7db76242&pp=srt&sigparams=cdn,expires,len,oi,pt,qn,trid&expires=1650864877&sk=e6dc08f553097d93a991c3ade5d3ad60&oi=2028336756&src=57349&_aliauth=bd6f1bf1c627c745774624321abd9f85&_alisec=eb814f2a9bc53e0763c7ed7836f349f3&order=1&p2p_type=8192&qn=10000&sl=1&cdn=cn-gotcha103&trid=100304361020c85c4ef681ce6cad7d9547bd
[2022-04-25 12:33:38,394] [DEBUG] [stream_remuxer] [21927742] Starting stream remuxer...
[2022-04-25 12:33:38,396] [DEBUG] [stream_remuxer] [21927742] Started stream remuxer
[2022-04-25 12:33:38,411] [DEBUG] [stream_processor] [21927742] Processing the 1th stream...
[2022-04-25 12:33:38,477] [DEBUG] [stream_processor] [21927742] frame rate: 30.0, video frame interval: 34
[2022-04-25 12:33:38,479] [WARNING] [stream_processor] [21927742] Timestamp jumped, updated delta: -71481989
last tag: AudioTag(filtered=False, tag_type=<TagType.AUDIO: 8>, data_size=2, timestamp=0, stream_id=0, offset=392, body=0, sound_format=<SoundFormat.AAC: 10>, sound_rate=<SoundRate.F_44KHZ: 3>, sound_size=<SoundSize.SAMPLES_16BIT: 1>, sound_type=<SoundType.STEREO: 1>, aac_packet_type=<AACPacketType.AAC_SEQUENCE_HEADER: 0>)
current tag: AudioTag(filtered=False, tag_type=<TagType.AUDIO: 8>, data_size=4, timestamp=71482012, stream_id=4373148, offset=409, body=249a7248, sound_format=<SoundFormat.AAC: 10>, sound_rate=<SoundRate.F_44KHZ: 3>, sound_size=<SoundSize.SAMPLES_16BIT: 1>, sound_type=<SoundType.STEREO: 1>, aac_packet_type=<AACPacketType.AAC_SEQUENCE_HEADER: 0>)
[2022-04-25 12:33:38,479] [DEBUG] [parameters_checker] [21927742] Audio parameters changed: AudioTag(filtered=False, tag_type=<TagType.AUDIO: 8>, data_size=4, timestamp=23, stream_id=4373148, offset=409, body=249a7248, sound_format=<SoundFormat.AAC: 10>, sound_rate=<SoundRate.F_44KHZ: 3>, sound_size=<SoundSize.SAMPLES_16BIT: 1>, sound_type=<SoundType.STEREO: 1>, aac_packet_type=<AACPacketType.AAC_SEQUENCE_HEADER: 0>)
[2022-04-25 12:33:38,480] [WARNING] [stream_processor] [21927742] Audio parameters changed at 00:00:00.000
[2022-04-25 12:33:38,552] [INFO] [base_stream_recorder] [21927742] Video file created: '/mnt/w/bilibili_live_test/21927742 - AI艾灵/blive_21927742_2022-04-25-123338.flv'
[2022-04-25 12:33:38,553] [DEBUG] [danmaku_dumper] [21927742] Started dumping danmaku
[2022-04-25 12:33:38,555] [DEBUG] [raw_danmaku_dumper] [21927742] Started dumping raw danmaku
[2022-04-25 12:33:38,556] [DEBUG] [stream_processor] [21927742] New file: /mnt/w/bilibili_live_test/21927742 - AI艾灵/blive_21927742_2022-04-25-123338.flv
[2022-04-25 12:33:38,556] [INFO] [danmaku_dumper] [21927742] Danmaku file created: '/mnt/w/bilibili_live_test/21927742 - AI艾灵/blive_21927742_2022-04-25-123338.xml'
[2022-04-25 12:33:38,556] [DEBUG] [stream_processor] [21927742] The flv header has been copied
[2022-04-25 12:33:38,557] [INFO] [raw_danmaku_dumper] [21927742] Raw danmaku file created: '/mnt/w/bilibili_live_test/21927742 - AI艾灵/blive_21927742_2022-04-25-123338.jsonl'
[2022-04-25 12:33:38,559] [DEBUG] [stream_processor] [21927742] Transfering meta tags...
[2022-04-25 12:33:38,561] [DEBUG] [stream_processor] [21927742] Meta tags have been transfered
[2022-04-25 12:33:38,562] [DEBUG] [stream_processor] [21927742] Transfer the first data tag: AudioTag(filtered=False, tag_type=<TagType.AUDIO: 8>, data_size=780, timestamp=23, stream_id=4373148, offset=428, body=c391cb36, sound_format=<SoundFormat.AAC: 10>, sound_rate=<SoundRate.F_44KHZ: 3>, sound_size=<SoundSize.SAMPLES_16BIT: 1>, sound_type=<SoundType.STEREO: 1>, aac_packet_type=<AACPacketType.AAC_RAW: 1>)
[2022-04-25 12:33:38,562] [DEBUG] [stream_processor] [21927742] Transfering tags... timestamp delta: -23
[2022-04-25 12:33:38,563] [DEBUG] [stream_processor] [21927742] 1 tags have been transfered
[2022-04-25 12:33:38,563] [DEBUG] [stream_processor] [21927742] The first data tag has been transfered
[2022-04-25 12:33:38,564] [DEBUG] [stream_processor] [21927742] Transfering tags until complete...
[2022-04-25 12:33:38,578] [DEBUG] [stream_processor] [21927742] Transfering tags... timestamp delta: -23
[2022-04-25 13:34:37,492] [WARNING] [hls_stream_recorder] [21927742] HTTPError('403 Client Error: Forbidden for url: http://d1--cn-gotcha103.bilivideo.com/live-bvc/367670/live_510100897_27417968.m3u8?pt=android&free_type=0&sign=6253e30b5e1fc10df9f972cb2ae099bb&len=0&alitime=1650861217.799&flowtype=1&source=onetier&machinezone=ylf&site=117e18fdf897d705ea4cb56b7db76242&pp=srt&sigparams=cdn,expires,len,oi,pt,qn,trid&expires=1650864877&sk=e6dc08f553097d93a991c3ade5d3ad60&oi=2028336756&src=57349&_aliauth=bd6f1bf1c627c745774624321abd9f85&_alisec=eb814f2a9bc53e0763c7ed7836f349f3&order=1&p2p_type=8192&qn=10000&sl=1&cdn=cn-gotcha103&trid=100304361020c85c4ef681ce6cad7d9547bd')
[2022-04-25 13:34:37,493] [DEBUG] [base_stream_recorder] [21927742] Retry streaming_loop after 1 seconds
[2022-04-25 13:34:38,494] [INFO] [base_stream_recorder] [21927742] Getting the live stream url... qn: 10000, format: ts, api platform: android, use alternative stream: False
[2022-04-25 13:34:38,701] [INFO] [base_stream_recorder] [21927742] Adopted the stream format (ts) and quality (10000)
[2022-04-25 13:34:38,702] [INFO] [base_stream_recorder] [21927742] Got live stream url: 'http://d1--cn-gotcha103.bilivideo.com/live-bvc/590595/live_510100897_27417968.m3u8?expires=1650868538&len=0&oi=2028336756&pt=android&qn=10000&trid=10038240da2eca234d62a5fe04e1de19e424&sigparams=cdn,expires,len,oi,pt,qn,trid&cdn=cn-gotcha103&sign=8171faeb6e2256d28a5d6bcca910c3c0&sk=e6dc08f553097d93a991c3ade5d3ad60&p2p_type=8192&src=57349&sl=1&free_type=0&flowtype=1&machinezone=ylf&pp=srt&source=onetier&order=1&site=a3ff7ea60ba5449cdf86d85d5099a7f9'
[2022-04-25 13:34:38,730] [DEBUG] [hls_stream_recorder] [21927742] playlist changed to variant playlist: http://d1--cn-gotcha103.bilivideo.com/live-bvc/590595/live_510100897_27417968.m3u8?pt=android&free_type=0&sign=8171faeb6e2256d28a5d6bcca910c3c0&len=0&alitime=1650864878.97&flowtype=1&source=onetier&machinezone=ylf&site=a3ff7ea60ba5449cdf86d85d5099a7f9&pp=srt&sigparams=cdn,expires,len,oi,pt,qn,trid&expires=1650868538&sk=e6dc08f553097d93a991c3ade5d3ad60&oi=2028336756&src=57349&_aliauth=2596c01ebc5cf9bf33b59dd5bfe327f7&_alisec=54644a61dbfaaa998832be6b42ce1db6&order=1&p2p_type=8192&qn=10000&sl=1&cdn=cn-gotcha103&trid=10038240da2eca234d62a5fe04e1de19e424
[2022-04-25 14:35:38,256] [WARNING] [hls_stream_recorder] [21927742] HTTPError('403 Client Error: Forbidden for url: http://d1--cn-gotcha103.bilivideo.com/live-bvc/590595/live_510100897_27417968.m3u8?pt=android&free_type=0&sign=8171faeb6e2256d28a5d6bcca910c3c0&len=0&alitime=1650864878.97&flowtype=1&source=onetier&machinezone=ylf&site=a3ff7ea60ba5449cdf86d85d5099a7f9&pp=srt&sigparams=cdn,expires,len,oi,pt,qn,trid&expires=1650868538&sk=e6dc08f553097d93a991c3ade5d3ad60&oi=2028336756&src=57349&_aliauth=2596c01ebc5cf9bf33b59dd5bfe327f7&_alisec=54644a61dbfaaa998832be6b42ce1db6&order=1&p2p_type=8192&qn=10000&sl=1&cdn=cn-gotcha103&trid=10038240da2eca234d62a5fe04e1de19e424')
[2022-04-25 14:35:38,257] [DEBUG] [base_stream_recorder] [21927742] Retry streaming_loop after 1 seconds
[2022-04-25 14:35:39,259] [INFO] [base_stream_recorder] [21927742] Getting the live stream url... qn: 10000, format: ts, api platform: android, use alternative stream: False
[2022-04-25 14:35:39,460] [INFO] [base_stream_recorder] [21927742] Adopted the stream format (ts) and quality (10000)
[2022-04-25 14:35:39,461] [INFO] [base_stream_recorder] [21927742] Got live stream url: 'http://d1--cn-gotcha103.bilivideo.com/live-bvc/262729/live_510100897_27417968.m3u8?expires=1650872199&len=0&oi=2028336756&pt=android&qn=10000&trid=10031a69861e344e4f1485348d7dd0444bfb&sigparams=cdn,expires,len,oi,pt,qn,trid&cdn=cn-gotcha103&sign=ba83cb7140d734af22134c395cf77478&sk=e6dc08f553097d93a991c3ade5d3ad60&p2p_type=8192&src=57349&sl=1&free_type=0&flowtype=1&machinezone=ylf&pp=srt&source=onetier&order=1&site=6a543f3c687ceeda1365a97c4436132b'
[2022-04-25 14:35:39,482] [DEBUG] [hls_stream_recorder] [21927742] playlist changed to variant playlist: http://d1--cn-gotcha103.bilivideo.com/live-bvc/262729/live_510100897_27417968.m3u8?pt=android&free_type=0&sign=ba83cb7140d734af22134c395cf77478&len=0&alitime=1650868539.699&flowtype=1&source=onetier&machinezone=ylf&site=6a543f3c687ceeda1365a97c4436132b&pp=srt&sigparams=cdn,expires,len,oi,pt,qn,trid&expires=1650872199&sk=e6dc08f553097d93a991c3ade5d3ad60&oi=2028336756&src=57349&_aliauth=cc39246f84e69fd7b95a89a7f6432e40&_alisec=f7fbd0f6e5f866d59180e244f0220540&order=1&p2p_type=8192&qn=10000&sl=1&cdn=cn-gotcha103&trid=10031a69861e344e4f1485348d7dd0444bfb
Recording: 1.80GB [2:03:39, 283kB/s, 23058 - 3号直播间: 哔哩哔哩音悦台]
Recording: 6.30GB [2:03:35, 891kB/s, 21927742 - AI艾灵: 叮——您的AI点歌机已上线!]
acgnhiki commented 2 years ago

3 号直播间 和 21927742 直播间都是录的 HLS(ts) 流,url 过期了都 403 了。

[2022-04-25 16:27:02,380] [INFO] [recorder] [23058] Started recording
[2022-04-25 16:27:02,380] [DEBUG] [hls_stream_recorder] [23058] Segment data feeder thread started
[2022-04-25 16:27:02,380] [DEBUG] [hls_stream_recorder] [23058] Stream processor thread started
[2022-04-25 16:27:02,381] [INFO] [base_stream_recorder] [23058] Getting the live stream url... qn: 20000, format: ts, api platform: android, use alternative stream: False
[2022-04-25 16:27:02,381] [INFO] [task_manager] Successfully added task 23058
[2022-04-25 16:27:02,382] [INFO] [task_manager] Adding task 21927742...
[2022-04-25 16:27:02,494] [INFO] [base_stream_recorder] [23058] The specified stream quality (20000) is not available, will using the original stream quality (10000) instead.
[2022-04-25 16:27:02,494] [INFO] [base_stream_recorder] [23058] Getting the live stream url... qn: 10000, format: ts, api platform: android, use alternative stream: False
[2022-04-25 16:27:02,610] [INFO] [base_stream_recorder] [23058] Adopted the stream format (ts) and quality (10000)
[2022-04-25 16:27:02,611] [INFO] [base_stream_recorder] [23058] Got live stream url: 'http://d1--cn-gotcha103.bilivideo.com/live-bvc/604049/live_11153765_9369560.m3u8?expires=1650878882&len=0&oi=2028336756&pt=android&qn=10000&trid=1003c063b506de0f4aab9860b0273c9b8536&sigparams=cdn,expires,len,oi,pt,qn,trid&cdn=cn-gotcha103&sign=716b9e499934e6029541a5e4f8d683ab&sk=e6ebdb4335e5ce69c92795322cf9e04e&p2p_type=8192&src=57349&sl=2&free_type=0&flowtype=1&machinezone=jd&pp=rtmp&source=onetier&order=1&site=3e6c5e0c4699310f457af5bf15a4c6c3'
[2022-04-25 16:27:02,963] [DEBUG] [danmaku_client] [21927742] Danmu info updated
[2022-04-25 16:27:02,963] [DEBUG] [danmaku_client] [21927742] Connecting to server...
[2022-04-25 16:27:03,044] [DEBUG] [stream_remuxer] [23058] Starting stream remuxer...
[2022-04-25 16:27:03,045] [DEBUG] [stream_remuxer] [23058] Started stream remuxer
[2022-04-25 16:27:03,059] [DEBUG] [stream_processor] [23058] Processing the 1th stream...
[2022-04-25 16:27:03,220] [DEBUG] [danmaku_client] [21927742] Established WebSocket connection
[2022-04-25 16:27:03,222] [DEBUG] [danmaku_client] [21927742] Sent user authentication
[2022-04-25 16:27:03,270] [DEBUG] [stream_processor] [23058] frame rate: 60.0, video frame interval: 17
[2022-04-25 16:27:03,271] [WARNING] [stream_processor] [23058] Timestamp jumped, updated delta: -9517198
last tag: AudioTag(filtered=False, tag_type=<TagType.AUDIO: 8>, data_size=2, timestamp=0, stream_id=0, offset=386, body=0, sound_format=<SoundFormat.AAC: 10>, sound_rate=<SoundRate.F_44KHZ: 3>, sound_size=<SoundSize.SAMPLES_16BIT: 1>, sound_type=<SoundType.STEREO: 1>, aac_packet_type=<AACPacketType.AAC_SEQUENCE_HEADER: 0>)
current tag: AudioTag(filtered=False, tag_type=<TagType.AUDIO: 8>, data_size=4, timestamp=9517221, stream_id=9517221, offset=403, body=249a7248, sound_format=<SoundFormat.AAC: 10>, sound_rate=<SoundRate.F_44KHZ: 3>, sound_size=<SoundSize.SAMPLES_16BIT: 1>, sound_type=<SoundType.STEREO: 1>, aac_packet_type=<AACPacketType.AAC_SEQUENCE_HEADER: 0>)
[2022-04-25 16:27:03,271] [DEBUG] [parameters_checker] [23058] Audio parameters changed: AudioTag(filtered=False, tag_type=<TagType.AUDIO: 8>, data_size=4, timestamp=23, stream_id=9517221, offset=403, body=249a7248, sound_format=<SoundFormat.AAC: 10>, sound_rate=<SoundRate.F_44KHZ: 3>, sound_size=<SoundSize.SAMPLES_16BIT: 1>, sound_type=<SoundType.STEREO: 1>, aac_packet_type=<AACPacketType.AAC_SEQUENCE_HEADER: 0>)
[2022-04-25 16:27:03,272] [WARNING] [stream_processor] [23058] Audio parameters changed at 00:00:00.000
[2022-04-25 16:27:03,293] [DEBUG] [danmaku_client] [21927742] Recieved reply
[2022-04-25 16:27:03,293] [DEBUG] [danmaku_client] [21927742] Auth OK
[2022-04-25 16:27:03,293] [DEBUG] [danmaku_client] [21927742] Connected to server
[2022-04-25 16:27:03,294] [DEBUG] [danmaku_client] [21927742] Created message loop
[2022-04-25 16:27:03,294] [DEBUG] [danmaku_client] [21927742] Started danmaku client
[2022-04-25 16:27:03,294] [DEBUG] [live_monitor] [21927742] Enabled live monitor
[2022-04-25 16:27:03,295] [DEBUG] [postprocessor] [21927742] Started postprocessor
[2022-04-25 16:27:03,295] [DEBUG] [recorder] [21927742] Started recorder
[2022-04-25 16:27:03,295] [INFO] [recorder] [21927742]
================================== User Info ==================================
user name        : AI艾灵
gender           : 女
sign             : 一个爱唱歌的AI主播,24小时直播那种。Q群:373884858  舰长群:1104053716
uid              : 510100897
level            : 6
---------------------------------- Room Info ----------------------------------
title            : 叮——您的AI点歌机已上线!
cover            : https://i0.hdslb.com/bfs/live/new_room_cover/c70c4f8ddd1dd036e2c04d6a76e8d5f8b6a69e6f.jpg
online           : 1,553
live status      : LIVE
live start time  : 2022-04-06 10:35:30
room id          : 21927742
short room id    : NULL
area id          : 371
area name        : 虚拟主播
parent area id   : 9
parent area name : 虚拟主播
tags             : AI歌姬,虚拟主播,歌姬,唱歌,人工智能,国风,舞见
description      :
25小时直播的AI点唱机(不是)
亲密度体系【初见-么么-抱抱-贴贴】已正式上线!
专属问候,主动献词,点歌置顶......更多福利等你来解锁哦
每个等级都要神秘权限等你解锁!
本月上舰送艾灵定制玩偶抱枕!
有什么想听的歌,艾灵酱有什么不足之处都可以说哦~
艾灵QQ群:876019510
快来找我玩吧!
===============================================================================

[2022-04-25 16:27:03,297] [DEBUG] [danmaku_dumper] [21927742] Changed stream recorder
[2022-04-25 16:27:03,298] [DEBUG] [raw_danmaku_dumper] [21927742] Changed stream recorder
[2022-04-25 16:27:03,298] [DEBUG] [recorder] [21927742] Changed stream recorder to HLSStreamRecorder
[2022-04-25 16:27:03,298] [DEBUG] [raw_danmaku_dumper] [21927742] Enabled raw danmaku dumper
[2022-04-25 16:27:03,298] [DEBUG] [raw_danmaku_receiver] [21927742] Started raw danmaku receiver
[2022-04-25 16:27:03,299] [DEBUG] [danmaku_dumper] [21927742] Enabled danmaku dumper
[2022-04-25 16:27:03,299] [DEBUG] [danmaku_receiver] [21927742] Started danmaku receiver
[2022-04-25 16:27:03,299] [DEBUG] [base_stream_recorder] [21927742] Starting stream recorder...
[2022-04-25 16:27:03,300] [DEBUG] [hls_stream_recorder] [21927742] Stream recorder thread started
[2022-04-25 16:27:03,300] [DEBUG] [base_stream_recorder] [21927742] Started stream recorder
[2022-04-25 16:27:03,302] [DEBUG] [hls_stream_recorder] [21927742] Segment fetcher thread started
[2022-04-25 16:27:03,302] [DEBUG] [hls_stream_recorder] [21927742] Segment data feeder thread started
[2022-04-25 16:27:03,302] [DEBUG] [hls_stream_recorder] [21927742] Stream processor thread started
[2022-04-25 16:27:03,302] [INFO] [base_stream_recorder] [21927742] Getting the live stream url... qn: 20000, format: ts, api platform: android, use alternative stream: False
[2022-04-25 16:27:03,302] [INFO] [recorder] [21927742] Started recording
[2022-04-25 16:27:03,305] [INFO] [task_manager] Successfully added task 21927742
[2022-04-25 16:27:03,305] [INFO] [task_manager] Load all tasks complete
[2022-04-25 16:27:03,362] [INFO] [base_stream_recorder] [23058] Video file created: '/mnt/w/bilibili_live_test/23058 - 3号直播间/blive_23058_2022-04-25-162703.flv'
[2022-04-25 16:27:03,364] [DEBUG] [danmaku_dumper] [23058] Started dumping danmaku
[2022-04-25 16:27:03,365] [DEBUG] [raw_danmaku_dumper] [23058] Started dumping raw danmaku
[2022-04-25 16:27:03,366] [DEBUG] [stream_processor] [23058] New file: /mnt/w/bilibili_live_test/23058 - 3号直播间/blive_23058_2022-04-25-162703.flv
[2022-04-25 16:27:03,367] [INFO] [raw_danmaku_dumper] [23058] Raw danmaku file created: '/mnt/w/bilibili_live_test/23058 - 3号直播间/blive_23058_2022-04-25-162703.jsonl'
[2022-04-25 16:27:03,367] [DEBUG] [stream_processor] [23058] The flv header has been copied
[2022-04-25 16:27:03,368] [INFO] [danmaku_dumper] [23058] Danmaku file created: '/mnt/w/bilibili_live_test/23058 - 3号直播间/blive_23058_2022-04-25-162703.xml'
[2022-04-25 16:27:03,369] [DEBUG] [stream_processor] [23058] Transfering meta tags...
[2022-04-25 16:27:03,371] [DEBUG] [stream_processor] [23058] Meta tags have been transfered
[2022-04-25 16:27:03,372] [DEBUG] [stream_processor] [23058] Transfer the first data tag: AudioTag(filtered=False, tag_type=<TagType.AUDIO: 8>, data_size=916, timestamp=23, stream_id=9517221, offset=422, body=e921ae3b, sound_format=<SoundFormat.AAC: 10>, sound_rate=<SoundRate.F_44KHZ: 3>, sound_size=<SoundSize.SAMPLES_16BIT: 1>, sound_type=<SoundType.STEREO: 1>, aac_packet_type=<AACPacketType.AAC_RAW: 1>)
[2022-04-25 16:27:03,373] [DEBUG] [stream_processor] [23058] Transfering tags... timestamp delta: -23
[2022-04-25 16:27:03,373] [DEBUG] [stream_processor] [23058] 1 tags have been transfered
[2022-04-25 16:27:03,374] [DEBUG] [stream_processor] [23058] The first data tag has been transfered
[2022-04-25 16:27:03,375] [DEBUG] [stream_processor] [23058] Transfering tags until complete...
[2022-04-25 16:27:03,391] [DEBUG] [stream_processor] [23058] Transfering tags... timestamp delta: -23
[2022-04-25 16:27:03,399] [WARNING] [stream_processor] [23058] Timestamp jumped, updated delta: -9517199
last tag: AudioTag(filtered=False, tag_type=<TagType.AUDIO: 8>, data_size=892, timestamp=9517267, stream_id=9517267, offset=2377, body=41acbd6a, sound_format=<SoundFormat.AAC: 10>, sound_rate=<SoundRate.F_44KHZ: 3>, sound_size=<SoundSize.SAMPLES_16BIT: 1>, sound_type=<SoundType.STEREO: 1>, aac_packet_type=<AACPacketType.AAC_RAW: 1>)
current tag: AudioTag(filtered=False, tag_type=<TagType.AUDIO: 8>, data_size=916, timestamp=9517291, stream_id=9517291, offset=3284, body=b700ae42, sound_format=<SoundFormat.AAC: 10>, sound_rate=<SoundRate.F_44KHZ: 3>, sound_size=<SoundSize.SAMPLES_16BIT: 1>, sound_type=<SoundType.STEREO: 1>, aac_packet_type=<AACPacketType.AAC_RAW: 1>)
[2022-04-25 16:27:03,467] [INFO] [base_stream_recorder] [21927742] The specified stream quality (20000) is not available, will using the original stream quality (10000) instead.
[2022-04-25 16:27:03,468] [INFO] [base_stream_recorder] [21927742] Getting the live stream url... qn: 10000, format: ts, api platform: android, use alternative stream: False
[2022-04-25 16:27:03,626] [INFO] [base_stream_recorder] [21927742] Adopted the stream format (ts) and quality (10000)
[2022-04-25 16:27:03,640] [INFO] [base_stream_recorder] [21927742] Got live stream url: 'http://d1--cn-gotcha103.bilivideo.com/live-bvc/210476/live_510100897_27417968.m3u8?expires=1650878883&len=0&oi=2028336756&pt=android&qn=10000&trid=1003e1fbe90496df48598259b4e5891ca5fd&sigparams=cdn,expires,len,oi,pt,qn,trid&cdn=cn-gotcha103&sign=4dc085e89660f6073bdbd2cf9f358f12&sk=e6dc08f553097d93a991c3ade5d3ad60&p2p_type=8192&src=57349&sl=1&free_type=0&flowtype=1&machinezone=jd&pp=srt&source=onetier&order=1&site=14fdfade16ac9f5fe863ddb493366250'
[2022-04-25 16:27:04,401] [DEBUG] [stream_remuxer] [21927742] Starting stream remuxer...
[2022-04-25 16:27:04,402] [DEBUG] [stream_remuxer] [21927742] Started stream remuxer
[2022-04-25 16:27:04,418] [DEBUG] [stream_processor] [21927742] Processing the 1th stream...
[2022-04-25 16:27:04,485] [DEBUG] [stream_processor] [21927742] frame rate: 30.0, video frame interval: 34
[2022-04-25 16:27:04,488] [WARNING] [stream_processor] [21927742] Timestamp jumped, updated delta: -85485990
last tag: AudioTag(filtered=False, tag_type=<TagType.AUDIO: 8>, data_size=2, timestamp=0, stream_id=0, offset=392, body=0, sound_format=<SoundFormat.AAC: 10>, sound_rate=<SoundRate.F_44KHZ: 3>, sound_size=<SoundSize.SAMPLES_16BIT: 1>, sound_type=<SoundType.STEREO: 1>, aac_packet_type=<AACPacketType.AAC_SEQUENCE_HEADER: 0>)
current tag: AudioTag(filtered=False, tag_type=<TagType.AUDIO: 8>, data_size=4, timestamp=85486013, stream_id=1599933, offset=409, body=249a7248, sound_format=<SoundFormat.AAC: 10>, sound_rate=<SoundRate.F_44KHZ: 3>, sound_size=<SoundSize.SAMPLES_16BIT: 1>, sound_type=<SoundType.STEREO: 1>, aac_packet_type=<AACPacketType.AAC_SEQUENCE_HEADER: 0>)
[2022-04-25 16:27:04,488] [DEBUG] [parameters_checker] [21927742] Audio parameters changed: AudioTag(filtered=False, tag_type=<TagType.AUDIO: 8>, data_size=4, timestamp=23, stream_id=1599933, offset=409, body=249a7248, sound_format=<SoundFormat.AAC: 10>, sound_rate=<SoundRate.F_44KHZ: 3>, sound_size=<SoundSize.SAMPLES_16BIT: 1>, sound_type=<SoundType.STEREO: 1>, aac_packet_type=<AACPacketType.AAC_SEQUENCE_HEADER: 0>)
[2022-04-25 16:27:04,489] [WARNING] [stream_processor] [21927742] Audio parameters changed at 00:00:00.000
[2022-04-25 16:27:04,831] [INFO] [base_stream_recorder] [21927742] Video file created: '/mnt/w/bilibili_live_test/21927742 - AI艾灵/blive_21927742_2022-04-25-162704.flv'
[2022-04-25 16:27:04,833] [DEBUG] [danmaku_dumper] [21927742] Started dumping danmaku
[2022-04-25 16:27:04,833] [DEBUG] [raw_danmaku_dumper] [21927742] Started dumping raw danmaku
[2022-04-25 16:27:04,834] [DEBUG] [stream_processor] [21927742] New file: /mnt/w/bilibili_live_test/21927742 - AI艾灵/blive_21927742_2022-04-25-162704.flv
[2022-04-25 16:27:04,834] [INFO] [raw_danmaku_dumper] [21927742] Raw danmaku file created: '/mnt/w/bilibili_live_test/21927742 - AI艾灵/blive_21927742_2022-04-25-162704.jsonl'
[2022-04-25 16:27:04,835] [DEBUG] [stream_processor] [21927742] The flv header has been copied
[2022-04-25 16:27:04,836] [INFO] [danmaku_dumper] [21927742] Danmaku file created: '/mnt/w/bilibili_live_test/21927742 - AI艾灵/blive_21927742_2022-04-25-162704.xml'
[2022-04-25 16:27:04,837] [DEBUG] [stream_processor] [21927742] Transfering meta tags...
[2022-04-25 16:27:04,838] [DEBUG] [stream_processor] [21927742] Meta tags have been transfered
[2022-04-25 16:27:04,839] [DEBUG] [stream_processor] [21927742] Transfer the first data tag: AudioTag(filtered=False, tag_type=<TagType.AUDIO: 8>, data_size=8, timestamp=23, stream_id=1599933, offset=428, body=595037cd, sound_format=<SoundFormat.AAC: 10>, sound_rate=<SoundRate.F_44KHZ: 3>, sound_size=<SoundSize.SAMPLES_16BIT: 1>, sound_type=<SoundType.STEREO: 1>, aac_packet_type=<AACPacketType.AAC_RAW: 1>)
[2022-04-25 16:27:04,839] [DEBUG] [stream_processor] [21927742] Transfering tags... timestamp delta: -23
[2022-04-25 16:27:04,840] [DEBUG] [stream_processor] [21927742] 1 tags have been transfered
[2022-04-25 16:27:04,841] [DEBUG] [stream_processor] [21927742] The first data tag has been transfered
[2022-04-25 16:27:04,842] [DEBUG] [stream_processor] [21927742] Transfering tags until complete...
[2022-04-25 16:27:04,861] [DEBUG] [stream_processor] [21927742] Transfering tags... timestamp delta: -23
Recording: 202MB [11:21, 349kB/s, 23058 - 3号直播间: 哔哩哔哩音悦台]
[2022-04-25 16:49:38,082] [DEBUG] [stream_processor] [23058] Failed to read data, due to: TimeoutError(10, <built-in method read of _io.BufferedReader object at 0x7f581033f670>)
[2022-04-25 16:49:38,084] [DEBUG] [stream_processor] [23058] 140574 tags have been transfered
[2022-04-25 16:49:38,084] [DEBUG] [hls_stream_recorder] [23058] TimeoutError(10, <built-in method read of _io.BufferedReader object at 0x7f581033f670>)
[2022-04-25 16:49:38,084] [DEBUG] [stream_remuxer] [23058] Stopping stream remuxer...
[2022-04-25 16:49:38,086] [DEBUG] [stream_remuxer] [23058] BrokenPipeError(32, 'Broken pipe')
[2022-04-25 16:49:38,086] [DEBUG] [stream_remuxer] [23058] Stopped stream remuxer
[2022-04-25 16:49:40,927] [DEBUG] [stream_remuxer] [23058] Starting stream remuxer...
[2022-04-25 16:49:40,928] [DEBUG] [stream_remuxer] [23058] Started stream remuxer
[2022-04-25 16:49:40,955] [DEBUG] [stream_processor] [23058] Processing the 2th stream...
[2022-04-25 16:49:40,978] [DEBUG] [stream_processor] [23058] frame rate: 60.0, video frame interval: 17
[2022-04-25 16:49:40,980] [DEBUG] [parameters_checker] [23058] Audio parameters changed: AudioTag(filtered=False, tag_type=<TagType.AUDIO: 8>, data_size=2, timestamp=0, stream_id=0, offset=386, body=0, sound_format=<SoundFormat.AAC: 10>, sound_rate=<SoundRate.F_44KHZ: 3>, sound_size=<SoundSize.SAMPLES_16BIT: 1>, sound_type=<SoundType.STEREO: 1>, aac_packet_type=<AACPacketType.AAC_SEQUENCE_HEADER: 0>)
[2022-04-25 16:49:40,981] [WARNING] [stream_processor] [23058] Audio parameters changed at 00:22:43.962
[2022-04-25 16:49:40,983] [WARNING] [stream_processor] [23058] Timestamp jumped, updated delta: -10877191
last tag: AudioTag(filtered=False, tag_type=<TagType.AUDIO: 8>, data_size=2, timestamp=0, stream_id=0, offset=386, body=0, sound_format=<SoundFormat.AAC: 10>, sound_rate=<SoundRate.F_44KHZ: 3>, sound_size=<SoundSize.SAMPLES_16BIT: 1>, sound_type=<SoundType.STEREO: 1>, aac_packet_type=<AACPacketType.AAC_SEQUENCE_HEADER: 0>)
current tag: AudioTag(filtered=False, tag_type=<TagType.AUDIO: 8>, data_size=4, timestamp=10877214, stream_id=10877214, offset=403, body=249a7248, sound_format=<SoundFormat.AAC: 10>, sound_rate=<SoundRate.F_44KHZ: 3>, sound_size=<SoundSize.SAMPLES_16BIT: 1>, sound_type=<SoundType.STEREO: 1>, aac_packet_type=<AACPacketType.AAC_SEQUENCE_HEADER: 0>)
[2022-04-25 16:49:40,984] [DEBUG] [parameters_checker] [23058] Audio parameters changed: AudioTag(filtered=False, tag_type=<TagType.AUDIO: 8>, data_size=4, timestamp=23, stream_id=10877214, offset=403, body=249a7248, sound_format=<SoundFormat.AAC: 10>, sound_rate=<SoundRate.F_44KHZ: 3>, sound_size=<SoundSize.SAMPLES_16BIT: 1>, sound_type=<SoundType.STEREO: 1>, aac_packet_type=<AACPacketType.AAC_SEQUENCE_HEADER: 0>)
[2022-04-25 16:49:40,984] [WARNING] [stream_processor] [23058] Audio parameters changed at 00:22:43.962
[2022-04-25 16:49:40,985] [DEBUG] [stream_processor] [23058] Reading tags for tag deduplication...
[2022-04-25 16:49:52,867] [DEBUG] [stream_processor] [23058] Read 2059 tags, total size: 3102021
[2022-04-25 16:49:52,868] [DEBUG] [stream_processor] [23058] Finding duplicated tags...
[2022-04-25 16:49:52,868] [DEBUG] [stream_processor] [23058] The last output tag is AudioTag(filtered=False, tag_type=<TagType.AUDIO: 8>, data_size=931, timestamp=1363962, stream_id=10881184, offset=393417680, body=a73cc973, sound_format=<SoundFormat.AAC: 10>, sound_rate=<SoundRate.F_44KHZ: 3>, sound_size=<SoundSize.SAMPLES_16BIT: 1>, sound_type=<SoundType.STEREO: 1>, aac_packet_type=<AACPacketType.AAC_RAW: 1>)
[2022-04-25 16:49:52,869] [DEBUG] [stream_processor] [23058] The last duplicated tag found at 403 is AudioTag(filtered=False, tag_type=<TagType.AUDIO: 8>, data_size=931, timestamp=3993, stream_id=10881184, offset=1139340, body=a73cc973, sound_format=<SoundFormat.AAC: 10>, sound_rate=<SoundRate.F_44KHZ: 3>, sound_size=<SoundSize.SAMPLES_16BIT: 1>, sound_type=<SoundType.STEREO: 1>, aac_packet_type=<AACPacketType.AAC_RAW: 1>)
[2022-04-25 16:49:52,869] [DEBUG] [stream_processor] [23058] JoinPoint(offset=393418626, timestamp=1363966, seamless=True); offset: 0x17731782, timestamp: 00:22:43.966, seamless: yes
[2022-04-25 16:49:52,870] [DEBUG] [stream_processor] [23058] Transfering tags... timestamp delta: 1359969
[2022-04-25 16:49:52,909] [DEBUG] [stream_processor] [23058] 1655 tags have been transfered
[2022-04-25 16:49:52,910] [DEBUG] [stream_processor] [23058] Transfering tags until complete...
[2022-04-25 16:49:52,911] [DEBUG] [stream_processor] [23058] Transfering tags... timestamp delta: 1359969
[2022-04-25 17:18:28,084] [DEBUG] [stream_processor] [21927742] Failed to read data, due to: TimeoutError(10, <built-in method read of _io.BufferedReader object at 0x7f58102975c0>)
[2022-04-25 17:18:28,085] [DEBUG] [stream_processor] [21927742] 226647 tags have been transfered
[2022-04-25 17:18:28,085] [DEBUG] [hls_stream_recorder] [21927742] TimeoutError(10, <built-in method read of _io.BufferedReader object at 0x7f58102975c0>)
[2022-04-25 17:18:28,086] [DEBUG] [stream_remuxer] [21927742] Stopping stream remuxer...
[2022-04-25 17:18:28,087] [DEBUG] [stream_remuxer] [21927742] TimeoutError(10, <built-in method readline of _io.TextIOWrapper object at 0x7f5810292110>)
[2022-04-25 17:18:28,088] [DEBUG] [stream_remuxer] [21927742] Stopped stream remuxer
[2022-04-25 17:18:36,648] [DEBUG] [stream_remuxer] [21927742] Starting stream remuxer...
[2022-04-25 17:18:36,650] [DEBUG] [stream_remuxer] [21927742] Started stream remuxer
[2022-04-25 17:18:36,679] [DEBUG] [stream_processor] [21927742] Processing the 2th stream...
[2022-04-25 17:18:36,736] [DEBUG] [stream_processor] [21927742] frame rate: 30.0, video frame interval: 34
[2022-04-25 17:18:36,739] [DEBUG] [parameters_checker] [21927742] Audio parameters changed: AudioTag(filtered=False, tag_type=<TagType.AUDIO: 8>, data_size=2, timestamp=0, stream_id=0, offset=392, body=0, sound_format=<SoundFormat.AAC: 10>, sound_rate=<SoundRate.F_44KHZ: 3>, sound_size=<SoundSize.SAMPLES_16BIT: 1>, sound_type=<SoundType.STEREO: 1>, aac_packet_type=<AACPacketType.AAC_SEQUENCE_HEADER: 0>)
[2022-04-25 17:18:36,739] [WARNING] [stream_processor] [21927742] Audio parameters changed at 00:51:41.977
[2022-04-25 17:18:36,740] [WARNING] [stream_processor] [21927742] Timestamp jumped, updated delta: -88569995
last tag: AudioTag(filtered=False, tag_type=<TagType.AUDIO: 8>, data_size=2, timestamp=0, stream_id=0, offset=392, body=0, sound_format=<SoundFormat.AAC: 10>, sound_rate=<SoundRate.F_44KHZ: 3>, sound_size=<SoundSize.SAMPLES_16BIT: 1>, sound_type=<SoundType.STEREO: 1>, aac_packet_type=<AACPacketType.AAC_SEQUENCE_HEADER: 0>)
current tag: AudioTag(filtered=False, tag_type=<TagType.AUDIO: 8>, data_size=4, timestamp=88570018, stream_id=4683938, offset=409, body=249a7248, sound_format=<SoundFormat.AAC: 10>, sound_rate=<SoundRate.F_44KHZ: 3>, sound_size=<SoundSize.SAMPLES_16BIT: 1>, sound_type=<SoundType.STEREO: 1>, aac_packet_type=<AACPacketType.AAC_SEQUENCE_HEADER: 0>)
[2022-04-25 17:18:36,741] [DEBUG] [parameters_checker] [21927742] Audio parameters changed: AudioTag(filtered=False, tag_type=<TagType.AUDIO: 8>, data_size=4, timestamp=23, stream_id=4683938, offset=409, body=249a7248, sound_format=<SoundFormat.AAC: 10>, sound_rate=<SoundRate.F_44KHZ: 3>, sound_size=<SoundSize.SAMPLES_16BIT: 1>, sound_type=<SoundType.STEREO: 1>, aac_packet_type=<AACPacketType.AAC_SEQUENCE_HEADER: 0>)
[2022-04-25 17:18:36,742] [WARNING] [stream_processor] [21927742] Audio parameters changed at 00:51:41.977
[2022-04-25 17:18:36,743] [DEBUG] [stream_processor] [21927742] Reading tags for tag deduplication...
[2022-04-25 17:18:37,150] [DEBUG] [stream_processor] [21927742] Read 1460 tags, total size: 14487769
[2022-04-25 17:18:37,151] [DEBUG] [stream_processor] [21927742] Finding duplicated tags...
[2022-04-25 17:18:37,151] [DEBUG] [stream_processor] [21927742] The last output tag is AudioTag(filtered=False, tag_type=<TagType.AUDIO: 8>, data_size=669, timestamp=3101977, stream_id=4701910, offset=2443228429, body=df63bc2a, sound_format=<SoundFormat.AAC: 10>, sound_rate=<SoundRate.F_44KHZ: 3>, sound_size=<SoundSize.SAMPLES_16BIT: 1>, sound_type=<SoundType.STEREO: 1>, aac_packet_type=<AACPacketType.AAC_RAW: 1>)
[2022-04-25 17:18:37,152] [DEBUG] [stream_processor] [21927742] The last duplicated tag found at 1309 is AudioTag(filtered=False, tag_type=<TagType.AUDIO: 8>, data_size=669, timestamp=17995, stream_id=4701910, offset=13016159, body=df63bc2a, sound_format=<SoundFormat.AAC: 10>, sound_rate=<SoundRate.F_44KHZ: 3>, sound_size=<SoundSize.SAMPLES_16BIT: 1>, sound_type=<SoundType.STEREO: 1>, aac_packet_type=<AACPacketType.AAC_RAW: 1>)
[2022-04-25 17:18:37,153] [DEBUG] [stream_processor] [21927742] JoinPoint(offset=2443229113, timestamp=3102000, seamless=True); offset: 0x91a0b7b9, timestamp: 00:51:42.000, seamless: yes
[2022-04-25 17:18:37,153] [DEBUG] [stream_processor] [21927742] Transfering tags... timestamp delta: 3083982
[2022-04-25 17:18:37,164] [DEBUG] [stream_processor] [21927742] 150 tags have been transfered
[2022-04-25 17:18:37,165] [DEBUG] [stream_processor] [21927742] Transfering tags until complete...
[2022-04-25 17:18:37,166] [DEBUG] [stream_processor] [21927742] Transfering tags... timestamp delta: 3083982
[2022-04-25 17:28:01,981] [WARNING] [hls_stream_recorder] [23058] HTTPError('403 Client Error: Forbidden for url: http://d1--cn-gotcha103.bilivideo.com/live-bvc/604049/live_11153765_9369560.m3u8?expires=1650878882&len=0&oi=2028336756&pt=android&qn=10000&trid=1003c063b506de0f4aab9860b0273c9b8536&sigparams=cdn,expires,len,oi,pt,qn,trid&cdn=cn-gotcha103&sign=716b9e499934e6029541a5e4f8d683ab&sk=e6ebdb4335e5ce69c92795322cf9e04e&p2p_type=8192&src=57349&sl=2&free_type=0&flowtype=1&machinezone=jd&pp=rtmp&source=onetier&order=1&site=3e6c5e0c4699310f457af5bf15a4c6c3')
[2022-04-25 17:28:01,982] [DEBUG] [base_stream_recorder] [23058] Retry streaming_loop after 1 seconds
[2022-04-25 17:28:02,873] [WARNING] [hls_stream_recorder] [21927742] HTTPError('403 Client Error: Forbidden for url: http://d1--cn-gotcha103.bilivideo.com/live-bvc/210476/live_510100897_27417968.m3u8?expires=1650878883&len=0&oi=2028336756&pt=android&qn=10000&trid=1003e1fbe90496df48598259b4e5891ca5fd&sigparams=cdn,expires,len,oi,pt,qn,trid&cdn=cn-gotcha103&sign=4dc085e89660f6073bdbd2cf9f358f12&sk=e6dc08f553097d93a991c3ade5d3ad60&p2p_type=8192&src=57349&sl=1&free_type=0&flowtype=1&machinezone=jd&pp=srt&source=onetier&order=1&site=14fdfade16ac9f5fe863ddb493366250')
[2022-04-25 17:28:02,874] [DEBUG] [base_stream_recorder] [21927742] Retry streaming_loop after 1 seconds
[2022-04-25 17:28:02,983] [INFO] [base_stream_recorder] [23058] Getting the live stream url... qn: 10000, format: ts, api platform: android, use alternative stream: False
[2022-04-25 17:28:03,190] [INFO] [base_stream_recorder] [23058] Adopted the stream format (ts) and quality (10000)
[2022-04-25 17:28:03,191] [INFO] [base_stream_recorder] [23058] Got live stream url: 'http://d1--cn-gotcha103.bilivideo.com/live-bvc/130284/live_11153765_9369560.m3u8?expires=1650882543&len=0&oi=2028336756&pt=android&qn=10000&trid=100311057b5ccb894b199d27be7ca6de9882&sigparams=cdn,expires,len,oi,pt,qn,trid&cdn=cn-gotcha103&sign=07e73f197d7c99ff17e42ece34e38a74&sk=e6ebdb4335e5ce69c92795322cf9e04e&p2p_type=8192&src=57349&sl=2&free_type=0&flowtype=1&machinezone=jd&pp=rtmp&source=onetier&order=1&site=64a1de34c1ae73cf586ceb76c372e438'
[2022-04-25 17:28:03,874] [INFO] [base_stream_recorder] [21927742] Getting the live stream url... qn: 10000, format: ts, api platform: android, use alternative stream: False
[2022-04-25 17:28:04,062] [INFO] [base_stream_recorder] [21927742] Adopted the stream format (ts) and quality (10000)
[2022-04-25 17:28:04,062] [INFO] [base_stream_recorder] [21927742] Got live stream url: 'http://d1--cn-gotcha103.bilivideo.com/live-bvc/109824/live_510100897_27417968.m3u8?expires=1650882544&len=0&oi=2028336756&pt=android&qn=10000&trid=1003ffc1e0f686a14f62b93613109eeca8cb&sigparams=cdn,expires,len,oi,pt,qn,trid&cdn=cn-gotcha103&sign=ba71e405fad719802a0ec590f33c5944&sk=e6dc08f553097d93a991c3ade5d3ad60&p2p_type=8192&src=57349&sl=1&free_type=0&flowtype=1&machinezone=ylf&pp=srt&source=onetier&order=1&site=7ed5150037065b86eb4081fa65e0c0ad'
Recording: 914MB [1:02:14, 282kB/s, 23058 - 3号直播间: 哔哩哔哩音悦台]
Recording: 2.89GB [1:02:14, 476kB/s, 21927742 - AI艾灵: 叮——您的AI点歌机已上线!]
acgnhiki commented 2 years ago

通过这几天录制测试,发现会被二压的主播大都支持 fmp4,fmp4 流大多都是在推流 10 秒内出现,个别延迟比较大的会超过 1 分钟,url 过期也都是可以录制到下播,也很抗网络波动的影响,即使是 wifi 环境带宽几乎跑满也没什么影响。

ts 流问题比较多,还经常片段请求 404 丢失片段数据,可以放弃对 ts 流的录制了,也难怪 B 站的直播播放器只支持 flv 和 fmp4。

以后想比较稳定地录制原画就只能靠 fmp4 了。