-
v0.2.0 — encoded packet ring
Stablebuild / cmake build (CUDA 12.4, Ubuntu 22.04) (push) Failing after 3m3stest-u4-runner / u4 runner smoke test (push) Successful in 1sbuild / ffmpeg filter patch (out-of-tree) (push) Has been skippedrelease / build runtime Docker image (push) Failing after 5m58srelease / build source tarball (push) Successful in 6m2sreleased 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()+ accessorscuframes_subscriber_get_codec_params(codec_id, extradata, size)
- C++ RAII:
cuframes::Publisher::enable_packets / set_codec_extradata / publish_packet. cuframes-rtsp-source:--enable-packet-ringCLI flag. ДублируетAVPacketв encoded ring до передачи декодеру.- FFmpeg demuxer
cuframes_packets://<key>(вgx/ffmpeg-patched, branchn7.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_packetsdemuxer:gx/ffmpeg-patchedbranchn7.1-cuframes(uploaded merged PR #1).
Связано
- Issue #2 — feature request с motivation
- PR #4 — full implementation
gx/ffmpeg-patchedPR #1 — FFmpeg demuxerdocs/protocol.md§10 — wire protocol
Downloads
- Encoded packet ring — отдельный SHM
-
v0.1.0 — Foundation Stable
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_tcuframes.hpp— header-only C++17 RAII wrapper над C APIcuframes-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
Документация
- README.md — quickstart
- docs/architecture.md — design + IPC internals
- docs/integration.md — guides для downstream проектов
- filter/README.md — FFmpeg demuxer
- CHANGELOG.md — release notes
- ROADMAP.md — что дальше (v0.2, v0.3, v1.0)
- BENCHMARKS.md — измерения
Reference deployments
- gx/cctv PR #20 — C++ cctv-processor через
CuframesSource gx/frigate:cuframesDocker image — Frigate с patched FFmpeg (instructions in filter/README.md)
License
LGPL-2.1+
Downloads