花了1.5小时,经历了4次git clone失败、moviepy版本冲突、装错了一个没有界面的版本——我终于生成了第一个视频。这是我希望开始之前就有人写好的指南。 After 1.5 hours, 4 failed git clones, a moviepy version conflict, and a version that had no GUI — I finally made a video. This is the guide I wish existed when I started.
跳到真实安装指南 ↓ Skip to Real Setup Guide ↓MoneyPrinterTurbo 是一个开源的 AI 工具,可以根据一句话自动生成视频。你给它一个主题(例如"关于黑洞的5个冷知识"),它会自动生成完整视频——包括文案、配音、画面、字幕和背景音乐——完全不需要你动手剪辑。 MoneyPrinterTurbo is an open-source AI tool that automatically generates videos from a single sentence. You give it a topic (e.g. "Top 5 facts about black holes") and it produces a complete video — script, voiceover, visuals, subtitles, and background music — without you touching a timeline.
由国内开发者 harry0703 创建,因"第一个真正一键式 AI 视频生成流水线"在 GitHub 上爆火。 It was built by a Chinese developer (harry0703) and gained massive traction on GitHub for being the first truly one-click AI video pipeline that runs locally.
我用提示词 "东京必去的3个地方" 进行了测试。以下是 AI 生成视频与手动剪辑的对比: I tested it with the prompt "Top 3 things to do in Tokyo". Here's what came out, side by side with a manually-edited video for comparison:
| 对比维度Criteria | MoneyPrinterTurbo | 手动剪辑Manual Editing |
|---|---|---|
| 1分钟视频耗时Time to produce 1-min video | ~60 秒~60 seconds | ~30 分钟~30 minutes |
| 画面质量Visual quality | 不错(素材库拼接)Good (stock footage) | 取决于剪辑水平Depends on skill |
| 配音质量Voiceover quality | 良好(Edge TTS,免费)Good (Edge TTS, free) | 需要录音设备Needs recording/mic |
| 自定义程度Customization | 限于模板参数Limited to templates | 完全自由Full control |
| 单条视频成本Cost per video | ~$0.01(API 费用)~$0.01 (API fees) | 时间 + 软件订阅Time + subscription |
简单回答:完全免费,零 API Key 也可用。前提是使用 v1.1.0 + g4f 配置(见下方指南)。 The short answer: yes, completely free. Zero API keys required. If you use v1.1.0 + the g4f config shown below.
每个教程都说"又快又简单"。以下是真正有效的步骤,包括所有别人跳过不谈的部分。每步标注了适用范围: Every tutorial says "quick and easy." Here's what actually works. Each step tagged so you know what affects you:
📖 需要独立的安装教程?MoneyPrinterTurbo 安装指南(10分钟完整版) 📖 Want a standalone tutorial? MoneyPrinterTurbo Setup Guide (10-Minute Complete)
🎬 装好了?怎么用 MoneyPrinterTurbo 做出第一个视频 → 🎬 Already installed? How to use MPT and make your first video →
GLOBAL 全球通用,谁都会遇到Happens to everyone, everywhere | REGIONAL 仅限中国/受限网络用户China / restricted-network users only
git clone --branch v1.1.0 --depth 1 https://github.com/harry0703/MoneyPrinterTurbo.gitcd MoneyPrinterTurbo--depth 1 减少下载量规避中断。VPN ON for git clone — GitHub connections reset frequently through GFW. --depth 1 minimizes the pain.
pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/pip install moviepy==1.0.3 — v2.0.0 破坏了 MPT v1.1.0 依赖的 API。If you get "moviepy.editor not found": pip install moviepy==1.0.3 — v2.0.0 broke the API MPT v1.1.0 depends on.config.example.toml → config.toml。只改一行:
Copy config.example.toml → config.toml. Change ONE line:llm_provider = "g4f"cd D:\Projects\MoneyPrinterTurbopython main.pycd D:\Projects\MoneyPrinterTurbostreamlit run .\webui\Main.py新手用 v1.1.0。有 Streamlit 图形界面(点点就行),内置 Edge TTS(免费配音),支持 g4f(免费 AI)。v1.2.x 是完全重写版——纯 FastAPI、没有界面、需要外部 API Key。适合开发者做流水线集成;对只想生成一个视频的人来说是灾难。 v1.1.0 for beginners. It has a Streamlit Web UI (point-and-click), built-in Edge TTS (free voiceover), and g4f support (free AI). v1.2.x is a complete rewrite — FastAPI-only, no GUI, requires external API keys. Great for developers building pipelines; terrible for someone who just wants to make a video.
仓库比较大。两个解决办法:(1) 用 --depth 1 浅克隆——跳过历史记录,下载量减少 80%。(2) 如果不在美国,开 VPN——部分地区到 GitHub 的连接会频繁重置。黄金命令:git clone --branch v1.1.0 --depth 1 https://github.com/harry0703/MoneyPrinterTurbo.git
The full repo is large. Two fixes: (1) Use --depth 1 for a shallow clone — skips git history, reduces download by 80%. (2) Turn on your VPN if you're outside the US — GitHub connections from some regions reset frequently. The magic command: git clone --branch v1.1.0 --depth 1 https://github.com/harry0703/MoneyPrinterTurbo.git
moviepy 2.0 移除了 MPT v1.1.0 依赖的 moviepy.editor 模块。修复:pip install moviepy==1.0.3。因为 requirements.txt 没有锁定精确版本。
moviepy 2.0 removed the moviepy.editor module that MPT v1.1.0 depends on. Fix: pip install moviepy==1.0.3. This happens because requirements.txt doesn't pin an exact version.
MPT v1.1.0 把后端(FastAPI,负责视频渲染)和前端(Streamlit,你看到的界面)拆成了两个独立进程。后端用 python main.py 启动(端口 8080),前端用 streamlit run webui/Main.py 启动(端口 8501)。两个都需要跑着。生成视频期间两个窗口都别关。
MPT v1.1.0 splits the backend (FastAPI, handles video rendering) and frontend (Streamlit, the UI you see) into separate processes. The backend runs on python main.py (port 8080), the frontend on streamlit run webui/Main.py (port 8501). You need both running. Keep both windows open while making videos.
能用——但要管理好预期。它不会从零生成 AI 视频(像 Sora 那样)。它是把素材片段 + AI 配音 + 字幕拼接成一个精致的幻灯片式视频。效果像一个不错的 YouTube 科普视频。适合无出镜内容频道、教程、社媒短视频。不适合创意电影或动画。 Yes — but set expectations. It doesn't generate AI video from scratch (like Sora). It assembles stock footage + AI voiceover + subtitles into a polished slideshow-video. The result looks like a decent YouTube explainer. Perfect for faceless content channels, tutorials, and social media clips. Not suitable for cinematic or creative video projects.
git clone:开 VPN(部分地区 GitHub 被墙/不稳定)。pip install:关 VPN + 用镜像如 https://mirrors.aliyun.com/pypi/simple/——VPN 会让 pip 慢到怀疑人生。生成视频:开 VPN——Pexels 素材下载不走 VPN 经常失败。
Git clone: VPN ON (GitHub is blocked/unstable from some regions). pip install: VPN OFF + use a mirror like https://mirrors.aliyun.com/pypi/simple/ — VPN will slow pip to a crawl. Generating videos: VPN ON — Pexels stock footage downloads often fail without it.
不需要。MPT 不在本地跑 AI 模型——它调用云端 API 或素材服务。一切都在 CPU 上运行。一个普通笔记本就够。"faster-whisper" 依赖只在开启 Whisper 字幕时才会用到(默认关闭)。 No. MPT doesn't run local AI models — it calls cloud APIs or stock services. Everything runs on CPU. A basic laptop is sufficient. The "faster-whisper" dependency is only used if you enable Whisper subtitles (off by default).
MPT 本身是 MIT 协议——无限制。Pexels 素材可免版税商用。Edge TTS 配音免费商用。如果你改用 Azure TTS 或 OpenAI,请查看各自的服务条款。结论:用免费配置(g4f + Edge TTS + Pexels)生成的视频,商用没问题。 MPT itself is MIT-licensed — no restrictions. Stock footage from Pexels is royalty-free. Edge TTS voices are free for commercial use. If you switch to Azure TTS or OpenAI, check their terms. Bottom line: with the free setup (g4f + Edge TTS + Pexels), you're clear for commercial use.
我在 Windows 11(中国网络环境)上花了 ~4 小时才让 MPT v1.1.0 生成出一个视频。每一步都踩了坑。以下按类别整理了全部 18 个 bug——含症状、根因、修复代码。 I spent ~4 hours getting MPT v1.1.0 to generate one video on Windows 11 (China). Every single step hit an issue. Below are all 18 bugs — with symptoms, root causes, and fix code — organized by category.
| 小白路径Beginner Path | 程序员路径Programmer Path | |
|---|---|---|
| MPT 版本Version | v1.1.0 (Streamlit Web UI) | v1.2.9 (API-only, CLI) |
| LLM | Qwen (DashScope/Bailian) — 免费、国内直连free, China-direct | 任意 OpenAI 兼容服务Any OpenAI-compatible provider |
| 界面Interface | 浏览器 localhost:8501Browser at localhost:8501 | curl / 自定义脚本custom scripts |
| 预计耗时(修复后)Expected Time (after fixes) | ~30 min | ~15 min |
| 实际耗时(中国)Reality (China) | 2–4 小时hours | 1–2 小时hours |
RPC failed, early EOF, fetch-pack unexpected disconnect
git clone --branch v1.1.0 --depth 1 https://github.com/harry0703/MoneyPrinterTurbo.git
浅克隆 + 指定分支,跳过全部历史记录,减少约 80% 下载量
Shallow clone + specific branch, skips all history, ~80% less data
pip install -r requirements.txt 卡住不动或超时hangs or times out
pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
换用阿里云镜像Switch to Aliyun mirror
WSServerHandshakeError: 403, message='Invalid response status' 来自 speech.platform.bing.com
pip install edge-tts --upgrade
→ 完整修复指南:为什么被墙、VPN 开关策略、替代方案
→ Full fix guide: why it's blocked, VPN strategy, alternatives
large-v3 模型(~3GB)——国内极慢
Subtitle fallback to Whisper downloads large-v3 model (~3GB) from Hugging Face — extremely slow in China
/docs API 页面,没有 Streamlit 界面
Installed latest, only /docs API page, no Streamlit UI
git checkout v1.1.0
v1.1.0 是最后一个有图形界面的版本。→ 完整修复指南:为什么没有界面、如何切换、v1.1.0 vs v1.2.x 对比v1.1.0 is the last version with a Web UI. → Full fix guide: why there's no GUI, how to switch, v1.1.0 vs v1.2.x comparison
ModuleNotFoundError: No module named 'moviepy.editor'
moviepy.editor 模块
moviepy v2.0.0 removed the moviepy.editor module that MPT v1.1.0 depends on
pip install moviepy==1.0.3
→ 完整修复指南:moviepy 1.x vs 2.x 区别、受影响项目、预防措施
→ Full fix guide: moviepy 1.x vs 2.x differences, affected projects, prevention
write_videofile() got an unexpected keyword argument 'temp_audiofile_path'
temp_audiofile 而非 temp_audiofile_path
moviepy v1.0.3 uses temp_audiofile not temp_audiofile_path
app/services/video.py 中全局替换Replace all occurrences in app/services/video.py
temp_audiofile_path → temp_audiofile
Unable to choose an output format for 'D:\...\tasks\<uuid>'
temp_audiofile 被设为目录路径而非文件路径(缺少扩展名)
temp_audiofile was set to a directory path instead of a file path with extension
video.py 第 109、256 行In video.py lines 109, 256
temp_audiofile=output_dir
→ temp_audiofile=os.path.join(output_dir, "temp_audio.m4a")
ImportError: cannot import name 'mktimestamp' from 'edge_tts.submaker'
mktimestamp 工具函数
edge-tts package upgraded and removed the mktimestamp utility function
app/services/voice.py 第5行添加本地实现:Add local implementation to app/services/voice.py line 5:
def mktimestamp(seconds: float) -> str:
hrs = int(seconds // 3600)
mins = int((seconds % 3600) // 60)
secs = int(seconds % 60)
millis = int((seconds % 1) * 1000)
return f"{hrs:02d}:{mins:02d}:{secs:02d}.{millis:03d}"
'SubMaker' object has no attribute 'subs'
.subs 重命名为 .cues(返回 Subtitle 对象列表而非字符串)
edge-tts renamed .subs → .cues (list of Subtitle objects instead of strings)
voice.py:In voice.py:
# Line 1017:
sub_maker.subs → sub_maker.cues
# Line 1087: replace zip(sub_maker.offset, sub_maker.subs)
# with iteration over sub_maker.cues, using
# .content for text and .start/.end.total_seconds() for timestamps
'SubMaker' object has no attribute 'offset'
.offset,时间戳现在在 Subtitle.start / .end(timedelta 对象)
edge-tts removed .offset, timestamps now in Subtitle.start/.end as timedelta objects
voice.py 的 get_audio_duration()(约1125行):In get_audio_duration() (~line 1125):
def get_audio_duration(sub_maker):
if not sub_maker.cues:
return 0.0
return sub_maker.cues[-1].end.total_seconds()
sub_maker.cues is None (流式结束后无字幕填充)(no cues populated after streaming)
sub_maker.create_sub((offset, duration), text)。新 API:sub_maker.feed(chunk)——直接传入原始 chunk 字典
Old API: sub_maker.create_sub((offset, duration), text). New API: sub_maker.feed(chunk) — takes raw chunk dict
voice.py _do() 函数(约1013行):In voice.py _do() function (~line 1013):
# Old:
sub_maker.create_sub((chunk["offset"], chunk["duration"]), chunk["text"])
# New:
sub_maker.feed(chunk)
sub_maker.cues is None (即使 feed() 修好后仍然为空)(still empty even after feed() fix)
SentenceBoundary 事件(不发 WordBoundary)。条件 chunk["type"] == "WordBoundary" 永远不成立
New edge-tts only emits SentenceBoundary chunks (not WordBoundary). The condition never matches
voice.py 第1012行):Change condition to accept both (voice.py line 1012):
# Old:
elif chunk["type"] == "WordBoundary":
# New:
elif chunk["type"] in ("WordBoundary", "SentenceBoundary"):
RetryProviderError: RetryProvider failed — 所有免费 GPT 供应商全部报错all free GPT providers return errors
curl_cffi, undetected_chromedriver, platformdirs
Free g4f providers are unstable/unmaintained/blocked; missing deps: curl_cffi, undetected_chromedriver, platformdirs
Error code: 429 - account suspended due to insufficient balance
https://dashscope.console.aliyun.com/
免费获取 API Key,百万 token 额度Get free API key with million-token quota
OSError: [WinError 1455] The paging file is too small
taskkill /F /IM ffmpeg.exe
3. 如果仍然失败:设置 → 系统 → 关于 → 高级系统设置 → 性能 → 高级 → 虚拟内存 → 自定义:初始 4096,最大 8192 → 重启
3. If still fails: Settings → System → About → Advanced system settings → Performance → Advanced → Virtual memory → Custom: Initial 4096, Max 8192 → Restart
Invalid voice '' — TTS 失败3次后任务返回 None(Streamlit 报 AttributeError)TTS fails 3 times, then task returns None (AttributeError in Streamlit)
en-US-AnaNeural-Female)
Must select a voice from the Speech Synthesis dropdown (e.g. en-US-AnaNeural-Female)
所有修改均在 app/services/ 目录下:
All changes are in app/services/:
| 文件File | 修改内容Changes |
|---|---|
voice.py | 5处修复:添加 mktimestamp、subs→cues、offset→cues[-1].end、create_sub→feed、WordBoundary→SentenceBoundary5 fixes: mktimestamp (add), subs→cues, offset→cues[-1].end, create_sub→feed, WordBoundary→SentenceBoundary |
video.py | 2处修复:temp_audiofile_path→temp_audiofile,目录路径→文件路径2 fixes: temp_audiofile_path→temp_audiofile, directory→file path |
config.toml | llm_provider=qwen,pexels_api_keys 填入llm_provider=qwen, pexels_api_keys filled |
| 包Package | 版本Version | 备注Note |
|---|---|---|
moviepy | 1.0.3 | ❌ 不要用 2.0.0+❌ NOT 2.0.0+ |
edge-tts | 最新版latest | ⚠️ 需要上述5个代码补丁⚠️ requires 5 code patches above |
dashscope | 最新版latest | ✅ 兼容 Qwen/Bailian API Key✅ still compatible with Qwen/Bailian keys |
MoneyPrinterTurbo 由国内开发者 harry0703 创建并开源,是目前 GitHub 上最受欢迎的 AI 视频生成工具之一——截至 2026 年 5 月已获得 72,000+ Stars 和 10,000+ Forks,长期位列 GitHub Trending 前列。 MoneyPrinterTurbo was created and open-sourced by developer harry0703. It is one of the most popular AI video generation tools on GitHub — with 72,000+ stars and 10,000+ forks as of May 2026, consistently ranking on GitHub Trending.
项目采用 MIT 开源许可证——可自由商用、修改和分发,无任何限制。技术栈基于 Python,核心流水线整合了 LLM(文案生成)、TTS(配音)、Pexels(素材搜索)和 moviepy + FFmpeg(视频合成)。 Licensed under MIT — free for commercial use, modification, and redistribution with no restrictions. The tech stack is Python-based, integrating LLM (script generation), TTS (voiceover), Pexels (stock footage), and moviepy + FFmpeg (video composition).