Skip to content

Media ​

Uploads go straight to storage through presigned multipart URLs; everything slow runs in the media container on the media-* queues. All routes are under /v1. Responses are { data, meta }; errors are Problem Details with the codes below.

Upload and assets (signed-in user) ​

MethodPathBody / queryResponseErrors
POST/media/uploads{ profileId, kind: audio|video|image, purpose: recording_audio|music_video|lyric_video|visualizer|artwork|stem_source|other, fileName, contentType, byteSize, checksumSha256? }201 { assetId, partSizeBytes, partUrls[], expiresAt }MEDIA_UPLOAD_TYPE_INVALID, MEDIA_UPLOAD_TOO_LARGE, MEDIA_ASSET_NOT_FOUND (profile not yours), RATE_LIMITED
POST/media/uploads/:assetId/complete{ parts: [{ partNumber, etag }] } (every part, 1..n)AssetView (status uploaded)MEDIA_UPLOAD_NOT_PENDING, MEDIA_UPLOAD_INCOMPLETE
POST/media/uploads/:assetId/abort—{ status: "ok" }MEDIA_UPLOAD_NOT_PENDING
GET/media/assetsprofileId, status?, kind?, cursor?, limit?page of AssetViewMEDIA_ASSET_NOT_FOUND
GET/media/assets/:assetId—AssetViewMEDIA_ASSET_NOT_FOUND
DELETE/media/assets/:assetId—{ status: "ok" }MEDIA_INVALID_TRANSITION
GET/media/assets/:assetId/events—[{ type, stage, progressPercent, occurredAt }] (newest first, 100)MEDIA_ASSET_NOT_FOUND
GET/media/assets/:assetId/waveform—{ url } signed JSON { version, durationMs, buckets, peaks[] }MEDIA_ASSET_NOT_FOUND
GET/media/assets/:assetId/playbacktier=preview|full (default preview), quality (default aac_128)application/vnd.apple.mpegurl media playlistMEDIA_ASSET_NOT_READY, MEDIA_RENDITION_NOT_FOUND
GET/media/assets/:assetId/key—raw 16-byte AES-128 key, no-store (owner check of their own stream)MEDIA_CONTENT_KEY_NOT_FOUND
POST/media/assets/:assetId/stems—202 { status: "accepted" }MEDIA_ASSET_NOT_READY, MEDIA_INVALID_TRANSITION
GET/media/assets/:assetId/stems—[{ stem: vocals|drums|bass|other, url }]MEDIA_ASSET_NOT_READY

Access: the uploader, or anyone the canManageProfile port allows for the asset's profile. Everyone else gets MEDIA_ASSET_NOT_FOUND.

AssetView: id, profileId, kind, purpose, status (pending|uploaded|processing|ready|failed|cancelled|deleted), originalFileName, contentType, byteSize, durationMs, width, height, isLossless, sampleRateHz, bitDepth, loudnessIntegratedLufs, truePeakDbtp, previewStartMs, isPossibleDuplicate, failureCode, progressPercent, renditions[{ tier, kind, quality, status }], createdAt, readyAt.

Staff (catalog:moderate) ​

MethodPathResponseErrors
GET/staff/media/assets/:assetIdAssetViewMEDIA_ASSET_NOT_FOUND
POST/staff/media/assets/:assetId/reprocess202MEDIA_INVALID_TRANSITION

Pipeline ​

QueueJobDoes
media-ingestmedia.ingestdownload, SHA-256, ffprobe, SoX stats, validation, chromaprint, duplicate check (checksum, then fingerprint), plan renditions
media-transcodemedia.transcode (one per rendition)AAC HLS 64/128/256, FLAC HLS (lossless masters), video 360/480/720/1080, 15 s previews (audio 128k, video ≤480p, unencrypted), waveform + EBU R128 loudness, artwork 3000…64 px
media-analysismedia.analyse, media.stemsBPM, key, energy, danceability, valence, 128-d embedding; stems via external separator
media-packagemedia.packageoffline file (aac_256 m4a or flac), AES-128-CBC with the asset's content key
mediamedia.maintenance (hourly)next months' media_asset_events partitions; aborts uploads pending past MEDIA_UPLOAD_ABANDON_HOURS

Full-tier HLS segments and init sections are AES-128 sealed with one key per asset; the playlist's EXT-X-KEY points at MEDIA_KEY_URL_TEMPLATE (served by playback, gated by entitlement and lease). Signed URLs live MEDIA_PLAYBACK_URL_TTL_SECONDS.

Storage layout: masters/<id>/original.<ext>, hls/<id>/<tier>/<quality>/<render>/…, artwork/<id>/<size>.jpg, waveform/<id>/peaks.json, stems/<id>/<stem>.flac, packages/<id>/<quality>.plmz.

Events ​

TypeWhen
media.asset.uploadedmultipart completed (starts ingest)
media.asset.progressevery stage; relay to studio:<profileId>
media.asset.ready / media.asset.failedoutcome
media.asset.duplicate_detectedanother owner's live asset matches
media.asset.preview_changedpreview re-rendered from a new start
media.analysis.completed, media.stems.ready, media.package.readyderived outputs

Module API additions ​

MemberPurpose
describeMasters(assetIds)codec, container, bit depth, sample rate, channels, duration, byte size, SHA-256, bucket, key
signedDownloadUrl(assetId, ttlSeconds, filename?){ url, filename, expiresAt }; the storage port can't set Content-Disposition, so the name is returned beside the URL
listStemAssets(recordingAssetId)ready stems as rendition IDs by stem (vocals, drums, bass, other)
importExternalAsset({ ownerProfileId, ownerUserId, kind, purpose?, contentType, fileName?, source: { sourceUrl } | { bucket, key } })creates a pending asset; media.import (queue media-ingest) copies it in, then the normal pipeline runs
fingerprintMatches(assetId)[{ assetId, ownerUserId, profileId, score, matchedBy: checksum|fingerprint|similar_fingerprint }], best first

Account privacy ​

On identity.user.deleted: unfinished uploads (pending|uploaded|processing|failed|cancelled) become deleted and open multipart uploads are aborted. Ready assets stay (they may back catalogue) with originalFileName redacted and sourceUrl cleared. Data export section media: uploads.

Analysis and stems modes ​

VariableValuesNotes
MEDIA_ANALYSER_MODEnative (default), command, fakenative: aubio tempo/onset for BPM and onset density, ffmpeg decodes a 60 s mono window (-f f32le, 22.05 kHz) for chroma + Krumhansl key, RMS loudness, energy/danceability/valence/acousticness heuristics, and a 128-d band-energy embedding (plemuz-bands-v1, heuristic, not learned). command runs an external analyser that prints the result JSON. Production refuses fake.
MEDIA_AUBIO_PATHdefault aubiofrom aubio-tools in the media image
MEDIA_STEMS_MODEnone (default), command, fakenone refuses stem requests with MEDIA_STEMS_DISABLED (409). command runs Demucs from the optional media-ml image via MEDIA_STEMS_COMMAND, e.g. demucs -n htdemucs -o {output} {input}. Production refuses fake, and requires the command when command is set.

instrumentalness is null in native mode.

Plemuz API v2