Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

28 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฅ ViCast-NIP

Buy Me a Coffee

Download ViCast License NDI SDK DeckLink SDK C++

ViCast is a high-performance C++ broadcast gateway for real-time video routing between NDIยฎ network video, GPU desktop capture, and SDI broadcast hardware.
Designed for 24/7 production environments, ViCast delivers ultra-low latency video processing using SIMD-accelerated pipelines, lock-free frame pools, and multithreaded architecture.
It automatically manages signal routing, failover, synchronization, and broadcast output, making it ideal for studio automation, live production, and IP video infrastructure.


๐Ÿ“Œ Table of Contents


๐Ÿง  Architecture Overview

INPUT

  • GPU Desktop Capture (DXGI duplication)
  • NDI Primary / Backup

PROCESS

  • libyuv scaling
  • Fill / Key generation
  • Frame pool (zero allocation)

OUTPUT

  • NDI Fill
  • NDI Key
  • NDI Embedded
  • DeckLink SDI (V210 10-bit)

TIMING

  • DeckLink Genlock (if present)
  • Software frame pacing fallback

โšก Core Features

  • Intelligent Input Routing
    Prioritizes local GPU Desktop Duplication. If unavailable, switches to NDI sources automatically.

  • Automatic NDI Failover
    Monitors Primary NDI source. If signal drops beyond a configurable threshold, switches to Backup seamlessly.

  • Zero-Overhead Desktop Capture
    Uses DXGI API for 60fps capture with minimal CPU overhead and direct GPU memory access.

  • Multi-Channel NDI Output
    Simultaneously broadcasts Fill, Key (Alpha), and Embedded RGBA streams.

  • DeckLink SDI Integration
    Professional 10-bit V210 output with optional hardware Genlock / Reference lock.

  • Thread-Safe Telemetry
    Real-time console dashboard for routing, FPS, dropped frames, clock drift, and system health.


๐Ÿ”„ Input Failover Logic

Priority Order:

  1. GPU Desktop Capture
  2. NDI Primary
  3. NDI Backup

ViCast Failover State Machine


๐Ÿ”„ Video Routing Pipeline

The engine dynamically switches between Desktop Capture, NDI Primary, and NDI Backup sources.
Failover engages automatically when frames are dropped beyond flapThreshold.

Priority Table:

Priority Source
1 GPU Desktop Capture
2 NDI Primary
3 NDI Backup

๐Ÿ“Š Output Capability Matrix

Feature NDI Fill NDI Key NDI Embedded SDI (DeckLink)
Color โœ“ โœ— โœ“ โœ“
Alpha โœ— โœ“ โœ“ Optional
10-bit โœ“ โœ“ โœ“ โœ“
Hardware Sync Network Network Network โœ“
Broadcast Switcher Compatible โœ“ โœ“ โœ“ โœ“

โš™๏ธ Supported Pixel Formats

Format Bit Depth Usage
RGBA 8-bit GPU capture
UYVY 8-bit NDI pipeline
V210 10-bit SDI output
YUV 4:2:2 10-bit DeckLink hardware

โฑ Timing & Synchronization

Hardware Genlock (Preferred)

  • Locks output to external reference if present (Blackburst, Tri-Level, or House Ref).
  • Ensures frame-accurate sync across devices.

Internal Clock (Fallback)

  • High-precision software timer if no Genlock detected.
  • Maintains stable frame pacing for NDI and single-device SDI pipelines.

๐Ÿš€ Performance Design

  • SIMD acceleration via libyuv
  • Lock-free frame pools
  • Zero dynamic allocation in hot paths
  • Multithreaded pipeline
  • GPU-assisted capture

Typical Latency:

Pipeline Latency
Desktop โ†’ NDI ~1 frame
NDI โ†’ SDI ~1โ€“2 frames
Desktop โ†’ SDI ~1 frame

๐Ÿงฉ Internal Processing Pipeline

INPUT

  • GPU Desktop Capture (DXGI)
  • NDI Primary / Backup

PROCESS

  • Frame pool (zero allocation)
  • libyuv scaling & color conversion
  • Fill / Key generation

OUTPUT

  • NDI Fill
  • NDI Key
  • NDI Embedded
  • DeckLink SDI (V210)

๐Ÿ“ก Broadcast Integration

