Automatic recording, processing, and storage via Cloudflare Stream + R2
Complete SDK examples for all platforms
import { WaveClient } from '@wave/sdk';
const wave = new WaveClient({
apiKey: process.env.WAVE_API_KEY,
});
// Start recording with full configuration
async function startRecording(streamId: string) {
const recording = await wave.recordings.start(streamId, {
format: 'mp4',
quality: '1080p',
storage: {
destination: 'cloudflare_r2',
bucket: 'my-recordings',
path: 'streams/{stream_id}/{date}/{time}',
},
options: {
autoStopOnDisconnect: true,
generateThumbnails: true,
thumbnailInterval: 60,
createHlsVod: true,
maxDurationHours: 8,
splitEveryHours: 2, // Split long recordings
},
metadata: {
title: 'My Live Stream',
description: 'Weekly broadcast',
tags: ['live', 'weekly'],
},
});
console.log('Recording started:', recording.id);
return recording;
}Choose the right format for your use case
| Format | Extension | Compatibility | Best For | File Size |
|---|---|---|---|---|
MP4 (H.264) Recommended | .mp4 | Universal | Web playback, social sharing, general distribution | Medium |
MP4 (H.265/HEVC) | .mp4 | Modern devices | 4K content, storage optimization, premium archives | Small (50% reduction) |
WebM (VP9) | .webm | Web browsers | Web-first distribution, royalty-free codec | Small |
HLS Segments | .m3u8 + .ts | Streaming players | On-demand streaming, adaptive bitrate VOD | Large (multiple qualities) |
Original Transport | .ts/.flv | Professional | Archival, re-encoding, broadcast backup | Large |
Resolution, bitrate, and storage estimates by quality level
| Preset | Resolution | Bitrate | Frame Rate | Storage/Hour | Availability |
|---|---|---|---|---|---|
| 4K Ultra HD | 3840x2160 | 15-25 Mbps | 30/60 | ~6.75 GB/hour | Enterprise |
| 1440p QHD | 2560x1440 | 8-12 Mbps | 30/60 | ~3.6 GB/hour | Professional |
| 1080p Full HD | 1920x1080 | 4.5-8 Mbps | 30/60 | ~2.25 GB/hour | All tiers |
| 720p HD | 1280x720 | 2.5-4 Mbps | 30/60 | ~1.12 GB/hour | All tiers |
| 480p SD | 854x480 | 1-2 Mbps | 30 | ~0.56 GB/hour | All tiers |
| Audio Only | N/A | 128-320 Kbps | N/A | ~0.14 GB/hour | All tiers |
Where your recordings are stored
Zero egress fees, global edge delivery
Industry-standard object storage
Unified storage with BigQuery integration
Backblaze B2, MinIO, DigitalOcean Spaces
// Configure S3-compatible storage destination
curl -X POST https://api.wave.com/v1/storage/destinations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "my-backblaze-storage",
"type": "s3_compatible",
"config": {
"endpoint": "https://s3.us-west-001.backblazeb2.com",
"bucket": "wave-recordings",
"region": "us-west-001",
"access_key_id": "YOUR_KEY_ID",
"secret_access_key": "YOUR_SECRET_KEY",
"path_prefix": "streams/",
"storage_class": "STANDARD"
},
"lifecycle": {
"transition_to_archive_days": 90,
"delete_after_days": 365
}
}'Complete API endpoints for recording management
/api/v1/streams/:id/recordings/startStart recording a live stream
/api/v1/streams/:id/recordings/stopStop an active recording
/api/v1/streams/:id/recordingsList all recordings for a stream
/api/v1/recordings/:recording_idGet recording details and status
/api/v1/recordings/:recording_id/downloadGet signed download URL
/api/v1/recordings/:recording_idDelete a recording permanently
/api/v1/recordings/:recording_id/transcodeCreate additional quality variants
/api/v1/recordings/:recording_idUpdate recording metadata
Automatically record streams when they go live
// Enable auto-recording for a stream
curl -X PATCH https://api.wave.com/v1/streams/{stream_id} \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"recording": {
"auto_record": true,
"default_format": "mp4",
"default_quality": "1080p",
"storage_destination": "cloudflare_r2",
"filename_template": "{stream_title}_{date}_{time}",
"max_duration_hours": 8,
"options": {
"generate_thumbnails": true,
"thumbnail_interval_seconds": 60,
"create_hls_vod": true,
"notify_on_ready": true
}
}
}'Available variables: {stream_id},{stream_title},{date},{time},{timestamp},{recording_id}
Real-time notifications for recording lifecycle events
recording.startedRecording has begun capturing
recording.stoppedRecording capture has stopped
recording.processingRecording is being processed/transcoded
recording.readyRecording is available for download
recording.failedRecording failed due to an error
recording.deletedRecording was permanently deleted
Optimize your recording workflow for reliability and cost
Common issues and diagnostic commands
How leading companies use WAVE recordings
WAVE's recording infrastructure handles our 100,000+ hours of course content with 99.999% availability. The automatic transcoding to multiple qualities reduced our processing time by 78% while the R2 integration cut our egress costs to zero.
For live sports, you get one chance to capture the moment. WAVE's recording system has never failed us across 15,000+ live events. The instant replay integration with sub-second clip extraction is a game-changer for our production workflow.
Migrating to WAVE from our legacy recording system was seamless. The S3-compatible API meant zero code changes, but we gained 3x transcoding speed and the intelligent storage tiering saves us $2.3M annually.
Estimate your monthly recording storage costs
| Hours/Month | 720p Storage | 1080p Storage | 4K Storage | R2 Cost* |
|---|---|---|---|---|
| 10 hours | 11.2 GB | 22.5 GB | 67.5 GB | ~$1.01 |
| 50 hours | 56 GB | 112.5 GB | 337.5 GB | ~$5.06 |
| 200 hours | 224 GB | 450 GB | 1.35 TB | ~$20.25 |
| 1000 hours | 1.12 TB | 2.25 TB | 6.75 TB | ~$101.25 |
* Cloudflare R2 pricing: $0.015/GB/month storage. Zero egress fees. Prices are estimates based on 1080p quality.