Create A New Stream
POST /videos/[id]/streams
Submit a new job to create a stream for a video. This endpoint will return the information of the created job.
The status of the job can be tracked at /videos/<video_id>/jobs/<job_id>/status
New Stream Request Parameters
streamFormat
: “MVHEVC”, “HEVC”, “H264”bitrateLadder
: List of bitrates and heights for the stream. Bitrates are measured in Mbps.
Example request to pull a video’s information by ID
const newStreamData = { streamFormat: 'MVHEVC', bitrateLadder: [ { bitrate: 5, height: 1080 }, { bitrate: 10, height: 2160 }, { bitrate: 15, height: 2160 } ]}
fetch('https://spatialgen.com/api/videos/<yourvideoid>/streams', { method: 'POST', headers: { 'X-SPATIALGEN-APPKEY': apiKey, }, body: JSON.stringify(newStreamData)})
Example Response
{ "createdAt": string, "id": number, "status": string, "progress": [],}