---
name: unzebra
description: Removes camera zebra-stripe exposure warnings that were recorded into a video. One CLI (unzebra) uploads a local video, finds the striped windows, makes a free 12-second side-by-side sample, and after the user approves the price repairs the whole video and downloads it. Use when a user says their footage has zebra stripes, zebra pattern or exposure-warning stripes baked in.
---

# Unzebra agent skill

Source: https://unzebra.com/agent/SKILL.md (always current). CLI: https://unzebra.com/agent/unzebra.js. Website: https://unzebra.com.

| You need to | Go to |
|---|---|
| Decide whether this tool fits the request | #when-to-use |
| Install the command | #install |
| Credentials (you never touch a key) | #credentials |
| Run it: every command with example output | #commands |
| Prices and limits | #limits-and-cost |
| Exit codes and what to do | #exit-codes |
| Judge a result, retry, or give up | #judging-results |
| What to tell the user when it fails | #what-to-tell-the-user |

## When to use

Unzebra removes the zebra pattern: the diagonal stripes a camera or field monitor draws over over-exposed areas as a warning, which ended up in the recording (HDMI output with overlays on, a screen recording, a stream). It detects the striped regions frame by frame and repairs them, keeping the original picture and colour.

Use it for requests like:
- "My interview was recorded with zebras on, can you get rid of the stripes?"
- "The livestream recording has those diagonal exposure lines on the faces."
- "Clean HDMI was off on the A-cam, the stripes are burned into the footage."

Do not use it for:
- Moiré, LED-wall banding or flicker, focus peaking, burned-in text, logos or timecode. Those are different problems; Unzebra does not fix them.
- Still images, or audio.
- Footage where the stripes were only in the viewfinder and the file is clean. Ask the user to look first, or run a free scan.
- Editing, trimming, colour grading or exporting to another format. The output is the same video with the stripes repaired.

## Install

One file, no dependencies, Node 18 or later. ffprobe is used when present, not required.

```bash
mkdir -p ~/.local/bin
curl -fsSL https://unzebra.com/agent/unzebra.js -o ~/.local/bin/unzebra
chmod +x ~/.local/bin/unzebra
unzebra version
```

`unzebra version` prints the version. `unzebra help` prints every option.

## Credentials

You do not need to, and must not, read, ask for, or print any key. The command finds its own credential, in this order, and never writes it to disk or prints it:

| Order | Where | What |
|---|---|---|
| 1 | `UNZEBRA_AGENT_API_KEY` | Agent key. Exchanged on every run for a short-lived token. Checked first. |
| 2 | `UNZEBRA_API_KEY` | Personal API key (starts with XJP_), sent as the Bearer token. |
| 3 | `UNZEBRA_SECRET_REF` | ns/KEY read through `xjp secret get` when neither key is set. Same as --secret-ref. Defaults to unzebra-agent/BOT_API_KEY when the xjp CLI is installed. |

