dsh-video-clone: Container-Level GUID-Tagged Unique Video Distribution

Introduction

When distributing the same asset across multiple accounts and channels, the requirement is often “files must be distinguishable, but the visuals must remain unchanged”: each file needs a different hash for reconciliation and traceability, yet re-encoding or modifying the video is forbidden, as that introduces costs and risks to visual quality. Common practices involve renaming files or using external manifests, but once files are copied or renamed, the mapping between the delivery chain and the account is easily lost.

DeepSeek Harness (DSH) decomposes capabilities into loadable plugins. Below we introduce the community plugin dsh-video-clone (Maintainer: 2015215218, Category: Client): On the premise of modifying only the container without touching the bitstream, it clones a single video into N copies, writes a unique GUID into each, and produces a traceability ledger mapping guid→file→label. It also provides DSH tools, a Web workbench panel, and a CLI. See SkillHub for the directory page, and GitHub for source code and documentation (MIT, Node.js ≥ 18, current package version 1.0.0).

What is this

In one sentence: Clone N copies, inject a unique GUID into each, make the whole-file hashes distinct, while keeping the encoded bitstream and decoded frames byte-for-byte identical to the source.

The plugin registers two tools on the DSH host side: video_clone (batch cloning) and video_clone_scan (reverse lookup of markers and GUIDs from files). The Web side provides a “Video Unique-ification” workbench in the sidebar; the command-line entry point is bin/video-clone.js within the package (bin name video-clone in package.json).

Principle: Modify only the container, do not touch the bitstream

The core idea is to write markers into positions specified by the container standards where “players will skip or only read as metadata,” without re-encoding or resampling.

Container Marker Location Description
MP4 / MOV moov/udta/meta/ilst/©cmt (ffprobe comment) + free box at file end Comment is metadata; free is a standard padding box
MKV / WebM Void + Tags/SimpleTag within Segment Void is padding; Tags is metadata
AVI / RIFF JUNK chunk at tail, and correct RIFF size JUNK is a standard padding chunk
MPEG-TS / M2TS Null packet (PID 0x1FFF) at tail Payload can be arbitrary; demuxers discard it
FLV Tail script data tag (onXCLN) Unknown script tags are usually ignored
Unrecognized Appended to file end Prefix remains a complete copy

When modifying MP4, if moov changes length, the implementation synchronously corrects the stco/co64 absolute offsets; otherwise, the file might play but show visual glitches. The N copies produced in a single call have consistent sizes: padding is aligned to 64 bytes via padBytes, avoiding size differences of a few bytes caused by varying UTF-8 lengths of labels.

The writing strategy is controlled by mode: both (default, visible metadata + invisible padding), pad (padding only), meta (metadata only). The default both is designed to allow traceability via padding bits even if metadata is transcoded or stripped.

Triple Self-Verification and Ledger

Each cloning run performs three types of verification, with results written to ledgers in the output directory (ledger.json, ledger.jsonl, ledger.csv):

  1. Byte Layout (layoutOk): Untouched regions match the source, and written regions read back consistently.
  2. Distinct Hashes (hashesAllDistinct): The sha256 and md5 of the N copies are pairwise distinct, and none equals the source file.
  3. Media Layer (streamIdentical / framesIdentical): Compare encoded bitstreams using ffmpeg -f streamhash, or compare pixels frame-by-frame using -f framemd5.

If any item fails, the overall ok becomes false. The README specifically emphasizes: if ffmpeg verification produces no output, old logic might judge two empty strings as equal and falsely report success; the current implementation “fails if evidence cannot be obtained” and writes the reason to notes / media.error. Media layer verification depends on local ffmpeg; the README states that without ffmpeg, it degrades to hash verification.

deriveFromLabel can deterministically derive GUIDs from labels, facilitating recalculation and comparison by label if the ledger is lost.

Core Features (DSH Side)

Tool video_clone

Typical invocation form (parameter names consistent with README):

video_clone(input="asset.mp4", count=10, labels=["AccountA","AccountB",...], outputDir="distribution")

Summary of common parameters:

