File
Video & Audio Operations
Use these SDK methods on a File
to extract audio, extract frames to ZIP, or generate transcripts.
Each operation has an async enqueue method with a corresponding status method, plus a sync helper that polls until completion.
Audio Extract
Status
Sync helper
Extract Frames (ZIP)
Status
Sync helper
Transcribe (Audio or Video)
Status
Sync helper
Parameters
Common
Name | Type | Description |
---|---|---|
namespaceId | string (required) | Destination namespace id |
location | string (required) | Destination folder (no leading/trailing "/" ) |
filename | string (required) | Output filename (no / ) |
poll | { intervalMs?: number; timeoutMs?: number } | For *Sync methods only |
Audio Extract (extras)
Name | Type | Notes |
---|---|---|
format | 'mp3' \| 'aac' \| 'wav' \| 'flac' \| 'ogg' \| 'opus' | Default: mp3 |
bitrateKbps | number? | ≤ 512 |
sampleRateHz | number? | ≤ 192000 |
channels | number? | 1..6 |
start | number? | seconds |
duration | number? | seconds |
normalize | boolean? | default false |
Extract Frames (extras)
Name | Type | Notes |
---|---|---|
start | number? | seconds |
endTime | number? | must be > start when both set |
Transcribe (extras)
Name | Type | Notes |
---|---|---|
language | string? | default en-US |
Returns
All *Async
methods:
{ status: 'queued', operationId: string, source: { id, name, location, namespaceId }, dest: { namespaceId, location, filename } }
All *Sync
methods on success:
{ status: 'completed', operationId: string, source, dest }
Status helpers:
- Audio:
{ id, type: 'audio-extract', status }
- Frames:
{ id, type: 'extract-frames', status }
- Transcribe:
{ id, type: 'transcribe', status }
Operation Reference
Operation | Params (shape) | Notes |
---|---|---|
extractAudio | { format, bitrateKbps?, sampleRateHz?, channels?, start?, duration?, normalize? } | Extracts audio from a video source into chosen format |
extractFrames | { start?, endTime? } | Emits a ZIP of frames between times (if provided) |
crop | { x, y, width, height } | Crops video frame |
muteSegment | { start, duration } | Mutes audio between times |
fade | { type: 'in''out', startTime, duration } | Video fade effect |
addText | { text, x, y, fontSize, fontColor, startTime?, endTime? } | Draws text; fontFile (TTF/OTF) optional |
addBorder | { top, right, bottom, left } | Adds border via padding |
reverse | { video?: boolean = true, audio?: boolean = false } | Reverse video and/or audio |
audioFade | { type: 'in''out', startTime, duration } | Audio fade envelope |
motionBlur | { frames=5, weights?, outputFps? } | Temporal blur; weights like “1 2 3 2 1” |
Notes
- Ensure destination folders exist; SDK/API will normalize
location
. - Filename rules: no
/
. For frames ZIP: must end with.zip
. For transcript: must end with.txt
. - Conflict handling: enqueue calls fail with 409 if a file with the same
(namespaceId, location, filename)
already exists. - Permissions: the source file’s namespace must be accessible by your API key.