Skip to content

feat: adapt bitrate and keyframes on loss instead of freezing - #43

Merged
kvm404 merged 2 commits into
mainfrom
feat/degraded-network
Aug 18, 2026
Merged

kvm404 merged 2 commits into
mainfrom
feat/degraded-network

Conversation

@kvm404

@kvm404 kvm404 commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • Bitrate table per quality preset (360p is no longer 4 Mbps).
  • BitrateController steps bitrate down on encoder drops and requests faster IDRs.
  • Receiver h264parse config-interval=-1; jitterbuffer stays 150ms.
  • Linux /status can set request_keyframe when RTP is stale.

Why

v0.2 PR 7. Stay live on lossy Wi-Fi instead of freezing until the next GOP.

Testing

  • Unit tests
  • Manual Android verification

Evidence: go test ./... / -race; JAVA_HOME=... ./gradlew testDebugUnitTest.

Compatibility Impact

  • GStreamer/media pipeline
  • Android camera/encoder behavior

No Android /status poll yet (PR 5 watchdog). Adaptation is drop-driven; noteReceiverAge / noteRequestKeyframe are hooks.

Privacy/Security Impact

  • Not applicable

Notes

Draft. May conflict with #42 on control/server.go — restack after that merges if needed. No 15 fps toggle (PR 9). No /telemetry.

kvm404 added 2 commits August 18, 2026 07:25
Use the per-preset bitrate table, step MediaCodec bitrate and IDR cadence
from encoder input drops, and repeat SPS/PPS on the receiver so a shredded
GOP stays live instead of frozen until the next keyframe.
@kvm404
kvm404 force-pushed the feat/degraded-network branch from 15bad62 to ec6fa2f Compare August 18, 2026 01:56
@kvm404

kvm404 commented Aug 18, 2026

Copy link
Copy Markdown
Owner Author

Restacked onto main after #42 and #45. Combined request_keyframe with the existing richer /status (receiver restarts + one-shot secrets). Local go test ./... + race on control/gstreamer + Android testDebugUnitTest passed.

@kvm404
kvm404 marked this pull request as ready for review August 18, 2026 01:59
@kvm404
kvm404 merged commit fe25173 into main Aug 18, 2026
2 checks passed
@kvm404
kvm404 deleted the feat/degraded-network branch August 18, 2026 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant