Giter VIP home page Giter VIP logo

moneyprinterturbo's Introduction

MoneyPrinterTurbo 💸

只需提供一个视频 主题关键词 ,就可以全自动生成视频文案、视频素材、视频字幕、视频背景音乐,然后合成一个高清的短视频。

特别感谢 🙏

由于该项目的 部署使用,对于一些小白用户来说,还是 有一定的门槛,在此特别感谢

录咖(AI智能 多媒体服务平台) 网站基于该项目,提供的免费AI视频生成器服务,可以不用部署,直接在线使用,非常方便。

功能特性 🎯

  • 完整的 MVC架构,代码 结构清晰,易于维护,支持API和Web界面
  • 支持视频文案 AI自动生成,也可以自定义文案
  • 支持多种 高清视频 尺寸
    • 竖屏 9:16,1080x1920
    • 横屏 16:9,1920x1080
  • 支持 批量视频生成,可以一次生成多个视频,然后选择一个最满意的
  • 支持 视频片段时长设置,方便调节素材切换频率
  • 支持 中文英文 视频文案
  • 支持 多种语音 合成
  • 支持 字幕生成,可以调整 字体位置颜色大小,同时支持字幕描边设置
  • 支持 背景音乐,随机或者指定音乐文件,可设置背景音乐音量
  • 视频素材来源 高清,而且 无版权
  • 支持 OpenAImoonshotAzuregpt4freeone-api 等多种模型接入

后期计划 📅

  • GPT-SoVITS 配音支持
  • 优化语音合成,利用大模型,使其合成的声音,更加自然,情绪更加丰富
  • 增加视频转场效果,使其看起来更加的流畅
  • 优化视频素材的匹配度

视频演示 📺

竖屏 9:16

▶️ 《如何增加生活的乐趣》

demo-portrait-1.mp4

▶️ 《生命的意义是什么》

demo-portrait-2.mp4

横屏 16:9

▶️《生命的意义是什么》

demo-landscape.mp4

▶️《为什么要运动》

demo-landscape-2.mp4

安装部署 📥

建议使用 conda 创建 python 虚拟环境

git clone https://github.com/harry0703/MoneyPrinterTurbo.git
cd MoneyPrinterTurbo
conda create -n MoneyPrinterTurbo python=3.10
conda activate MoneyPrinterTurbo
pip install -r requirements.txt

快速使用 🚀

视频教程

前提

  • 尽量不要使用 中文路径,避免出现一些无法预料的问题
  • 请确保你的 网络 是正常的,即可以正常访问境外网站

① 安装好 ImageMagick

Windows:
MacOS:
brew install imagemagick
Ubuntu
sudo apt-get install imagemagick
CentOS
sudo yum install ImageMagick

② 修改配置文件

  • config.example.toml 文件复制一份,命名为 config.toml
  • 按照 config.toml 文件中的说明,配置好 pexels_api_keysllm_provider,并根据 llm_provider 对应的服务商,配置相关的 API Key
  • 如果是Windows系统,imagemagick_path 为你的实际安装路径(如果安装的时候没有修改路径,直接取消注释即可)

③ 配置大模型(LLM)

  • 如果要使用 GPT-4.0GPT-3.5,需要有 OpenAIAPI Key,如果没有,可以将 llm_provider 设置为 g4f ( 一个免费使用GPT的开源库 https://github.com/xtekky/gpt4free)
  • 或者可以使用到 月之暗面 申请。注册就送 15元体验金,可以对话1500次左右。然后设置 llm_provider="moonshot"moonshot_api_key 。感谢 @jerryblues 的建议

启动Web界面 🌐

注意需要到 MoneyPrinterTurbo 项目 根目录 下执行以下命令

Windows

conda activate MoneyPrinterTurbo
webui.bat

MacOS or Linux

conda activate MoneyPrinterTurbo
sh webui.sh

启动后,会自动打开浏览器

效果如下图:

启动API服务 🚀

python main.py

启动后,可以查看 API文档 http://127.0.0.1:8080/docs 直接在线调试接口,快速体验。

效果如下图:

语音合成 🗣

所有支持的声音列表,可以查看:声音列表

字幕生成 📜

当前支持2种字幕生成方式:

  • edge: 生成速度更快,性能更好,对电脑配置没有要求,但是质量可能不稳定
  • whisper: 生成速度较慢,性能较差,对电脑配置有一定要求,但是质量更可靠

可以修改 config.toml 配置文件中的 subtitle_provider 进行切换

建议使用 edge 模式,如果生成的字幕质量不好,再切换到 whisper 模式

如果留空,表示不生成字幕。

背景音乐 🎵

用于视频的背景音乐,位于项目的 resource/songs 目录下。

当前项目里面放了一些默认的音乐,来自于 YouTube 视频,如有侵权,请删除。

字幕字体 🅰

用于视频字幕的渲染,位于项目的 resource/fonts 目录下,你也可以放进去自己的字体。

常见问题 🤔

❓RuntimeError: No ffmpeg exe could be found

通常情况下,ffmpeg 会被自动下载,并且会被自动检测到。 但是如果你的环境有问题,无法自动下载,可能会遇到如下错误:

RuntimeError: No ffmpeg exe could be found.
Install ffmpeg on your system, or set the IMAGEIO_FFMPEG_EXE environment variable.

此时你可以从 https://www.gyan.dev/ffmpeg/builds/ 下载ffmpeg,解压后,设置 ffmpeg_path 为你的实际安装路径即可。

[app]
# 请根据你的实际路径设置,注意 Windows 路径分隔符为 \\
ffmpeg_path = "C:\\Users\\harry\\Downloads\\ffmpeg.exe"

❓生成音频时报错或下载视频报错

issue 56

failed to generate audio, maybe the network is not available. 
if you are in China, please use a VPN.

issue 44

failed to download videos, maybe the network is not available. 
if you are in China, please use a VPN.

这个大概率是网络原因,无法访问境外的服务,请使用VPN解决。

❓ImageMagick is not installed on your computer

issue 33

  1. 按照 示例配置 里面提供的 下载地址 ,安装 https://imagemagick.org/archive/binaries/ImageMagick-7.1.1-29-Q16-x64-static.exe, 用静态库
  2. 不要安装在中文路径里面,避免出现一些无法预料的问题

issue 54

如果是linux系统,可以手动安装,参考 https://cn.linux-console.net/?p=16978

感谢 @wangwenqiao666的研究探索

反馈建议 📢

  • 可以提交 issue 或者 pull request
  • 也可以关注我的 抖音视频号网旭哈瑞.AI
    • 我会在上面发布一些 使用教程纯技术 分享。
    • 如果有更新和优化,我也会在上面 及时通知
    • 有问题也可以在上面 留言,我会 尽快回复
抖音 视频号

参考项目 📚

该项目基于 https://github.com/FujiwaraChoki/MoneyPrinter 重构而来,做了大量的优化,增加了更多的功能。 感谢原作者的开源精神。

许可证 📝

点击查看 LICENSE 文件

moneyprinterturbo's People

Contributors

harry0703 avatar root-ftw avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.