Parameter Description
count Number of copies, default 5
mode both / pad / meta
labels Label for each copy, written to markers and ledger
deriveFromLabel Deterministically generate GUID from label
namePattern Filename template: {name} {i} {i:03} {guid} {label} {ext}
verify frames (default) / media / hash / off
strictSize Require copy size to be exactly consistent with source; error if insufficient free or comment space

Tool video_clone_scan

Searches for markers in existing files to reverse-lookup GUIDs and corresponding copy indices.

Web Workbench

package.json declares dsh.client.platform: "web", and the client exports ./client → client.js. The sidebar “Video Unique-ification” panel supports source selection, setting count/labels/strategy/verification level, async task progress (clone returns jobId, poll job), and displays the label, path, size, GUID, sha256, and self-verification results for each copy; the bottom allows pasting a path to reverse-lookup a GUID.

Source selection supports system native file dialogs (calling corresponding APIs for macOS / Windows / Linux) and directory browsing. The host HTTP route prefix is /video-clone/api, POST only, and constrained by browser trust fences. Panel state is persisted via localStorage; it shares the same cloneVideo implementation with the tools and CLI.

For local development, the README explains that the profile can use a file: symlink pointing to the repository directory; DSH must be restarted after modifying source code, as already imported modules will not be updated by the plugin_manager’s hot reload.

Installation and Activation

The SkillHub directory page marks this plugin as installable, with surfaces including host and web (dshhub.surfaces), categorized as Tools/Media. The scraped materials do not provide a unified dsh plugin add … single-line installation command; please refer to the directory page or the repository README for the installation method corresponding to your current DSH version.

Loading contracts (errors will cause the plugin to silently fail to activate or the panel to be blank; the README has test guards):

  • exports["."] in package.json must point to index.js (containing apply), not lib/index.js.
  • index.js must export inject and include "tools"; the client must declare inject (this plugin uses ['slots', 'layout']).
  • Web side: exports["./client"] → client.js, and the key of main must be verbatim identical to the id of sidebar.panellist; register main first, then register sidebar.panellist.

The plugin reads and writes files, calls local ffmpeg, and uses system file dialogs with the permissions of the current DSH process user. Please review the source code and license yourself before installing or activating, and do not operate on sensitive assets directly in untrusted environments.

Typical Usage

CLI

# Clone 10 copies, tag by account, verify frame-by-frame
node bin/video-clone.js clone asset.mp4 -n 10 -l AccountA,AccountB,AccountC --verify frames

# Reverse-lookup GUIDs in files
node bin/video-clone.js scan distribution/*.mp4

# Dry run: only output plan, do not write to disk
node bin/video-clone.js plan asset.mp4

# View container structure
node bin/video-clone.js info asset.mp4

Test entry points within the repository (recorded in README):

node test/run-tests.js
node test/plugin-tests.js

The full npm test also includes test/web-tests.js and test/version-tests.js.

Use Cases and Boundaries

Suitable for: Unique file identification when distributing the same visual asset through multiple channels, post-hoc traceability by GUID/ledger, and integration with agent workflows (DSH tools allow parameter tuning for batch output).

Must Know (Excerpted from README “Boundaries”):

  • Cannot replace platform content-level duplicate detection. The visuals and audio track remain unchanged; perceptual hash/video signature comparisons may still judge them as the same content.
  • meta mode comments may be stripped by transcoding or -map_metadata -1; default both is recommended for resilience.
  • ©cmt is plaintext and readable by ffprobe; if you do not want it to be conspicuous in metadata, use mode=pad.
  • No transcoding, no adding headers or trailers; fragmented MP4 (fMP4 / DASH) degrades to tail appending if moov is not rearranged.

Conclusion

dsh-video-clone encapsulates “distinct hashes + zero media modification + auditable ledger” into a single DSH client plugin: host tools, Web panel, and CLI share the same implementation, and perform explicit self-verification on layout, hashes, and the media layer. To trial or integrate, enter from the SkillHub directory for installation instructions, and see the GitHub README for details and test tables.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye