Get the FREE Ultimate OpenClaw Setup Guide →

media-composition

Scanned
npx machina-cli add skill athola/claude-night-market/media-composition --openclaw
Files (1)
SKILL.md
9.1 KB

Table of Contents

Media Composition Skill

Combine multiple media assets (GIFs, videos, images) into composite outputs for detailed tutorials and documentation.

When To Use

  • Combining multiple media outputs into compositions
  • Creating composite demos from terminal and browser recordings

When NOT To Use

  • Single-format output that does not need composition
  • Simple terminal recordings - use scry:vhs-recording directly

Overview

This skill orchestrates the combination of separately generated media assets into unified outputs. It reads manifest files that define components and their composition rules, validates all inputs exist, and executes FFmpeg commands to produce the final composite media.

Required TodoWrite Items

- Parse composition manifest file
- Validate all component outputs exist
- Determine composition layout and parameters
- Execute FFmpeg composition command
- Verify combined output file created
- Report composition metrics (file size, dimensions)

Verification: Run the command with --help flag to verify availability.

Manifest Format

Manifests define the components to combine and how to arrange them:

# Example manifest: tutorials/mcp.manifest.yaml
name: mcp
title: "MCP Server Integration"
components:
  - type: tape
    source: mcp.tape
    output: assets/gifs/mcp-terminal.gif
  - type: playwright
    source: browser/mcp-browser.spec.ts
    output: assets/gifs/mcp-browser.gif
    requires:
      - "skrills serve"
combine:
  output: assets/gifs/mcp-combined.gif
  layout: vertical
  options:
    padding: 10
    background: "#1a1a2e"

Verification: Run the command with --help flag to verify availability.

Manifest Schema

FieldTypeRequiredDescription
namestringYesIdentifier for the composition
titlestringNoHuman-readable title
componentsarrayYesList of media components to combine
components[].typestringYesSource type: tape, playwright, static
components[].sourcestringYesPath to source file
components[].outputstringYesPath to generated output
components[].requiresarrayNoCommands to run before generation
combine.outputstringYesPath for combined output
combine.layoutstringYesLayout mode (see table below)
combine.optionsobjectNoLayout-specific options

Step-by-Step Process

1. Parse Manifest File

# Read and validate manifest structure
yq eval '.' manifest.yaml

# Extract component outputs
yq eval '.components[].output' manifest.yaml

Verification: Run the command with --help flag to verify availability.

2. Validate Component Outputs

# Check all required files exist
for output in $(yq eval '.components[].output' manifest.yaml); do
  if [[ ! -f "$output" ]]; then
    echo "ERROR: Missing component: $output"
    exit 1
  fi
done

Verification: Run the command with --help flag to verify availability.

3. Execute FFmpeg Composition

Based on the layout specified in the manifest, execute the appropriate FFmpeg command.

4. Verify Combined Output

# Verify output exists and has content
if [[ -f "$output" && -s "$output" ]]; then
  echo "Composition successful: $output"
  ls -lh "$output"
else
  echo "ERROR: Composition failed"
  exit 1
fi

Verification: Run the command with --help flag to verify availability.

FFmpeg Composition Commands

Vertical Stacking

Stack GIFs/videos top to bottom:

ffmpeg -i top.gif -i bottom.gif \
  -filter_complex "[0:v][1:v]vstack=inputs=2" \
  -y output.gif

Verification: Run the command with --help flag to verify availability.

With padding between:

ffmpeg -i top.gif -i bottom.gif \
  -filter_complex "[0:v]pad=iw:ih+10:0:0:color=black[top];[top][1:v]vstack=inputs=2" \
  -y output.gif

Verification: Run the command with --help flag to verify availability.

Horizontal Stacking

Stack GIFs/videos side by side:

ffmpeg -i left.gif -i right.gif \
  -filter_complex "[0:v][1:v]hstack=inputs=2" \
  -y output.gif

Verification: Run the command with --help flag to verify availability.

Sequential Concatenation

Play GIFs/videos one after another:

# Create concat list file
cat > concat_list.txt << EOF
file 'first.gif'
file 'second.gif'
file 'third.gif'
EOF

# Concatenate
ffmpeg -f concat -safe 0 -i concat_list.txt \
  -y output.gif

Verification: Run the command with --help flag to verify availability.

Grid Layout (2x2)

ffmpeg -i tl.gif -i tr.gif -i bl.gif -i br.gif \
  -filter_complex "[0:v][1:v]hstack=inputs=2[top];[2:v][3:v]hstack=inputs=2[bottom];[top][bottom]vstack=inputs=2" \
  -y output.gif

