twitter-to-reel
Convert Twitter/X posts into Instagram Reels format. Screenshots tweets, crops to show username/caption/media, creates a 9:16 vertical canvas with matching background color, and overlays downloaded video content. Works alongside twitter-media-downloader skill. Use when user wants to repurpose Twitter content for Instagram, TikTok, or other vertical video platforms.
When & Why to Use This Skill
The Twitter to Reel Converter is a specialized Claude skill designed to automate the transformation of Twitter/X posts into high-quality, 9:16 vertical videos optimized for Instagram Reels, TikTok, and YouTube Shorts. By integrating automated screenshotting, intelligent theme detection (light/dark mode), and video overlay capabilities, it streamlines the content repurposing workflow for creators and social media managers, ensuring professional-looking results with minimal manual effort.
Use Cases
- Case 1: Transforming viral text-based tweets or threads into engaging vertical video content to maximize reach on Instagram and TikTok.
- Case 2: Automating social media workflows for brands that need to cross-post announcements or customer testimonials from X to video-centric platforms.
- Case 3: Creating consistent, branded video snippets by overlaying original tweet media onto customized vertical canvases with matching background colors.
- Case 4: Efficiently archiving and sharing high-quality visual records of social media interactions in a mobile-friendly video format.
| name | twitter-to-reel |
|---|---|
| description | Convert Twitter/X posts into Instagram Reels format. Screenshots tweets, crops to show username/caption/media, creates a 9:16 vertical canvas with matching background color, and overlays downloaded video content. Works alongside twitter-media-downloader skill. Use when user wants to repurpose Twitter content for Instagram, TikTok, or other vertical video platforms. |
Twitter to Reel Converter
Convert Twitter/X posts into Instagram Reels format (9:16 vertical video).
Dependencies
Install required packages before use:
pip install playwright pillow numpy
playwright install chromium
FFmpeg must also be available:
# Ubuntu/Debian
apt-get install ffmpeg
# macOS
brew install ffmpeg
Quick Start
Create a reel from a tweet URL (video auto-downloaded):
uv run python scripts/create_reel.py "https://x.com/user/status/123" -o output.mp4
Or provide a video file explicitly:
uv run python scripts/create_reel.py "https://x.com/user/status/123" video.mp4 -o output.mp4
Workflow
- Download (auto): If no video provided, downloads from tweet using twitter-media-downloader
- Screenshot: Captures the tweet using a headless browser
- Detect Theme: Identifies light/dark mode for background matching
- Canvas: Creates 1080x1920 vertical canvas with matching background
- Compose: Places tweet at top, overlays video in media area
- Export: Outputs Instagram Reels-ready MP4
Scripts
create_reel.py (Main Script)
Full pipeline from tweet URL to finished reel:
uv run python scripts/create_reel.py "TWEET_URL" [VIDEO_FILE] [options]
Options:
| Option | Description |
|---|---|
-o, --output |
Output file path (default: reel_output.mp4) |
--theme |
Force theme: light, dark, or auto (default: auto) |
--position |
Tweet position: top, center, bottom (default: top) |
--padding |
Padding around tweet in pixels (default: 40) |
--no-cleanup |
Keep intermediate files |
--cookies |
Path to cookies.txt for auth |
--browser |
Browser to extract cookies from (recommended: firefox) |
--no-auto-download |
Disable automatic video download (require explicit video path) |
Note: Using
--browser firefoxis recommended as it automatically extracts cookies from your browser session. This applies to both tweet screenshots and video downloads.
screenshot_tweet.py (Standalone)
Screenshot a tweet without video overlay:
uv run python scripts/screenshot_tweet.py "TWEET_URL" -o screenshot.png
Options:
| Option | Description |
|---|---|
-o, --output |
Output file path |
--theme |
Force light or dark theme |
--width |
Browser viewport width (default: 550) |
--full |
Capture full tweet thread |
--cookies |
Cookies file for protected tweets |
compose_video.py (Standalone)
Compose video onto an existing screenshot:
uv run python scripts/compose_video.py screenshot.png video.mp4 -o reel.mp4
Examples
Auto-Download (Recommended)
Simply provide the tweet URL - video is downloaded automatically:
uv run python scripts/create_reel.py "https://x.com/NASA/status/123456" -o nasa_reel.mp4
With authentication for protected tweets:
uv run python scripts/create_reel.py "https://x.com/user/status/123" --browser firefox -o reel.mp4
Manual Download (Advanced)
If you want more control, download separately first:
# First download the video
uv run python ../twitter-media-downloader/scripts/download.py "https://x.com/user/status/123" -o ./downloads
# Then create the reel
uv run python scripts/create_reel.py "https://x.com/user/status/123" ./downloads/*.mp4 -o reel.mp4
Or provide a video file directly:
uv run python scripts/create_reel.py "https://x.com/NASA/status/123456" my_video.mp4 -o reel.mp4
Customization
Dark theme with bottom positioning:
uv run python scripts/create_reel.py "https://x.com/user/status/123" \
--theme dark --position bottom -o my_reel.mp4
Screenshot Only (No Video)
uv run python scripts/screenshot_tweet.py "https://x.com/user/status/123" -o tweet.png
Output Specifications
- Resolution: 1080x1920 (Instagram Reels standard)
- Aspect Ratio: 9:16 vertical
- Format: MP4 (H.264 video, AAC audio)
- Background: Matches tweet theme (white/black)
Troubleshooting
- Tweet not loading: Use
--browser firefox(recommended) or--cookiesfor protected accounts - Wrong colors: Force theme with
--theme lightor--theme dark - Video too long: Trim video before processing or use
--duration - Playwright errors: Run
playwright install chromium