---
name: ffmpeg-alpha-overlays
description: Encode transparent RGBA PNG sequences (and optional 48 kHz SFX audio) into true alpha-channel Apple ProRes 4444 (.mov, yuva444p10le) for DaVinci Resolve/Premiere/Final Cut and WebM VP9 (.webm, yuva420p with -auto-alt-ref 0) for Chrome, Firefox, and OBS, verified via ffprobe. Use when exporting animated logo stings, lower-thirds, or transparent UI overlays.
---

# FFmpeg Transparent WebM & ProRes 4444 Overlay Playbook

## 1. Verify Input Frames Actually Contain an Alpha Channel
Never encode before checking that source PNGs are `rgba` (not opaque `rgb24`):
```bash
ffprobe -v error -select_streams v:0 -show_entries stream=pix_fmt,width,height -of compact=p=0 frames/frame_0001.png
```
Must report `pix_fmt=rgba` (or `rgba64be`). If `rgb24`, stop and tell the user to re-render with transparent background enabled.

## 2. Encode Editing-Bay Master (Apple ProRes 4444 `.mov`)
Universal NLE master for DaVinci Resolve, Premiere Pro, After Effects, and Final Cut Pro:
```bash
ffmpeg -y -framerate "${FPS:-30}" -i frames/frame_%04d.png -i sfx_48k.wav \
  -c:v prores_ks -profile:v 4444 -pix_fmt yuva444p10le -alpha_bits 16 \
  -c:a pcm_s16le -ar 48000 -shortest \
  overlay_alpha_prores4444.mov
```
*(Omit `-i sfx_48k.wav -c:a pcm_s16le -ar 48000 -shortest` and add `-an` for silent overlays.)*

## 3. Encode Web & OBS Overlay (WebM VP9 `.webm`)
CRITICAL: Always include `-auto-alt-ref 0` alongside `-pix_fmt yuva420p` so `libvpx-vp9` preserves the separate alpha channel cleanly across browsers and OBS:
```bash
ffmpeg -y -framerate "${FPS:-30}" -i frames/frame_%04d.png -i sfx_48k.wav \
  -c:v libvpx-vp9 -pix_fmt yuva420p -b:v 2M -auto-alt-ref 0 \
  -c:a libopus -b:a 128k -shortest \
  overlay_alpha_web.webm
```

## 4. Mandatory ffprobe Alpha Verification Gate
Always inspect BOTH output files before finishing (note that `ffprobe` needs `-c:v libvpx-vp9` to expose VP9's `yuva420p` alpha channel plus Matroska `alpha_mode=1`):
```bash
ffprobe -v error -select_streams v:0 -show_entries stream=codec_name,pix_fmt -of compact=p=0 overlay_alpha_prores4444.mov
ffprobe -v error -c:v libvpx-vp9 -select_streams v:0 -show_entries stream=codec_name,pix_fmt:stream_tags=alpha_mode -of compact=p=0 overlay_alpha_web.webm
```
Expected results:
- `.mov`: `codec_name=prores|pix_fmt=yuva444p12le` (or `yuva444p10le`)
- `.webm`: `codec_name=vp9|pix_fmt=yuva420p|tag:alpha_mode=1`
*(Note: Safari `<video>` elements require HEVC with alpha inside `.mov` for transparent web playback; mention this explicitly if the user targets iOS Safari web overlays.)*
