SmallPeaches / DanmakuRender

一个可以录制带弹幕直播流的小工具
263 stars 33 forks source link

抖音录制中断 #210

Open foeris opened 2 months ago

foeris commented 2 months ago

重启程序后可以继续录制

[2024-04-12 20:53:33,068][danmakuio][DEBUG]: Cancel the future. [2024-04-12 20:54:10,151][streamgearsio][DEBUG]: 255 streamgears: 2024-04-12 20:54:10  WARN biliup::downloader::httpflv: Unexpected aac sequence header tag. TagHeader { tag_type: Audio, data_size: 4, timestamp: 2702180, stream_id: 0 } [2024-04-12 20:54:10,185][streamgearsio][DEBUG]: 255 streamgears: 2024-04-12 20:54:10  WARN biliup::downloader::httpflv: Unexpected h264 sequence header tag. TagHeader { tag_type: Video, data_size: 56, timestamp: 2702180, stream_id: 0 } [2024-04-12 20:54:20,570][streamgearsio][DEBUG]: 255 streamgears: 2024-04-12 20:54:20  INFO biliup::downloader::httpflv: Done... ./ckk[正在录制] 255-%Y%m%d%H%M%S [2024-04-12 20:54:20,577][streamgearsio][DEBUG]: stream-gears exit. [2024-04-12 20:54:20,580][connectionpool][DEBUG]: Starting new HTTPS connection (1): live.douyin.com:443 [2024-04-12 20:54:20,833][connectionpool][DEBUG]: https://live.douyin.com:443 "GET /webcast/room/web/enter/?web_rid=38819616641&aid=6383&device_platform=web&browser_language=zh-CN&browser_platform=Win32&browser_name=Edge&browser_version=104.0.1293.54 HTTP/1.1" 200 None [2024-04-12 20:54:20,839][connectionpool][DEBUG]: Starting new HTTPS connection (1): live.douyin.com:443 [2024-04-12 20:54:21,147][connectionpool][DEBUG]: https://live.douyin.com:443 "GET /webcast/room/web/enter/?web_rid=38819616641&aid=6383&device_platform=web&browser_language=zh-CN&browser_platform=Win32&browser_name=Edge&browser_version=104.0.1293.54 HTTP/1.1" 200 None [2024-04-12 20:54:21,157][connectionpool][DEBUG]: Starting new HTTPS connection (1): live.douyin.com:443 [2024-04-12 20:54:21,476][connectionpool][DEBUG]: https://live.douyin.com:443 "GET /webcast/room/web/enter/?web_rid=38819616641&aid=6383&device_platform=web&browser_language=zh-CN&browser_platform=Win32&browser_name=Edge&browser_version=104.0.1293.54 HTTP/1.1" 200 None [2024-04-12 20:54:21,481][init][ERROR]: 255 Stream-gears 异常退出 . Traceback (most recent call last): File "D:\1ckk\DMR\Downloader__init.py", line 215, in start_helper self.start_once() File "D:\1ckk\DMR\Downloader__init__.py", line 176, in start_once return future.result() File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\concurrent\futures_base.py", line 439, in result return self.get_result() File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\concurrent\futures_base.py", line 391, in get_result raise self._exception File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\concurrent\futures\thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "D:\1ckk\DMR\Downloader__init__.py", line 164, in video_thread self.downloader.start() File "D:\1ckk\DMR\Downloader\streamgearsio.py", line 114, in start return self.start_helper() File "D:\1ckk\DMR\Downloader\streamgearsio.py", line 111, in start_helper raise RuntimeError(f'{self.taskname} Stream-gears 异常退出 {line}.') RuntimeError: 255 Stream-gears 异常退出 . [2024-04-12 20:54:21,523][danmakuio][DEBUG]: danmaku writer stoped. [2024-04-12 20:54:21,526][init][DEBUG]: PIPE MESSAGE: {'src': 'downloader', 'msg': './ckk\ckk丶 2024年04月12日20点09分09秒 周一快乐.flv', 'type': 'split', 'group': '255', 'video_info': {'url': 'https://live.douyin.com/38819616641', 'taskname': '255', 'streamer': 'ckk丶', 'title': '周一快乐', 'time': datetime.datetime(2024, 4, 12, 20, 9, 9, 506507), 'has_danmu': '', 'duration': 2712.017997980118}} [2024-04-12 20:54:21,527][init][INFO]: 分片 ./ckk\ckk丶 2024年04月12日20点09分09秒 周一快乐.flv 录制完成. [2024-04-12 20:54:21,528][connectionpool][DEBUG]: Starting new HTTPS connection (1): live.douyin.com:443 [2024-04-12 20:54:21,528][init][INFO]: 添加分片 ./ckk\ckk丶 2024年04月12日20点09分09秒 周一快乐.flv 至渲染队列. [2024-04-12 20:54:21,529][init][INFO]: 正在渲染: ./ckk\ckk丶 2024年04月12日20点09分09秒 周一快乐.flv [2024-04-12 20:54:21,535][danmakuio][DEBUG]: Cancel the future. [2024-04-12 20:54:21,848][connectionpool][DEBUG]: https://live.douyin.com:443 "GET /webcast/room/web/enter/?web_rid=38819616641&aid=6383&device_platform=web&browser_language=zh-CN&browser_platform=Win32&browser_name=Edge&browser_version=104.0.1293.54 HTTP/1.1" 200 None [2024-04-12 20:54:21,854][streamgearsio][DEBUG]: Stream-gears downloader stoped. [2024-04-12 20:54:21,857][connectionpool][DEBUG]: Starting new HTTPS connection (1): live.douyin.com:443 [2024-04-12 20:54:22,183][connectionpool][DEBUG]: https://live.douyin.com:443 "GET /webcast/room/web/enter/?web_rid=38819616641&aid=6383&device_platform=web&browser_language=zh-CN&browser_platform=Win32&browser_name=Edge&browser_version=104.0.1293.54 HTTP/1.1" 200 None [2024-04-12 20:54:22,196][connectionpool][DEBUG]: Starting new HTTPS connection (1): live.douyin.com:443 [2024-04-12 20:54:22,507][connectionpool][DEBUG]: https://live.douyin.com:443 "GET /webcast/room/web/enter/?web_rid=38819616641&aid=6383&device_platform=web&browser_language=zh-CN&browser_platform=Win32&browser_name=Edge&browser_version=104.0.1293.54 HTTP/1.1" 200 None [2024-04-12 20:54:22,514][connectionpool][DEBUG]: Starting new HTTPS connection (1): live.douyin.com:443 [2024-04-12 20:54:22,734][init][DEBUG]: PIPE MESSAGE: {'src': 'downloader', 'msg': 'restart', 'type': 'error', 'group': '255', 'desc': RuntimeError('255 Stream-gears 异常退出 .')} [2024-04-12 20:54:22,734][init][INFO]: 正在上传 ./ckk\ckk丶 2024年04月12日20点09分09秒 周一快乐.flv 至 tabis [2024-04-12 20:54:22,734][init][ERROR]: 录制 255 遇到错误,即将重试. [2024-04-12 20:54:22,735][init][DEBUG]: {'msg_type': 'upload', 'video': './ckk\ckk丶 2024年04月12日20点09分09秒 周一快乐.flv', 'group': ('255', 'src_video'), 'video_info': {'url': 'https://live.douyin.com/38819616641', 'taskname': '255', 'streamer': 'ckk丶', 'title': '周一快乐', 'time': datetime.datetime(2024, 4, 12, 20, 9, 9, 506507), 'has_danmu': '', 'duration': 2712.017997980118}, 'upload_config': {'engine': 'biliuprs', 'account': 'tabis', 'retry': 0, 'realtime': True, 'cookies': None, 'min_length': 15, 'line': 'bda2', 'limit': 3, 'copyright': 1, 'source': '', 'tid': 154, 'cover': '', 'title': '[ckk]{MONTH}月{DAY}日 {TITLE}', 'desc': '{STREAMER} 的直播回放{HAS_DANMU} \n标题:{TITLE} \n时间:{YEAR}年{MONTH}月{DAY}日 \n抖音号:38819616641\n', 'dynamic': '{STREAMER} 的直播回放,{YEAR}年{MONTH}月{DAY}日', 'interactive': 0, 'tag': 'ckk', 'dtime': 0, 'dolby': 0, 'no_reprint': 1, 'open_elec': 1, 'target': 'bilibili', 'uploader_name': '255_src_video_0'}, 'uploader_name': '255_src_video_0', 'kwargs': {}} [2024-04-12 20:54:22,735][init][ERROR]: 255 Stream-gears 异常退出 . [2024-04-12 20:54:22,736][init][DEBUG]: PIPE MESSAGE: {'src': 'downloader', 'msg': 'start', 'type': 'info', 'group': '255'} [2024-04-12 20:54:22,736][biliuprs][DEBUG]: biliuprs: ['tools/biliup.exe', '-u', './.temp/tabis.json', 'append', '--vid', 'BV1Nq421F7CE', '--copyright', '1', '--cover', '', '--desc', 'ckk丶 的直播回放 \n标题:周一快乐 \n时间:2024年04月12日 \n抖音号:38819616641\n', '--dolby', '0', '--dtime', '0', '--dynamic', 'ckk丶 的直播回放,2024年04月12日', '--interactive', '0', '--line', 'bda2', '--limit', '3', '--no-reprint', '1', '--open-elec', '1', '--source', '', '--tag', 'ckk', '--tid', '154', '--title', '[ckk]04月12日 周一快乐', './ckk\ckk丶 2024年04月12日20点09分09秒 周一快乐.flv'] [2024-04-12 20:54:22,736][init][INFO]: 255 录制开始. [2024-04-12 20:54:22,737][ffmpegrender][WARNING]: GOP 设置失败:division by zero [2024-04-12 20:54:22,738][ffmpegrender][DEBUG]: ffmpeg render args: ['tools/ffmpeg.exe', '-y', '-hwaccel', 'auto', '-fflags', '+discardcorrupt', '-i', './ckk\ckk丶 2024年04月12日20点09分09秒 周一快乐.flv', '-vf', "subtitles=filename='./ckk/ckk丶 2024年04月12日20点09分09秒 周一快乐.ass'", '-c:v', 'h264_nvenc', '-b:v', '6M', '-c:a', 'aac', '-b:a', '320K', './ckk(带弹幕版)\ckk丶 2024年04月12日20点09分09秒 周一快乐(带弹幕版).mp4'] [2024-04-12 20:54:22,805][connectionpool][DEBUG]: https://live.douyin.com:443 "GET /webcast/room/web/enter/?web_rid=38819616641&aid=6383&device_platform=web&browser_language=zh-CN&browser_platform=Win32&browser_name=Edge&browser_version=104.0.1293.54 HTTP/1.1" 200 None [2024-04-12 20:54:31,638][connectionpool][DEBUG]: Starting new HTTPS connection (1): live.douyin.com:443 [2024-04-12 20:54:31,902][connectionpool][DEBUG]: https://live.douyin.com:443 "GET /webcast/room/web/enter/?web_rid=38819616641&aid=6383&device_platform=web&browser_language=zh-CN&browser_platform=Win32&browser_name=Edge&browser_version=104.0.1293.54 HTTP/1.1" 200 None [2024-04-12 20:54:31,907][init][ERROR]: Command '['tools/ffprobe.exe', '-headers', 'Content-Type: application/x-www-form-urlencoded\r\nUser-Agent: Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Mobile Safari/537.36 \r\n', '-i', 'http://pull-f3.douyincdn.com/third/stream-114952369069884075_or4.flv?auth_key=1713529507-0-0-c536fd7521ee2618e45a1060dad73c72', '-select_streams', 'v:0', '-print_format', 'json', '-show_format', '-show_streams', '-v', 'quiet']' returned non-zero exit status 1. Traceback (most recent call last): File "D:\1ckk\DMR\Downloader\init.py", line 215, in start_helper self.start_once() File "D:\1ckk\DMR\Downloader\init.py", line 121, in start_once width, height = FFprobe.get_resolution(stream_url,stream_request_header) File "D:\1ckk\DMR\utils.py", line 116, in get_resolution res = cls.run_ffprobe_livestream(url, header) File "D:\1ckk\DMR\utils.py", line 95, in run_ffprobe_livestream out = subprocess.check_output([ File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 424, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 528, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['tools/ffprobe.exe', '-headers', 'Content-Type: application/x-www-form-urlencoded\r\nUser-Agent: Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Mobile Safari/537.36 \r\n', '-i', 'http://pull-f3.douyincdn.com/third/stream-114952369069884075_or4.flv?auth_key=1713529507-0-0-c536fd7521ee2618e45a1060dad73c72', '-select_streams', 'v:0', '-print_format', 'json', '-show_format', '-show_streams', '-v', 'quiet']' returned non-zero exit status 1. [2024-04-12 20:54:31,944][danmakuio][DEBUG]: danmaku writer stoped. [2024-04-12 20:54:31,945][init][DEBUG]: No video file ./ckk[正在录制] 255-20240412200911.flv [2024-04-12 20:54:31,946][streamgearsio][DEBUG]: Stream-gears downloader stoped. [2024-04-12 20:54:31,947][init][DEBUG]: PIPE MESSAGE: {'src': 'downloader', 'msg': 'restart', 'type': 'error', 'group': '255', 'desc': CalledProcessError(1, ['tools/ffprobe.exe', '-headers', 'Content-Type: application/x-www-form-urlencoded\r\nUser-Agent: Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Mobile Safari/537.36 \r\n', '-i', 'http://pull-f3.douyincdn.com/third/stream-114952369069884075_or4.flv?auth_key=1713529507-0-0-c536fd7521ee2618e45a1060dad73c72', '-select_streams', 'v:0', '-print_format', 'json', '-show_format', '-show_streams', '-v', 'quiet'])} [2024-04-12 20:54:31,947][init][ERROR]: 录制 255 遇到错误,即将重试. [2024-04-12 20:54:31,948][init][ERROR]: Command '['tools/ffprobe.exe', '-headers', 'Content-Type: application/x-www-form-urlencoded\r\nUser-Agent: Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Mobile Safari/537.36 \r\n', '-i', 'http://pull-f3.douyincdn.com/third/stream-114952369069884075_or4.flv?auth_key=1713529507-0-0-c536fd7521ee2618e45a1060dad73c72', '-select_streams', 'v:0', '-print_format', 'json', '-show_format', '-show_streams', '-v', 'quiet']' returned non-zero exit status 1. [2024-04-12 20:54:41,950][connectionpool][DEBUG]: Starting new HTTPS connection (1): live.douyin.com:443 [2024-04-12 20:54:42,342][connectionpool][DEBUG]: https://live.douyin.com:443 "GET /webcast/room/web/enter/?web_rid=38819616641&aid=6383&device_platform=web&browser_language=zh-CN&browser_platform=Win32&browser_name=Edge&browser_version=104.0.1293.54 HTTP/1.1" 200 None [2024-04-12 20:54:42,347][init__][DEBUG]: PIPE MESSAGE: {'src': 'downloader', 'msg': 'start', 'type': 'info', 'group': '255'} [2024-04-12 20:54:42,350][connectionpool][DEBUG]: Starting new HTTPS connection (1): live.douyin.com:443 [2024-04-12 20:54:42,714][connectionpool][DEBUG]: https://live.douyin.com:443 "GET /webcast/room/web/enter/?web_rid=38819616641&aid=6383&device_platform=web&browser_language=zh-CN&browser_platform=Win32&browser_name=Edge&browser_version=104.0.1293.54 HTTP/1.1" 200 None [2024-04-12 20:54:42,723][connectionpool][DEBUG]: Starting new HTTPS connection (1): live.douyin.com:443 [2024-04-12 20:54:43,121][connectionpool][DEBUG]: https://live.douyin.com:443 "GET /webcast/room/web/enter/?web_rid=38819616641&aid=6383&device_platform=web&browser_language=zh-CN&browser_platform=Win32&browser_name=Edge&browser_version=104.0.1293.54 HTTP/1.1" 200 None [2024-04-12 20:54:53,666][connectionpool][DEBUG]: Starting new HTTPS connection (1): live.douyin.com:443 [2024-04-12 20:54:54,019][connectionpool][DEBUG]: https://live.douyin.com:443 "GET /webcast/room/web/enter/?web_rid=38819616641&aid=6383&device_platform=web&browser_language=zh-CN&browser_platform=Win32&browser_name=Edge&browser_version=104.0.1293.54 HTTP/1.1" 200 None

SmallPeaches commented 2 months ago

看起来像是主播断流导致的,你这个时候确定主播没有下播吗?

foeris commented 2 months ago

确定没有下播,确定之后我才去手动重启的

SmallPeaches commented 2 months ago

手动重启之后可以正常录制吗?

foeris commented 2 months ago

是的,手动重启还可以录制,至今也没再出现过这个现象,有些在意为什么中断后没能重新开始录制

SmallPeaches commented 2 months ago

看日志是重启了的,但是因为获取的地址访问不了所以说没开始录制,下次你发现中断打开日志文件试下看看http://pull-f3.douyincdn.com开头的这个流地址能不能直接访问?

foeris commented 2 months ago

好的

SmallPeaches commented 2 months ago

然后顺便再试下https://live.douyin.com/webcast/room/web/enter/?web_rid=38819616641&aid=6383&device_platform=web&browser_language=zh-CN&browser_platform=Win32&browser_name=Edge&browser_version=104.0.1293.54这个地址返回的数据正不正常。