Encode and stream video with adaptive bitrate using a single API call. V100 handles content analysis, multi-variant encoding, manifest generation, and CDN delivery.
// npm install v100-sdk
import { V100 } from 'v100-sdk';
const v100 = new V100('YOUR_API_KEY');
// Encode a video with adaptive bitrate
const job = await v100.abr.encode({
source: 'https://cdn.example.com/upload/raw-video.mp4',
contentAware: true, // Enable scene complexity analysis
perTitleOptimization: true, // Optimize ladder per video
variants: 6, // Number of quality rungs (2-8)
maxResolution: '1080p', // Cap at source resolution
codecs: ['h264', 'h265'], // Auto-selects per scene
manifests: ['dash', 'll-hls'], // Generate both formats
webhook: 'https://api.example.com/webhooks/encode'
});
// job.id → "abr_abc123"
// job.status → "analyzing" → "encoding" → "complete"
// When complete, get streaming URLs:
const result = await v100.abr.get('abr_abc123');
// result.dash → "https://cdn.v100.ai/abr_abc123/manifest.mpd"
// result.hls → "https://cdn.v100.ai/abr_abc123/master.m3u8"
// result.variants → [
// { resolution: "1080p", bitrate: 4200000, codec: "h265" },
// { resolution: "720p", bitrate: 2100000, codec: "h264" },
// { resolution: "480p", bitrate: 1100000, codec: "h264" },
// { resolution: "360p", bitrate: 600000, codec: "h264" },
// { resolution: "240p", bitrate: 300000, codec: "h264" },
// { resolution: "audio", bitrate: 128000, codec: "aac" }
// ]
// result.savings → "42% vs fixed ladder"
curl -X POST https://api.v100.ai/v1/abr/encode \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"source": "https://cdn.example.com/upload/raw-video.mp4",
"contentAware": true,
"perTitleOptimization": true,
"variants": 6,
"manifests": ["dash", "ll-hls"]
}'