Video matching
Video Similarity API
Compare two videos by URL and find aligned segments where they overlap. The MediaLayer video similarity API returns a continuous score, a confidence label, and time-aligned matched segments — so you can detect reused video, duplicate uploads, and spliced reuse without building the matching infrastructure yourself.
How the video matching API works
Send a POST request with source_url and target_url. MediaLayer downloads each video, samples frames, fingerprints them with a perceptual hash, and uses an in-memory locality-sensitive hashing (LSH) index to identify candidate matches before scoring full pairs. The result is a structured JSON envelope: a similarity_score, a confidence label, a match boolean, and a list of matched_segments with start and end timestamps for both source and target.
Reused video rarely re-uploads byte-for-byte. The same clip gets re-encoded for a different platform, has letterboxing added, picks up a watermark, or is trimmed at the head and tail. Frame fingerprints handle those edits — minor cropping, scale, and re-encoding do not change the visual signature in a way that breaks duplicate video detection.
The endpoint accepts MP4, MOV, WebM, and Matroska. There is a per-request duration cap to keep response times predictable; for longer-form video, splice your input into chunks and call the API in parallel. The matching is stateless: no model versioning, no warm-up, no index to maintain.
For production duplicate video detection, treat the per-segment scores in matched_segments as the primary signal and aggregate them however your workflow needs — total matched duration, longest contiguous run, weighted average. The top-level similarity_score is a useful summary, but a video matching API exposes the segment-level data precisely so you can build the higher-level decision yourself.
Video similarity API example
Two URLs in. JSON response with aligned segments out. Same request shape as the image and audio endpoints — one integration covers all three media types.
POST /video/match
{
"source_url": "https://example.com/source.mp4",
"target_url": "https://example.com/candidate.mp4"
}{
"match": true,
"confidence": "high",
"similarity_score": 0.91,
"processing_time_ms": 1820,
"media_type": "video",
"matched_segments": [
{
"source_start_sec": 5.0,
"source_end_sec": 12.5,
"target_start_sec": 0.0,
"target_end_sec": 7.5,
"score": 0.94
}
]
}Each entry in matched_segments shows where in the source and target the overlap occurs, with its own per-segment score. That is enough to power audit UIs, evidence trails for copyright workflows, and timestamped flags for moderation review — the matcher does not just answer "are these the same video", it answers "which parts overlap and by how much".
Use cases for video matching
Reused video detection across UGC
Identify uploads that recycle clips from earlier content, even after re-encoding or trimming.
Copyright and rights enforcement
Compare a known catalog video against newly uploaded content and surface the overlapping segments.
Ad creative compliance
Audit which placements are running which video assets across networks at scale.
Marketplace listing dedupe
Catch product videos being recycled across multiple seller accounts.
Highlight and clip dedupe
Collapse near-duplicate sports or news clips down to a canonical version before publishing.
Watermark / leak tracing
Match leaked footage back to the source video even after re-encoding and minor edits.
A hosted video matching API beats a DIY pipeline
Building duplicate video detection in-house means standing up a decoding pipeline, choosing a fingerprint algorithm, indexing frame signatures, and tuning thresholds against your own dataset. Then you have to keep that pipeline running through codec updates, container quirks, and the long tail of broken or partial files that a public URL can serve.
MediaLayer abstracts the decoding, fingerprinting, and matching behind a single JSON request. You send two URLs, you get back scored segments. There is no GPU pool to keep warm, no index to shard, and no library to upgrade inside your monolith. Your engineering hours go back into the part of the system that is actually specific to your product.
Related media matching APIs
The request and response shape is identical across MediaLayer's endpoints — one integration covers the full media surface.
Start matching videos by URL
Free plan to start on RapidAPI. Scale as your volume grows.