chore: drop no-op _framerate=15 patch on avatar video track#31
Merged
Conversation
The `avatar._sync.video_track._framerate = 15` line was reasoned to
halve VP8 encode rate by slowing `next_timestamp()` pacing on aiortc's
`VideoStreamTrack`. In practice it does nothing for output rate.
`Agent._prepare_rtc()` wraps our track in a `VideoForwarder` with
`fps=30` hardcoded:
forwarder = VideoForwarder(
self._video_track,
max_buffer=30,
fps=30, # ← drives consumer poll rate
...
)
The forwarder pulls from our track at 30 Hz. With `_framerate=15` the
underlying track simply returns the *same* frame twice in a row; the
forwarder still emits 30 fps and the encoder still runs at 30 fps,
just on duplicate input. CPU savings are effectively zero, and the
absence of visible 15 fps lag confirmed nothing about the output was
actually capped.
`AVSynchronizer.fps` doesn't help either — it controls `_pending`
release timing, not consumer poll rate, so the forwarder's 30 fps
poll dominates.
`sample_rate=24000` on `inworld.TTS(...)` stays — that one *is*
verified working (live memory drop measured after deploy).
|
@aliev must be a member of the GetStreamio team on Vercel to deploy. Learn more about collaboration on Vercel and other options here. |
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.
The
avatar._sync.video_track._framerate = 15line was reasoned to halve VP8 encode rate by slowingnext_timestamp()pacing on aiortc'sVideoStreamTrack. In practice it does nothing for output rate.Agent._prepare_rtc()wraps our track in aVideoForwarderwithfps=30hardcoded:The forwarder pulls from our track at 30 Hz. With
_framerate=15the underlying track simply returns the same frame twice in a row; the forwarder still emits 30 fps and the encoder still runs at 30 fps, just on duplicate input. CPU savings are effectively zero, and the absence of visible 15 fps lag in earlier load tests confirmed nothing about the output was actually capped.AVSynchronizer.fpsdoesn't help either — it controls_pendingrelease timing, not consumer poll rate, so the forwarder's 30 fps poll dominates.What stays
tts=inworld.TTS(..., sample_rate=24000)is unchanged — that one is verified working (live memory drop measured after deploy when Inworld stopped emitting 16kHz that needed in-loop resampling to 24kHz).Followup
If we want to actually cap the outbound encode rate, the lever is the
VideoForwarder'sfpsargument, not the underlying track. That's deeper in framework territory and not worth doing for this demo.