😫 The Pain Point
Zalo limits video attachments to 25MB. Your phone recorded a 100MB video. You need to compress it without making it unwatchable.
🚀 Agentic Solution
A Smart Video Compressor that targets a specific file size.
Key Features:
- Target Size: Specify “under 25MB” and the script calculates optimal bitrate.
- Quality Presets: Fast, Balanced, High Quality.
- Batch Mode: Compress multiple videos at once.
⚔️ Phase 1: Commander (Quick Fix)
For quick compression.
Prompt:
“I have a video
party.mp4(100MB). Write a Python script using FFmpeg to:
- Target Size: Compress to under 25MB.
- Calculate Bitrate: Based on duration and target size.
- Maintain Audio: Keep audio at 128kbps.
- Output: Save as
party_compressed.mp4.Print progress. Handle FFmpeg errors gracefully.”
Result: Shareable video that fits Zalo’s limit.
🏗️ Phase 2: Architect (Permanent Tool)
For Social Media Marketers.
Engineering Prompt:
**Role:** Python GUI Developer (PyQt6 Specialist)
**Task:** Create "Social Video Compressor" Desktop App
**Objective:** A batch video compression tool tailored for platform limits (Zalo 25MB, Discord 8MB).
**Tech Stack:**
* Language: Python 3.10+
* GUI Library: PyQt6 (Cross-platform)
* Media Engine: FFmpeg
* Packaging: PyInstaller
**Functional Requirements:**
1. **UI Layout (PyQt6):**
* **Drag Drop:** Area for video files.
* **Presets:** Buttons for "Zalo (25MB)", "Discord (8MB)", "Email (25MB)".
* **Custom:** Manual Target Size Input (MB).
* **Priority:** Radio for "Prioritize Quality" (slower) vs "Prioritize Speed".
2. **Core Logic:**
* Calculate Target Bitrate = (Target Size / Duration).
* Pass 1/Pass 2 FFmpeg encoding for strict size adherence.
* **Threading:** Run encoding process in background thread.
3. **Deliverables:**
* `main.py`: Complete source code.
* `requirements.txt`: Dependencies.
* **Build Instructions:**
* Windows: `pyinstaller --onefile --noconsole main.py`
* macOS: `pyinstaller --windowed --noconsole main.py`
🧠 Prompt Decoding
- Two-pass encoding: First pass analyzes the video, second pass optimizes compression. Better quality at same file size.
🛠️ Instructions
- Install FFmpeg.
- Copy Prompt → Run.