End-to-end MPEG-TS streaming of H.264 video with MISB ST 0601.8 KLV metadata over UDP.
Receiver first:
python3 examples/udp-pipelines/python/udp_receiver_93tags.py \
--host 0.0.0.0 --port 5000Then sender:
python3 examples/udp-pipelines/python/udp_sender_93tags.py \
--host 127.0.0.1 --port 5000 --count 50cmake -S . -B build -DGSTKLVPLUGIN_BUILD_EXAMPLES=ON
cmake --build buildThe C++ example binaries are built via CMake. Meson still builds the plugin and tests, but not the example executables.
Receiver first:
./build/gstklv_udp_receiver --host 0.0.0.0 --port 5000Then sender:
./build/gstklv_udp_sender --host 127.0.0.1 --port 5000 --count 50- Sender still uses
mpegtsmux alignment=7, so TS leaves in1316-byte network-friendly buffers. - Receiver uses
udpsrcwith MPEG-TS caps:video/mpegts, systemstream=true, packetsize=188. - PMT signaling is the same as the SRT examples because the transport differs, not the mux/signaling path.
- The receiver keeps video and decoded-KLV output clock-synchronised, so terminal prints follow the visible frame instead of a separate metadata-only timeline.
flowchart LR
A["videotestsrc"] --> B["videoconvert"]
B --> C["x264enc"]
C --> D["h264parse"]
D --> E["klvframeinject"]
E -->|video_src| F["queue"]
F --> G["mpegtsmux<br/>alignment=7"]
E -->|klv_src| H["queue"]
H --> I["meta/x-klv<br/>parsed=true<br/>stream-format=klv<br/>stream-type=21"]
I --> G
G --> J["tspmtrewrite"]
J --> K["udpsink"]
flowchart LR
A["udpsrc<br/>caps=video/mpegts"] --> B["tsdemux"]
B -->|video/x-h264| C["queue"]
C --> D["h264parse"]
D --> E["avdec_h264"]
E --> F["videoconvert"]
F --> G["videosink"]
B -->|meta/x-klv| H["queue"]
H --> I["klvmetadec"]
I --> J["fakesink / appsink"]
Practical note:
--print-summarygives the most stable live preview.--print-allis still useful for debugging, but console throughput can become the limiting factor before the transport does.
The UDP examples use the same tspmtrewrite behavior as the SRT examples:
stream_type = 0x06registration_descriptor = KLVAmetadata_descriptor (0x26) = present
That is the current repo behavior because it works with GStreamer tsdemux for raw KLV.
| Symptom | Resolution |
|---|---|
| Receiver prints KLV but the video window never starts | Check that sender still uses mpegtsmux alignment=7, and keep the receiver decode path as h264parse ! avdec_h264 ! videoconvert ! videosink |
| Prints do not seem aligned to the displayed frame | Keep the current receiver sync settings and prefer --print-summary when inspecting live streams |
- doc/srt_pipelines.md — Same workflows over SRT
- doc/examples_cpp.md — C++ examples overview
- doc/examples.md — Full examples map