Add UDP traffic analysis tools for GStreamer video debugging

This commit is contained in:
yair
2025-11-14 19:52:11 +02:00
parent 3a799c0a65
commit bdb89b2632
3 changed files with 383 additions and 0 deletions

View File

@@ -46,6 +46,57 @@ uv run .\scripts\recv_raw_rolling.py --no-display
See [`scripts/recv_raw_rolling.py`](scripts/recv_raw_rolling.py) for the Python implementation with debug options.
### UDP Traffic Analysis & Debugging
To inspect and analyze the raw UDP packets being transmitted:
```pwsh
# Detailed payload analyzer - shows format, dimensions, pixel statistics
uv run .\scripts\udp_payload_analyzer.py
```
**Example Output:**
```
================================================================================
PACKET #1 @ 17:45:23.456
================================================================================
Source: 127.0.0.1:52341
Total Size: 7368 bytes
PROTOCOL ANALYSIS:
--------------------------------------------------------------------------------
protocol : RAW
header_size : 0
payload_size : 7368
VIDEO PAYLOAD ANALYSIS:
--------------------------------------------------------------------------------
📹 Real camera data - Single line 2456x1 BGR
Format: BGR
Dimensions: 2456x1
Channels: 3
PIXEL STATISTICS:
--------------------------------------------------------------------------------
Channel 0 (B/R) : min= 0, max=110, mean= 28.63, std= 16.16
Channel 1 (G) : min= 17, max=233, mean= 62.39, std= 36.93
Channel 2 (R/B) : min= 25, max=255, mean= 99.76, std= 49.81
HEX PREVIEW (first 32 bytes):
--------------------------------------------------------------------------------
19 2e 4a 12 30 41 0a 2f 3f 01 32 3e 00 32 40 00 31 45 18 2d 4c 1e 2d...
SESSION SUMMARY:
Total Packets: 235
Total Bytes: 1,731,480 (7368 bytes/packet)
```
The analyzer automatically detects the format, shows pixel statistics per color channel, and provides a hex preview for debugging. Perfect for verifying data transmission and diagnosing issues.
```pwsh
# Simple packet receiver (no analysis, just basic info)
uv run .\scripts\udp_sniffer_raw.py
```
## Configuration Notes