ffmpeg-lens-perspective

Generate FFmpeg commands to correct lens and keystone distortion in video.

15|4|Updated Apr 18, 2026
One-click install
npx skills add https://github.com/damionrashford/media-os --skill ffmpeg-lens-perspective
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ffmpeg-lens-perspective
Source: https://github.com/damionrashford/media-os/tree/main/skills/ffmpeg-lens-perspective
Command: npx skills add https://github.com/damionrashford/media-os --skill ffmpeg-lens-perspective

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Corrects common optical issues in video workflows by applying FFmpeg filters to remove lens distortion, fix perspective, and adjust vignetting and rotation.

Core Features & Use Cases

  • Lens distortion correction using lenscorrection (k1/k2) and optional lensfun integration for camera-specific profiles.
  • Perspective/keystone correction via four-corner warp and optional interpolation modes.
  • Additional geometric transforms including vignette adjustment, rotation, shear, and tiltandshift for cinematic tweaks.
  • CLI with subcommands for undistort-barrel, undistort-pincushion, lensfun, perspective, vignette, rotate, shear, and tiltandshift.

Quick Start

Run the lens.py script with your input and output paths to generate the appropriate ffmpeg command for a chosen transform.

Frequently Asked Questions about ffmpeg-lens-perspective

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix fisheye lens distortion in video using FFmpeg?

You can fix fisheye lens distortion in FFmpeg by applying the lenscorrection filter with k1/k2 coefficients. This skill generates the necessary commands to correct barrel distortion typical of action-camera footage.

Can I use lensfun camera profiles to correct pincushion distortion in FFmpeg?

Yes, lensfun integration allows you to apply camera-specific profiles to correct pincushion distortion in FFmpeg. This skill exposes a dedicated subcommand to generate the correct filter chain for your telephoto footage.

What is the best way to correct keystone distortion in FFmpeg?

The best way to correct keystone distortion in FFmpeg is by using the perspective filter for a four-corner warp. This skill generates the perspective commands needed to fix architectural shots and align verticals.

Does FFmpeg support tilt-shift and vignette adjustments together?

FFmpeg supports both vignette adjustments and tilt-shift effects via dedicated filters. This skill provides subcommands to generate the combined filter chains for applying cinematic tweaks and vignette corrections.

Do I need a specific FFmpeg build to apply lens correction filters?

Yes, you need an FFmpeg build compiled with lenscorrection support to apply lens distortion fixes. Optional lensfun database access is also recommended if you want to use camera-specific correction profiles.

How do I rotate and shear video frames with FFmpeg filters?

You can rotate and shear video frames in FFmpeg by applying the rotate and shear filters. This skill provides dedicated subcommands to generate the exact filter parameters for these geometric transforms.