🇨🇳 中文文档 | English (Current)
A modern, user-friendly desktop application for converting video files to high-quality animated GIFs with advanced features like text overlay and video cropping.
- 🎬 Video to GIF Conversion: Support for multiple video formats (MP4, AVI, MOV, MKV, WMV, FLV, WebM)
- ✂️ Video Cropping: Precise region selection with interactive drag-and-drop interface
- 📝 Text Overlay: Add custom text with configurable font, size, color, and position
- ⚙️ Advanced Parameters:
- Customizable frame rate (FPS)
- Adjustable output dimensions
- Quality control
- Loop count settings
- Fast mode for quick processing
- 🔧 Automatic Dependency Management: Auto-detection and installation of required tools (ffmpeg, gifski)
- 🌍 Multi-language Support: English and Chinese interface with automatic system language detection
- 🎨 Modern Apple-style UI: Clean, intuitive interface with Apple design language
- 📁 Smart Path Memory: Remembers last import/export locations for convenience
- Python 3.12+ (recommended)
- Windows operating system (primary target)
-
Clone the repository:
git clone <repository-url> cd VideoToGIF
-
Install dependencies:
uv sync
-
Run the application:
uv run python main.py
The application automatically manages external tools:
- ffmpeg: For video processing and frame extraction
- gifski: For high-quality GIF generation
On first run, the app will check for these tools and offer to install them via Scoop (Windows package manager).
-
Launch the Application
- Run
uv run python main.py
from the project root
- Run
-
Import Video
- Double-click the video preview area or click "Import Video..."
- Select your video file (supports MP4, AVI, MOV, MKV, WMV, FLV, WebM)
-
Configure Parameters
- Basic Parameters: Set start time, duration, frame rate, quality, dimensions
- Video Cropping: Enable cropping and select region by dragging on video preview
- Text Overlay: Add custom text with position and styling options
-
Generate GIF
- Click "Generate GIF"
- Choose save location (defaults to video file directory)
- Wait for processing to complete
-
Preview Result
- Click "Preview" to open the generated GIF
The application follows a modular architecture with clear separation of concerns:
- MainApplication: Core coordinator and application lifecycle manager
- UIModule: Modern PySide6-based user interface with Apple design
- VideoProcessingModule: Video analysis and frame extraction
- GifGenerationModule: GIF creation orchestration
- DependencyManagementModule: External tool management
- ExternalCommandModule: Safe external command execution
- ConfigurationModule: Settings and preferences management
- LanguageModule: Multi-language support system
The application supports:
- English (default for non-Chinese systems)
- 中文 (default for Chinese systems)
Language is automatically detected from system locale and can be changed via the Language button in the interface.
Settings are stored in config.json
and include:
- External tool paths
- User preferences
- Last used directories
- Language selection
Run the test suite:
uv run python -m pytest tests/
Contributions are welcome! Please feel free to submit issues and pull requests.
This project is licensed under the MIT License.