-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdevices.html
More file actions
364 lines (334 loc) · 25.6 KB
/
devices.html
File metadata and controls
364 lines (334 loc) · 25.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="./">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Hardware I/O Device Enumeration — python-ffmpegio 0.11.0 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=80d5e7a1" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />
<link rel="stylesheet" type="text/css" href="_static/plot_directive.css" />
<link rel="stylesheet" type="text/css" href="_static/css/custom.css?v=048f17f8" />
<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=f3b36f1a"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home">
python-ffmpegio
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<!-- Local TOC -->
<div class="local-toc"><ul>
<li><a class="reference internal" href="#">Hardware I/O Device Enumeration</a><ul>
<li><a class="reference internal" href="#how-to-use">How to Use</a></li>
<li><a class="reference internal" href="#references">References</a><ul>
<li><a class="reference internal" href="#ffmpegio.devices.scan"><code class="docutils literal notranslate"><span class="pre">scan()</span></code></a></li>
<li><a class="reference internal" href="#ffmpegio.devices.list_sources"><code class="docutils literal notranslate"><span class="pre">list_sources()</span></code></a></li>
<li><a class="reference internal" href="#ffmpegio.devices.list_sinks"><code class="docutils literal notranslate"><span class="pre">list_sinks()</span></code></a></li>
<li><a class="reference internal" href="#ffmpegio.devices.list_source_options"><code class="docutils literal notranslate"><span class="pre">list_source_options()</span></code></a></li>
<li><a class="reference internal" href="#ffmpegio.devices.list_sink_options"><code class="docutils literal notranslate"><span class="pre">list_sink_options()</span></code></a></li>
<li><a class="reference internal" href="#ffmpegio.devices.resolve_source"><code class="docutils literal notranslate"><span class="pre">resolve_source()</span></code></a></li>
<li><a class="reference internal" href="#ffmpegio.devices.resolve_sink"><code class="docutils literal notranslate"><span class="pre">resolve_sink()</span></code></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">python-ffmpegio</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">Hardware I/O Device Enumeration</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/devices.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="hardware-i-o-device-enumeration">
<span id="devices"></span><h1>Hardware I/O Device Enumeration<a class="headerlink" href="#hardware-i-o-device-enumeration" title="Link to this heading"></a></h1>
<p>FFmpeg supports <a class="reference external" href="https://ffmpeg.org/ffmpeg-devices.html">a number of hardware I/O devices</a>,
from which video or audio data are read (sources) and to which data are written (sinks).
For each device, which is specified via <code class="docutils literal notranslate"><span class="pre">-f</span></code> option, some of device hardware name
must be obtained via FFmpeg commands:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>ffmpeg<span class="w"> </span>-sources
ffmpeg<span class="w"> </span>-sinks
</pre></div>
</div>
<p>If devices do not support these newer interfaces, via device-specific listing commands such as</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>ffmpeg<span class="w"> </span>-f<span class="w"> </span>dshow<span class="w"> </span>-list_devices<span class="w"> </span><span class="nb">true</span><span class="w"> </span>-i<span class="w"> </span>dummy
ffmpeg<span class="w"> </span>-f<span class="w"> </span>avfoundation<span class="w"> </span>-list_devices<span class="w"> </span><span class="nb">true</span><span class="w"> </span>-i<span class="w"> </span><span class="s2">""</span>
</pre></div>
</div>
<p>Moreover, some devices provide a query interface for the capability of individual hardware:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>ffmpeg<span class="w"> </span>-list_options<span class="w"> </span><span class="nb">true</span><span class="w"> </span>-f<span class="w"> </span>dshow<span class="w"> </span>-i<span class="w"> </span><span class="nv">video</span><span class="o">=</span><span class="s2">"Camera"</span>
ffmpeg<span class="w"> </span>-f<span class="w"> </span>video4linux2<span class="w"> </span>-list_formats<span class="w"> </span>all<span class="w"> </span>/dev/video0
</pre></div>
</div>
<p>For multi-hardware use, the hardware configuration must be scanned and chosen for each computer
even within a same OS. <code class="xref py py-mod docutils literal notranslate"><span class="pre">ffmpegio.devices</span></code> module is intended to abstract the hardware
selection process via unified naming scheme following the stream specifiers. Device supports
are implemented via plugin module, so user can implement interface for unsupported devices.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Currently, only Windows DirectShow source device (<code class="docutils literal notranslate"><span class="pre">-f</span> <span class="pre">dshow</span></code>) is supported. Developing
device plugins, especially those on MacOS, requires user feedback and involvement. If
you want a specific device to be supported, please post
<a class="reference external" href="https://github.com/python-ffmpegio/python-ffmpegio/issues">an issue on GitHub</a>
to initiate the process.</p>
</div>
<section id="how-to-use">
<h2>How to Use<a class="headerlink" href="#how-to-use" title="Link to this heading"></a></h2>
<p>By default, <code class="xref py py-mod docutils literal notranslate"><span class="pre">ffmpegio</span></code> does not scan the system for supported devices. User must
initialize the enumeration:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">ffmpegio</span>
<span class="n">ffmpegio</span><span class="o">.</span><span class="n">devices</span><span class="o">.</span><span class="n">scan</span><span class="p">()</span>
</pre></div>
</div>
<p>Once the system is scanned, the lists of sources and sinks can be obtained:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">sources</span> <span class="o">=</span> <span class="n">ffmpegio</span><span class="o">.</span><span class="n">devices</span><span class="o">.</span><span class="n">list_sources</span><span class="p">()</span>
</pre></div>
</div>
<p>The returned variable is a dict:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="p">{(</span><span class="s1">'dshow'</span><span class="p">,</span> <span class="s1">'a:0'</span><span class="p">):</span> <span class="s1">'Microphone (Realtek High Definition Audio)'</span><span class="p">,</span>
<span class="p">(</span><span class="s1">'dshow'</span><span class="p">,</span> <span class="s1">'v:0'</span><span class="p">):</span> <span class="s1">'WebCam SC-10HDP12B24N'</span><span class="p">}</span>
</pre></div>
</div>
<p>Given the enumeration, the enumerated device can be used as the <code class="docutils literal notranslate"><span class="pre">url</span></code> in any
<code class="xref py py-mod docutils literal notranslate"><span class="pre">ffmpegio</span></code> functions interacting with FFmpeg. For example:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># capture 10 seconds of audio</span>
<span class="n">fs</span><span class="p">,</span> <span class="n">x</span> <span class="o">=</span> <span class="n">ffmpegio</span><span class="o">.</span><span class="n">audio</span><span class="o">.</span><span class="n">read</span><span class="p">(</span><span class="s1">'a:0'</span><span class="p">,</span> <span class="n">f_in</span><span class="o">=</span><span class="s1">'dshow'</span><span class="p">,</span> <span class="n">t_in</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
<span class="c1"># stream webcam video feed for</span>
<span class="k">with</span> <span class="n">ffmpegio</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s1">'v:0'</span><span class="p">,</span> <span class="s1">'vr'</span><span class="p">,</span> <span class="n">f_in</span><span class="o">=</span><span class="s1">'dshow'</span><span class="p">)</span> <span class="k">as</span> <span class="n">dev</span><span class="p">:</span>
<span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">frame</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">dev</span><span class="p">):</span>
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s1">'Frame </span><span class="si">{</span><span class="n">i</span><span class="si">}</span><span class="s1">: </span><span class="si">{</span><span class="n">frame</span><span class="o">.</span><span class="n">shape</span><span class="si">}</span><span class="s1">'</span><span class="p">)</span>
<span class="c1"># save video and audio to mp4 file</span>
<span class="c1"># - if a device support multiple streams, specify their enums separated by '|'</span>
<span class="n">ffmpegio</span><span class="o">.</span><span class="n">transcode</span><span class="p">(</span><span class="s1">'v:0|a:0'</span><span class="p">,</span> <span class="s1">'captured.mp4'</span><span class="p">,</span> <span class="n">f_in</span><span class="o">=</span><span class="s1">'dshow'</span><span class="p">,</span> <span class="n">t_in</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
</pre></div>
</div>
</section>
<section id="references">
<h2>References<a class="headerlink" href="#references" title="Link to this heading"></a></h2>
<table class="autosummary longtable docutils align-default">
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#ffmpegio.devices.scan" title="ffmpegio.devices.scan"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ffmpegio.devices.scan</span></code></a></p></td>
<td><p>scans the system for input/output hardware</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#ffmpegio.devices.list_sources" title="ffmpegio.devices.list_sources"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ffmpegio.devices.list_sources</span></code></a></p></td>
<td><p>list enumerated source hardware devices</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#ffmpegio.devices.list_sinks" title="ffmpegio.devices.list_sinks"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ffmpegio.devices.list_sinks</span></code></a></p></td>
<td><p>list enumerated sink hardware devices</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#ffmpegio.devices.list_source_options" title="ffmpegio.devices.list_source_options"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ffmpegio.devices.list_source_options</span></code></a></p></td>
<td><p>list supported options of enumerated source hardware</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#ffmpegio.devices.list_sink_options" title="ffmpegio.devices.list_sink_options"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ffmpegio.devices.list_sink_options</span></code></a></p></td>
<td><p>list supported options of enumerated sink hardware</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#ffmpegio.devices.resolve_source" title="ffmpegio.devices.resolve_source"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ffmpegio.devices.resolve_source</span></code></a></p></td>
<td><p>resolve source enumeration</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#ffmpegio.devices.resolve_sink" title="ffmpegio.devices.resolve_sink"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ffmpegio.devices.resolve_sink</span></code></a></p></td>
<td><p>resolve sink enumeration</p></td>
</tr>
</tbody>
</table>
<dl class="py function">
<dt class="sig sig-object py" id="ffmpegio.devices.scan">
<span class="sig-prename descclassname"><span class="pre">ffmpegio.devices.</span></span><span class="sig-name descname"><span class="pre">scan</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#ffmpegio.devices.scan" title="Link to this definition"></a></dt>
<dd><p>scans the system for input/output hardware</p>
<p>This function must be called by user to enable device enumeration in
ffmpegio. Also, none of functions in <cite>ffmpegio.devices</cite> module will return
meaningful outputs until <cite>scan</cite> is called. Likewise, <cite>scan()</cite> must
run again after a change in hardware to reflect the change.</p>
<p>The devices are enumerated according to the outputs of outputs
<cite>ffmpeg -sources</cite> and <cite>ffmpeg -sinks</cite> calls for the devices supporting
this fairly new FFmpeg interface. Additional hardware configurations
are detected by registered plugins with hooks <cite>device_source_api</cite> or
<cite>device_sink_api</cite>.</p>
<section id="currently-supported-devices">
<h3>Currently Supported Devices<a class="headerlink" href="#currently-supported-devices" title="Link to this heading"></a></h3>
<p>Windows: dshow
Mac: tbd
Linux: tbd</p>
</section>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ffmpegio.devices.list_sources">
<span class="sig-prename descclassname"><span class="pre">ffmpegio.devices.</span></span><span class="sig-name descname"><span class="pre">list_sources</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dev</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mtype</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">return_nested</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#ffmpegio.devices.list_sources" title="Link to this definition"></a></dt>
<dd><p>list enumerated source hardware devices</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>dev</strong> (<em>"video"</em><em>, </em><em>"audio"</em><em>, </em><em>optional</em>) – ffmpeg device name, defaults to None</p></li>
<li><p><strong>mtype</strong> – media type, defaults to None</p></li>
<li><p><strong>return_nested</strong> (<em>bool</em><em>, </em><em>optional</em>) – True to return results in nested dict, defaults to False</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>dict of names of supported hardware, keyed by a tuple of the device name and enumeration,
or nested dicts. If dev is specified, dict of enumerated hardware devices and their names</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>dict(tuple(str,str),str) or dict(str,dict(str,str)) or dict(str,str)</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ffmpegio.devices.list_sinks">
<span class="sig-prename descclassname"><span class="pre">ffmpegio.devices.</span></span><span class="sig-name descname"><span class="pre">list_sinks</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dev</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mtype</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">return_nested</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#ffmpegio.devices.list_sinks" title="Link to this definition"></a></dt>
<dd><p>list enumerated sink hardware devices</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>dev</strong> (<em>"video"</em><em>, </em><em>"audio"</em><em>, </em><em>optional</em>) – ffmpeg device name, default to None</p></li>
<li><p><strong>mtype</strong> – media type, default to None</p></li>
<li><p><strong>return_nested</strong> (<em>bool</em><em>, </em><em>optional</em>) – True to return results in nested dict, defaults to False</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>dict of names of supported hardware, keyed by a tuple of the device name and enumeration,
or nested dicts. If dev is specified, dict of enumerated hardware devices and their names</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>dict(tuple(str,str),str) or dict(str,dict(str,str)) or dict(str,str)</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ffmpegio.devices.list_source_options">
<span class="sig-prename descclassname"><span class="pre">ffmpegio.devices.</span></span><span class="sig-name descname"><span class="pre">list_source_options</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">device</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">enum</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#ffmpegio.devices.list_source_options" title="Link to this definition"></a></dt>
<dd><p>list supported options of enumerated source hardware</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>device</strong> (<em>str</em>) – device name</p></li>
<li><p><strong>enum</strong> (<em>str</em>) – hardware specifier, e.g., v:0, a:0</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>list of supported option combinations. If option values are tuple
it indicates the min and max range of the option value.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>list[dict]</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ffmpegio.devices.list_sink_options">
<span class="sig-prename descclassname"><span class="pre">ffmpegio.devices.</span></span><span class="sig-name descname"><span class="pre">list_sink_options</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">device</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">enum</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#ffmpegio.devices.list_sink_options" title="Link to this definition"></a></dt>
<dd><p>list supported options of enumerated sink hardware</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>device</strong> (<em>str</em>) – device name</p></li>
<li><p><strong>enum</strong> (<em>str</em>) – hardware specifier, e.g., v:0, a:0</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>list of supported option combinations. If option values are tuple
it indicates the min and max range of the option value.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>list[dict]</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ffmpegio.devices.resolve_source">
<span class="sig-prename descclassname"><span class="pre">ffmpegio.devices.</span></span><span class="sig-name descname"><span class="pre">resolve_source</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">opts</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#ffmpegio.devices.resolve_source" title="Link to this definition"></a></dt>
<dd><p>resolve source enumeration</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> (<em>str</em>) – input url, possibly device enum</p></li>
<li><p><strong>opts</strong> (<em>dict</em>) – input options</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>possibly modified url and opts</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>tuple[str,dict]</p>
</dd>
</dl>
<p>This function is called by <cite>ffmpeg.compose()</cite> to convert
device enumeration back to url expected by ffmpeg</p>
<p>The device name (-f) could be provided via opts[‘f’] or encoded as a
part of enumeration</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ffmpegio.devices.resolve_sink">
<span class="sig-prename descclassname"><span class="pre">ffmpegio.devices.</span></span><span class="sig-name descname"><span class="pre">resolve_sink</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">opts</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#ffmpegio.devices.resolve_sink" title="Link to this definition"></a></dt>
<dd><p>resolve sink enumeration</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> (<em>str</em>) – output url, possibly device enum</p></li>
<li><p><strong>opts</strong> (<em>dict</em>) – output options</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>possibly modified url and opts</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>tuple[str,dict]</p>
</dd>
</dl>
<p>This function is called by <cite>ffmpeg.compose()</cite> to convert
device enumeration back to url expected by ffmpeg</p>
</dd></dl>
</section>
</section>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>© Copyright 2021-2022, Takeshi (Kesh) Ikuma, Louisiana State University Health Sciences Center.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>