SmallPeaches / DanmakuRender

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

渲染报错 #162

Closed MoncozGC closed 11 months ago

MoncozGC commented 11 months ago

请问在边录制视频边渲染视频的时候,时不时的会有渲染出错的情况是为什么呢? 下面是相关日志

[2023-12-18 21:29:12,367][connectionpool][DEBUG]: Starting new HTTPS connection (1): mp.huya.com:443
[2023-12-18 21:29:12,850][connectionpool][DEBUG]: https://mp.huya.com:443 "GET /cache.php?m=Live&do=profileRoom&roomid=333003 HTTP/1.1" 200 None
[2023-12-18 21:29:32,674][danmakuio][DEBUG]: New DMfile: ./直播回放\[正在录制]Zz1tai姿态-20231218-202940-Part001.ass
[2023-12-18 21:29:32,677][__init__][DEBUG]: PIPE MESSAGE: {'src': 'downloader', 'msg': './直播回放\\Zz1tai姿态 12-18 20_29.flv', 'type': 'split', 'group': 'Zz1tai姿态', 'video_info': {'url': 'https://www.huya.com/333003', 'taskname': 'Zz1tai姿态', 'streamer': 'Zz1tai姿态', 'title': '不是第一 就送1000 :)', 'time': datetime.datetime(2023, 12, 18, 20, 29, 37, 889840), 'has_danmu': '', 'duration': 3594.780755996704}}
[2023-12-18 21:29:32,679][__init__][INFO]: 分片 ./直播回放\Zz1tai姿态 12-18 20_29.flv 录制完成.
[2023-12-18 21:29:32,681][connectionpool][DEBUG]: Starting new HTTPS connection (1): mp.huya.com:443
[2023-12-18 21:29:32,681][__init__][INFO]: 添加分片 ./直播回放\Zz1tai姿态 12-18 20_29.flv 至渲染队列.
[2023-12-18 21:29:32,751][__init__][INFO]: 正在渲染: ./直播回放\Zz1tai姿态 12-18 20_29.flv
[2023-12-18 21:29:33,186][connectionpool][DEBUG]: https://mp.huya.com:443 "GET /cache.php?m=Live&do=profileRoom&roomid=333003 HTTP/1.1" 200 None
[2023-12-18 21:29:34,085][ffmpegrender][DEBUG]: ffmpeg render args: ['tools/ffmpeg.exe', '-y', '-hwaccel', 'auto', '-fflags', '+discardcorrupt', '-i', './直播回放\\Zz1tai姿态 12-18 20_29.flv', '-keyint_min', '300', '-g', '300', '-vf', "subtitles=filename='./直播回放/Zz1tai姿态 12-18 20_29.ass'", '-c:v', 'h264_nvenc', '-b:v', '15M', '-c:a', 'aac', '-b:a', '320K', '-s', '3840x2160', './直播回放(带弹幕版)\\Zz1tai姿态 12-18 20_29(带弹幕版).mp4']
[2023-12-18 21:29:35,679][__init__][DEBUG]: PIPE MESSAGE: {'src': 'render', 'msg': './直播回放(带弹幕版)\\Zz1tai姿态 12-18 20_29(带弹幕版).mp4', 'type': 'error', 'group': 'Zz1tai姿态', 'desc': "ffmpeg version N-111487-g36f4e6f8f4-20230716 Copyright (c) 2000-2023 the FFmpeg developers\nbuilt with gcc 13.1.0 (crosstool-NG 1.25.0.196_227d99d)\nconfiguration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --disable-libpulse --enable-libvmaf --disable-libxcb --disable-xlib --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-chromaprint --enable-libdav1d --enable-libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libkvazaar --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librist --enable-libssh --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libvpl --enable-openal --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libdrm --disable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags= --extra-libs=-lgomp --extra-version=20230716\nlibavutil      58. 14.100 / 58. 14.100\nlibavcodec     60. 22.100 / 60. 22.100\nlibavformat    60. 10.100 / 60. 10.100\nlibavdevice    60.  2.101 / 60.  2.101\nlibavfilter     9.  8.102 /  9.  8.102\nlibswscale      7.  3.100 /  7.  3.100\nlibswresample   4. 11.100 /  4. 11.100\nlibpostproc    57.  2.100 / 57.  2.100\nInput #0, flv, from './直播回放\\Zz1tai姿态 12-18 20_29.flv':\nMetadata:\ndisplayWidth    : 1920\ndisplayHeight   : 1080\nfps             : 60\nprofile         :\nlevel           :\nvideocodecreal  : 0\ncdn_ip          : 118.253.147.36\nServer          : Tengine\ncodecname       : 0\nencoder         : Lavf60.10.100\nDuration: 01:00:00.02, start: 0.017000, bitrate: 3340 kb/s\nStream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 60 fps, 60 tbr, 1k tbn\nStream #0:1: Audio: aac (LC), 48000 Hz, stereo, fltp\n[Parsed_subtitles_0 @ 000002487d8993c0] libass API version: 0x1701000\n[Parsed_subtitles_0 @ 000002487d8993c0] libass source: commit: 1a599b1db748dfc07df98cd37d8603edb87da2fd-dirty\n[Parsed_subtitles_0 @ 000002487d8993c0] Shaper: FriBidi 1.0.13 (SIMPLE) HarfBuzz-ng 7.3.0 (COMPLEX)\n[Parsed_subtitles_0 @ 000002487d8993c0] Using font provider directwrite (with GDI)\nUsing auto hwaccel type dxva2 with new default device.\nStream mapping:\nStream #0:0 -> #0:0 (h264 (native) -> h264 (h264_nvenc))\nStream #0:1 -> #0:1 (aac (native) -> aac (native))\nPress [q] to stop, [?] for help\n[Parsed_subtitles_0 @ 000002487de77580] libass API version: 0x1701000\n[Parsed_subtitles_0 @ 000002487de77580] libass source: commit: 1a599b1db748dfc07df98cd37d8603edb87da2fd-dirty\n[Parsed_subtitles_0 @ 000002487de77580] Shaper: FriBidi 1.0.13 (SIMPLE) HarfBuzz-ng 7.3.0 (COMPLEX)\n[Parsed_subtitles_0 @ 000002487de77580] Using font provider directwrite (with GDI)\n[h264_nvenc @ 000002487d8a00c0] OpenEncodeSessionEx failed: out of memory (10): (no details)\n[h264_nvenc @ 000002487d8a00c0] No capable devices found\n[vost#0:0/h264_nvenc @ 000002487da65440] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.\n[aac @ 000002487e8ac8c0] Qavg: 24346.320\n[aac @ 000002487e8ac8c0] 2 frames left in the queue on closing\nConversion failed!\n", 'msg_type': 'render', 'video': './直播回放\\Zz1tai姿态 12-18 20_29.flv', 'danmaku': './直播回放\\Zz1tai姿态 12-18 20_29.ass', 'output': './直播回放(带弹幕版)\\Zz1tai姿态 12-18 20_29(带弹幕版).mp4', 'video_info': {'url': 'https://www.huya.com/333003', 'taskname': 'Zz1tai姿态', 'streamer': 'Zz1tai姿态', 'title': '不是第一 就送1000 :)', 'time': datetime.datetime(2023, 12, 18, 20, 29, 37, 889840), 'has_danmu': '', 'duration': 3594.780755996704}, 'config': {'output_dir': None, 'format': 'mp4', 'engine': 'ffmpeg', 'nrenders': 4, 'hwaccel_args': ['-hwaccel', 'auto'], 'vencoder': 'h264_nvenc', 'vencoder_args': ['-b:v', '15M'], 'aencoder': 'aac', 'aencoder_args': ['-b:a', '320K'], 'output_resize': '3840x2160', 'advanced_render_args': None, 'nproc': 2, 'bufsize': 100, 'danmaku_resort': False}, 'kwargs': {}}
[2023-12-18 21:29:35,681][__init__][ERROR]: 分片 ./直播回放(带弹幕版)\Zz1tai姿态 12-18 20_29(带弹幕版).mp4 渲染错误.
[2023-12-18 21:29:35,682][__init__][ERROR]: ffmpeg version N-111487-g36f4e6f8f4-20230716 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 13.1.0 (crosstool-NG 1.25.0.196_227d99d)
configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --disable-libpulse --enable-libvmaf --disable-libxcb --disable-xlib --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-chromaprint --enable-libdav1d --enable-libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libkvazaar --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librist --enable-libssh --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libvpl --enable-openal --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libdrm --disable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags= --extra-libs=-lgomp --extra-version=20230716
libavutil      58. 14.100 / 58. 14.100
libavcodec     60. 22.100 / 60. 22.100
libavformat    60. 10.100 / 60. 10.100
libavdevice    60.  2.101 / 60.  2.101
libavfilter     9.  8.102 /  9.  8.102
libswscale      7.  3.100 /  7.  3.100
libswresample   4. 11.100 /  4. 11.100
libpostproc    57.  2.100 / 57.  2.100
Input #0, flv, from './直播回放\Zz1tai姿态 12-18 20_29.flv':
Metadata:
displayWidth    : 1920
displayHeight   : 1080
fps             : 60
profile         :
level           :
videocodecreal  : 0
cdn_ip          : 118.253.147.36
Server          : Tengine
codecname       : 0
encoder         : Lavf60.10.100
Duration: 01:00:00.02, start: 0.017000, bitrate: 3340 kb/s
Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 60 fps, 60 tbr, 1k tbn
Stream #0:1: Audio: aac (LC), 48000 Hz, stereo, fltp
[Parsed_subtitles_0 @ 000002487d8993c0] libass API version: 0x1701000
[Parsed_subtitles_0 @ 000002487d8993c0] libass source: commit: 1a599b1db748dfc07df98cd37d8603edb87da2fd-dirty
[Parsed_subtitles_0 @ 000002487d8993c0] Shaper: FriBidi 1.0.13 (SIMPLE) HarfBuzz-ng 7.3.0 (COMPLEX)
[Parsed_subtitles_0 @ 000002487d8993c0] Using font provider directwrite (with GDI)
Using auto hwaccel type dxva2 with new default device.
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_nvenc))
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[Parsed_subtitles_0 @ 000002487de77580] libass API version: 0x1701000
[Parsed_subtitles_0 @ 000002487de77580] libass source: commit: 1a599b1db748dfc07df98cd37d8603edb87da2fd-dirty
[Parsed_subtitles_0 @ 000002487de77580] Shaper: FriBidi 1.0.13 (SIMPLE) HarfBuzz-ng 7.3.0 (COMPLEX)
[Parsed_subtitles_0 @ 000002487de77580] Using font provider directwrite (with GDI)
[h264_nvenc @ 000002487d8a00c0] OpenEncodeSessionEx failed: out of memory (10): (no details)
[h264_nvenc @ 000002487d8a00c0] No capable devices found
[vost#0:0/h264_nvenc @ 000002487da65440] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.
[aac @ 000002487e8ac8c0] Qavg: 24346.320
[aac @ 000002487e8ac8c0] 2 frames left in the queue on closing
Conversion failed!

[2023-12-18 21:29:41,194][ffmpegio][DEBUG]: Zz1tai姿态 FFmpeg output:
frame=215522 fps= 60 q=-1.0 size=N/A time=00:59:52.00 bitrate=N/A speed=   1x
frame=215557 fps= 60 q=-1.0 size=N/A time=00:59:52.59 bitrate=N/A speed=   1x
frame=215597 fps= 60 q=-1.0 size=N/A time=00:59:53.26 bitrate=N/A speed=   1x
frame=215626 fps= 60 q=-1.0 size=N/A time=00:59:53.75 bitrate=N/A speed=   1x
frame=215657 fps= 60 q=-1.0 size=N/A time=00:59:54.26 bitrate=N/A speed=   1x
frame=215702 fps= 60 q=-1.0 size=N/A time=00:59:55.03 bitrate=N/A speed=   1x
frame=215729 fps= 60 q=-1.0 size=N/A time=00:59:55.46 bitrate=N/A speed=   1x
frame=215765 fps= 60 q=-1.0 size=N/A time=00:59:56.06 bitrate=N/A speed=   1x
frame=215795 fps= 60 q=-1.0 size=N/A time=00:59:56.56 bitrate=N/A speed=   1x
frame=215828 fps= 60 q=-1.0 size=N/A time=00:59:57.11 bitrate=N/A speed=   1x
frame=215865 fps= 60 q=-1.0 size=N/A time=00:59:57.71 bitrate=N/A speed=   1x
frame=215894 fps= 60 q=-1.0 size=N/A time=00:59:58.21 bitrate=N/A speed=   1x
frame=215940 fps= 60 q=-1.0 size=N/A time=00:59:58.98 bitrate=N/A speed=   1x
frame=215967 fps= 60 q=-1.0 size=N/A time=00:59:59.42 bitrate=N/A speed=   1x
frame=216002 fps= 60 q=-1.0 size=N/A time=01:00:00.00 bitrate=N/A speed=   1x
[segment @ 0000023bbbcd6840] Opening './直播回放\[正在录制]Zz1tai姿态-20231218-202940-Part001.flv' for writing
frame=216037 fps= 60 q=-1.0 size=N/A time=01:00:00.59 bitrate=N/A speed=   1x
frame=216062 fps= 60 q=-1.0 size=N/A time=01:00:01.01 bitrate=N/A speed=   1x
frame=216095 fps= 60 q=-1.0 size=N/A time=01:00:01.55 bitrate=N/A speed=   1x
frame=216124 fps= 60 q=-1.0 size=N/A time=01:00:02.05 bitrate=N/A speed=   1x
frame=216163 fps= 60 q=-1.0 size=N/A time=01:00:02.70 bitrate=N/A speed=   1x
frame=216200 fps= 60 q=-1.0 size=N/A time=01:00:03.31 bitrate=N/A speed=   1x
frame=216231 fps= 60 q=-1.0 size=N/A time=01:00:03.82 bitrate=N/A speed=   1x
frame=216269 fps= 60 q=-1.0 size=N/A time=01:00:04.46 bitrate=N/A speed=   1x
frame=216300 fps= 60 q=-1.0 size=N/A time=01:00:04.98 bitrate=N/A speed=   1x
frame=216335 fps= 60 q=-1.0 size=N/A time=01:00:05.56 bitrate=N/A speed=   1x
frame=216363 fps= 60 q=-1.0 size=N/A time=01:00:06.03 bitrate=N/A speed=   1x
frame=216394 fps= 60 q=-1.0 size=N/A time=01:00:06.55 bitrate=N/A speed=   1x
frame=216432 fps= 60 q=-1.0 size=N/A time=01:00:07.17 bitrate=N/A speed=   1x

[2023-12-18 21:30:12,867][connectionpool][DEBUG]: Starting new HTTPS connection (1): mp.huya.com:443
[2023-12-18 21:30:13,432][connectionpool][DEBUG]: https://mp.huya.com:443 "GET /cache.php?m=Live&do=profileRoom&roomid=333003 HTTP/1.1" 200 None
MoncozGC commented 11 months ago

ps: 单独渲染的时候可以正常渲染完成,不过会有大量的这种日志

[Parsed_subtitles_0 @ 0000024087ec66c0] fontselect: failed to find any fallback with glyph 0xF06C for font: (Microsoft YaHei, 700, 0)
[Parsed_subtitles_0 @ 0000024087ec66c0] Glyph 0xF06C not found, selecting one more font for (Microsoft YaHei, 700, 0)
[Parsed_subtitles_0 @ 0000024087ec66c0] fontselect: failed to find any fallback with glyph 0xF06C for font: (Microsoft YaHei, 700, 0)
[Parsed_subtitles_0 @ 0000024087ec66c0] Glyph 0xF06C not found, selecting one more font for (Microsoft YaHei, 700, 0)
[Parsed_subtitles_0 @ 0000024087ec66c0] fontselect: failed to find any fallback with glyph 0xF06C for font: (Microsoft YaHei, 700, 0)
[Parsed_subtitles_0 @ 0000024087ec66c0] Glyph 0xF06C not found, selecting one more font for (Microsoft YaHei, 700, 0)
[Parsed_subtitles_0 @ 0000024087ec66c0] fontselect: failed to find any fallback with glyph 0xF06C for font: (Microsoft YaHei, 700, 0)
[Parsed_subtitles_0 @ 0000024087ec66c0] Glyph 0xF06C not found, selecting one more font for (Microsoft YaHei, 700, 0)
[Parsed_subtitles_0 @ 0000024087ec66c0] fontselect: failed to find any fallback with glyph 0xF06C for font: (Microsoft YaHei, 700, 0)
SmallPeaches commented 11 months ago

你应该是并行数量开太高了,NVIDIA的消费级显卡最多同时运行5个编码任务。