smithery.ai

portrait-resizer

Convert videos to 9:16 portrait format (1080x1920) for TikTok, YouTube Shorts, Instagram Reels, and Facebook Reels. Supports smart cropping (face-aware), center cropping, and letterboxing. Maintains aspect ratio and quality.

First seen Apr 24, 2026

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Skill metadata

Parsed from SKILL.md frontmatter.

Version1.0
CompatibilityRequires FFmpeg and OpenCV (MediaPipe optional for face detection)
Allowed toolsBash(ffmpeg:*)
More metadata
version
1.0
formats
9:16 portrait

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 6,088 B
  • docs SUMMARY.md 261 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

Portrait Resizer

This skill converts horizontal videos to vertical 9:16 portrait format suitable for short-form content platforms.

When to Use

  • User wants to create TikTok videos from horizontal content
  • Converting YouTube videos to YouTube Shorts format
  • Creating Instagram Reels from widescreen video
  • Preparing content for Facebook Reels
  • Converting any 16:9 video to 9:16 format

Supported Platforms

  • TikTok: 1080x1920, 9:16, 15-60s
  • YouTube Shorts: 1080x1920, 9:16, 15-60s
  • Instagram Reels: 1080x1920, 9:16, 15-90s
  • Facebook Reels: 1080x1920, 9:16, 15-90s

Available Scripts

scripts/resizetoportrait.py

Convert video to 9:16 portrait format.

Usage:

python skills/portrait-resizer/scripts/resize_to_portrait.py <video_path> [options]

Options:

  • --width: Target width (default: 1080)
  • --height: Target height (default: 1920)
  • --mode: Resize mode (smart, center, letterbox) - default: smart
  • --focus-x: Focus point X coordinate (0-1, smart mode)
  • --focus-y: Focus point Y coordinate (0-1, smart mode)
  • --output, -o: Output video path (default: <videopath>portrait.mp4)
  • --quality: Quality preset (fast, medium, slow) - default: fast

Examples:

Basic resize to portrait:

python skills/portrait-resizer/scripts/resize_to_portrait.py video.mp4

Resize with smart cropping:

python skills/portrait-resizer/scripts/resize_to_portrait.py video.mp4 --mode smart

Resize with specific focus point:

python skills/portrait-resizer/scripts/resize_to_portrait.py video.mp4 --mode smart --focus-x 0.7 --focus-y 0.5

Center crop:

python skills/portrait-resizer/scripts/resize_to_portrait.py video.mp4 --mode center

Letterbox (padding on top/bottom):

python skills/portrait-resizer/scripts/resize_to_portrait.py video.mp4 --mode letterbox

scripts/batch_resize.py

Resize multiple videos to portrait format.

Usage:

python skills/portrait-resizer/scripts/batch_resize.py --input-dir <dir> [options]

Options:

  • --input-dir: Directory with videos to resize
  • --output-dir: Output directory (default: ./portrait/)
  • All other options from resizetoportrait.py

Example:

python skills/portrait-resizer/scripts/batch_resize.py --input-dir ./clips/ --output-dir ./portrait_clips/

Resize Modes

Smart Crop (Default)

Intelligently crops to focus on subjects:

  • Detects faces (MediaPipe if available, otherwise OpenCV Haar)
  • Samples frames across the clip to find dominant face position
  • Centers crop on weighted face centroid
  • Falls back to center crop if no faces detected

Center Crop

Simple center crop:

  • Crops from the center of the video
  • May cut off subjects on edges
  • Fast and predictable
  • Best when subject is always centered

Letterbox

Pillarbox/black bars:

  • Maintains full width of video
  • Adds padding on top and bottom
  • No content loss
  • Best for showing full context

Output Specifications

Default Output:

  • Resolution: 1080x1920
  • Aspect Ratio: 9:16
  • Video Codec: H.264 (libx264)
  • Audio Codec: AAC
  • Container: MP4

Platform-Specific Presets:

presets = {
    'tiktok': {
        'width': 1080,
        'height': 1920,
        'bitrate': '4000k',
        'fps': 30
    },
    'youtube_shorts': {
        'width': 1080,
        'height': 1920,
        'bitrate': '4000k',
        'fps': 30
    },
    'instagram_reels': {
        'width': 1080,
        'height': 1920,
        'bitrate': '4000k',
        'fps': 30
    }
}

Output Format

{
  "success": true,
  "input_path": "video.mp4",
  "output_path": "video_portrait.mp4",
  "input_resolution": {
    "width": 1920,
    "height": 1080
  },
  "output_resolution": {
    "width": 1080,
    "height": 1920
  },
  "mode": "smart",
  "focus_point": {
    "x": 0.65,
    "y": 0.50
  },
  "quality_settings": {
    "preset": "fast",
    "crf": 23
  }
}

Smart Crop Algorithm

  1. Face Detection: Uses MediaPipe (if available) or OpenCV Haar Cascades
  2. Frame Sampling: Samples frames at a fixed rate for stable focus
  3. Weighted Average: Chooses dominant face using size/confidence weighting
  4. Fallback: Uses center crop if no faces detected

Integration with Other Skills

After resizing, you can use these skills:

  • subtitle-overlay: Add captions to portrait video
  • autocut-shorts: Full workflow with all steps

Common Workflow

  1. User provides video file
  2. Find highlights using highlight-scanner
  3. Trim segments using video-trimmer
  4. Resize to portrait using this skill
  5. Add subtitles using subtitle-overlay
  6. Export final clips

Tips

  • Resize AFTER trimming (more efficient)
  • Use smart crop for talking-head content
  • Use center crop for action/sports content
  • Use letterbox for cinematic/wide shots
  • Test different focus points for best results
  • Face detection works best with clear frontal faces

Performance

  • Simple crop/resize: ~2-5 seconds per minute
  • Smart crop with face detection: ~5-10 seconds per minute
  • Batch processing: Parallel processing available

Error Handling

  • Small videos: Minimum resolution checks
  • Already portrait: Returns as-is or error
  • Face detection failure: Falls back to center crop
  • MediaPipe unavailable: Automatically uses OpenCV Haar cascade
  • Codec issues: Re-encodes with standard codecs

References