Goal
Produce repeatable media derivatives whose cache identity includes the canonical definition, source bytes, overlay bytes, and processor revision.Prerequisites
- An asset in the same account
- An
assets:processtoken for transforms - A clean, ready source before durable materialization
Workflow
1
Build a version 2 definition with the source media kind, ordered operations, and one output.
2
Store it as a named preset when multiple assets use it; set
eager=true to materialize after the clean scan gate.3
POST the definition or preset to the asset transforms route. Supply exactly one, never both.
4
Poll the returned Assets job until it completes, then list derivatives and use only an
available output.Complete task recipes
For runnable examples that continue through job polling and file delivery, use trim videos and create JPG posters or blur and crop a social preview. V2 recipes require the advanced_transforms plan entitlement in addition to API scopes and remaining processing allowance.Definition contract and bounds
versionis exactly2;media_kindisimageorvideo; operation order is significant.- A definition contains 1–24 operations. Output kinds are image, video, audio, or thumbnail.
- Final images are limited to 4096×4096 and 16,777,216 pixels. DPR is 0.5–4; blur sigma is greater than 0 and at most 100; output quality is 1–100 and defaults to 82 for image/thumbnail outputs.
- Background is
transparentor normalized 6/8-digit hex. Rotation is finite and normalized modulo 360. - Video FPS is 1–60. Trim end must exceed start. Trim and thumbnail timestamps are checked against probed source duration during processing.
- Image formats are JPEG, PNG, WebP, and AVIF; video is MP4; extracted audio is MP3, AAC, or WAV; thumbnails are JPEG, PNG, or WebP.
Timestamp thumbnail example
Presets, eager processing, and v1 compatibility
POST /assets/transformationscontinues to accept the legacy width/height/crop/format/quality fields and signed v1 specs.- For v2, send
name,definition, andeager. Stored presets exposedefinition_version,media_kind, normalized definition/spec,eager, andrevision. POST /assets/{assetID}/transformsaccepts{definition}or{preset}and returns an Assets job. If no idempotency key is supplied, the service derives one from asset ID, source checksum, and normalized spec.- For CLI
transform-run, the JSON passed to--fileis the complete request body: wrap a v2 definition as{ "definition": { ... } }, or use{ "preset": "name" }. GET /assets/{assetID}/derivativesreturns persisted output kind, MIME type, size, transform hash, dependency checksum, processor revision, and availability state.- The service invokes libvips/FFmpeg/ffprobe through context-bound argument arrays, strips metadata, normalizes color, and marks output deliverable only after durable persistence and replication.
Expected result
Identical source and transform dependencies collapse onto the same durable output, while any source, overlay, definition, or processor change produces a new identity.
Common failures
Related guides
Trim videos, create JPG posters and download MP4s
Copyable REST recipes for start/end trimming with audio, timestamp JPEG posters, job polling and signed download URLs for external AI services.
Blur images and create a 1200×630 social preview
Build an exact-size JPEG social card with ordered crop and blur operations, then choose durable public delivery or private access.
Media templates for Automations
Start a media automation from a ready-made template for image and video processing, publishing and creative review, then change its steps in Automations.
Assets REST API reference
The routes, wire fields, response states, and concurrency rules shared by every official Assets SDK.
Native video processing and secure playback
Version-pinned video packages, scan and review gates, replacement behavior, playback sessions, API routes, and failure recovery.