All projects

PROJECT / Systems / Network Programming

Custom RTP/UDP Video Streaming Server & Packet Analyzer

A C++17 transport system built directly on POSIX UDP sockets and libpcap. An explicit RTP encoder, validating receiver, and bounded 64-packet jitter buffer handle binary payload delivery, while a passive analyzer reports loss estimates, throughput, and jitter. The demo uses simulated media timing rather than decoded video playback.

Illustrative stock imagery · See the demo screenshot for actual project output

01 / THE PROBLEM

What this build explores

Real-time transport must keep making progress when datagrams arrive late, out of order, or malformed. This project exposes packet encoding, receiver resource limits, and independent telemetry directly through C++ and POSIX APIs.

02 / THE APPROACH

How the pieces connect

The transmitter serializes a 12-byte RTP header explicitly and sends up to 1400 payload bytes per UDP datagram with 33 ms pacing. The receiver uses recvmsg with MSG_TRUNC detection, validates RTP lengths and fields, and reorders packets in a bounded 64-packet window. A 500 ms gap timeout and resynchronization policy prevent indefinite waiting. A separate libpcap analyzer filters traffic and parses link-layer, IPv4, UDP, and RTP headers to report loss estimates, payload throughput, and interarrival jitter.

  1. 01Binary media payload
  2. 02RTP byte encoding
  3. 03Paced UDP datagrams
  4. 04Validate + bounded reorder
  5. 05Output file / passive telemetry

03 / ENGINEERING JUDGMENT

The tradeoffs

Bounded buffering favors memory limits and forward progress over recovering missing data; lost or discarded payload cannot be reconstructed. The implementation uses binary chunks with simulated media timing, without codec encoding/decoding, video playback, RTCP, retransmission, congestion control, or SRTP. Telemetry is intended for a single controlled stream; source/SSRC isolation and RTP timestamp rollover handling remain future work.

A useful next question

Add per-source/SSRC isolation and timestamp rollover handling, then validate on the target Embedded Linux hardware with controlled loss and reordering.

SOURCE & SCOPE

Reviewed against the current hardened README, RTP header encoder/parser, receiver, and passive analyzer. The README records Release and sanitizer-enabled Debug test passes on macOS/Apple Silicon, plus a byte-identical 2 MiB loopback demo. That loss-free run is not a delivery guarantee, maximum-throughput benchmark, or Embedded Linux validation.

Detailed contribution stories and additional benchmarks will be added in a later update.

VALIDATION / REPOSITORY EVIDENCE

What has been checked

  • Repository-documented 2 MiB loopback transfer with byte-for-byte input/output comparison and managed process teardown.
  • Header tests cover exact wire bytes, malformed lengths, extensions, padding, and sequence arithmetic. Loopback/offline-capture tests cover truncation, reordering, duplicates, wraparound, timeouts, shutdown, and parsing.
  • Release and AddressSanitizer/UndefinedBehaviorSanitizer Debug test passes are documented for macOS/Apple Silicon; board-specific Embedded Linux validation remains a next step.

Validation is reported by the linked repository and scoped to its documented environment.

FOLLOW THE IMPLEMENTATION

Explicit RTP wire format and packet validationPaced UDP transmitterBounded jitter-buffer receiverPassive packet analyzerLoopback and offline capture regressions
Read the engineering note: A jitter buffer needs a bound
NEXT BUILDSemanticEdge — Edge-to-Cloud Video Analytics

YOUR GUIDE TO MY WORK

Ask Atharva’s AI

A conversation is a good place to start.

Explore my work, experience, and engineering decisions. Answers use my portfolio information.

AI can make mistakes. Check linked sources. Free portfolio fallback available.