• v0.2.0 98d1bb5296

    v0.2.0 — encoded packet ring
    build / cmake build (CUDA 12.4, Ubuntu 22.04) (push) Failing after 3m3s
    test-u4-runner / u4 runner smoke test (push) Successful in 1s
    build / ffmpeg filter patch (out-of-tree) (push) Has been skipped
    release / build runtime Docker image (push) Failing after 5m58s
    release / build source tarball (push) Successful in 6m2s
    Stable

    gx released this 2026-05-19 17:49:50 +01:00 | 16 commits to main since this release

    Параллельный канал для record/mux consumer'ов без второго RTSP-подключения к камере.

    Highlights

    • Encoded packet ring — отдельный SHM /dev/shm/cuframes-<key>-packets для H.264/H.265 NAL units (variable-length byte buffer + slot index, seqlock-style read).
    • Wire protocol v2 (proto_version=2). Backward-compat: v2 publishers принимают v1 subscribers (frames-only).
    • Public C API:
      • cuframes_publisher_enable_packets(opts)
      • cuframes_publisher_set_codec_extradata(data, size)
      • cuframes_publisher_publish_packet(data, size, pts, dts, flags)
      • cuframes_subscriber_enable_packets() + _next_packet() + accessors
      • cuframes_subscriber_get_codec_params(codec_id, extradata, size)
    • C++ RAII: cuframes::Publisher::enable_packets / set_codec_extradata / publish_packet.
    • cuframes-rtsp-source: --enable-packet-ring CLI flag. Дублирует AVPacket в encoded ring до передачи декодеру.
    • FFmpeg demuxer cuframes_packets://<key>gx/ffmpeg-patched, branch n7.1-cuframes). Companion к существующему cuframes://.
    • 4 новых error codes: PACKET_OVERSIZED, NO_PACKET_RING, NO_CODEC_PARAMS, PACKET_OVERRUN (subscriber на overrun автоматически resync'ается на last keyframe).
    • Stress test libcuframes/tests/test_packet_ring.c: normal flow (2000 packets, payload integrity) + slow consumer scenario (OVERRUN + auto-resync).
    • Protocol spec §10 (397 строк) в docs/protocol.md — byte-exact layout, seqlock semantics, late-subscriber GOP-aligned start.

    Use case — Frigate dual-input

    cameras:
      cam_parking:
        ffmpeg:
          inputs:
            - path: cuframes://cam-parking
              input_args: -f cuframes
              roles: [detect]
            - path: cuframes_packets://cam-parking
              input_args: -f cuframes_packets
              roles: [record]
    

    1 RTSP connection к камере вместо 2-3 (Frigate сейчас открывает отдельный stream для record).

    Полный setup см. в docs/integrations/frigate.md — секция «v0.2: dual-input».

    Limitations (документировано)

    • Sub-stream selection отложено в v0.3 (<key>-substream-<N> naming).
    • Audio packets — v0.3 (тот же ring layout, codec_id = audio).
    • Codec change mid-stream — требует publisher destroy+recreate.

    Зависимости для full pipeline

    FFmpeg builds должны включать cuframes_packets demuxer:

    • gx/ffmpeg-patched branch n7.1-cuframes (uploaded merged PR #1).

    Связано

    Downloads
  • v0.1.0 a3ba3a95b2

    gx released this 2026-05-18 21:13:06 +01:00 | 35 commits to main since this release

    Первый функциональный release. Production-deployed на multi-camera CCTV-стeке (Frigate 0.17 + custom C++ processor, оба обслуживаются одним publisher'ом на одном NVDEC).

    Что внутри

    • libcuframes.so — main shared library: CUDA IPC ring buffer + handshake protocol + cross-process sync через cudaIpcEventHandle_t
    • cuframes.hpp — header-only C++17 RAII wrapper над C API
    • cuframes-rtsp-source — standalone tool: RTSP → NVDEC → cuframes IPC
    • FFmpeg input demuxer cuframes:// — out-of-tree patch для FFmpeg n7.1 (filter/)
    • CMake install rules, Docker runtime image, integration guides

    Tested

    • Stress: 1 publisher × 4 consumer × 2000 frames @ 120 fps — 0 torn, 0 gaps
    • E2E real camera (Dahua 1920×1080 HEVC 25fps) — 100/100 frames, 0 drops
    • Production: 24h uptime, 1 NVDEC обслуживает Frigate detect + custom processor одновременно

    Известные ограничения (v0.2 решит)

    • Только NV12 frame format
    • GPU→CPU copy в FFmpeg demuxer (zero-copy через AVHWFramesContext — v0.2)
    • Только encoded path для decoded frames; для record (mux без decode) consumer открывает свой RTSP — это решает v0.2 encoded packet sharing (см. issue #2)
    • Cross-container CUDA IPC требует ipc+pid namespace share (s6-overlay не совместим — нужен workaround или Frigate-image patch)
    • Только Linux + NVIDIA GPU compute capability ≥ 7.5

    Документация

    Reference deployments

    • gx/cctv PR #20 — C++ cctv-processor через CuframesSource
    • gx/frigate:cuframes Docker image — Frigate с patched FFmpeg (instructions in filter/README.md)

    License

    LGPL-2.1+

    Downloads