Error ffmpeg when using only CPU
Hi I tried the new version v2.2.0, with Docker and with CPU only, the result is that it can't create videos with ffmpeg because it uses NVIDIA codecs, you should add a check if it is CPU use “normal” codecs, thanks for your great work!!!
Though you put “check_gpu_available” is not sufficent, maybe a docker problem.
However I solved it by replacing “h264_nvenc” with “libx264”. (step7 & step12)
One idea would be to do a check if the /*/*NVIDIA*.so file exists, which in fact is what it would go to.
- open "step7_merge_sub_to_vid.py" , Line 84 changed: ### gpu_available = check_gpu_available() gpu_available = False # 强制用CPU,因为没有安装NVIDIA GPU驱动,如果有NVIDIA GPU驱动可以打开上面的注释
- open "step7_merge_sub_to_vid.py" , Line 73 changed: ### gpu_available = check_gpu_available() gpu_available = False # 强制用CPU,因为没有安装GUP驱动,如果有驱动可以打开上面的注释 if gpu_available: rprint("[bold green]Using GPU acceleration...[/bold green]") cmd.extend(['-map', '[v]', '-map', '[a]', '-c:v', 'h264_nvenc']) else: cmd.extend(['-map', '[v]', '-map', '[a]'])
@alittlegoldfish The problem with using this method is that if I have cuda support for other operations I cannot then use it, instead you should add a check for the file “libnvidia-encode.so.1” and if it does not exist use “libx264” (Or at least add it as a fallback) instead of “h264_nvenc” @Huanshere
2025-03-21 19:55:39 Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_nvenc))
2025-03-21 19:55:39 Stream #0:1 -> #0:1 (aac (native) -> aac (native))
2025-03-21 19:55:39 Press [q] to stop, [?] for help
2025-03-21 19:55:39 [aac @ 0x5621085bc340] Queue input is backward in time
2025-03-21 19:55:39 [Parsed_subtitles_2 @ 0x562108a908c0] Shaper: FriBidi 0.19.7 (SIMPLE) HarfBuzz-ng 2.6.4 (COMPLEX)
2025-03-21 19:55:39 [Parsed_subtitles_2 @ 0x562108a908c0] Using font provider fontconfig
2025-03-21 19:55:39 [Parsed_subtitles_3 @ 0x562108daaf00] Shaper: FriBidi 0.19.7 (SIMPLE) HarfBuzz-ng 2.6.4 (COMPLEX)
2025-03-21 19:55:39 [Parsed_subtitles_3 @ 0x562108daaf00] Using font provider fontconfig
2025-03-21 19:55:39 [h264_nvenc @ 0x5621084e2780] Cannot load libnvidia-encode.so.1
2025-03-21 19:55:39 [h264_nvenc @ 0x5621084e2780] The minimum required Nvidia driver for nvenc is 435.21 or newer
2025-03-21 19:55:39 Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
2025-03-21 19:55:39 [aac @ 0x5621085bc340] Qavg: 157.983
2025-03-21 19:55:39 [aac @ 0x5621085bc340] 2 frames left in the queue on closing
2025-03-21 19:55:39 Conversion failed!
2025-03-21 19:55:39
2025-03-21 19:55:39 ❌ FFmpeg execution error