{
  "markdown": "# libmisbklv\n\n[![CI](https://github.com/nitsuga/libmisbklv/actions/workflows/ci.yml/badge.svg)](https://github.com/nitsuga/libmisbklv/actions/workflows/ci.yml)\n\nC++20 library to read and write MISB KLV metadata — ST 0601 (UAS Datalink Local\nSet) + ST 0903 (VMTI) — from/to MPEG-TS containers via\n[GStreamer](https://gstreamer.freedesktop.org/) (file or stream; real-time\ninsertion via `appsrc`). Video passthrough can generate ST 0604 Precision Time\nStamp SEI into the H.264 stream on request\n([ADR 0024](context/decisions/0024-sei-generation-opt-in.md); off by default,\nso passthrough video is byte-identical); the rest of\nST 0604 (ES-layer timestamp *reading*, H.265 Nano, Commercial time code) and an\nffmpeg backend are deferred — see\n[ADR 0008](context/decisions/0008-media-backend-gstreamer.md) and\n[ADR 0009](context/decisions/0009-st0604-deferred.md).\n\n## Features\n\n- **ST 0601** UAS Datalink LS and **ST 0903** VMTI — embedded (Item 74),\n  standalone, and VTarget Series — decode and byte-exact re-encode.\n- **ST 1201 IMAPB** float↔integer mapping (incl. structural special values),\n  cross-checked against the standards' vectors and jmisb.\n- **MPEG-TS via GStreamer**: extract `stream_type` 0x06 from a file or live\n  `udp:` / `srt:` source, and insert to a file or live sink (clock-paced), all\n  with stock GStreamer — no custom plugin.\n- **Video passthrough on insert**: point the sink at a source file, RTSP URI, or\n  explicit GStreamer pipeline and its video elementary stream is re-muxed\n  unchanged (parsed, never decoded) alongside your KLV — one call writes a TS\n  with both a video PID and a KLV PID.\n- **gst-free file extraction**: pull `stream_type` 0x06 **and** 0x15 KLV from a\n  `.ts` buffer with zero dependencies (`extract_ts_klv`); GStreamer is only\n  needed for live sources.\n- **High-level API**: an owned, editable `Message` (typed `get<T>`/`set`,\n  byte-exact `encode`) plus a `KlvStream` / `KlvSink` read-edit-write facade —\n  read and write share one timeline, so editing a stream doesn't re-time it;\n  terminal read errors are checked explicitly after iteration, and a live sink's\n  backend failure can be polled and latest video delivery observed without\n  blocking.\n\n## Quick start\n\n```cpp\n#include \"misbklv/stream.hpp\"\nusing namespace misbklv;\n\nKlvStream in(\"input.ts\");            // a file, or \"udp:127.0.0.1:5004\" / \"srt:...\"\nKlvSink   out(\"file:output.ts\");\nif (out.error()) return;               // open_insert failed\nfor (Message& m : in) {\n  if (auto lat = m.get<double>(tags::Uas0601::SensorLatitude))\n    m.set(tags::Uas0601::SensorLatitude, Value{*lat + 0.001});   // nudge ~100 m north\n  if (!out.emit(m)) return;\n}\nif (in.error()) return;                // extraction or Message parse failed\nif (!out.close()) return;\n```\n\nFull walkthrough (including the gstreamer-free path) in [`docs/api.md`](docs/api.md).\n\n## Use in your project\n\n```cmake\n# Core only (Message, parse, codec) — no gstreamer dependency:\nfind_package(misbklv REQUIRED)\ntarget_link_libraries(app PRIVATE misbklv::misbklv)\n\n# ...or with the streaming facade (KlvStream / KlvSink), which needs gstreamer:\nfind_package(misbklv REQUIRED COMPONENTS gst)\ntarget_link_libraries(app PRIVATE misbklv::gst)\n```\n\n## Build from source\n\n```sh\n# Preferred — presets (CMake ≥ 3.21, CMakePresets.json v3; same presets CI uses):\ncmake --preset release          # or debug / sanitize\ncmake --build --preset release\nctest --test-dir build/release\n# debug → build/debug (Debug + GStreamer ON); sanitize → build/sanitize\n# (Debug + MISBKLV_SANITIZE=ON, MISBKLV_GSTREAMER=OFF core-only)\n# Presets place builds under build/* and set jobs=6 via a hidden base (nproc 7 → 6).\n\n# Fallback without presets:\ncmake -S . -B build\ncmake --build build\nctest --test-dir build\n```\n\nThe build and tests use project-owned synthetic fixtures. The `data/` directory\nis reserved for developer-provided media and is not required for a normal build.\nThe small generated fixtures are committed, so a normal build does not require\nPython or network access.\n\n### Requirements\n\n- **CMake ≥ 3.20** and a **C++20** compiler (GCC ≥ 11). The core library\n  (`misbklv::misbklv`) has no additional runtime or link dependencies.\n- **GStreamer ≥ 1.20** — *optional*, only for the streaming facade\n  (`misbklv::gst`). To **build** it you need `pkg-config` and the dev files for\n  `gstreamer-1.0`, `gstreamer-app-1.0`, and `gstreamer-codecparsers-1.0` (the\n  H.264/H.265 codecparsers; on Debian/Ubuntu this ships in the plugins-bad\n  `*-dev` package); to **run** it (and the gstreamer tests) you also need the\n  runtime plugins that provide the pipeline elements — MPEG-TS mux/demux and\n  SRT are in *plugins-bad*, UDP in *plugins-good*, app/core in *plugins-base*.\n  Without GStreamer the core still builds and its tests run; the facade and its\n  tests are skipped.\n\n### Ubuntu / Debian\n\n```sh\n# core build + tests\nsudo apt-get install -y cmake g++\n\n# ...plus the streaming facade (misbklv::gst): dev files + runtime plugins\nsudo apt-get install -y \\\n  pkg-config libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \\\n  libgstreamer-plugins-bad1.0-dev \\\n  gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad\n```\n\n### Other Linux\n\nNames vary by distro; you need a C++20 toolchain, CMake, and `pkg-config`, and —\nfor the facade — the GStreamer 1.x dev files (`gstreamer-1.0`,\n`gstreamer-app-1.0`, `gstreamer-codecparsers-1.0`) plus the base/good/bad\nruntime plugins. For example:\n\n- **Fedora:** `gcc-c++ cmake pkgconfig gstreamer1-devel gstreamer1-plugins-base-devel gstreamer1-plugins-bad-free-devel gstreamer1-plugins-base gstreamer1-plugins-good gstreamer1-plugins-bad-free`\n- **Arch:** `gcc cmake pkg-config gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad`\n\nPython 3.11+ is needed only to run the optional `regenerate-registry` and\n`regenerate-synthetic-fixtures` targets; their committed outputs are checked for\ndrift in CI.\n\n## Status\n\nThe KLV core (ST 0601 + ST 0903) and the GStreamer media backend are implemented\nand tested, and the library is installable via `find_package`. See\n[`planning/ROADMAP.md`](planning/ROADMAP.md) and\n[`planning/PROGRESS.md`](planning/PROGRESS.md) for the plan and current status,\nand [`context/decisions/`](context/decisions/) for the architectural decisions\n(ADRs).\n\nAgent working instructions live in [`AGENTS.md`](AGENTS.md) — the one canonical,\nvendor-neutral copy. `CLAUDE.md` is a one-line `@AGENTS.md` import, since Claude\nCode auto-loads that filename; supporting another agent means adding another\nthin pointer, never a second copy of the rules.\n\n## License\n\nApache-2.0 — see [`LICENSE`](LICENSE).\n",
  "bytes": 6641,
  "sha": "6f44823c2acc4fda0c18cce904c8862bbcb00f1020ee0e937112666628c6300c",
  "repo_slug": "nitsuga/libmisbklv",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/okf_nitsuga_libmisbklv_context_index_md_3bf35701/readme"
}