Commit fae6e44
root
Add nb_threads parameter to Graph for configurable thread control
Add a configurable `nb_threads` parameter to `Graph.__cinit__` to allow
users to control the number of threads used by the filter graph.
Features:
- `nb_threads=0` (default): Use FFmpeg's auto-detection (no behavior change)
- `nb_threads=1`: Single-threaded execution (safer for some use cases)
- `nb_threads=N`: Use N threads for filter graph execution
- Environment variable `PYAV_FILTERGRAPH_THREADS` can override the setting
This provides flexibility for users who need single-threaded execution
for thread safety reasons, while maintaining backward compatibility
with the default behavior.1 parent 8fb7d1d commit fae6e44
1 file changed
+23
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
16 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
17 | 39 | | |
18 | 40 | | |
19 | 41 | | |
| |||
0 commit comments