## TL;DR
Set `videoCompression: false` in your Cypress config to skip the ffmpeg compression step entirely. This is the fastest fix on minimal CI images where ffmpeg is missing or underpowered. If you need small video artifacts, install ffmpeg on the runner instead and keep compression on. The compression step runs after all specs pass, so a failure here fails an otherwise green run.

## Error
```text
Cypress failed to compress the video after the spec run finished.

Command failed with exit code 1: ffmpeg -i /tmp/runner/videos/login-spec.mp4 -vcodec libx264 -crf 32 /tmp/runner/videos/login-spec-compressed.mp4
```

## Steps
1. Open `cypress.config.js` (or `cypress.json` on Cypress 9 and older) and add `videoCompression: false` inside the `e2e` block. Expected: the config file contains the new option with no syntax errors.
2. Re-run the CI job. Expected: the run completes and uploads raw (larger) mp4 artifacts with no compression step in the log.
3. Optional: if artifact size matters, install ffmpeg on the runner image instead and leave compression enabled. Expected: the compression step logs success and produces smaller mp4 files.

## When to use
- Cypress exits non-zero on CI with a video or ffmpeg error after specs pass.
- The runner is a slim Docker image without ffmpeg installed.
- You want the quickest unblock and can accept larger video artifacts.

## When not to use
- Videos fail locally too (that points at a broken Cypress install, not CI).
- The failure is about screenshots, not video compression.
- You need compressed video artifacts and have time to fix the runner image properly.

## Tool compatibility
- Cypress 9 through 15 (the `videoCompression` config key exists in all of them).
- Any CI runner: GitHub Actions, GitLab CI, Jenkins, CircleCI.
- ffmpeg 4.x or 5.x if you choose the install-ffmpeg route.

## Variant phrasings
### ffmpeg exited with code 1 during cypress video processing
Same root cause: the post-run ffmpeg call failed. Disabling `videoCompression` skips it; installing ffmpeg fixes it.
### cypress could not compress video after spec run
Older Cypress wording for the same failure. Same fix applies.

## Why it happens
After the last spec finishes, Cypress shells out to ffmpeg to re-encode each video with libx264. Slim CI images often ship without ffmpeg, or the runner lacks the CPU and memory headroom for the encode, so the post-processing step exits non-zero and marks the whole run failed.

## Edge cases
- `videoCompression: false` but the error persists: check the log, the real failure is now earlier in the run.
- ffmpeg is installed but still fails: the runner may be OOM-killed during encoding, try a larger runner or disable compression.
- Videos are huge after disabling compression: set `video: false` for stable specs, or `videoUploadOnPasses: false` to keep video only for failures.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_rxCPowKZbHDx0unTgLG5qA
