fix(webrtc): make WebRTC FFmpeg stream maps configurable (closes #2) #6

Closed
zgaetano wants to merge 0 commits from fix/issue-2-configurable-map into m2-webrtc-core-integration
Owner

Closes #2.

BuildArgs had -map 0:v:0 / -map 0:a:0 baked in. That's correct for the production case (RTMP / SRT publishers send AV combined on input #0), but it wedges any process whose audio lives elsewhere — multi-input lavfi test scaffolds, multi-camera switches, SDI + separate file-audio.

ConfigWebRTC (and its API DTO twin) now expose VideoMap and AudioMap. Empty strings still mean the old defaults, so existing deployments are untouched.

Tests

TestBuildArgs_DefaultMaps                   ← locks the empty-string default
TestBuildArgs_CustomMaps                    ← drives the multi-input override
TestProcessConfigWebRTCMapsRoundtrip        ← DTO carries the new fields end to end

All race-clean: go test -race ./app/webrtc/... ./http/api/... ./restream/... green.

Stacks

Targets m2-webrtc-core-integration so it lands without depending on the M3 PR (#5). Once M2 lands on main, this can be rebased trivially.

Co-authored with Claude Opus 4.7.

Closes #2. `BuildArgs` had `-map 0:v:0` / `-map 0:a:0` baked in. That's correct for the production case (RTMP / SRT publishers send AV combined on input #0), but it wedges any process whose audio lives elsewhere — multi-input lavfi test scaffolds, multi-camera switches, SDI + separate file-audio. `ConfigWebRTC` (and its API DTO twin) now expose `VideoMap` and `AudioMap`. Empty strings still mean the old defaults, so existing deployments are untouched. ## Tests ``` TestBuildArgs_DefaultMaps ← locks the empty-string default TestBuildArgs_CustomMaps ← drives the multi-input override TestProcessConfigWebRTCMapsRoundtrip ← DTO carries the new fields end to end ``` All race-clean: `go test -race ./app/webrtc/... ./http/api/... ./restream/...` green. ## Stacks Targets `m2-webrtc-core-integration` so it lands without depending on the M3 PR (#5). Once M2 lands on `main`, this can be rebased trivially. Co-authored with Claude Opus 4.7.
zgaetano added 1 commit 2026-05-03 08:11:02 -04:00
fix(webrtc): make WebRTC FFmpeg stream maps configurable (closes #2)
Some checks failed
tests / build (push) Failing after 2s
tests / build (pull_request) Failing after 1s
49677fbd3d
BuildArgs hardcoded -map 0✌️0 / -map 0🅰️0 for the two RTP legs.
Correct for production RTMP/SRT publishers (single combined input),
but breaks any process whose audio lives on a different input index
— multi-input lavfi test scaffolds, multi-camera pipelines, SDI +
file-audio mixes, etc.

Adds VideoMap and AudioMap fields to ConfigWebRTC (and the API DTO),
defaulting to the prior literals so existing deployments are
unaffected. BuildArgs reads them.

Tests:
- TestBuildArgs_DefaultMaps locks the empty-string default behavior
- TestBuildArgs_CustomMaps drives the multi-input override path
- TestProcessConfigWebRTCMapsRoundtrip extends the DTO roundtrip

Closes #2.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Author
Owner

Merged into main via direct push as part of the v0.1.0-dragonfork release. Branch commits are reachable from main; closing this PR. Release: https://forge.wilddragon.net/zgaetano/datarhei-dragonfork-core/releases/tag/v0.1.0-dragonfork

Merged into `main` via direct push as part of the v0.1.0-dragonfork release. Branch commits are reachable from main; closing this PR. Release: https://forge.wilddragon.net/zgaetano/datarhei-dragonfork-core/releases/tag/v0.1.0-dragonfork
zgaetano closed this pull request 2026-05-03 08:28:57 -04:00
Some checks failed
tests / build (push) Failing after 2s
tests / build (pull_request) Failing after 1s

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: zgaetano/datarhei-dragonfork-core#6
No description provided.