chengyi-ai/native-subtitle-quote-image
保留视频内嵌字幕,精确取帧并生成 3:4 社交长图的 Agent Skill
What it solves
This project automates the creation of high-quality 3:4 social media quote images from video frames. It solves the problem of manually capturing, cropping, and formatting video subtitles into a visually appealing layout for platforms like Instagram or X, ensuring that the resulting images maintain a professional, compact aesthetic without awkward spacing or oversized subtitle bars.
How it works
The tool operates as an "Agent Skill" that can be integrated into AI agents. It processes local videos or online videos (via yt-dlp) through a workflow of frame extraction, subtitle positioning, and rendering. It offers two distinct modes:
- Native Mode: Preserves the original pixels of the video, capturing subtitles that are already "burned-in" to the frame. It does not perform OCR or redrawing.
- Script Mode: Renders verified text from a JSON script onto real video frames, clearly marking them as post-production subtitles.
The system uses Pillow for image manipulation and FFmpeg (via imageio-ffmpeg) for precise frame extraction. It includes a layout engine that automatically adjusts the ratio between the main image and subtitle bars based on the number of lines provided.
Who it’s for
- Content creators and social media managers who want to turn video highlights into shareable quote cards.
- AI Agent developers looking to add video-to-image processing capabilities to their agents.
- Users who need a consistent, compact visual style for video-based storytelling.
Highlights
- Dual Subtitle Modes: Strict separation between native burned-in subtitles and script-based overlays to maintain authenticity.
- Agent-Ready: Provided as a plug-and-play Skill for compatible AI agents (e.g., Codex).
- Automated Workflow: Supports everything from URL fetching via
yt-dlpto final visual quality assurance (QA). - Compact Layout Engine: Implements specific design rules to maximize the main image's prominence and minimize wasted space between subtitle bars.
Related
- Project
- Project
- Project
- Project