Skip to content

examples/camera_streamer: add a camera-free mock sender and publish the first decoded picture - #1476

Open
gareth-morgan-nv wants to merge 4 commits into
teng/5ef2afafrom
gmorgan/CameraStreamingReceiverFix
Open

gareth-morgan-nv wants to merge 4 commits into
teng/5ef2afafrom
gmorgan/CameraStreamingReceiverFix

Conversation

@gareth-morgan-nv

Copy link
Copy Markdown
Contributor

Summary

Stacked on #1410.

  • Mock sender: a camera-free AVS1/TCP server (Python plus ffmpeg) with independent synthetic HEVC streams of any size and rate, a synthetic clock (offset, drift) and a synthetic sensor start-of-frame, so the receiver and anything downstream can run without an Orin or cameras.
  • Mock-to-IPC tests: the mock through the real receiver (NVDEC) to the CUDA IPC buffers.
  • Receiver fix: the decoder called Decode() with no end-of-picture flag, so NVDEC held each picture until the next packet began. The first IDR of every session produced no output and every later picture was published one frame late under the next frame's metadata. Every AVS1 sample is exactly one access unit, so each packet is now marked CUVID_PKT_ENDOFPICTURE, with a pixel-versus-metadata test.

Testing

Mock unit and wire tests (python3 -m unittest discover -s mock_sender/tests) and tests.test_mock_to_ipc_pipeline (needs a GPU). With a flat-luma-per-frame stream the pixel/metadata offset was -1 frame before the fix and 0 after. Nothing here has run on an Orin or real cameras.

🤖 Generated with Claude Code

gareth-morgan-nv and others added 4 commits November 10, 2026 20:57
Serve AVS1 HEVC over TCP so the receiver and CUDA IPC consumers can run
without a Jetson or cameras. Like argus_sender it is the TCP server, serves
one receiver at a time and starts each connection at an IDR with a new
session. Streams are mono, may run at different rates, and can be paused
or disconnected on a schedule. Timing comes from a synthetic clock with a
configurable offset and drift; SOF/TSC and Argus frame timestamps are never
marked valid.

Tests check the records against the receiver's AVS1 parser, mixed-rate
presence, resume at an IDR after a pause, and a new session on reconnect.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Gareth Morgan <gmorgan@nvidia.com>
…tart-of-frame

Mark each frame's start-of-frame TSC valid, a fixed --sof-lag-ms before
capture-ready, with the matching TSC anchor in the bundle header, so the
receiver derives the sensor start time in the sender's wall domain as it does
for Argus. The TSC domain is the mock's own and the stamp stays synthetic.

Default the synthetic clock offset to zero, as with chrony-synced clocks:
consumers that compare sender stamps with the host clock otherwise see the
offset as latency. The mock's accept loop now returns when its listener is
closed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Gareth Morgan <gmorgan@nvidia.com>
…UDA IPC buffers

Run mock_sender, the unmodified camera_receiver (NVDEC) and the
consumer's CUDA IPC client together. Assert frame geometry, sequence and
session metadata, the synthetic SOF lag and real decoded pixels, and that a
forced disconnect yields a new session with restarted counters.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Gareth Morgan <gmorgan@nvidia.com>
The NVDEC parser holds a picture back until the next packet begins unless
the packet is marked as a complete picture. Every packet here is exactly one
access unit, so the first IDR of each session produced no output and every
later picture was published one frame late, under the next frame's metadata.
Mark each packet CUVID_PKT_ENDOFPICTURE.

The pipeline test now requires stream_sequence 1 first and checks that the
decoded luma of flat-level frames matches the metadata frame_number.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Gareth Morgan <gmorgan@nvidia.com>
@coderabbitai

coderabbitai Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

This branch had an error being deployed

1 failed deployment
dev — 1421797a Deployed Nov 11, 2026 by gareth-morgan-nv via publish-wheel #6764
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants