😫 Vấn đề (The Pain Point)
Bạn có file phim và file sub rời. Khi xem trên máy tính thì ổn, nhưng copy vào TV hoặc upload lên Facebook thì mất phụ đề. Bạn cần “đốt” (burn) phụ đề dính luôn vào hình ảnh.
🚀 Giải pháp Agentic (The Solution)
Tool Hardsub chuyên nghiệp, cho phép chỉnh font chữ, size chữ, màu sắc phụ đề.
Tính năng:
- Style Subtitle: Chọn Font Tiếng Việt, màu vàng, viền đen cho dễ đọc.
- Auto Match: Tự động tìm file .srt cùng tên với video để gán.
- Preview: Xem thử kết quả trước khi render.
🤖 Engineering Prompt (Copy & Paste)
**Role:** Video Engineer (Python)
**Task:** Create a "Subtitle Hardcode Tool".
**Requirements:**
1. **Tech Stack:** Python, `tkinter`, `ffmpeg-python`.
2. **GUI:**
* Select Video File.
* Select Subtitle File (.srt).
* **Style Options:** Font Size (Default 24), specific Font path (optional).
* "Burn Subtitles" button.
3. **Logic:**
* Construct complex FFmpeg filter command: `vf="subtitles=filename.srt:force_style='FontSize=24'"`
* *Note:* Handling Windows paths with FFmpeg subtitles filter is tricky (escaping backslashes). The script must handle path formatting robustly.
* Execute encode.
4. **Deliverables:**
* `hardsub.py`
* `run.bat`
* `requirements.txt`
**Context:** Making videos universally compatible with subtitles visible on all devices.
🧠 Giải mã Prompt
- Path Escaping: FFmpeg rất “khó tính” với đường dẫn file trên Windows (dấu
\). Prompt nhấn mạnh việc xử lý này để đảm bảo AI viết code thay thế\thành/hoặc escape\\đúng cách.
🛠️ Hướng dẫn
- Copy Prompt -> Paste.
- Chạy
run.bat. - Chọn Video + File SRT -> Burn.