If the command exits 2, the credential is missing or refused: stop and tell the user (see #exit-codes). Other settings, normally left alone: `UNZEBRA_API_BASE` (API host. Default https://asr.xiaojins.com); `UNZEBRA_AUTH_BASE` (Token exchange host. Default https://auth.xiaojins.com); `UNZEBRA_CLIENT_ID` (OAuth client the agent key is exchanged under. Default unzebra).

Everything runs on the credential owner's Unzebra account and spends its balance.

If a key may have leaked, delete the agent and create a new one; a reset does not end sessions already opened with the old key.

## Commands

Input is a local video file path the user gave you. Results are written to `--out <dir>` (default: the current folder); use a dedicated folder next to the input, e.g. `--out ./unzebra-out`. Add `--json` and read stdout as JSON; progress lines go to stderr (`--quiet` silences them).

```text
unzebra repair <file> [--sample <start_s>,<end_s>] [--full] [--yes]
               [--out <dir>] [--name <stem>] [--no-wait] [--timeout <s>] [--quiet] [--json]
unzebra quote <file|upload_id> [--json]
unzebra job get <job_id> [--full] [--json]
unzebra jobs [--limit <n>] [--json]
unzebra export <job_id> [--out <dir>] [--name <stem>] [--json]
unzebra whoami [--json]
unzebra version | help
```

The usual flow: scan (free), sample the worst window (free), show the user the side-by-side file, get approval for the price, then repair the whole video.

### 1. Scan: where the stripes are and what the whole video costs (free)

```bash
unzebra repair interview.mov --json
```

```json
{
  "upload_id": "…",
  "analyze_job_id": "…",
  "source": { "duration_s": 183, "width": 1920, "height": 1080, "fps": 25 },
  "windows": [
    { "start_s": 40, "end_s": 50, "score": 0.91 },
    { "start_s": 100, "end_s": 110, "score": 0.62 }
  ],
  "quote": { "usd": "$12.00", "usd_cents": 1200, "minutes_billed": 4, "duration_s": 183,
             "min_applied": false, "too_long": false, "rate_usd_per_minute": "3.00", "minimum_usd": "9.99" },
  "charged": false
}
```

`windows` are listed worst first; `score` is the share of the frame covered by stripes. An empty list means none were found.

### 2. Free sample of one window (up to 12 seconds)

```bash
unzebra repair interview.mov --sample 40,50 --out ./unzebra-out --json
```

```json
{
  "job_id": "…",
  "kind": "sample",
  "status": "completed",
  "charged_usd": "0.00",
  "available_until": "…",
  "files": {
    "video": "unzebra-out/interview.sample-40-50.unzebra.mp4",
    "sbs": "unzebra-out/interview.sample-40-50.sbs.mp4"
  }
}
```

`video` is the repaired clip; `sbs` is a side-by-side comparison, original on the left and repaired on the right. Uploading the same file again is recognised and skipped.

### 3. Whole video: price first, then charge only with --yes

```bash
unzebra repair interview.mov --full --json
```

Prints the quote with `"charged": false` and exits 0. Nothing is charged. Show the user the `usd` amount and wait for an explicit yes. Then:

```bash
unzebra repair interview.mov --full --yes --out ./unzebra-out --json
```

```json
{
  "job_id": "…",
  "kind": "full",
  "status": "completed",
  "charged_usd": "12.00",
  "files": { "video": "unzebra-out/interview.unzebra.mp4", "sbs": "unzebra-out/interview.sbs.mp4" }
}
```

Long videos take a while; the command waits (default timeout 3600 s, `--timeout <s>` to change). With `--no-wait` it prints `job_id` and returns at once.

### 4. Other commands

| Command | Does | Output |
|---|---|---|
| `unzebra quote interview.mov --json` | Price only (uploads and scans if needed). Also takes an upload_id. | The `quote` object above. |
| `unzebra export <job_id> --out ./unzebra-out --json` | Downloads a finished job's files again with fresh links; waits if it is still running. Works for 7 days after the job finished. | `{ "job_id", "kind", "available_until", "files": { "video", "sbs" } }` |
| `unzebra job get <job_id> --json` | One job: status, progress, charge, error. `--full` adds the windows and the signed links. | `{ "id", "kind", "status", "progress", "credits_charged", "error", … }` |
| `unzebra jobs --limit 10 --json` | Recent jobs, newest first. | An array of jobs. |
| `unzebra whoami --json` | Who the credential is and the balance in dollars. | `{ "credential": "agent", "user_id", "balance_usd": "43.21" }` |
| `unzebra version` | Version. | `0.1.0` |

Download links inside a job expire after about 15 minutes; never hand them to the user as permanent. Use `export` to fetch fresh files.

## Limits and cost

All prices are in US dollars, taken from the user's Unzebra balance.

- Scan: free.
- Scan: 10 per account per UTC day; scanning a video that was already scanned does not count, and neither does scanning again after `analysis_stale` (the command does that once by itself).
- Sample: free, up to 12 seconds each, 3 per account per day.
- Whole video: $3.00 per minute of video, rounded up to the next whole minute, minimum $9.99 per video. A 4-minute clip is $12.00; a 2-minute clip is $9.99.
- One job takes up to 60 billed minutes. Files up to 16 GiB.
- One continuous shot per job. Cuts between cameras or scenes are not supported yet and can leave marks around the cut: have the user trim the recording and send only the part that needs repair. For an urgent job that needs a person, the user emails support@unzebra.com.
- Up to 60 fps, a video is billed by its length. Above 60 fps, repair works frame by frame, so the video is billed by its frames counted at 60 frames per second: a 2-minute clip at 120 fps is billed as 4 minutes. One job takes up to 60 billed minutes. After the scan the quote carries `billing.note` when this applies; show that sentence next to the price.
- The quote is the price that will be charged when its length was measured by the scan. When the quote says `estimate` (JSON `estimate: true`, `duration_source: "declared"`), it was worked out from the length the browser or CLI reported; the charge follows the measured length, and the amount printed after `--yes` (`charged`) is the one that counts. Tell the user it is an estimate.
- A whole-video job that fails is returned to the balance automatically.
- Results are kept 7 days after the job finishes.
- The balance is topped up by the user at https://unzebra.com/pricing (packs of $9.99, $29.99, $79.99). You cannot top it up.

**The whole-video repair charges money. Always run `--full` without `--yes` first, show the user the price, and add `--yes` only after the user explicitly approves that amount.**

## Exit codes

| Code | Meaning | What to do |
|---|---|---|
| 0 | Success. Also returned when --full stops after printing the price because --yes was not given. | Read stdout (use --json). If the price was printed, show it to the user and wait for approval. |
| 1 | Usage error: a missing argument, an unreadable file, a file over 16 GiB, a sample window longer than 12 seconds. | Fix the command. Do not retry it unchanged. |
| 2 | Credential refused (401, or 403 without repair access or with a key from another site, wrong_station; a refused key exchange answers 400 invalid_grant at the auth token endpoint), or no credential found. | Stop. Tell the user the Unzebra agent key is missing or no longer valid; they manage it at unzebra.com/account/api. |
| 3 | The job cannot be done as asked: the repair failed, the video is too long or unreadable, the upload expired or was not found, the upload or job belongs to another account, or today's free scans or samples are used up. | Do not retry the same command. Tell the user the reason printed on stderr. |
| 4 | The balance does not cover the repair. | Tell the user the price and that the balance is short; they add to it at unzebra.com/pricing. Run the same command again only after they say they have. |
| 5 | Timed out while waiting. The job keeps running. | Run the `unzebra export <job_id>` command printed on stderr, later, to collect the result. Do not start the job again. |
| 6 | API or network error, including repairs being switched off for a while. | Wait a few minutes and retry once. If it fails again, tell the user the service is unavailable right now. |

The reason is always printed on stderr, prefixed with `unzebra:`.

## Judging results

Open the side-by-side file (`sbs`) and compare left (original) with right (repaired):
- The diagonal stripes are gone from the bright areas: faces, skies, windows, white shirts.
- No blotches, smears or flat patches where the stripes were; texture such as skin and fabric is still there.
- Colours and brightness outside the striped areas are unchanged.
- Moving subjects stay clean across the clip, not only in some frames.

If the sample is good, the whole video will be repaired the same way; offer the full repair with its price.

If the sample is not good:
1. Try another window: the next one in `windows`, or a moment the user points to (`--sample <start>,<end>`, at most 12 s). Different lighting can behave differently.
2. If stripes remain after two different windows, stop. Do not run the full repair. Tell the user honestly (see below) and suggest they send the clip through the Feedback button on https://unzebra.com.

Give up at once, without retrying, on: no_stripes_detected, not_a_video, unsupported_frame_rate and frame_count_mismatch (the user re-exports first), source_too_long (suggest splitting), the daily scan limit, source_changed (upload again instead), paid_duration_exceeded (new price first), a video over 60 minutes (suggest splitting), the daily sample quota, a refused credential. For the other failure codes, retry once as the table below says, then stop.

## What to tell the user

Plain sentences you can use; replace $X with the quoted price.

When a job fails (exit 3), stderr names the code in parentheses after `failed`. Say what happened, then the next step. Only `no_stripes_detected`, `not_a_video`, `unsupported_frame_rate`, `frame_count_mismatch`, `source_too_long`, `source_changed` come from the video itself. `paid_duration_exceeded` fails at once without retries: get a new price (`--full` without `--yes`), show it to the user, and start again only after they approve it. Every other code is on Unzebra's side and was already retried automatically on other machines before the job failed, so retry it yourself at most once. For a whole-video job, add that the charge is returned to the balance automatically.

| Code | What happened | Next step |
|---|---|---|
| `no_stripes_detected` | The scan found no zebra stripes anywhere in this video, so there was nothing to repair. | If you can see stripes, send the clip through Feedback on unzebra.com. |
| `not_a_video` | The file could not be read as a video. | Export it again as MP4 or MOV and upload that file. |
| `unsupported_frame_rate` | The video's frame rate is outside what repair supports (1 to 240 fps). | Export it at a standard frame rate and upload it again. |
| `frame_count_mismatch` | The file is usually fine, but its frame count does not match its length and frame rate; this is common with interlaced footage. | Re-export it at its original frame rate, or deinterlace it, then upload it again. |
| `source_too_long` | The video is longer than one job takes (60 billed minutes), so it was refused before the scan. | Split it into shorter parts and upload each one. |
| `analysis_stale` | This scan was withdrawn: the repair measured more frames than were paid for, and the charge was returned. | Scan the video again; a new scan does not count toward the daily limit. |
| `source_changed` | The uploaded file was replaced after it was scanned, so the repair did not run on it. | Upload the video again and start from the scan. |
| `source_unavailable` | The uploaded file was no longer on the server when the job started. | Upload the video again. |
| `superseded` | An identical job finished first, and its result is the one to use. | Open that job in the job list and download its result. |
| `paid_duration_exceeded` | The video measured longer than the minutes that were paid for, so the repair stopped. | Get a new price for the whole video and start it again. |
| `output_verification_failed` | The repaired file failed its final check, even after retrying on other machines. | Try again later; if it fails again, contact support with the job id. |
| `insufficient_disk` | The processing machines ran out of disk space, even after retrying. | Try again later; if it fails again, contact support with the job id. |
| `source_download_failed` | The processing machines could not fetch the uploaded file, even after retrying. | Try again later; if it fails again, upload the video again. |
| `worker_unavailable` | No processing machine took the job in time. | Try again in a few minutes. |
| `worker_lost` | The processing machine stopped responding and no retries were left. | Try again in a few minutes. |
| `worker_shutdown` | The processing machines were shut down during the job, even after retrying. | Try again in a few minutes. |
| `tool_failed` | The repair tool failed on this video, even after retrying on other machines. | Try again later; if it fails again, contact support with the job id. |
| `worker_error` | The processing machines hit an error, even after retrying. | Try again later; if it fails again, contact support with the job id. |
| `invariant_violated` | The repair changed pixels outside the stripes, so the result was thrown away. | Try again later; if it fails again, contact support with the job id. |
| `bad_window` | The processing machines could not use the sample window, even after retrying. | Try a different window; if it fails again, contact support with the job id. |
| `bad_job` | The processing machines could not read the job request, even after retrying. | Start again from the upload; if it fails again, contact support with the job id. |
| `unsupported_kind` | The processing machines do not support this kind of job yet. | Try again later; if it fails again, contact support with the job id. |
| any other code | The repair did not finish. | Try again; if it fails again, contact support with the job id. |

Other situations:

| Situation | Say |
|---|---|
| Stripes remain in the sample | The free sample did not remove the stripes cleanly, so I did not pay for the whole video; this footage may be outside what the tool handles today. |
| Video too long (quote too_long, or 409 too_long) | This video is longer than the 60 minutes one repair takes; it needs to be split into shorter parts first. |
| Upload expired (409 upload_expired) | The uploaded copy expired on the server; I will upload the file again. |
| Balance short (exit 4) | The repair costs $X and your Unzebra balance does not cover it; you can add to it at unzebra.com/pricing. |
| Scan limit (exit 3, analysis_quota_exceeded) | Today's 10 free scans are used up; they reset at midnight UTC (stderr gives the exact time). Scans of a video already scanned do not count. |
| Sample quota (exit 3, sample_quota_exceeded) | Today's 3 free samples are used up; I can try again tomorrow, or repair the whole video now if you approve the price. |
| Timeout (exit 5) | The repair is still running; I will collect the result when it finishes. |
| Repairs switched off (exit 6, repair_unavailable) | Unzebra has paused repairs for now; nothing was charged for this attempt. I can try again later. |
| Service unavailable (exit 6) | Unzebra is not reachable right now; nothing was charged for this attempt. I can try again later. |
| Credential refused (exit 2) | The Unzebra agent key is missing or no longer valid; you can create or reset it at unzebra.com/account/api. If a key may have leaked, delete the agent and create a new one; a reset does not end sessions already opened with the old key. |

Support: support@unzebra.com (give the job id, never a key).