System Compatibility
NDI Production workflows โœ“
SDI Switchers โœ“
Graphics Engines โœ“
IP Video Infrastructure โœ“
Studio Automation โœ“

๐Ÿ’ป System Requirements

Operating System

  • Windows 10 / 11 (64-bit)

Hardware (Optional)

  • Blackmagic DeckLink card for SDI output

Dependencies

Dependency Purpose
NDIยฎ SDK Network video transport
Blackmagic Desktop Video DeckLink drivers
Visual Studio 2022 (MSVC v143) Build toolchain
libyuv SIMD video processing

โš™๏ธ Configuration

  • Controlled via config.json in AppData/Local/ViCast or executable folder.
  • Blank = Disabled design, e.g., "ndiOutputEmbedded": "" disables the sender.

Example config.json

{
  "enableDesktopCapture": true,
  "enableNdiInput": true,
  
  "ndiInputPrimary": "STUDIO-PC (Mix 1)",
  "ndiInputBackup": "STUDIO-PC (Mix 2)",
  
  "flapThreshold": 5,
  
  "ndiOutputFill": "ViCast Fill",
  "ndiOutputKey": "ViCast Key",
  "ndiOutputEmbedded": "ViCast NDI",
  
  "outputWidth": 1920,
  "outputHeight": 1080,
  "outputFpsN": 25,
  "outputFpsD": 1,
  
  "forceProgressive": true,
  "forceInterlaced": false,
  
  "ndiHighestQuality": true,
  "clockVideo": true,
  "clockAudio": true,
  "pixelFormat": "v210",
  
  "enableDeckLink": false,
  "decklinkDevices": [
    {
      "name": "DeckLink 8K Pro",
      "outputMode": "1080p25",
      "keyOutput": true
    }
  ],
  "verboseLogging": true
}

Key Parameters

  • outputFpsN / outputFpsD: frame rate fraction (e.g., 60000/1000 = 60fps)
  • enableDesktopCapture: overrides NDI inputs if true
  • flapThreshold: consecutive dropped frames before failover
  • enableDeckLink: enables SDI output (V210 10-bit)

๐Ÿ› ๏ธ Building the Project

1โƒฃ Clone the repository

git clone https://github.com/vivek-kr-git/ViCast

2๏ธโƒฃ Install Dependencies

Install the following:

  • NDI SDK
  • DeckLink SDK
  • libyuv

Add them to Visual Studio:

  • Project Properties โ†’ Include Directories
  • Project Properties โ†’ Linker Dependencies

3๏ธโƒฃ Build

  • Configuration: Release
  • Platform: x64

โš ๏ธ Debug builds may not sustain real-time 60fps performance due to disabled compiler optimizations.


๐Ÿ“Š Performance Characteristics

ViCast is optimized for real-time broadcast workloads.
Key techniques include:

  • Lock-free frame pools
  • SIMD processing
  • Zero dynamic allocation in hot paths
  • Multithreaded pipeline
  • Hardware synchronization

Typical latency: ~1โ€“2 frames (depending on hardware and pipeline configuration)


๐Ÿ“„ License

ViCast is licensed under the Apache License 2.0. See LICENSE for details.


๐Ÿ™ Acknowledgements

  • NDIยฎ by Vizrt
  • DeckLink SDK by Blackmagic Design
  • libyuv by Google

See THIRDPARTY.md for full copyright and licensing information.


โ˜• Support

If you like ViCast-NIP and want to support development, you can buy me a coffee:

Buy Me a Coffee


๐Ÿ“ธ Demo

ViCast Demo Image

Example of ViCast in action โ€“ desktop capture routed to NDI and SDI output.


๐Ÿ“บ Supported DeckLink Video Modes

Standard Definition (SD)

Resolution Frame Rate Scan Type DeckLink Mode
720ร—486 29.97 Interlaced bmdModeNTSC
720ร—486 23.98 Progressive bmdModeNTSC2398
720ร—486 29.97 Progressive bmdModeNTSCp
720ร—576 25 Interlaced bmdModePAL
720ร—576 25 Progressive bmdModePALp

HD 720 (Progressive Only)

Resolution Frame Rate Scan Type DeckLink Mode
1280ร—720 50 Progressive bmdModeHD720p50
1280ร—720 59.94 Progressive bmdModeHD720p5994
1280ร—720 60 Progressive bmdModeHD720p60

HD 1080 Interlaced

