How to Disable Frame Deduplication with the `--no-dedup` Flag in Claude-Video

Add --no-dedup to your watch command to skip the perceptual deduplication step and preserve every extracted frame from the video.

The claude-video repository provides a watch skill that extracts frames from video sources for analysis. By default, this process collapses near-duplicate frames using a perceptual hashing algorithm to reduce redundancy. When you need to retain every single frame—such as for high-precision timestamp analysis or subtle motion detection—you can disable this behavior using the command-line flag.

What Frame Deduplication Does in Claude-Video

Frame deduplication is a greedy pixel-difference check that runs on down-scaled thumbnails after extraction. According to the source code in bradautomates/claude-video, the logic lives in skills/watch/scripts/frames.py, specifically within the dedupe_perceptual function and its helper _dedupe_by_deltas.

This step compares consecutive frames and drops those with minimal visual changes. While this keeps frame counts manageable for AI context windows, it can inadvertently remove frames containing subtle but important visual information.

How the --no-dedup Flag Works

The argument parser in skills/watch/scripts/watch.py (around lines 64-75) defines the flag:

parser.add_argument(
    "--no-dedup",
    action="store_true",
    help="Do not collapse near-duplicate frames",
)

When invoked, the flag sets args.no_dedup to True, which inverts the logic to set dedup = False. This boolean propagates through the frame-selection pipeline. When dedup=False, the code skips the call to dedupe_perceptual, meaning the pipeline retains all extracted frames without dropping any as "near-duplicates."

Command-Line Usage

Run the watch command with the flag to disable deduplication entirely:


# Default behavior with deduplication enabled

watch https://example.com/video.mp4

# Disable deduplication to keep every frame

watch https://example.com/video.mp4 --no-dedup

The flag works with local files and URLs alike, ensuring that the subsequent analysis receives the complete frame sequence.

Verifying Deduplication is Disabled

The test suite confirms this behavior in two key locations.

Integration testing in tests/test_watch.py contains test_no_dedup_preserves_static_frames. This test runs the watch command with --no-dedup on a static video and verifies that the output contains more than one frame, confirming that the deduplication step was bypassed.

Unit testing in tests/test_dedup.py validates that when dedup=False is passed to the frame engine, the metadata field deduped_count remains 0 and the selected frame count matches the total extracted frames.

When to Disable Frame Deduplication

Disable deduplication when:

  • Analyzing subtle visual changes that the perceptual hash might classify as duplicates
  • Preserving exact timestamps for frame-level synchronization
  • Processing low-framerate content where every frame carries distinct information
  • Debugging frame extraction to ensure no data is lost before analysis

Summary

  • The --no-dedup flag disables the dedupe_perceptual function in skills/watch/scripts/frames.py
  • When used, the pipeline skips the _dedupe_by_deltas helper and retains all extracted frames
  • The flag sets dedup=False, which results in deduped_count: 0 in the output metadata
  • Tests in tests/test_watch.py and tests/test_dedup.py verify that static videos preserve all frames when the flag is active

Frequently Asked Questions

What happens to the metadata when I use --no-dedup?

When deduplication is disabled, the metadata field deduped_count is set to 0 and the selected_frames count equals the total number of frames extracted from the video source.

Can I disable deduplication when using the Python API directly?

Yes. When calling the frame extraction functions programmatically from skills/watch/scripts/frames.py, pass dedup=False to bypass the dedupe_perceptual call and retain all frames in the returned collection.

Why does the watch skill deduplicate frames by default?

The default deduplication reduces the number of frames passed to language models, optimizing for token usage and context window limits while preserving meaningful visual changes through the perceptual hashing algorithm in _dedupe_by_deltas.

Does --no-dedup affect video download or frame extraction speed?

No. The flag only affects the post-processing deduplication step. Video download and frame extraction occur at the same speed; however, disabling deduplication increases the final frame count, which may slow down subsequent AI analysis due to larger input sizes.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →