audio: record-only mode via negative audioPort#88
Merged
Conversation
Make `outgoing.audioPort` a signed tri-state so audio can be captured and recorded without ever being streamed: < 0 (e.g. -1) capture + record only, no UDP send (NEW) 0 share the video target (unchanged) > 0 dedicated UDP audio port (unchanged) The capture/encode thread still runs and feeds the recording ring on the record-only path; only the network send is skipped. Recording is gated on record.enabled/audio.enabled, independent of audioPort, so audio still lands in TS-format recordings (HEVC recordings carry no audio track). - Widen audio_port uint16_t -> int32_t (venc_config.h, maruko_config.h) - Drop truncating (uint16_t) parse cast; render via pp_field_int - FIELD type FT_UINT16 -> FT_INT (accepts negatives, still MUT_RESTART); settable via config file or /api/v1/set?outgoing.audioPort=-1 - stream_disabled flag on both audio backends; skip output init + guard both send sites; "record-only (no stream)" init log - Test: -1 survives parse + save/reload round-trip - Docs (README, AUDIO_UDP_OUTPUT_FEASIBILITY) + dashboard tooltip + webui blob make test-werror: 1659 passed. make verify: clean (Star6E + Maruko). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a way to enable + record audio without streaming it, by making
outgoing.audioPorta signed tri-state:audioPort< 0(e.g.-1)0> 0The capture/encode thread still runs and feeds the recording ring on the record-only path; only the network send is skipped. Recording is gated on
record.enabled/audio.enabled, independent ofaudioPort, so audio still lands in TS-format recordings.Motivation: previously there was no clean knob for this.
audio.enabled=falsekills recording too;audio.mutesilences the source;audioPort=0mixes audio onto the video stream (UDP) or fully disables audio in SHM mode. A negative value cleanly expresses "capture + record, never transmit" without depending on the video transport.Changes
audio_portuint16_t→int32_t(venc_config.h,maruko_config.h)(uint16_t)parse cast; render viapp_field_intFT_UINT16→FT_INT(accepts negatives viastrtol, stillMUT_RESTART); settable via config file or/api/v1/set?outgoing.audioPort=-1stream_disabledflag on both audio backends (star6e_audio.c,maruko_audio.c); skip output-socket init and guard both send sites;record-only (no stream)init log-1survives parse + save/reload round-tripREADME.md,AUDIO_UDP_OUTPUT_FEASIBILITY.md) + dashboard tooltip + regeneratedvenc_webui.cConstraints
record.format— HEVC recordings carry no audio track (pre-existing).Verification
make test-werror→ 1659 passed, 0 failed (incl. new-1parse + round-trip)make verify→ passed end-to-end (Star6E + Maruko builds + webui-check)audioPort=-1produces no audio socket on the wire while the.tsrecording contains the opus track (3527 packets / 72.7 s). Also verified the runtime API set:/api/v1/set?outgoing.audioPort=-1applies, persists, and respawns into record-only mode.🤖 Generated with Claude Code