Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

到最后一步报错了 #33

Open
ReplyInSimpleChineseAlways opened this issue Jun 27, 2024 · 6 comments
Open

到最后一步报错了 #33

ReplyInSimpleChineseAlways opened this issue Jun 27, 2024 · 6 comments

Comments

@ReplyInSimpleChineseAlways

[12/12]
[MoviePy] >>>> Building video D:\00_AI_TOOLS\ComfyUI-aki-v1.2\output\hallo_1719451232483069200.mp4
[MoviePy] Writing audio in hallo_1719451232483069200TEMP_MPY_wvf_snd.mp3
[MoviePy] Done.
[MoviePy] Writing video D:\00_AI_TOOLS\ComfyUI-aki-v1.2\output\hallo_1719451232483069200.mp4
Traceback (most recent call last):
File "D:\00_AI_TOOLS\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-Hallo\Hallo\scripts\inference.py", line 375, in
inference_process(command_line_args)
File "D:\00_AI_TOOLS\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-Hallo\Hallo\scripts\inference.py", line 346, in inference_process
tensor_to_video(tensor_result, output_file, driving_audio_path)
File "D:\00_AI_TOOLS\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-Hallo\Hallo\hallo\utils\util.py", line 318, in tensor_to_video
new_video_clip.write_videofile(output_video_file, fps=fps, audio_codec='aac')
File "D:\00_AI_TOOLS\ComfyUI-aki-v1.2\python\lib\site-packages\decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "D:\00_AI_TOOLS\ComfyUI-aki-v1.2\python\lib\site-packages\moviepy\decorators.py", line 54, in requires_duration
return f(clip, *a, **k)
File "D:\00_AI_TOOLS\ComfyUI-aki-v1.2\python\lib\site-packages\decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "D:\00_AI_TOOLS\ComfyUI-aki-v1.2\python\lib\site-packages\moviepy\decorators.py", line 137, in use_clip_fps_by_default
return f(clip, *new_a, **new_kw)
File "D:\00_AI_TOOLS\ComfyUI-aki-v1.2\python\lib\site-packages\decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "D:\00_AI_TOOLS\ComfyUI-aki-v1.2\python\lib\site-packages\moviepy\decorators.py", line 22, in convert_masks_to_RGB
return f(clip, *a, **k)
File "D:\00_AI_TOOLS\ComfyUI-aki-v1.2\python\lib\site-packages\moviepy\video\VideoClip.py", line 338, in write_videofile
ffmpeg_write_video(self, filename, fps, codec,
File "D:\00_AI_TOOLS\ComfyUI-aki-v1.2\python\lib\site-packages\moviepy\video\io\ffmpeg_writer.py", line 201, in ffmpeg_write_video
writer = FFMPEG_VideoWriter(filename, clip.size, fps, codec = codec,
File "D:\00_AI_TOOLS\ComfyUI-aki-v1.2\python\lib\site-packages\moviepy\video\io\ffmpeg_writer.py", line 86, in init
'-r', '%.02f' % fps,
TypeError: must be real number, not NoneType

@AIFSH
Copy link
Owner

AIFSH commented Jun 27, 2024

readme,check your ffmpeg

@ReplyInSimpleChineseAlways
Copy link
Author

ffmpeg
ffmpeg version 7.0.1-full_build-www.gyan.dev Copyright (c) 2000-2024 the FFmpeg developers
built with gcc 13.2.0 (Rev5, Built by MSYS2 project)

我使用秋叶的集成包,本地安装了ffmpeg, 这样是不是不行?

@ReplyInSimpleChineseAlways
Copy link
Author

image
我看控制台的显示, ffmpeg已经安装了。
还是说我的这个ffmpeg不行?

@Kinglord
Copy link

Kinglord commented Jun 28, 2024

Sadly this has nothing to do with ffmpeg, apparently there's a bug in moviepy itself (the latest version) that isn't passing in the fps correctly to the deocrators. Maybe this only happens on Windows? I'm not actually sure how it works for anyone :D

Here is a link to the bug:
Zulko/moviepy#2158

I did a dirty hack to hardcode it in moviepy so I didn't have to mess with decorators. You can make this change as well to ffmpeg_writer.py if you like, just set the fps to something reasonable, I had mine on 24 and it works fine.

I added this code to the main class and the ffmpeg_write_video function just to be safe:

    # Ensure fps is set to 24 if not provided
    if fps is None:
        fps = 24

Hopefully that will fix things for you as well! I wish there was a way to punt on the whole moviepy thing cause it's pretty old. If not, I think we could edit the comfyui node to include an FPS setting so that's properly being passed and that would work as well and it's something we can control.

@zhd7787
Copy link

zhd7787 commented Jul 8, 2024

升级 moviepy就可以了,我就是这样搞好的

pip install moviepy--upgrade

@killpj
Copy link

killpj commented Jul 14, 2024

升级 moviepy有冲突,又降级到1.0.3,正常了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants