# A video trim you can check before adding an AI agent

This is an original synthetic reference workflow created on 2026-09-04, not downloaded footage or a test of a named AI client.

## Available files

- `synthetic-source.mp4`: generated test pattern plus a 440 Hz tone; 12 seconds, 320 × 180 pixels, 25 fps, 300 decoded video frames.
- `synthetic-trim.mp4`: an actual re-encoded segment from 3 seconds through 7 seconds; 4 seconds, the same dimensions and frame rate, 100 decoded video frames.
- `video-workflow.sh`: the executed commands, using FFmpeg's built-in `testsrc2` and `sine` inputs. Run in an empty directory with FFmpeg installed; it preserves existing files with `-n`.
- `video-verification.json`: generated-file sizes, SHA-256 hashes, decoded frame counts and verification scope.

The pattern moves and the clip has sound. Start playback with your volume low. The media is deliberately small; it is not a codec, HDR, subtitle, speech, face detection or 4K stress test.

## What was actually verified

The script ran locally with FFmpeg 7.1 from the imageio-ffmpeg 0.6.0 macOS ARM64 wheel. Both complete files decoded successfully using `-xerror`. Video frame counts were measured by decoding: 300 and 100. The source and output each contain H.264 video and AAC audio. Byte sizes and hashes in the JSON refer to these particular files, not every possible build of FFmpeg.

No AI client, agent framework or directory-listed skill was installed or tested for this example. Browser playback and acoustic quality were not evaluated. The optional `ffprobe` command at the end of the script is provided for users who have it; this environment used FFmpeg decoding for verification instead.

## Reproduce the fixed workflow

1. Install an FFmpeg build with `libx264`, the AAC encoder, and the `testsrc2` / `sine` source filters. Check your chosen distributor and local executable before running commands.
2. Create an empty local working folder and put `video-workflow.sh` there. Run `sh video-workflow.sh`. If the executable is not on PATH, set `FFMPEG=/absolute/path/to/ffmpeg` for that command.
3. Confirm that the output is 4 seconds long and has 100 video frames at 25 fps. Inspect the beginning and end; retain the untouched source. A general media player duration display can be rounded, so use a stream/frame inspection when precise timing matters.
4. Compare an AI-assisted workflow against this fixed baseline only after it can produce the same bounded result. Keep the agent's proposed command, actual exit status and verification result separate.

## A proposed assistant instruction, not an executed client result

> Work only in a copy of this example folder. Inspect the source media first. Propose a command that retains seconds 3–7, keeps one video and one audio stream, and writes a new file without overwriting the source. Explain whether it copies streams or re-encodes. After an approved run, check the output's dimensions, frame rate, duration and video-frame count, then report what was actually verified. Do not upload media or claim to have watched or tested a file without doing so.

For this task a fixed script is already enough. An assistant may help explain a command or diagnose an error, but it does not establish a need for an autonomous agent.

## Why re-encode this example?

A stream-copy cut and a decoded/re-encoded cut have different timing and quality tradeoffs. This reference explicitly re-encodes; it is not advertised as lossless. It does not claim a frame-perfect stream-copy cut at arbitrary boundaries. Use representative copies of your own footage to investigate keyframes, variable frame rate, rotation metadata, multiple audio tracks and subtitles before adopting a workflow.

Primary references:
- FFmpeg command documentation: https://ffmpeg.org/ffmpeg.html
- FFmpeg source-filter documentation: https://ffmpeg.org/ffmpeg-filters.html
- Maintained Python wheel wrapper used for this verification: https://github.com/imageio/imageio-ffmpeg

The files are intentionally self-contained and use no API keys, network requests or personal footage.
