Current Location:Home >> Blog >> device

What do the main stream and sub stream of surveillance cameras mean? How to choose?

Time:2025-10-25 Views:3
Catalog Navigation

    Preface

    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.

    1. Core Concepts: Summarized in One Sentence

    • 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.

    2. Technical Parameter Comparison: Differences at a Glance

    Parameter comparison is the most intuitive. Below are typical characteristics (specifics vary by device):

    DimensionMain StreamSub Stream
    Aliasprimary, main, highsub, extra, low
    ResolutionHigh (e.g., 1080P, 4K, 8MP)Low (e.g., 720P, 480P, CIF)
    BitrateHigh (4~8 Mbps or higher)Low (0.2~1 Mbps)
    Frame RateHigh (25/30 fps, full frame rate)Low (10~15 fps, configurable)
    Bandwidth UsageHigh (network pressure)Extremely low (public network transmission friendly)
    Decoding CostHigh (heavy CPU/GPU burden)Low (mobile devices decode easily)
    Encoding ProfileHigh (e.g., Main/High Profile)Low (e.g., Baseline Profile)

    3. Necessity of Dual Streams: Addressing Pain Points and Solutions

    Without sub streams, the system would collapse:

    1. Remote Preview Lag: 4K main stream (8 Mbps) encountering 2 Mbps upload bandwidth results in video transmission failure or explosive latency.

    2. Multi-Channel Preview Crash: 16-channel HD streams require 64 Mbps bandwidth + high decoding load, overwhelming client/server.

    3. 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.

    4. Development Practice: Code-Level Interaction Guide

    1. Obtain RTSP Address Reference: IP Camera RTSP Protocol URL Guide:

      • Main Stream: rtsp://IP/stream1 (or /main)

      • Sub Stream: rtsp://IP/stream2 (or /sub)

    2. 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.

    3. Storage vs. Preview Separation:

      • Recording: Main stream → NVR/Server (high-quality archive).

      • Forwarding: Sub stream → Web/APP/Low-power devices (real-time low consumption).

    Summary and Insights

    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