Resolution Frame Rate Scan Type DeckLink Mode
1920ร—1080 25 Interlaced bmdModeHD1080i50
1920ร—1080 59.94 Interlaced bmdModeHD1080i5994
1920ร—1080 60 Interlaced bmdModeHD1080i6000

HD 1080 Progressive

Resolution Frame Rate Scan Type DeckLink Mode
1920ร—1080 23.98 Progressive bmdModeHD1080p2398
1920ร—1080 24 Progressive bmdModeHD1080p24
1920ร—1080 25 Progressive bmdModeHD1080p25
1920ร—1080 29.97 Progressive bmdModeHD1080p2997
1920ร—1080 30 Progressive bmdModeHD1080p30
1920ร—1080 50 Progressive bmdModeHD1080p50
1920ร—1080 59.94 Progressive bmdModeHD1080p5994
1920ร—1080 60 Progressive bmdModeHD1080p6000

Legacy 2K Film (1556 lines)

Resolution Frame Rate Scan Type DeckLink Mode
2048ร—1556 23.98 Progressive bmdMode2k2398
2048ร—1556 24 Progressive bmdMode2k24
2048ร—1556 25 Progressive bmdMode2k25

2K DCI

Resolution Frame Rate Scan Type DeckLink Mode
2048ร—1080 23.98 Progressive bmdMode2kDCI2398
2048ร—1080 24 Progressive bmdMode2kDCI24
2048ร—1080 25 Progressive bmdMode2kDCI25
2048ร—1080 29.97 Progressive bmdMode2kDCI2997
2048ร—1080 30 Progressive bmdMode2kDCI30
2048ร—1080 50 Progressive bmdMode2kDCI50
2048ร—1080 59.94 Progressive bmdMode2kDCI5994
2048ร—1080 60 Progressive bmdMode2kDCI60

4K UHD

Resolution Frame Rate Scan Type DeckLink Mode
3840ร—2160 23.98 Progressive bmdMode4K2160p2398
3840ร—2160 24 Progressive bmdMode4K2160p24
3840ร—2160 25 Progressive bmdMode4K2160p25
3840ร—2160 29.97 Progressive bmdMode4K2160p2997
3840ร—2160 30 Progressive bmdMode4K2160p30
3840ร—2160 50 Progressive bmdMode4K2160p50
3840ร—2160 59.94 Progressive bmdMode4K2160p5994
3840ร—2160 60 Progressive bmdMode4K2160p60

4K DCI

Resolution Frame Rate Scan Type DeckLink Mode
4096ร—2160 23.98 Progressive bmdMode4kDCI2398
4096ร—2160 24 Progressive bmdMode4kDCI24
4096ร—2160 25 Progressive bmdMode4kDCI25
4096ร—2160 29.97 Progressive bmdMode4kDCI2997
4096ร—2160 30 Progressive bmdMode4kDCI30
4096ร—2160 50 Progressive bmdMode4kDCI50
4096ร—2160 59.94 Progressive bmdMode4kDCI5994
4096ร—2160 60 Progressive bmdMode4kDCI60

8K UHD

Resolution Frame Rate Scan Type DeckLink Mode
7680ร—4320 23.98 Progressive bmdMode8K4320p2398
7680ร—4320 24 Progressive bmdMode8K4320p24
7680ร—4320 25 Progressive bmdMode8K4320p25
7680ร—4320 29.97 Progressive bmdMode8K4320p2997
7680ร—4320 30 Progressive bmdMode8K4320p30
7680ร—4320 50 Progressive bmdMode8K4320p50
7680ร—4320 59.94 Progressive bmdMode8K4320p5994
7680ร—4320 60 Progressive bmdMode8K4320p60

8K DCI

Resolution Frame Rate Scan Type DeckLink Mode
8192ร—4320 23.98 Progressive bmdMode8kDCI2398
8192ร—4320 24 Progressive bmdMode8kDCI24
8192ร—4320 25 Progressive bmdMode8kDCI25
8192ร—4320 29.97 Progressive bmdMode8kDCI2997
8192ร—4320 30 Progressive bmdMode8kDCI30
8192ร—4320 50 Progressive bmdMode8kDCI50
8192ร—4320 59.94 Progressive bmdMode8kDCI5994
8192ร—4320 60 Progressive bmdMode8kDCI60

Releases

Contributors

Languages