feat(examples): Python バインディングを使った FastAPI 製エコーサーバーを追加する - #350
Open
yuki-uchida wants to merge 2 commits into
Open
feat(examples): Python バインディングを使った FastAPI 製エコーサーバーを追加する#350yuki-uchida wants to merge 2 commits into
yuki-uchida wants to merge 2 commits into
Conversation
yuki-uchida
force-pushed
the
feat/python-echo-example
branch
from
September 8, 2026 01:39
9fc37e9 to
5ef46f4
Compare
examples/python/echo-server runs a MoQT DUAL listener inside a FastAPI process. Objects received on a published track are written back to every session subscribed to the same track name; subscribers join at a group boundary so the echoed stream starts on a keyframe. GET / reports session and track counters. Verified with moq-cli: an ffmpeg test pattern published as demo/video and subscribed from a second moq-cli decodes 150 frames after the first group is skipped.
maturin develop installs into whichever virtualenv it detects, which made the module land in a different .venv than the one running uvicorn. uv sync builds bindings/python as the declared path dependency into the example's own .venv.
yuki-uchida
force-pushed
the
feat/python-echo-example
branch
from
September 8, 2026 14:01
02cc0ec to
916c8a6
Compare
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.
概要
FastAPI プロセス内で MoQT の DUAL リスナーを動かし、publish された track の object を同名 track の購読者へそのまま書き戻すエコーサーバーの example を追加しました。
#349 の上に積んでいます。
やったこと
examples/python/echo-server: lifespan でmoqt.listenを起動。PublishRequestは accept して読み取りタスクへ、SubscribeRequestは track ごとの購読者リストへ登録し、object を同名 track の全購読者(セッション横断)へ fan-outGET /でセッション数・track ごとの受信/echo 数・購読者数を返すやらないこと
TrackWriterが再採番する)影響範囲
テスト
moq-cli subscribe→ ffmpeg testsrc をmoq-cli publishで 6 秒 publish。video 180 object 受信・150 echo(最初の group はスキップ)、受信した H.264 を ffprobe で 150 フレーム 640x360 としてデコード確認備考
delivery timeout: Not enough bytes remainingの ERROR ログが出る。moqt側のデコードログの問題と見ており、この PR では扱わない