🔧 关键修复: 1. Python 脚本最终结果输出: - 在函数结束前发送 JSON-RPC 格式的最终结果 - 成功时:rpc.success(result) - 失败时:rpc.error(JSONRPCError.GENERATION_FAILED, msg, details) - 确保最终结果是标准 JSON-RPC 2.0 格式 2. Rust 解析逻辑优化: - 区分进度通知和最终结果响应 - 优先返回 JSON-RPC 结果/错误响应 - 备用机制:检查直接 JSON 中的 status 字段 - 避免返回进度消息作为最终结果 3. 前端 JSON-RPC 响应处理: - 检测 jsonrpc: '2.0' 格式 - 提取 result 字段作为成功结果 - 处理 error 字段并抛出相应错误 - 保持向后兼容直接 JSON 格式 4. 错误处理链路完善: - Python 异常 → JSON-RPC 错误响应 - Rust 解析 → 提取错误信息 - 前端处理 → 显示具体错误原因 - 端到端的错误传播机制 ✅ 修复效果: - 正确识别成功/失败状态 ✓ - 返回最终结果而非进度消息 ✓ - 标准化的错误处理 ✓ - 完整的 JSON-RPC 2.0 支持 ✓ 现在前端应该能正确显示视频生成的成功状态! |
||
|---|---|---|
| python_core | ||
| src | ||
| src-tauri | ||
| .gitignore | ||
| README.md | ||
| gemini.md | ||
| index.html | ||
| install_ai_video_deps.py | ||
| jm_video_ui.md | ||
| package.json | ||
| pnpm-lock.yaml | ||
| postcss.config.js | ||
| prompt.md | ||
| tailwind.config.js | ||
| test_image.jpg | ||
| test_path_fix.py | ||
| tsconfig.json | ||
| tsconfig.node.json | ||
| vite.config.ts | ||
README.md
MixVideo V2 - 视频混剪软件
A modern video editing software built with Tauri (Rust + React) frontend and Python core processing engine.
Architecture
分层架构设计 (Layered Architecture)
- 前端层 (Frontend Layer): Tauri + React - UI渲染和用户交互
- 桥接层 (Bridge Layer): Tauri Commands - 前端与Python核心的通信
- 核心层 (Core Layer): Python - 视频处理核心逻辑
- 服务层 (Service Layer): Python - 后台服务和文件管理
Project Structure
mixvideo_v2/
├── src-tauri/ # Tauri backend (Rust)
│ ├── src/
│ │ ├── main.rs
│ │ ├── commands/ # Tauri commands for Python bridge
│ │ └── utils/
│ ├── Cargo.toml
│ └── tauri.conf.json
├── src/ # React frontend
│ ├── components/ # UI components
│ ├── hooks/ # React hooks
│ ├── services/ # API services
│ ├── stores/ # State management
│ └── utils/
├── python_core/ # Python video processing engine
│ ├── video_processing/ # Core video processing modules
│ ├── audio_processing/ # Audio processing modules
│ ├── services/ # Background services
│ ├── utils/ # Utility functions
│ └── requirements.txt
├── assets/ # Static assets
├── docs/ # Documentation
└── tests/ # Test files
Core Libraries
Video Processing
- MoviePy: 剪辑拼接、字幕添加、特效调整
- FFmpeg-Python: 底层编码/解码、格式转换
- OpenCV-Python: 帧级处理、人脸识别
- PySceneDetect: 自动检测镜头切换点
Audio Processing
- Librosa: 节拍跟踪、频谱分析
- Pydub: 音频剪切、音量调整、混音
- PyAudio: 麦克风输入流采集
- Spleeter: 人声/伴奏分离
AI & Machine Learning
- Video-Transformers: 视频内容理解
- Magenta: AI音乐生成
- TempoCNN: 基于CNN的BPM预测
Getting Started
Prerequisites
- Node.js 18+
- Rust 1.70+
- Python 3.9+
- FFmpeg
Installation
- Clone the repository
- Install frontend dependencies:
npm install - Install Python dependencies:
pip install -r python_core/requirements.txt - Run development server:
npm run tauri dev
Features
- 🎬 视频剪辑拼接
- 🎵 音频处理与节拍同步
- 🎨 特效与滤镜
- 🤖 AI辅助剪辑
- 📱 多平台适配
- ⚡ 分布式任务处理
License
MIT License