home / skills / bobmatnyc / claude-mpm-skills / media-transcoding

This skill automates FFmpeg-based media transcoding with preset-driven workflows, backups, and logs to deliver consistent web, mobile, and archive outputs.

npx playbooks add skill bobmatnyc/claude-mpm-skills --skill media-transcoding

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

Files (2)
SKILL.md
2.7 KB
---
name: media-transcoding
description: FFmpeg-based media transcoding workflows with preset-driven conversions, batch processing, and safe backups for web/mobile/archive outputs.
version: 1.0.0
category: toolchain
author: Claude MPM Team
license: MIT
progressive_disclosure:
  entry_point:
    summary: "Use FFmpeg presets to convert videos for web/mobile/archive with batch scripts, backups, and faststart MP4s."
    when_to_use: "Optimizing video files for web delivery, compressing large media libraries, or standardizing outputs with repeatable presets."
    quick_start: "1. Run ./ffmpeg_convert.sh check 2. Convert one file with web_standard 3. Batch convert with batch_web_standard"
tags:
  - ffmpeg
  - media
  - video
  - transcoding
  - encoding
---

# Media Transcoding (FFmpeg)

## Overview

Use FFmpeg presets to normalize video outputs for web streaming, mobile delivery, or archival quality. Your `hf-videos` repo already includes a simple bash script and a more advanced Python script with presets, backups, and logging.

## Quick Start (hf-videos)

```bash
./ffmpeg_convert.sh check
./ffmpeg_convert.sh web_standard "My Video.mp4"
./ffmpeg_convert.sh batch_web_standard
```

Outputs are written to `converted/` with backups in `backup/` and logs in `conversion.log`.

## Preset Summary (hf-videos)

- **web_standard**: 1080p max, CRF 23, 128k audio, `+faststart`
- **web_high**: 1080p max, CRF 20, 192k audio
- **mobile**: 720p max, CRF 25, 96k audio
- **ultra_compact**: 480p max, CRF 28, 64k audio
- **archive**: original res, CRF 18, 256k audio

All presets use H.264 + AAC with `+faststart` for streaming-friendly MP4s.

## Batch Workflow

1. Run a single-file conversion first to validate output.
2. Run batch conversion once the preset is confirmed.
3. Verify output sizes and playback.

Batch commands:

```bash
./ffmpeg_convert.sh batch_web_standard
./ffmpeg_convert.sh batch_mobile
./ffmpeg_convert.sh batch_ultra_compact
```

## Advanced Script (convert_video.py)

Use `convert_video.py` when you need:

- Progress monitoring
- Metadata inspection
- Overwrite control
- Preset listing and batch automation

```bash
python3 convert_video.py --list-presets
python3 convert_video.py --file "My Video.mp4" --preset web_standard
python3 convert_video.py --preset mobile --overwrite
```

## Output Conventions

- Converted files use suffixes like `_web_standard`.
- Backups preserve original filenames.
- Logs go to `conversion.log` for audit and troubleshooting.

## Troubleshooting

- **FFmpeg missing**: `brew install ffmpeg` (macOS) or install from ffmpeg.org.
- **Permission errors**: `chmod +x ffmpeg_convert.sh`.
- **Disk pressure**: clean `converted/` and `backup/` after validation.

## Related Skills

- `toolchains/universal/infrastructure/docker`

Overview

This skill provides FFmpeg-based media transcoding workflows with preset-driven conversions, batch processing, and safe backups for web, mobile, and archive outputs. It standardizes encoding with ready-made presets and writes converted files and backups to dedicated folders while logging every operation. The goal is reliable, repeatable media preparation for streaming, delivery, and long-term storage.

How this skill works

The skill exposes preset profiles that map resolution, CRF, audio bitrate, and container flags to common delivery targets (web_standard, mobile, archive, etc.). It can run single-file conversions for validation or batch jobs for bulk processing, creating backup copies of originals and writing conversion logs for audit. An advanced Python utility adds progress reporting, metadata inspection, overwrite control, and preset listing to automate safe pipelines.

When to use it

  • Prepare videos for web streaming or CDN delivery with streaming-friendly MP4 flags
  • Create mobile-optimized versions with lower resolution and bitrate for constrained devices
  • Produce compact previews or proxies for rapid review and collaboration
  • Generate archival-quality masters with higher bitrates for long-term storage
  • Run bulk conversions after validating a single-file preset
  • Automate conversion tasks in CI or media toolchains

Best practices

  • Always run one single-file conversion to validate the preset before batch processing
  • Keep originals backed up in a separate folder before overwriting or deleting files
  • Use the archive preset to produce a high-quality master before creating delivery variants
  • Monitor disk usage and clean converted/backup folders after verification to avoid disk pressure
  • Log and version your preset set so encoding parameters remain reproducible

Example use cases

  • Convert a camera master to a streaming-friendly MP4 with faststart for CDN delivery
  • Batch-generate mobile and compact proxy files for a large footage intake
  • Create an archive-quality copy at higher bitrate while also producing a low-bandwidth preview
  • Integrate the preset list and conversion CLI into a media CI pipeline for automated releases
  • Run metadata inspection and progress reporting during long transcodes to track job status

FAQ

What codecs and containers are used by default?

Presets use H.264 video with AAC audio in MP4 containers and include streaming-friendly flags like +faststart by default.

How do I avoid losing originals during batch jobs?

The workflow always writes backups to a backup folder before overwriting; validate a single-file run first and verify backups exist before deleting originals.