In video streaming application development (such as security surveillance, remote conferencing, or IoT projects), camera configuration often involves Main Stream and Sub Stream. What are the differences? Why dual streams? How to choose?
This article analyzes this "pair of aces" from a developer's perspective using technical language to help you optimize system design.
Main Stream: High-definition high-quality stream, high resolution, high bitrate, equivalent to a hardcover book, pursuing ultimate image quality, suitable for critical scenarios.
Sub Stream: Smooth low-resource stream, low resolution, low bitrate, equivalent to a pocket-sized paperback, pursuing low bandwidth and low latency, suitable for real-time multi-channel preview.
Essentially, this is an engineering trade-off between quality for resources and space for time.
Parameter comparison is the most intuitive. Below are typical characteristics (specifics vary by device):
| Dimension | Main Stream | Sub Stream |
|---|---|---|
| Alias | primary, main, high | sub, extra, low |
| Resolution | High (e.g., 1080P, 4K, 8MP) | Low (e.g., 720P, 480P, CIF) |
| Bitrate | High (4~8 Mbps or higher) | Low (0.2~1 Mbps) |
| Frame Rate | High (25/30 fps, full frame rate) | Low (10~15 fps, configurable) |
| Bandwidth Usage | High (network pressure) | Extremely low (public network transmission friendly) |
| Decoding Cost | High (heavy CPU/GPU burden) | Low (mobile devices decode easily) |
| Encoding Profile | High (e.g., Main/High Profile) | Low (e.g., Baseline Profile) |
Without sub streams, the system would collapse:
Remote Preview Lag: 4K main stream (8 Mbps) encountering 2 Mbps upload bandwidth results in video transmission failure or explosive latency.
Multi-Channel Preview Crash: 16-channel HD streams require 64 Mbps bandwidth + high decoding load, overwhelming client/server.
Data Depletion: On mobile networks, high-bitrate streams burn through GBs of data in minutes.
Dual Stream Architecture Precisely Resolves:
Main Stream Mission: Fidelity storage and detail capture. Recorded locally/dedicated network to NVR, ensuring clear identification of license plates/faces during playback.
Sub Stream Mission:
Low bandwidth transmission: Public network real-time push without pressure.
Low decoding cost: Smooth playback on phones/tablets.
Multi-channel simultaneous display: Supports dozens of channels preview.
AI optimization: Lightweight source feeds motion detection/intrusion algorithms, reducing computational burden and improving efficiency.
Obtain RTSP Address Reference: IP Camera RTSP Protocol URL Guide:
Main Stream: rtsp://IP/stream1 (or /main)
Sub Stream: rtsp://IP/stream2 (or /sub)
Smart Switching Logic (Enhancing User Experience):
Default: Multi-channel/remote preview pulls sub stream.
Interaction: User double-clicks fullscreen → Seamlessly switch to main stream.
Dynamic: Real-time bandwidth monitoring, downgrade to sub stream on poor networks, upgrade to main stream on good networks.
Storage vs. Preview Separation:
Recording: Main stream → NVR/Server (high-quality archive).
Forwarding: Sub stream → Web/APP/Low-power devices (real-time low consumption).
Dual streams represent an elegant scenario-adaptive design, embodying the principle of graded services under resource constraints:
Storage/Detail Priority → Main Stream (High Configuration).
Bandwidth/Latency/Computation Priority → Sub Stream (Low Configuration).
Developers mastering this concept can precisely configure devices, optimize architecture, and build high-performance, user-friendly video systems. Next time you choose streams, make decisive decisions based on business pain points!
Post a Comment