Repository navigation
Conversation
The player (video-rtc.js) starts WebRTC and MSE side by side and keeps the one with the higher score: video+audio beats video only. Most cameras send AAC, which WebRTC cannot carry, so the WebRTC stream had no audio track and scored 0x220 against 0x311 for MSE with H.264+AAC. WebRTC was closed a second after it connected and every live view ended up on MSE or HLS, with several seconds of delay. Add an ffmpeg:<stream>#audio=opus source next to the existing #audio=aac one. go2rtc starts the transcoder only when a consumer asks for Opus, so MSE/HLS viewers and recordings are unaffected, and WebRTC now carries audio and wins.
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.
Problem
The live player (
video-rtc.js) starts WebRTC and MSE side by side and keeps whichever scores higher. Video plus audio beats video only.Most cameras send AAC, which WebRTC cannot carry. The WebRTC stream therefore had no audio track and scored
0x220, while MSE with H.264 + AAC scored0x311. WebRTC connected and was closed about a second later. Every live view ended up on MSE, or on HLS in the app after its 9 s timeout, with several seconds of delay.I confirmed this with a packet capture. RTP was flowing to the phone over UDP 8555, then stopped about 2 s later while the MSE consumer stayed.
Change
go2rtcSourcesaddsffmpeg:<stream>#audio=opusnext to the existing#audio=aacsource. go2rtc starts the transcoder only when a consumer asks for Opus, so MSE, HLS and recording are unaffected. WebRTC now carries audio and wins the comparison. As a side effect, the app gets sound in real-time mode.Testing
bun testpasses, withbrands.test.tsupdated for the new source list.