Problem
The drone demo (and any real-time rendering publisher) encodes every frame at 30fps regardless of whether anyone is watching. This wastes CPU on the H.264 encoder when there are no subscribers.
Proposal
Add an API to detect when a track has active subscribers, so the publisher can skip encoding when nobody is watching. Something like the inverse of unused().await:
// Wait until at least one subscriber exists
track.demanded().await;
// Or check non-blocking
if track.has_subscribers() {
// encode and publish
}
This would allow the game loop to still run (physics/state updates) but skip the expensive RGBA→YUV→H.264 encode pipeline when no viewer is connected.
Context
In dev/drone/src/video.rs, the encoder thread processes every frame unconditionally. With multiple drone instances and dual rendition (720p + 360p), this is 2x H.264 encodes per drone at 30fps even when idle.
Scope
Rust only — this would be an addition to moq_lite::TrackProducer or the moq_mux catalog/import layer.
🤖 Generated with Claude Code
Problem
The drone demo (and any real-time rendering publisher) encodes every frame at 30fps regardless of whether anyone is watching. This wastes CPU on the H.264 encoder when there are no subscribers.
Proposal
Add an API to detect when a track has active subscribers, so the publisher can skip encoding when nobody is watching. Something like the inverse of
unused().await:This would allow the game loop to still run (physics/state updates) but skip the expensive RGBA→YUV→H.264 encode pipeline when no viewer is connected.
Context
In
dev/drone/src/video.rs, the encoder thread processes every frame unconditionally. With multiple drone instances and dual rendition (720p + 360p), this is 2x H.264 encodes per drone at 30fps even when idle.Scope
Rust only — this would be an addition to
moq_lite::TrackProduceror themoq_muxcatalog/import layer.🤖 Generated with Claude Code