Chapter 04 · Cloudflare Deploy
Subchapter 4.216
references/stream/gotchas.mdMarkdown4 KBView on GitHub
Cause: Uploaded file is not a valid video format Solution: Ensure file is in supported format (MP4, MKV, MOV, AVI, FLV, MPEG-2 TS/PS, MXF, LXF, GXF, 3GP, WebM, MPG, QuickTime)
Cause: Video duration exceeds maxDurationSeconds constraint
Solution: Increase maxDurationSeconds in direct upload config or trim video before upload
Cause: Failed to download video from URL (upload from URL) Solution: Ensure URL is publicly accessible, uses HTTPS, and video file is available
Cause: Video file is corrupted or improperly encoded Solution: Re-encode video using FFmpeg or check source file integrity
Cause: Video must be at least 0.1 seconds long Solution: Ensure video has valid duration (not a single frame)
requireSignedURLs enabled without providing tokenrequireSignedURLs: false for public videosallowedOrigins array| Resource | Limit |
|---|---|
| Max file size | 30 GB |
| Max frame rate | 60 fps (recommended) |
| Max duration per direct upload | Configurable via maxDurationSeconds |
| Token generation (API endpoint) | 1,000/day recommended (use signing keys for higher) |
| Live input outputs (simulcast) | 5 per live input |
| Webhook retry attempts | 5 (exponential backoff) |
| Webhook timeout | 30 seconds |
| Caption file size | 5 MB |
| Watermark image size | 2 MB |
| Metadata keys per video | Unlimited |
| Search results per page | Max 1,000 |
// Error response type
interface StreamError {
success: false;
errors: Array<{
code: number;
message: string;
}>;
}
// Handle errors
async function uploadWithErrorHandling(url: string, file: File) {
const formData = new FormData();
formData.append('file', file);
const response = await fetch(url, { method: 'POST', body: formData });
const result = await response.json();
if (!result.success) {
throw new Error(result.errors[0]?.message || 'Upload failed');
}
return result;
}