Stream audio and video over WebRTC with `transport=`, each stream waiting its turn in the queue #13965
hysts
marked this pull request as ready for review 40 days ago
hysts
changed the title Add `gr.WebRTC`, with each stream waiting its turn in the queue Add `gr.WebRTC` and WebRTC streams for `gr.Server`, each waiting its turn in the queue 29 days ago
hysts
marked this pull request as draft 29 days ago
add changeset
c4693a77
Merge remote-tracking branch 'origin/7.0-dev' into webrtc-component
b9276317
Replay a cached stream function's whole run
55291474
End a cancelled stream at once
1ea0b05c
Close a re-rendered stream in its process
d63ed4b5
Keep a stream's logs for a page that reconnects
dff91c19
Send a stream chunk's progress before its wait
ff6fb1d7
Type the stream runs as async generators
18a16b7f
Check a warned stream while its page still reads
0127885e
Move a stream's waiting logs with its event
32c470b9
Check a cached stream replay with both executors
4ef416e7
Revert "Close a re-rendered stream in its process"
ac4df99e
Refuse WebRTC.stream() inside @gr.render
59a1978c
Show a hidden stream error like any event's
ac46ff24
Make no frame of a send-mode handler's return
d8a07a71
Read and drop the tracks a stream does not use
eb9e9b35
Admit a WebRTC stream without a worker thread
6b5f68f4
Count a process's streams when placing sessions
ef030751
Keep two WebRTC tests to their own connections
110285e2
End a stream stopped while it connects as stopped
8666dd1d
Refuse chunks for a WebRTC stream event
b2f7cbca
Give a test's stand-in stream function a lease flag
a0c7aed6
Merge remote-tracking branch 'origin/7.0-dev' into webrtc-component
4baf013e
Give a time limit test room to connect on CI
23f2b17a
Find an app's streams in the events it serves
11c31613
Say nothing when a stream stopped during setup is declined
2068a7da
Keep a handler's error when it breaks the stream's setup
d6a5807f
Keep the duration of a stream handler's gr.Error
b35f4268
Treat a second track of a kind as an extra track
59b8cca6
Count streams when a new session's first event picks a process
8baf9f7a
Acknowledge a client.webrtc() stream once it is over
14534666
Let a backgrounded page start a stream again
c3b2a047
Trim comments and docstrings
6533989b
Trim overlapping tests
03c1710f
Restore tests and comments the trims took too far
5cb810d3
Keep a stream running when its page's heartbeat drops
a2df1955
hysts
marked this pull request as ready for review 20 days ago
hysts
marked this pull request as draft 19 days ago
Merge remote-tracking branch 'origin/7.0-dev' into webrtc-component
545bde9e
Rework WebRTC as a transport of Gradio streaming
2474138a
hysts
changed the title Add `gr.WebRTC` and WebRTC streams for `gr.Server`, each waiting its turn in the queue Stream audio and video over WebRTC with `transport=`, each stream waiting its turn in the queue 15 days ago
add changeset
04e391b2
Fix type errors, skill file and docs left from the rework
bf4f7448
Refuse transport streams that could not work
59db2149
Fail a stream whose other inputs cannot be preprocessed
c1371d46
Send component updates and type changes of stream outputs
e7adee42
Repeat the last frame for a skipped video output
41fbe075
Word the receive-stream generator error without mode=
152306b3
End a transport stream when its component unmounts
1c707889
Keep a newer stream's live media and send the newest inputs
9cf8c431
Take named values in send_chunk() of a WebRTC stream
d0d7f0d9
Format the new tests and fix their type errors
7d590d09
Stream audio and video together from gr.Server
29cd6afa
Document stream_every for streams with transport=
093b89af
Close the camera or mic when a WebRTC stream fails
c79b26e9
Keep gr.State inputs of a WebRTC stream in step
159720c6
Allow for a lost last result in the State stream test
c8a00657
Put the component of a WebRTC stream in streaming mode
271a38b4
Do not round stream_every to whole frames a second
211d753a
Check that media_output can show the stream's media
3c52c053
Accept Optional media hints on gr.Server WebRTC endpoints
8acebe94
Move the handler classes to gradio.streaming
413fd4be
Refuse handler classes without transport=
045c776b
Import gradio.streaming with gradio
f87ae436
Add ReplyOnPause for voice agents
62c13b93
Type fn as accepting stream handler instances
f8ab6fb6
Keep the subclass when ReplyOnPause is copied
bb969cfa
Merge remote-tracking branch 'origin/7.0-dev' into webrtc-component
7b50aefe
Merge remote-tracking branch 'origin/7.0-dev' into webrtc-component
4c749fbb
Skip the WebRTC tests without aiortc
173c9ba8
Fix stale RemoteEventHandle docstring
93a3f0e6
Refuse transport= on chained listeners
a065b4f3
Detect OAuth hints of a ReplyOnPause function
2be269ce
Keep show_progress_on, scroll_to_output and key
76913952
Look up kept history messages by id
d41c2f40
Tidy up the stream's input counter and skip check
5b1dec81
Say what output_every compares a value with
7be3bb27
Refuse transport= streams inside @gr.render
fd3e1150
Keep gr.Video an ordinary output after a WebRTC stream
70a66e95
Point at the return hint when an endpoint has no outputs
e73dc891
Resume a WebRTC stream's event instead of starting one
c849a431
Send no local media in a stream that only receives
101f497c
Drop stream code that nothing uses any more
3ea4e6f6
Check for the webrtc extra in one place
440fccc8
Narrow the stream function in the return hint test
7da96a2c
Refuse a non-numpy type= on a WebRTC stream's input
3900343b
Merge remote-tracking branch 'origin/7.0-dev' into webrtc-component
061ac86c
Merge remote-tracking branch 'origin/7.0-dev' into webrtc-component
e29d3f62
Merge remote-tracking branch 'origin/7.0-dev' into webrtc-component
030c5dbe
Keep core Gradio free of numpy with streams
dc09be6f
add changeset
954350cd
Fix the numpy check under a blocking import hook
975aec11
Add a driver for .stream() generators
1eead0ab
Send WebRTC stream frames to a generator
f34444ff
Send HTTP stream chunks to a generator
1895f47f
Type gr.Server generator streams by what they are sent
92704175
Document generator functions for .stream()
2568b967
Stop recording when a stream's generator returns
1fba88dc
Refuse queue=False for .stream() generators
f0ff9ed2
add changeset
156c546e
Name gr.Server generator inputs with a NamedTuple
4f221cba
Stop recording when a stream's generator fails
21a0c419
Start a stream's time limit at its first step
7900f56e
Add on_time_limit="stop" to end a stream at its limit
d7e8dffb
Let a stream go on past time_limit while nobody waits
957c752e
Let a WebRTC stream go on past time_limit too
30dd9201
Rejoin the queue when a WebRTC stream hands over
1d87fecc
Test time limit periods of receive-only WebRTC streams
282fc174
Tell ZeroGPU visitors once that a stream goes on
3e609c8a
Document on_time_limit in the streaming guides
91d63392
Mark a rejoin explicitly instead of any pending
176314b1
Format the WebRTC tests
53dcd082
Merge 7.0-dev into webrtc-component
52884fc6
Take named arguments for undocumented endpoints
93cc1f7c
Leave gr.Server WebRTC endpoints out of the API docs
b9268d87
Refuse API settings on a stream with transport=
23d300b6
Revert the undocumented stream endpoints
05bdf8ea
Let clients call a WebRTC stream once with a file
e5be6ed6
Run a stream called once as an ordinary event
fa173f21
Say which file a stream called once takes
983a0438
Run a chunk once when it waited for a worker
0f7ede70
Refuse stream generators with defaulted inputs
78138054
Refuse a stream time_limit that is not above 0
51aa55a6
Keep .change for a streaming gr.Video in Interface
20d25b6b
Hand over at time_limit when streams hold workers
ed6a756b
Fail a generator stream whose process exited
45f81179
Pad odd-sized video frames to even sizes
50ce4a8d
Play mono stream audio at its level
614c99db
Compare stream outputs when they go out
0b72c983
Say which arrays a stream frame can be
17940c6c
Pace output checks that find nothing changed
a5d2e169
Check room without reserving it when handing over
09a973f7
Test the lease hand-over and steady the chunk test
d74b5d9e
Keep a WebRTC stream's state on other events' status
51d2f844
Stop the previous camera when switching cameras
29c55e62
Read the Interface test's config with get_config_file
c1026597
Keep the Interface test's Video for its id
ca5bfdaf
Revert "Pace output checks that find nothing changed"
3c2a275a
Revert "Compare stream outputs when they go out"
6aec439d
Ask the process pool before handing a stream over
e089c1a4
Trim the round 51 tests
48468347
Say when a stream hands over at its time limit
ba4fc63f
Fail a stream that never connects
4b4549de
Hand over only a stream that closed
246a7c86
Treat a stream called once as an ordinary event
07ecc102
Prepare stream inputs in the launched app
3ea9a0de
Say gradio.streaming needs numpy
59cd3626
Write the numpy bound in full
42c38730
Format the round 52 changes
26bb9539
Give a test's prepare_inputs the new signature
6a3658ea
Give the numpy check's noqa a reason
0cdea67d
abidlabs
approved these changes
on 2026-11-24
Merge 7.0-dev into webrtc-component
999fcfbd
Refuse eta= on a stream with transport=
5e387d5f
Read only uploaded files when a stream is called
ed7dca92
Carry gr.State into generator streams over WebRTC
9076a3ec
End a camera or mic stream whose browser went away
4131f0b1
Port the immersive demo guide off FastRTC
cf822d8c
Document a transport stream as the app's function
d30bbae7
Close a WebRTC stream at once when the page goes
ee001b68
Acknowledge the event a WebRTC stream handed over
cbafbbaf
Read a WebRTC stream's statuses whatever events it yields
0a4a6ab7
Estimate the wait behind a stream to its period's end
4e978508
Record an event taken out of the line as cancelled
11c20b6e
Show a received stream in an interactive output
f072a95a
Start a WebRTC stream on a Record click right after one
f0b416ec
Ignore a connect failure of a stream that rejoined
9406cf08
Report a WebRTC stream that cannot join the queue again
08767cd2
Pass the caller's headers to a WebRTC stream's join
1bb5c179
Answer overlapping next() calls of a WebRTC stream
a06f6d2c
Fail a WebRTC stream whose media has no usable track
3535cd60
Hand a stream over to whom its process keeps waiting
462d7517
Upload files among a WebRTC stream's other inputs
001d870b
Keep a stream going after a slow first call
9faab0ea
Give an audio-video handler its loop with video only
0ec4bec6
Explain a video function that takes frames via *args
b6e9482f
Clear a handler's audio on the event loop
2f5c8da1
Run a stream's shutdown in its handler's context
7589113c
Give a generator stream a gr.Progress of its own
3ace9b1a
Send the listener's component only from .stream()
85c185a7
Check time_limit only on stream events
2398aa0d
Tell a stream id apart as the stream's function does
08097096
Refuse ReplyOnPause(pause_seconds=0)
ab31f8a8
Refuse js= with transport= on a js-only event too
214c4ee6
Close a generator whose call was cancelled late
d669d5e9
Count a generator stream as work in its process
2c25f3fc
Correct WebRTC stream docs and messages
72120af0
Declare submit()'s headers parameter on Client
f503e7e0
Wait for a stream's running calls before the next one
bbcc5de6
Call click() with time_limit through Any in a test
b2b927f1
Keep stream_transport on a camera that starts its stream
9ffc02da
Test that the next stream waits for a running call
2c5e6342
Document @spaces.GPU generator streams on ZeroGPU
fe8dd6dd
Merge remote-tracking branch 'origin/7.0-dev' into webrtc-component
c47ff8fb
Stub play() in the camera switch test
62008908
Count a stream's time limit only while it runs
55ecf3dc
Say that start_up should return once ready
298c258f
Check files in a gr.Server stream's inputs
dc22cdbd
Keep outputs when an HTTP stream generator ends
95af02e4
End a WebRTC generator stream without a warning
c41e5c8d
Point the TURN error at WebRTCOptions
4c4460e3
Install the components extra in WebRTC guides
8f8c9ba2
Read a stream's return value as an event's
286d6017
Show the camera preview while a stream rejoins
89bcdb30
Do not fail a stream for errors after its end
bfd6a255
End a WebRTC stream stopped while it starts
696096cb
Start one stream for Record, Stop, Record
555ca9b5
Hand a stream over on a process being retired
584b2d68
Install Pillow with the webrtc extra
84176f9e
Refuse skip_frames=False together with stream_every
d8aa50fe
Refuse a sendonly offer for a send-receive stream
f7701d98
Keep a webcam recording when another stream ends
271a26d3
Say that a cancelled WebRTC stream ended
39ae05da
Close a WebRTC stream's queue event once
315b4ae4
Refuse a stream generator that takes *args
244792f5
Send a chunk that came in line to a stream once
931156d3
Keep the stream's camera when a switch lands late
6919e832
Word the ZeroGPU notice for streams without GPU
8ca1013e
Add transport= to gr.on
7159cc7e
Fix stream docs and messages the code contradicts
21779058
End an HTTP stream generator with its last outputs
456b8e2e
Refuse sendonly only for a stream's own track
14b41cfc
Test a close just after a stream left the line
b8b6b13d
Keep (frame, CloseStream) in VideoEmitType
7aab0f20
Say that late inputs, not the network, ended it
7dbf5d9e
Refuse an audio-video offer missing a track
dfa91ca8
Do not hold a skip_frames=False stream to fps
ba4d3778
End a stream called once at its CloseStream
ccb2e3cf
Ignore a value returned by a stream without outputs
684efa93
Mention the 30 fps cap in gr.on's stream_every
992df034
Add reference pages for gradio.streaming
72a8f9d9
Trim the webcam guide back to its tutorial
10c23ade
Say that gr.Video streams with transport="webrtc"
54bfe664
hysts
marked this pull request as ready for review 4 days ago
Report a 429 instead of freezing the stream
50760086
Keep an output image's load when the next arrives
31f77177
Send a camera's frames one at a time
42be57b5
abidlabs
approved these changes
on 2026-11-30
Give up on a camera frame whose upload hangs
055f51d0
Keep the defaults of gr.Server stream parameters
d35b00f1
Continue a capped utterance instead of cutting it
a9d5dfbf
End a stream whose camera or microphone stops
01f28fda
Send a plain audio function's output at 48 kHz
2e42d0da
Complete an ended stream after its shutdown
bcb97eab
Add the WebRTC webcam guide's app as a demo
6c24fedd
Skip TURN in the guide's snippet outside a Space
66bcb9dc
Skip type checks of the new demo's optional imports
354a8862
Remove the FastRTC-era YOLO webcam demo
b582c3a9
Let a pause end a capped utterance's continuation
646c7ede
Let ReplyOnPause send at another sample rate
fa795ee8
Wait for an ended stream's shutdown only once
5686578b
Check BlockFunction.api_params against None
26d424f9
Keep a slow link's longer wait for camera frames
13244faa
Give a stopped camera 5 s before ending the stream
520571d5
Letterbox the WebRTC guide demo's frames
26e44c41
Merge remote-tracking branch 'origin/7.0-dev' into webrtc-component
7ba15961
hysts
merged
13250d53
into 7.0-dev 7 hours ago
hysts
deleted the webrtc-component branch 7 hours ago
Login to write a write a comment.
Login via GitHub