Skip to content

MatejVik/omtsndcli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

omtsndcli_v01

omtsndcli_v01 is the current documented Linux OMT sender CLI snapshot for the sender PC project.

It targets a direct capture path:

Linux sender PC -> Magewell Pro Capture HDMI -> V4L2 / ALSA -> OMT sender

The current source snapshot is based on the proven working implementation from omtcli06_fix.cpp, renamed and documented for repository use.

Current validated state

Validated in the project handoff:

  • Debian 13 sender PC
  • host qduv1
  • 4× Magewell Pro Capture HDMI visible as /dev/video0 to /dev/video3
  • OMT stack already built: libvmx, libomtnet, libomt
  • verified against vMix:
    • discovery works
    • test video works
    • test audio works
    • live V4L2 video works
    • live ALSA HDMI audio works

What the program does

  • sends video from:
    • built-in testcard
    • Linux V4L2 capture device
  • sends audio from:
    • built-in test noise generator
    • ALSA capture device
  • exposes module help for video/audio backends
  • classifies V4L2 formats as passthrough, conversion-only, or unsupported
  • maps user bitrate options onto OMT quality enums
  • prints runtime video/audio statistics every 5 seconds
  • prints sender health roughly every 60 seconds
  • keeps rolling interval data and prints a last-24h summary on exit
  • stops cleanly on SIGINT / SIGTERM

Source file

Primary repo source:

  • omtsndcli_v01.cpp

Lineage source used for this snapshot:

  • omtcli06_fix.cpp

Dependencies

System / project dependencies expected by the current source:

  • C++17 compiler
  • ALSA development headers (alsa/asoundlib.h)
  • Linux V4L2 headers (linux/videodev2.h)
  • OMT C/C++ wrapper header: libomt.h
  • linkable libomt
  • linkable libasound

Build

Example build command used by the current source layout:

clang++ -O3 -std=c++17 -o omtsndcli_v01 omtsndcli_v01.cpp \
    -L. -lomt -lasound -Wl,-rpath,'$ORIGIN'

Reference OMT library build sequence from the validated environment:

cd ~/omt/libvmx/build && bash ./buildlinuxx64.sh
cd ~/omt/libomtnet     && dotnet build -c Release
cd ~/omt/libomt/build  && bash ./buildlinuxx64.sh

Usage

./omtsndcli_v01 [-t video_source] [-s audio_source]

General help

./omtsndcli_v01 -h

Video modules

./omtsndcli_v01 -t help
./omtsndcli_v01 -t testcard:help
./omtsndcli_v01 -t v4l2:help

Audio modules

./omtsndcli_v01 -s help
./omtsndcli_v01 -s testcard:help
./omtsndcli_v01 -s alsa:help

Examples

Testcard video only:

./omtsndcli_v01 -t testcard

Testcard video + testcard audio:

./omtsndcli_v01 -t testcard -s testcard

Magewell / V4L2 video only:

./omtsndcli_v01 -t v4l2:device=/dev/video0

Magewell video with explicit name / format / quality:

./omtsndcli_v01 -t v4l2:device=/dev/video0:name=Cam1:format=YUY2:b=mid

Magewell video + ALSA audio:

./omtsndcli_v01 -t v4l2:device=/dev/video0 -s alsa:hw:2,0

V4L2 with control override example:

./omtsndcli_v01 -t v4l2:device=/dev/video0:ctrl.brightness=128

CLI parameter model

Style:

driver:param=value:param=value

Notable aliases:

  • device= or d=
  • format= or fmt=
  • bitrate= or b=

Supported source modules

Video

testcard

Built-in moving test image. When compatible with 1920x1080 UYVY, it can also try to load:

  • california-1080-uyvy.yuv

Syntax:

-t testcard[:name=Testcard][:width=1920][:height=1080][:fps=60][:format=UYVY][:file=california-1080-uyvy.yuv]

Supported testcard output formats in the current code:

  • UYVY
  • YUY2

v4l2

Linux V4L2 capture input, intended for Magewell cards.

Syntax:

-t v4l2:device=/dev/video0[:name=Cam1][:width=1920][:height=1080][:fps=50][:format=YUY2]
-t v4l2:device=/dev/video0:ctrl.<control_name>=<value>

