Videos

Concatenate two videos you own

Joins exactly two videos already in your library, in the order given, into one new video. Input is FILE REFERENCES, never a multi-file upload. There is no N-way merge.

SYNCHRONOUS. There is no job to poll, and there is a hard latency ceiling. The merge runs inside this request via ffmpeg. Which path runs decides everything: two clips that already share codec, resolution, frame rate and pixel format are stream-copied (merge_method: lossless); anything else is fully re-encoded (reencode), roughly an order of magnitude slower. Clips from two different generation models routinely differ, so the slow path is not an edge case.

MEASURED on the deployed stack (2026-08-31):

lossless  2 x  30 s in ->  60 s out :   4.2 s   200
lossless  2 x 180 s in -> 360 s out :   7.0 s   200
reencode  2 x  30 s in ->  60 s out :  32.7 s   200
reencode  2 x 180 s in              : 120.2 s   504

The ceiling is the gateway read timeout of 120 seconds, not a limit this API can raise from PHP. The re-encode path costs about 0.55 s per second of OUTPUT, so treat about 3 minutes of COMBINED input as the practical limit for mismatched clips. Past it you receive a bare gateway 504 with NO JSON body - the only response on this API that is not the standard envelope - the work is discarded, and no output file is registered. The stream-copy path is unconstrained at any length this API can ingest, because the 48 MB per-file upload cap binds first.

credits_used is always 0 today. Merging is not currently billed; the field is returned explicitly rather than left to be inferred.

post/v1/videos/merge

Request

  • Base URL: https://contentmaschine.ai/api
  • URL: https://contentmaschine.ai/api/v1/videos/merge
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://contentmaschine.ai/api/oauth/authorize, token URL https://contentmaschine.ai/api/oauth/token)

Request body

file_uuidsstring[] required

Exactly two uuids of videos you own, in join order.

Response

The merged video.

successboolean
timestampstring date-time

Example response

{
  "success": true
}

Changes

No recorded changes to this operation across all 1 revision of this API.