josiahsiegel/claude-plugin-marketplace

ffmpeg-python-integration-reference

Authoritative Python-FFmpeg parameter integration reference ensuring type safety, accurate parameter mappings, and proper unit conversions.

View source
Original skill document

Rendered from the source repository. Headings, examples, code, tables, links, and referenced images are preserved.

Python-FFmpeg Integration Reference

Use this skill when Python code is constructing FFmpeg commands, filters, ASS subtitles, or raw-frame pipes and the risk is a type, unit, color, or stream-mapping bug. This SKILL is a lean orchestrator; detailed tables and full code examples live in references/python-ffmpeg-reference.md.

When to Use

  • ffmpeg-python stream graphs and filter arguments
  • Python subprocess calls to FFmpeg
  • drawtext, ASS/SSA, karaoke, and animated caption parameter mapping
  • RGB/BGR/ASS color conversion bugs
  • Seconds vs centiseconds vs milliseconds confusion
  • Raw frame pipe I/O with NumPy/OpenCV
  • Range/type validation before command execution

Critical Rules

  1. Validate types before passing parameters. fontsize and crf are integers; bitrates are strings with units such as 5M or 192k; FFmpeg expressions are strings.
  2. Quote FFmpeg expressions in Python. Use x="(w-tw)/2", not Python variables named w or tw.
  3. Handle audio explicitly. In ffmpeg-python, a video filter chain usually drops audio unless you map input_file.audio into the output.
  4. Know the color context. FFmpeg drawtext colors are RGB/named strings; OpenCV arrays are BGR; ASS colors are &HAABBGGRR.
  5. Know the time context. FFmpeg filters use seconds; ASS karaoke tags use centiseconds; ASS animation tags use milliseconds.

Quick Reference

FFmpeg / ASS parameterPython typeFormat / rangeCommon failure
-crfint or strH.264/H.265 0-51passing 18.5
-b:v, -b:astr5M, 1000k, 192kraw integer without unit
fontsizeintpractical 12-200passing '24'
fontcolorstrwhite, #FFFFFF, 0xFFFFFFRGB tuple/list
ASS colourstr&HAABBGGRRusing RGB byte order
x, y, alpha, enablestr for expressions'(w-tw)/2, between(t,1,5)unquoted expression

Core Workflow

  1. Probe the input or metadata source so you know width, height, fps, duration, and stream availability.
  2. Choose the integration layer: ffmpeg-python for command graphs, subprocess for full CLI parity and pipes, PyAV for frame-level library access.
  3. Normalize color and time units at the Python boundary.
  4. Validate parameters and ranges before building a command.
  5. Map audio/subtitle streams intentionally.
  6. Run on a short sample first; capture stderr for actionable FFmpeg errors.

Reference Map

  • references/python-ffmpeg-reference.md - Full preserved reference: color conversion functions, ASS style structures, karaoke/animation helpers, drawtext parameter tables, ffmpeg-python examples, subprocess pipe patterns, pitfalls, validation helpers, full working examples.

Related Skills

  • ffmpeg-opencv-integration - OpenCV/NumPy frame pipelines and BGR/RGB handoff
  • ffmpeg-pyav-integration - PyAV frame-level API patterns
  • ffmpeg-captions-subtitles - Subtitle extraction, burn-in, and styling
  • ffmpeg-animation-timing-reference - Timing units, readability, easing, and sync
from this repository

More skills

All skills
josiahsiegel
Community

ffmpeg-opencv-integration

Complete FFmpeg + OpenCV + Python integration guide for video processing pipelines. PROACTIVELY activate for: (1) FFmpeg to OpenCV frame handoff, (2) cv2.VideoCapture vs ffmpeg subprocess, (3) BGR/RGB color format conversion gotchas, (4) Frame dimension order img[y,x] vs img[x,y], (5) ffmpegcv GPU-accelerated video I/O, (6) VidGear multi-threaded streaming, (7) Decord batch video loading for ML, (8) PyAV frame-level processing, (9) Audio stream preservation with video filters, (10) Memory-efficient frame generators, (11) OpenCV + FFmpeg + Modal parallel processing, (12) Pipe frames between FFmpeg and OpenCV. Provides: Color format conversion patterns, coordinate system gotchas, library selection guide, memory management, subprocess pipe patterns, GPU-accelerated alternatives to cv2.VideoCapture. Ensures: Correct integration between FFmpeg and OpenCV without color/coordinate bugs. See also: ffmpeg-python-integration-reference for type-safe parameter mappings.

installs
1
GitHub stars
54
Updated
Jun 18
josiahsiegel
Community

tailwindcss-mobile-first

Mobile-first responsive design patterns with Tailwind CSS v4 (2025-2026). PROACTIVELY activate for: (1) mobile-first design with Tailwind breakpoints (sm:, md:, lg:, xl:, 2xl:), (2) responsive utility ordering (default = mobile, then breakpoints), (3) responsive typography (text-base sm:text-lg lg:text-xl), (4) responsive grids and flexbox, (5) hide/show across breakpoints (hidden md:block), (6) max- breakpoints for desktop-down overrides, (7) container queries (@container) for component-level responsiveness, (8) safe-area insets and notch handling, (9) landscape vs portrait orientation, (10) touch vs hover (hover: with @media). Provides: breakpoint reference, mobile-first patterns, container-query examples, safe-area recipes, and touch/hover handling.

installs
1
GitHub stars
53
Updated
Jun 18
josiahsiegel
Community

tailwindcss-advanced-layouts

Tailwind CSS advanced layout techniques including CSS Grid and Flexbox patterns. PROACTIVELY activate for: (1) building complex layouts with CSS Grid, (2) grid-template-areas via Tailwind v4 arbitrary values, (3) responsive grid (grid-cols-, auto-fit, minmax), (4) Flexbox patterns (flex-1, flex-grow, gap), (5) sticky headers and footers, (6) holy grail layout, (7) masonry-style layouts, (8) container queries (@container) with Tailwind, (9) subgrid usage, (10) aspect-ratio utilities, (11) magazine-style multi-column layouts. Provides: Grid template recipes, container-query patterns, holy-grail templates, masonry alternatives, and aspect-ratio examples.

installs
1
GitHub stars
53
Updated
Jun 18