home / skills / plurigrid / asi / media

media skill

/skills/media

This skill helps you automate media processing workflows using ffmpeg, imagemagick, and sox for video, image, and audio tasks.

npx playbooks add skill plurigrid/asi --skill media

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
772 B
---
name: media
description: Media processing = ffmpeg + imagemagick + sox.
metadata:
  trit: 1
---

# media

Media processing = ffmpeg + imagemagick + sox.

## Atomic Skills

| Skill | Domain |
|-------|--------|
| ffmpeg | Video/audio |
| imagemagick | Images |
| sox | Audio |

## Video

```bash
# Convert
ffmpeg -i in.mov -c:v libx264 out.mp4

# Resize
ffmpeg -i in.mp4 -vf scale=1280:-1 out.mp4

# GIF
ffmpeg -i in.mp4 -vf "fps=10,scale=320:-1" out.gif
```

## Audio

```bash
# Extract
ffmpeg -i video.mp4 -vn -c:a aac audio.m4a

# Convert
sox in.wav -r 44100 out.wav
```

## Image

```bash
# Resize
convert in.png -resize 800x600 out.png

# Format
convert in.png out.jpg
```

## Pipeline

```bash
ffmpeg -i in.mp4 -f image2pipe - | convert - -resize 50% out.gif
```

Overview

This skill bundles practical media processing tools: ffmpeg for video/audio, ImageMagick for images, and SoX for audio. It provides concise commands and patterns to convert, resize, extract, and pipeline media tasks for automation and batch processing. Use it to build reproducible media workflows from single commands to chained pipelines.

How this skill works

The skill exposes atomic capabilities: ffmpeg handles transcoding, format conversion, frame extraction, and filters for video and audio. ImageMagick (convert) performs image format changes, resizing, and image composition. SoX performs audio resampling, format conversion, and basic effects. Commands can be combined via pipes to stream data between tools without intermediate files.

When to use it

  • Transcoding video or audio to web-friendly formats (H.264/AAC, MP4/M4A).
  • Batch resizing or reformatting images for thumbnails or responsive sites.
  • Extracting audio from video or converting sample rates and codecs.
  • Generating animated GIFs or frame sequences from video clips.
  • Building automated pipelines that stream frames/images between tools.

Best practices

  • Always test commands on a short sample file before batch processing large datasets.
  • Prefer streaming via pipes for memory-efficient pipelines and fewer temp files.
  • Specify codecs and quality settings explicitly (e.g., -c:v libx264, -crf) for reproducible output.
  • Preserve original metadata when needed; strip it intentionally when not required.
  • Use lossless intermediates only when necessary to avoid quality degradation.

Example use cases

  • Convert a ProRes .mov to a web-ready MP4: ffmpeg -i in.mov -c:v libx264 out.mp4.
  • Create a GIF thumbnail from a clip: ffmpeg -i in.mp4 -vf "fps=10,scale=320:-1" out.gif.
  • Extract podcast audio from video: ffmpeg -i episode.mp4 -vn -c:a aac episode.m4a.
  • Resize and change format for images: convert in.png -resize 800x600 out.jpg.
  • Stream frames into ImageMagick for batch processing: ffmpeg -i in.mp4 -f image2pipe - | convert - -resize 50% out.gif.

FAQ

When should I use SoX instead of ffmpeg for audio?

Use SoX for advanced audio effects, precise resampling, and waveform edits; use ffmpeg for container-aware transcoding and when working with video+audio together.

Can I avoid quality loss when converting formats?

Use lossless codecs or higher bitrate/quality settings and avoid repeated lossy transcodes. Keep a high-quality master and produce derived files from it.