Module help enumerates:

  • available /dev/video* devices
  • formats
  • sizes
  • frame rates
  • normalized control names

The sender classifies formats into:

  • OMT passthrough
  • conversion-only
  • unsupported

Formats currently handled in code include these categories:

  • passthrough: YUYV/YUY2, UYVY, NV12, YV12, BGR32/BGRA
  • conversion to BGRA: RGB32, RGB24, BGR24
  • explicitly not forwarded as-is: YUV420/YU12/I420

Audio modules

testcard

Built-in audio generator using random noise.

Syntax:

-s testcard[:volume=-20][:rate=48000][:channels=2]

Notes:

  • default volume is -20 dB
  • current implementation expects 2 channels

alsa

ALSA capture device input.

Syntax:

-s alsa:hw:2,0
-s alsa:device=hw:2,0[:volume=0][:rate=48000][:channels=2]

The module help enumerates visible ALSA capture PCM devices.

Quality mapping

The current code accepts both labels and numeric aliases:

  • low or 1 -> OMTQuality_Low
  • mid, medium, 2, or default -> OMTQuality_Medium
  • high or 3 -> OMTQuality_High

Startup prints the resolved OMT quality explicitly.

Runtime output and diagnostics

The sender prints:

  • selected video source
  • selected audio source
  • stream name
  • resolved OMT quality
  • audio frame size
  • capture startup information
  • 5-second interval stats
  • OMT sender connection / tally / totals
  • 60-second sender health line
  • final rolling summary for the last 24 hours

Sender health fields:

  • captured = frames obtained from capture
  • sent = frames accepted by omt_send
  • dropped = send failures
  • late = omt_send exceeded frame-time budget
  • omt_send avg/max = mean and peak send duration in milliseconds

Important interpretation:

  • late does not automatically mean dropped
  • on the validated 1080p50 path, occasional late events can happen while the pipeline still runs correctly

Known tested observations from handoff

Observed/recorded bitrate behavior in earlier testing:

  • low75 Mbit/s
  • medium136 Mbit/s
  • high136 Mbit/s

Interpretation used in the project notes:

  • medium and high looked similar on the tested content
  • that was treated as an observation to re-measure, not yet as a confirmed encoder bug

Signal handling and shutdown

The current source handles:

  • Ctrl+C / SIGINT
  • SIGTERM

On shutdown it:

  • stops V4L2 streaming
  • unmaps capture buffers
  • closes ALSA capture
  • frees frame buffers
  • prints the rolling summary
  • destroys the OMT sender

Recommended next steps in the project

  1. treat omtsndcli_v01.cpp as the canonical repo source
  2. re-measure medium vs. high quality behavior
  3. archive a stable release snapshot
  4. then proceed to multi-instance execution and systemd services

Notes

This repository snapshot is meant to preserve the current known-good implementation state in a cleaner, documented form for GitHub. It does not claim that packaging, install scripts, service units, or multi-instance orchestration are finished.

Licensing

This repository can be published under the MIT License for the project’s own code.

Why this looks safe for the current tree:

  • the checked-in application source directly depends on libomt.h, ALSA, and Linux V4L2 headers
  • the project notes say the sender lineage began from the OMT C++ example sender
  • the Open Media Transport organization lists libomtnet, libomt, libvmx, and Examples as MIT-licensed repositories
  • alsa-lib is LGPL-2.1
  • videodev2.h is part of the Linux V4L2 userspace API and is published under ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)

Practical implications:

  • your application source may be MIT
  • OMT libraries remain under their own MIT licenses
  • ALSA remains under LGPL-2.1; dynamic linking is the normal path on Linux and does not force your own source code to become LGPL, but binary redistribution should still respect LGPL obligations
  • if you later commit vendored copies of libomt.h, libomt.so, libvmx.so, or other third-party files into the repository, keep their original license texts/notices with them
  • no Magewell SDK headers are used in the current source snapshot; capture is done through generic V4L2/ALSA interfaces

This is a technical license check for the current repository contents, not formal legal advice.

About

omt cli sender mostly from hw inputs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages