MoneyPrinterTurbo icon indicating copy to clipboard operation
MoneyPrinterTurbo copied to clipboard

无法生成视频,只能生成音频

Open StarryNight-Feng opened this issue 10 months ago • 5 comments

生成视频时,日志报错,配置文件中没有与视频相关的配置 2024-03-29 17:03:11.418 | INFO | app.services.material:search_videos:44 - searching videos: https://api.pexels.com/videos/search?query=Reasons+for+working&per_page=20&orientation=portrait, with proxies: {}

2024-03-29 17:03:12.150 | ERROR | app.services.material:search_videos:51 - search videos failed: {'status': 401, 'code': 'Unauthorized'}

2024-03-29 17:03:12.154 | INFO | app.services.material:download_videos:104 - found 0 videos for 'Reasons for working'

2024-03-29 17:03:12.157 | INFO | app.services.material:search_videos:44 - searching videos: https://api.pexels.com/videos/search?query=Work+and+personal+growth&per_page=20&orientation=portrait, with proxies: {}

2024-03-29 17:03:12.716 | ERROR | app.services.material:search_videos:51 - search videos failed: {'status': 401, 'code': 'Unauthorized'}

StarryNight-Feng avatar Mar 29 '24 09:03 StarryNight-Feng

啊抱歉,是我的问题,pexels_api_keys填错地方了

StarryNight-Feng avatar Mar 29 '24 09:03 StarryNight-Feng

嗯,新的问题,在最后一步合成视频时,必定会崩溃。视频最终合成了,但视频只显示第一帧,音频正常播放 QQ截图20240329175154

StarryNight-Feng avatar Mar 29 '24 09:03 StarryNight-Feng

https://github.com/harry0703/MoneyPrinterTurbo/issues/85

和这个用户的问题相似,目前还在定位中

harry0703 avatar Mar 29 '24 09:03 harry0703

大概率是电脑配置比较低导致的,可以换个高配电脑试试看

harry0703 avatar Mar 30 '24 07:03 harry0703

Same here, I workaround like this to fix the issue (disable the progress bar):

final_clip.write_videofile(combined_video_path, threads=threads, logger=None)

https://github.com/harry0703/MoneyPrinterTurbo/blob/7fb1a95a82c3795df56ac0452320be3c281e9ee4/app/services/video.py#L95

please reference this thread which is a known issue in moviepy Zulko/moviepy#645

https://github.com/harry0703/MoneyPrinterTurbo/issues/85#issuecomment-2032350951

HeathKang avatar Apr 02 '24 15:04 HeathKang

用的moonshot,但是只有audio.mp4, video 提示“”ERROR | app.services.material:search_videos:51 - search videos failed: {'status': 401, 'code': 'Unauthorized'}“”

generating audio

2024-04-03 10:12:27.557 | INFO | app.services.voice:tts:992 - start, voice name: zh-CN-XiaoxiaoNeural

2024-04-03 10:12:30.563 | INFO | app.services.voice:tts:1006 - completed, output file: .\storage\tasks\8b836264-4f08-45b7-b08c-dfb0dcb5031c\audio.mp3

2024-04-03 10:12:30.578 | INFO | app.services.task:start:92 -

generating subtitle, provider: edge

2024-04-03 10:12:30.582 | INFO | app.services.task:start:117 -

downloading videos

2024-04-03 10:12:30.583 | INFO | app.services.material:search_videos:44 - searching videos: https://api.pexels.com/videos/search?query=Importance+of+Reading&per_page=20&orientation=portrait, with proxies: {}

2024-04-03 10:12:31.548 | ERROR | app.services.material:search_videos:51 - search videos failed: {'status': 401, 'code': 'Unauthorized'}

2024-04-03 10:12:31.552 | INFO | app.services.material:download_videos:104 - found 0 videos for 'Importance of Reading'

kinshandash avatar Apr 03 '24 02:04 kinshandash

使用moonshot,但是只有audio.mp4,视频提示“”错误| app.services.material:search_videos:51 - 搜索视频失败:{'status': 401, 'code': '未经授权'}“”

生成音频

2024-04-03 10:12:27.557 |信息| app.services.voice:tts:992 - 启动,语音名称:zh-CN-XiaoxiaoNeural

2024-04-03 10:12:30.563 |信息| app.services.voice:tts:1006 - 已完成,输出文件:.\storage\tasks\8b836264-4f08-45b7-b08c-dfb0dcb5031c\audio.mp3

2024-04-03 10:12:30.578 |信息|应用程序.services.task:开始:92 -

生成字幕,提供者:edge

2024-04-03 10:12:30.582 |信息|应用程序.services.task:开始:117 -

下载视频

2024-04-03 10:12:30.583 |信息| app.services.material:search_videos:44 - 搜索视频:https://api.pexels.com/videos/search ?query=Importance+of+Reading&per_page=20&orientation=portrait ,使用代理:{}

2024-04-03 10:12:31.548 |错误| app.services.material:search_videos:51 - 搜索视频失败:{'status': 401, 'code': 'Unauthorized'}

2024-04-03 10:12:31.552 |信息| app.services.material:download_videos:104 - 找到 0 个有关“阅读的重要性”的视频

状态码401,应该是配置文件中的pexels_api_keys不正确,你需要去注册pexels账号,并申请一个key,免费的。地址:https://www.pexels.com/

StarryNight-Feng avatar Apr 03 '24 02:04 StarryNight-Feng

已经填了也不行 123

kinshandash avatar Apr 03 '24 02:04 kinshandash

格式错误了,应该是

pexels_api_keys = ["123adsf4567adf89","abd1321cd13efgfdfhi"]

harry0703 avatar Apr 03 '24 02:04 harry0703

ok了,感谢大佬~~

kinshandash avatar Apr 03 '24 03:04 kinshandash

大概率是电脑配置比较低导致的,可以换个高配电脑试试看

与电脑配置无关,我的电脑是3代I7处理器,4核8线程,16G内存,生成视频的时候跑不满。 另外,如果我不勾选生成字幕,就不会报错

StarryNight-Feng avatar Apr 03 '24 03:04 StarryNight-Feng

可以使用这个地址测试: http://ai.appleecg.com:8501/

alistaitsacle avatar Apr 03 '24 10:04 alistaitsacle

大概率是电脑配置比较低导致的,可以换个高配电脑试试看

与电脑配置无关,我的电脑是3代I7处理器,4核8线程,16G内存,生成视频的时候跑不满。 另外,如果我不勾选生成字幕,就不会报错

更新代码,重新试试

harry0703 avatar Apr 04 '24 01:04 harry0703