Best Practices
Best Practices Guide
Optimization, performance, and production excellence for professional streaming
Version 1.0•Updated November 2025•40-50 min read
Video Encoding Best Practices
Recommended Encoder Settings
H.264 (Universal Compatibility)
Codec:H.264 (AVC)
Profile:High
Level:4.1 (1080p30) / 4.2 (1080p60)
Rate Control:CBR (Constant Bitrate)
Keyframe:2 seconds
H.265 (Better Compression)
Codec:H.265 (HEVC)
Profile:Main10
Bitrate Savings:50% lower
Rate Control:CBR
Use Case:4K streaming
Quality vs Bitrate Recommendations
| Resolution | Frame Rate | Bitrate | Use Case |
|---|---|---|---|
| 1080p | 60 fps | 6000 kbps | Gaming, sports |
| 1080p | 30 fps | 4500 kbps | General streaming |
| 720p | 60 fps | 4000 kbps | Fast action |
| 720p | 30 fps | 2500 kbps | Standard quality |
| 480p | 30 fps | 1500 kbps | Mobile/low bandwidth |
OBS Studio Optimal Settings
# Output Settings
Output Mode: Advanced
Encoder: NVIDIA NVENC H.264 (or x264 if no GPU)
Rate Control: CBR
Bitrate: 4500 kbps (1080p30) or 6000 kbps (1080p60)
Keyframe Interval: 2
Preset: Quality (NVENC) or veryfast (x264)
Profile: high
B-frames: 2
# Video Settings
Base Resolution: 1920x1080
Output Resolution: 1920x1080
Downscale Filter: Lanczos (best quality)
FPS: 30 or 60
# Advanced Settings
Process Priority: High
Renderer: Direct3D 11 (Windows) or OpenGL (macOS)Hardware Encoding Recommendation
NVIDIA NVENC provides the best balance of quality and performance. Use x264 only with powerful CPUs (8+ cores).
Network Optimization
Bandwidth Management
Upload Requirements
- • Recommended: 1.5x target bitrate
- • 1080p60: 10 Mbps upload
- • Test: speedtest.net
- • Wired connection preferred
Latency Targets
- • OMT: <16ms (real-time)
- • WebRTC: <500ms (interactive)
- • SRT: 2-4s (professional)
- • HLS: 10-30s (mass distribution)
Reliability
- • Use wired Ethernet (not Wi-Fi)
- • Enable QoS on router
- • Dedicated network for streaming
- • Backup internet connection
CDN Configuration
# Optimal CDN Settings
{
"regions": [
"us-east", // North America (primary)
"us-west", // North America (secondary)
"eu-central", // Europe
"ap-southeast" // Asia Pacific
],
"caching": {
"vod": "7d", // VOD content
"thumbnails": "30d", // Thumbnails
"live": "disabled" // Live streams (no caching)
},
"optimization": {
"gzip": true,
"http2": true,
"http3": true,
"brotli": true
}
}Performance Tuning
Server Optimization
CPU & GPU Optimization
- • Use hardware encoding (NVENC, QuickSync, VCE)
- • Optimize encoder preset for CPU/GPU balance
- • Monitor CPU usage (keep under 80%)
- • Use dedicated GPU for encoding
- • Enable GPU-accelerated graphics
Memory & Storage
- • Minimum 16GB RAM for production
- • Use SSD for recordings (NVMe preferred)
- • Monitor disk I/O during streaming
- • Separate OS and recording drives
- • Regular cleanup of old recordings
Client-Side Performance
// Adaptive Bitrate Streaming (ABR)
const player = new WavePlayer({
streamId: 'str_abc123',
adaptive: {
enabled: true,
startLevel: 2, // Start at medium quality
switchThreshold: 0.8, // Switch up at 80% buffer
minBuffer: 3, // 3 seconds minimum buffer
maxBuffer: 30 // 30 seconds maximum buffer
},
preload: true,
lowLatency: true
});
// Network-aware quality selection
player.on('networkChange', ({ bandwidth }) => {
if (bandwidth < 2000) {
player.setQuality('360p');
} else if (bandwidth < 4000) {
player.setQuality('720p');
} else {
player.setQuality('1080p');
}
});Production Workflows
Multi-Camera Productions
- 1
Plan Camera Angles
Wide shot, medium shot, close-up, overhead, audience
- 2
Synchronize Sources
Ensure all cameras have identical settings and time sync
- 3
Configure Scenes
Pre-program scene transitions and compositions
- 4
Test Transitions
Practice switching between cameras smoothly
- 5
Monitor Quality
Watch output feed, check audio levels, monitor bitrate
Live Event Checklist
Scaling Strategies
Handling 1M+ Concurrent Viewers
Infrastructure
- • Multi-region CDN deployment
- • Edge caching for VOD content
- • Load balancing across origin servers
- • Auto-scaling groups
Optimization
- • Adaptive bitrate streaming (ABR)
- • Multi-quality transcoding
- • Geographic routing
- • Connection pooling
Auto-Scaling Configuration
# Auto-scaling policy
{
"scaleUp": {
"metric": "concurrent_viewers",
"threshold": 80, // 80% of capacity
"cooldown": 300, // 5 minutes
"increment": 2 // Add 2 instances
},
"scaleDown": {
"metric": "concurrent_viewers",
"threshold": 30, // 30% of capacity
"cooldown": 900, // 15 minutes
"decrement": 1 // Remove 1 instance
},
"limits": {
"min": 2, // Minimum 2 instances
"max": 100 // Maximum 100 instances
}
}Security Best Practices
Authentication & Authorization
- • Implement token-based authentication (JWT)
- • Use short-lived access tokens (15 minutes)
- • Rotate API keys quarterly
- • Implement role-based access control (RBAC)
- • Enable two-factor authentication (2FA)
Content Protection
- • Enable TLS 1.3 for all connections
- • Implement DRM (Widevine, FairPlay, PlayReady)
- • Use signed URLs with expiration
- • Enable geo-blocking when needed
- • Implement watermarking for premium content
DDoS Protection
- • Use CDN with DDoS protection
- • Implement rate limiting (per IP, per user)
- • Enable bot detection and blocking
- • Monitor traffic patterns for anomalies
- • Have incident response plan ready
Monitoring & Observability
Key Performance Indicators
| Metric | Target | Alert Threshold |
|---|---|---|
| Stream uptime | 99.9% | < 99% |
| Buffering ratio | < 2% | > 5% |
| Start time | < 2s | > 5s |
| Frame drop rate | < 0.1% | > 1% |
| Viewer engagement | > 70% | < 50% |
Alert Configuration
# Critical alerts (immediate notification)
stream.offline: 15 seconds
bitrate.drop: > 30% for 10 seconds
frame.drops: > 5% for 30 seconds
viewer.disconnect.rate: > 10% in 1 minute
# Warning alerts (5 minute notification)
cpu.usage: > 80% for 5 minutes
memory.usage: > 90% for 5 minutes
disk.usage: > 85%
network.latency: > 100ms for 5 minutes
# Info alerts (daily summary)
viewer.count: Daily peak and average
bandwidth.usage: Daily total
storage.usage: Current utilizationCost Optimization
Bandwidth Optimization
- • Use adaptive bitrate streaming
- • Optimize video encoding settings
- • Leverage CDN caching effectively
- • Implement viewer-based quality
Storage Management
- • Auto-delete old recordings
- • Use tiered storage (hot/cold)
- • Compress archived content
- • Implement lifecycle policies
Cost Monitoring Tip
Set up budget alerts at 50%, 75%, and 90% of monthly budget to avoid unexpected costs.