Feat/gst consumer capture time - #2657
Open
TangmereCottage wants to merge 10 commits into
Open
Conversation
added 2 commits
July 24, 2026 15:54
Pairs OM1 with the OM1-video-processor GStreamer pipeline, which serves a single muxed A+V RTSP session on one clock. Config (non-breaking; defaults preserve current behavior): - config/unitree_g1_conversation.json5 env-parametrized for ASR plugin/URL and VLM URL. - docker-compose.yml exposes ASR_INPUT_PLUGIN, ASR_RTSP_URL, VLM_RTSP_URL. Code — stamp ASR audio at capture: - packageAudio(pcm, captureMs) stamps the provided capture time. - sendChunkAt(pcm, capture) added; sendChunk kept as a time.Now() wrapper for back-compat. - google_asr.go (local mic) and google_asr_rtsp.go (RTSP) stamp time.Now() when the buffer/chunk is read and pass it through. - Tests updated to pass and assert the capture timestamp. Also adds scripts/bootstrap-go.sh: a no-root installer that pins Go to the go.mod version, for sandboxes/CI without a preinstalled toolchain.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
added 8 commits
July 28, 2026 12:55
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.
Consume the synchronized A+V stream + stamp ASR audio at capture
Pairs OM1 with the OM1-video-processor GStreamer pipeline, which serves a single
muxed A+V RTSP session (
rtsp://localhost:8555/live) on one clock. Two parts:config (repoint consumers) and code (stamp audio capture time at ingest).
Config — repoint consumers (non-breaking)
config/unitree_g1_conversation.json5is env-parametrized; defaults preservecurrent behavior exactly:
type: "${ASR_INPUT_PLUGIN:-GoogleASRInput}"+rtsp_url: "${ASR_RTSP_URL:-rtsp://localhost:8555/live}"(the local plugin ignores theextra key).
rtsp_url: "${VLM_RTSP_URL:-rtsp://localhost:8554/top_camera_raw}"(unchanged default).
docker-compose.ymlexposesASR_INPUT_PLUGIN,ASR_RTSP_URL,VLM_RTSP_URL.To consume the GStreamer stream:
Both consumers read the same muxed URL; each ffmpeg selects its track
(
google_asr_rtspuses-vn,video_rtsp_streamuses-an), so audio andvideo come from one synchronized source.
Code — stamp ASR audio at capture
Previously the audio timestamp was set at package/send time
(
packageAudio→time.Now().UnixMilli()), discarding capture timing. Now:packageAudio(pcm, captureMs)stamps the provided capture time.sendChunkAt(pcm, capture)added;sendChunkkept as atime.Now()wrapperfor back-compat (riva/elevenlabs/parallel unchanged — trivially extendable).
google_asr.go(local mic) andgoogle_asr_rtsp.go(RTSP) stamptime.Now()at the moment the buffer/chunk is read and pass it through.This makes ASR chunks carry capture time, so downstream alignment with
video-derived features works on a common timeline.
Deliberately out of scope (follow-ups)
transcript still reaches the IO layer without a capture timestamp
(
asr_common.goAddInput(..., time.Time{})); mapping it back to the sourceaudio window needs the ASR WS protocol to echo timestamps.
image2pipecarries no per-frame PTS; truecapture-time for video needs a PTS-preserving transport (documented at the
stamp site in
video_rtsp_stream.go).sendChunkAtto the riva/elevenlabs paths (one-line each).Verification
Config validated as JSON5; compose validated as YAML. The Go changes are
mechanical (caller consistency checked:
sendChunkstill present; only the twopackageAudiotest call sites updated) but were not compiled in thisenvironment — run
go build ./... && go test ./plugins/inputs/asr/...in CI.