Verification: Run the command with --help flag to verify availability.

With Background Color

ffmpeg -i top.gif -i bottom.gif \
  -filter_complex "color=c=#1a1a2e:s=800x600[bg];[bg][0:v]overlay=0:0[tmp];[tmp][1:v]overlay=0:300" \
  -y output.gif

Verification: Run the command with --help flag to verify availability.

Layout Options

LayoutDescriptionOptions
verticalStack top to bottompadding, background, align
horizontalStack left to rightpadding, background, align
sequentialPlay in ordertransition, duration
gridN x M grid arrangementrows, cols, padding
overlayLayer on top of each otherposition, opacity
pipPicture-in-picturecorner, scale, margin

Layout Option Details

OptionTypeDefaultDescription
paddingint0Pixels between components
backgroundstring"black"Background color (hex or name)
alignstring"center"Alignment: left, center, right
transitionstring"none"Transition type: fade, wipe, none
scalefloat0.25Scale factor for PiP
cornerstring"br"PiP corner: tl, tr, bl, br

Example Compositions

Terminal + Browser Tutorial

name: plugin-demo
components:
  - type: tape
    source: demo.tape
    output: terminal.gif
  - type: playwright
    source: browser.spec.ts
    output: browser.gif
combine:
  output: demo-combined.gif
  layout: vertical
  options:
    padding: 5
    background: "#0d1117"

Verification: Run the command with --help flag to verify availability.

Side-by-Side Comparison

name: before-after
components:
  - type: static
    source: before.gif
    output: before.gif
  - type: static
    source: after.gif
    output: after.gif
combine:
  output: comparison.gif
  layout: horizontal
  options:
    padding: 10

Verification: Run the command with --help flag to verify availability.

Picture-in-Picture

name: pip-demo
components:
  - type: tape
    source: main.tape
    output: main.gif
  - type: playwright
    source: overlay.spec.ts
    output: overlay.gif
combine:
  output: pip-demo.gif
  layout: pip
  options:
    corner: br
    scale: 0.3
    margin: 20

Verification: Run the command with --help flag to verify availability.

Exit Criteria

  • Manifest file parsed successfully
  • All component outputs validated as existing
  • FFmpeg composition command executed without errors
  • Combined output file exists and has non-zero size
  • Output dimensions and duration logged
  • Temporary files cleaned up

Troubleshooting

Common Issues

Command not found Ensure all dependencies are installed and in PATH

Permission errors Check file permissions and run with appropriate privileges

Unexpected behavior Enable verbose logging with --verbose flag

Source

git clone https://github.com/athola/claude-night-market/blob/master/plugins/scry/skills/media-composition/SKILL.mdView on GitHub

Overview

Media Composition stitches GIFs, videos, and images into unified tutorial outputs. It reads a manifest to define components and layouts, validates inputs, and uses FFmpeg to produce vertical, horizontal, or grid-style composites for documentation and demonstrations.

How This Skill Works

The skill reads a manifest that lists media components and a desired layout, validates that each component output exists, then builds and executes FFmpeg commands to stitch, tile, or stack the assets into a final composite. It can handle vertical, horizontal, grid, and other layout options, optionally applying padding or background colors before outputting the final file.

When to Use It

  • When you need to merge multiple media outputs into a single cohesive tutorial
  • When creating composite demos that pair terminal recordings with browser interactions
  • When arranging assets in vertical, horizontal, or grid layouts for clear demonstrations
  • When you must validate component outputs exist before running the composition
  • When you want to verify final output properties (size, dimensions) after generation

Quick Start

  1. Step 1: Create a manifest describing components and the desired layout
  2. Step 2: Run the FFmpeg-based composition tool with the manifest to produce the output
  3. Step 3: Verify the final file exists and review its dimensions and quality

Best Practices

  • Define a clear manifest with all components, their sources, outputs, and the desired layout
  • Validate that every component output exists before executing the FFmpeg command
  • Start with a simple layout (e.g., 2x1) and iterate to more complex grids
  • Use layout options like padding and background color to improve readability
  • After generation, verify the final file’s dimensions and file size match expectations

Example Use Cases

  • A 2x2 grid combining terminal recordings and a browser demo for a product walkthrough
  • Side-by-side video and terminal transcript to document a CLI workflow
  • Vertical stack of GIFs showing step-by-step instructions for a setup guide
  • A mixed media tutorial with a colored background to separate components
  • Sequential concatenation of tutorial clips into a single narrated guide

Frequently Asked Questions

Add this skill to your agents

Related Skills

Sponsor this space

Reach thousands of developers