root e4fdb666ce fix: 按 Tauri 最佳实践重构 Python 进程通信
🔧 核心重构:

1. 使用 Tauri Shell Plugin 替代直接 Command:
   - 导入 tauri_plugin_shell::ShellExt
   - 使用 app.shell().command() 创建进程
   - 利用 CommandEvent 处理进程输出
   - 支持异步事件驱动的进程通信

2. 改进编码处理:
   - 在 Windows 下设置 PYTHONIOENCODING=utf-8
   - 设置 PYTHONUTF8=1 环境变量
   - 使用 String::from_utf8_lossy 处理输出
   - 确保跨平台编码兼容性

3. 优化 JSON 输出解析:
   - 实时检测 JSON 格式的输出行
   - 提取最后的完整 JSON 对象
   - 区分进度信息和最终结果
   - 保持向后兼容性

4. 增强错误处理和调试:
   - 分别收集 stdout 和 stderr
   - 详细的进程状态跟踪
   - 改进的错误信息格式
   - 实时输出日志便于调试

5. 函数签名更新:
   - 所有 Python 命令函数添加 AppHandle 参数
   - 支持 Tauri 的依赖注入模式
   - 保持类型安全和错误处理

 修复效果:
- 解决进程通信问题 ✓
- 正确识别成功/失败状态 ✓
- 改善 Windows 编码支持 ✓
- 符合 Tauri 社区最佳实践 ✓

现在 Python 进程通信应该更加稳定可靠!
2025-07-10 12:51:30 +08:00
2025-07-10 09:41:40 +08:00
2025-07-10 09:41:40 +08:00
2025-07-10 09:41:40 +08:00
2025-07-10 09:41:40 +08:00
2025-07-10 09:41:40 +08:00
2025-07-10 09:41:40 +08:00
2025-07-10 09:41:40 +08:00
2025-07-10 09:41:40 +08:00
2025-07-10 09:41:40 +08:00

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

  1. Clone the repository
  2. Install frontend dependencies: npm install
  3. Install Python dependencies: pip install -r python_core/requirements.txt
  4. Run development server: npm run tauri dev

Features

  • 🎬 视频剪辑拼接
  • 🎵 音频处理与节拍同步
  • 🎨 特效与滤镜
  • 🤖 AI辅助剪辑
  • 📱 多平台适配
  • 分布式任务处理

License

MIT License

Description
视频混剪V2
Readme 1.9 MiB
Languages
Python 50.2%
TypeScript 39.3%
Rust 6.8%
HTML 2.5%
Batchfile 0.6%
Other 0.5%