API Reference/Docs/Compute/
Transcription

ZiB Network

Transcription

ZiB Transcription generates subtitle tracks for your video or audio files. The SRT/WebVTT output is encrypted, stored redundantly on the network, and accessible via the same CDN URL pattern as any other file. Three quality tiers are available — pick based on the speed/accuracy tradeoff you need.

When requested alongside video encoding, subtitle tracks are automatically embedded in the HLS manifest as #EXT-X-MEDIA entries. Any HLS player (hls.js, Video.js, native Safari, AVPlayer) will surface them automatically in the subtitle menu.

Compute nodes decrypt the input file in-memory only during inference. The AES key is never written to disk on the node. The transcript output is encrypted before being written anywhere. Node operators cannot read the file content or the generated transcript.

Tiers

fastestFastest
Highest throughput

Best for short clips or when speed matters more than nuance. English accuracy is good; multilingual accuracy is limited.

recommendedRecommendedDefault
Balanced

The default. Good balance of speed and accuracy for English and common European languages. Recommended for most use cases.

accurateAccurate
Slower

Higher accuracy across more languages. Use when transcription quality is critical or for non-English content.

Standalone Job

Use submitTranscription(objectId, model) to transcribe a file that has already been uploaded. The objectId is the file_id UUID returned by any upload method.

javascript
// Submit a transcription job
const job = await storage.submitTranscription(fileId, 'recommended');
// => { job_id: 'uuid', status: 'queued' }

console.log('Job ID:', job.job_id);

Request body (raw HTTP)

http
POST /v1/api/compute/{objectId}
Authorization: Bearer ACCESS_KEY:SECRET_KEY
Content-Type: application/json

{
  "transcription": "recommended"
}

Response

json
{
  "job_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "queued"
}

With Encoding

Pass transcription as an option to startEncoding(). Transcription runs in parallel with video encoding. The HLS manifest will include subtitle tracks when the job completes.

javascript
const { encoding_id } = await storage.startEncoding(fileId, {
  transcription: 'recommended',
});

// Poll encoding status
let status;
do {
  await new Promise(r => setTimeout(r, 3000));
  status = await storage.getEncodingStatus(encoding_id);
} while (status.status !== 'complete' && status.status !== 'failed');

// HLS URL — subtitle tracks embedded automatically
console.log('Stream:', status.hls_manifest_url);
// => https://cdn.zibnetwork.com/stream/<id>/master.m3u8
// Subtitle track visible in any HLS player
Combined encoding + transcription is more efficient than separate calls — the video is decrypted once on the compute node and both jobs share the decode step.

Polling & Status

javascript
const status = await storage.getComputeStatus(jobId);
// => {
//   job_id: 'uuid',
//   status: 'queued' | 'processing' | 'complete' | 'failed',
//   srt_file_id: 'uuid' | null,
//   sidecar_file_id: null,
//   error_message: null | 'string'
// }
Status Values
queuedJob is waiting to be picked up by a compute node.
processingA compute node is currently running inference.
completeDone. srt_file_id is populated with the output file UUID.
failedJob failed. error_message contains the reason.

Recommended polling interval

Poll every 3–5 seconds. Typical transcription times: 10–30s for short clips, 1–3 minutes for a 30-minute video on the recommended tier.

SRT Output

The transcription output is a standard SRT file stored encrypted on the ZiB network. Fetch it via the CDN URL using the srt_file_id from the job status.

javascript
const status = await storage.getComputeStatus(jobId);

if (status.status === 'complete' && status.srt_file_id) {
  const srtUrl = storage.getCdnUrl(status.srt_file_id);
  // => https://cdn.zibnetwork.com/objects/<srt_file_id>

  // Fetch the SRT content
  const srt = await fetch(srtUrl).then(r => r.text());
  console.log(srt);
}

Example SRT

text
1
00:00:01,240 --> 00:00:04,800
Welcome to ZiB Network.

2
00:00:05,100 --> 00:00:09,200
Files are encrypted client-side before
any bytes leave the browser.

3
00:00:10,000 --> 00:00:13,500
Node operators never see plaintext content.

HLS Subtitles

When transcription is requested with encoding, ZiB embeds the subtitle track directly in the HLS master manifest using #EXT-X-MEDIA. No extra work is needed — just load the HLS URL in any compatible player.

hls.js example

javascript
import Hls from 'hls.js';

const video = document.querySelector('video');
const hls = new Hls();

hls.loadSource(status.hls_manifest_url);
hls.attachMedia(video);

// Subtitle tracks are automatically available in hls.subtitleTrackController
// The user can select them via the player's subtitle menu

Video.js example

javascript
import videojs from 'video.js';

const player = videojs('my-video', {
  sources: [{ src: status.hls_manifest_url, type: 'application/x-mpegURL' }],
});
// Subtitle tracks appear in the CC button automatically
Safari and iOS/iPadOS use native HLS playback and will display subtitle tracks from the manifest in the system subtitle picker without any additional configuration.