How to Disable Near-Duplicate Frame Removal in claude-video Using the --no-dedup Flag

To disable near-duplicate frame removal in claude-video, invoke the watch command with the --no-dedup flag, which sets the internal dedup parameter to False and bypasses the dedupe_perceptual filtering logic.

The claude-video toolkit automatically collapses visually identical frames during video processing to reduce noise and token consumption. By default, the watch entry point analyzes extracted frames for perceptual similarity and drops redundant images before analysis. You can override this behavior and preserve every frame using the --no-dedup argument.

How the --no-dedup Flag Controls Frame De-duplication

Argument Parsing in watch.py

In skills/watch/scripts/watch.py, the command-line interface defines the --no-dedup boolean flag at lines 64–68. When present, this argument sets args.no_dedup to True.

The script then inverts this value when calling frame-extraction functions such as extract_keyframes and extract_scene_or_uniform:

dedup=not args.no_dedup

This logic appears around lines 212–224, ensuring that the flag's presence translates to dedup=False downstream.

Conditional Logic in frames.py

The actual de-duplication logic resides in skills/watch/scripts/frames.py. Frame extraction functions accept a dedup parameter that defaults to True, but when passed as False, they skip the perceptual hashing comparison:

if dedup:
    frames, n_dropped = dedupe_perceptual(frames)

This conditional check appears at multiple points in the file (lines 443, 560, and 665–670), allowing the pipeline to retain duplicate frames when the flag is active.

Practical Usage Examples

Default Behavior (De-duplication Enabled)

By default, claude-video removes visually identical frames automatically:

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

The output report includes a deduped count showing how many frames were removed as duplicates.

Disable Frame Removal

To keep every extracted frame—including static screen recordings or held slides—add the --no-dedup flag:

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

The final report will show deduped: 0, preserving all visual data for analysis.

Combining with Other Options

The flag works alongside other extraction parameters such as --detail and --resolution:

watch https://example.com/video.mp4 \
      --detail efficient \
      --resolution 720 \
      --no-dedup

This configuration extracts keyframes at 720-pixel width using efficient sampling while retaining all near-duplicates.

Verification and Testing

The repository includes tests verifying this behavior. In tests/test_watch.py, the test_no_dedup_preserves_static_frames test (lines 82–84) validates that invoking the command with --no-dedup retains multiple visually identical frames. Additionally, tests/test_dedup.py contains unit tests confirming that passing dedup=False correctly skips the dedupe_perceptual function.

Summary

  • The --no-dedup flag inverts the default dedup=True behavior in claude-video.
  • In skills/watch/scripts/watch.py, the flag is parsed and passed as dedup=not args.no_dedup to extraction functions.
  • In skills/watch/scripts/frames.py, conditional checks prevent calls to dedupe_perceptual when the flag is active.
  • Use this option for static content, slide decks, or when pixel-perfect frame retention is required for analysis.

Frequently Asked Questions

When should I use the --no-dedup flag?

Use --no-dedup when processing videos with static content such as screen recordings, presentation slides, or security footage where every frame might contain subtle but important changes. Disable de-duplication when analyzing motion-heavy content only if visual redundancy would waste tokens without adding analytical value.

Does disabling de-duplication affect processing performance?

Yes. Retaining near-duplicate frames increases the total number of images passed to the analysis pipeline, which consumes more tokens and processing time. The trade-off is necessary only when visual continuity or static screen states must be preserved for detailed examination.

What is the difference between --no-dedup and changing the --detail level?

The --detail parameter controls frame extraction density (how many frames are sampled from the video timeline), while --no-dedup determines whether visually identical frames are collapsed after extraction. You can use efficient detail sampling with de-duplication disabled to capture sparse but unique frames, or dense sampling with de-duplication enabled for motion analysis.

How can I verify that de-duplication is actually disabled?

Check the final report output from the watch command. When --no-dedup is active, the deduped count will display 0. Alternatively, examine the intermediary frame files in the temporary output directory to confirm that consecutive visually identical frames have not been removed from the sequence.

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 →