You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* probe_coroutine.py: retrieve file metadata in asynchronous pipeline or list using Python `asyncio` coroutines.
19
14
20
15
## FFplay
21
16
22
-
Test ingasynchronous techniques with video playback makes some effects obvious.
17
+
Testing asynchronous techniques with video playback makes some effects obvious.
23
18
The FFplay asyncio example is more advanced than the FFprobe example.
24
19
In the FFprobe example, the lazy asyncio generator produces metadata concurrently as fast as it's requested.
25
20
There is no resource throttling in the FFprobe example, so the CPU could become overwhelmed with context switching.
26
21
27
22
The FFplay example in contrast is an example of a task using resource throttling via asyncio.Queue.
28
-
The queueing could also be implemented for FFprobe style task if desired.
23
+
The queuing could also be implemented for FFprobe style task if desired.
29
24
However, the rationale employed is that the FFprobe task is overall lightweight, and thus other parts of the pipeline inherently limit resource utilization.
30
25
If the FFprobe task was in an asyncio.gather() algorithm, resource utilization could get too high.
31
26
Thus we have a "win-win" by using asyncio generator for FFprobe--the throttling comes implicitly from other parts of the pipeline.
0 commit comments