How to add compression artifacts with Claude

At one second the shot turns to badly streamed video, the holographic backdrop breaking into 24-pixel blocks of banded color and the bottle's label text smearing to a blur, until it comes back crisp at five seconds.

Get this effect

  1. Switch to Code in your Claude Desktop App

  2. Install the skill (once)

    Show the prompt
    Install the Recharm video effects skill: download https://recharm-growth-staging.s3.us-east-2.amazonaws.com/website/downloads/recharm-video-effects.zip and unzip it into ~/.claude/skills
  3. Ask for the effect

    Add compression artifacts to input.mp4
    How much smaller the damaged copy is encoded; each 8-pixel block shows up this many times bigger: 3
    MPEG-2 quantizer, 2 (clean) to 31 (worst): 31

Several videos, several effects, one ask

Put your clips in the folder, mention them with @, and ask for everything at once. Claude runs one tested script after another on each clip, then joins them.

Add compression artifacts to @clip1.mp4, put a sale badge on @clip2.mp4, give @clip3.mp4 a VHS look, then join all three with crossfades.

Settings you can change

Ask Claude to change any of these, or edit them at the top of the command.

SettingDefaultWhat it does
SHRINK3How much smaller the damaged copy is encoded; each 8-pixel block shows up this many times bigger.
QUALITY31MPEG-2 quantizer, 2 (clean) to 31 (worst). Lower it for subtler damage.
START1.0Second the artifacts kick in.
END5.0Second the picture comes back clean.

Without the skill

Don’t want to install the skill? Paste this prompt into Claude Code and Claude writes the command itself.

Show the prompt
In input.mp4 (540x960, 30fps), make the shot look like heavily compressed video from 1.0 to 5.0 seconds, with ffmpeg in two steps. First, shrink a copy to one third size (180x320, area scaling) and re-encode it with no audio at the worst MPEG-2 quality: -c:v mpeg2video -qmin 31 -q:v 31 -g 30 -bf 0, at 30fps, into a temporary .mkv file (not .mpg, whose timestamps drift). Second, scale that damaged copy back up 3x to 540x960 with nearest-neighbor scaling so each 8-pixel encoder block becomes a flat-edged 24x24 square, and overlay it at 0,0 on the original only between 1.0 and 5.0 seconds (overlay with shortest=1); before 1.0 and after 5.0 seconds the video must be untouched. Output H.264 yuv420p at 30fps, 6 seconds, same size, keeping the original audio. There's no text to draw, but if you add any, draw it with Pillow, not ffmpeg's drawtext. Save it as output.mp4.

Run it without Claude

This is the exact command we tested. Save it as compression-artifacts.sh and run:

sh compression-artifacts.sh input.mp4 output.mp4
Show the command
#!/bin/sh
# Compression artifacts: from 1s to 5s the shot looks crushed by a starved encoder, all blocky squares,
# banded color and smeared detail, then it comes back clean.
# Usage: sh compression-artifacts.sh input.mp4 output.mp4
# Needs ffmpeg.
set -e
IN="$1"; OUT="$2"
SHRINK=3     # encode at 1/3 size so each 8-pixel block shows up as a 24-pixel square
QUALITY=31   # MPEG-2 quantizer, 2 (clean) to 31 (worst); 31 bands color and wipes out detail
START=1.0    # second the artifacts kick in
END=5.0      # second the picture comes back clean

TMP=$(mktemp -d)
trap 'rm -rf "$TMP"' EXIT
DAMAGED="$TMP/damaged.mkv"

# 1. Re-encode a small copy as badly as MPEG-2 allows: one keyframe a second, the frames between built from it.
ffmpeg -y -v error -i "$IN" -an -vf "scale=iw/$SHRINK:ih/$SHRINK:flags=area,fps=30" \
  -c:v mpeg2video -qmin $QUALITY -q:v $QUALITY -g 30 -bf 0 "$DAMAGED"

# 2. Blow it back up with hard pixel edges so the blocks stay square, and lay it over the clean clip between START and END.
ffmpeg -y -v error -i "$IN" -i "$DAMAGED" -filter_complex \
  "[1:v]scale=iw*$SHRINK:ih*$SHRINK:flags=neighbor[bad];\
[0:v][bad]overlay=0:0:shortest=1:enable='between(t,$START,$END)',fps=30,format=yuv420p[v]" \
  -map "[v]" -map 0:a? -c:v libx264 -crf 18 -c:a copy "$OUT"

Find 3x winning ads

Recharm cuts your ad footage into tagged, searchable clips: hooks, testimonials, product shots. Find the shots that win, add the effect with Claude, and ship 3x more ad edits.

Start 14-day free trial