-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathadv-ffmpeg.html
More file actions
313 lines (285 loc) · 28.2 KB
/
adv-ffmpeg.html
File metadata and controls
313 lines (285 loc) · 28.2 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
<!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>ffmpegio.ffmpegprocess: Direct invocation of FFmpeg subprocess — 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="#"><code class="xref py py-mod docutils literal notranslate"><span class="pre">ffmpegio.ffmpegprocess</span></code>: Direct invocation of FFmpeg subprocess</a><ul>
<li><a class="reference internal" href="#ffmpegio-ffmpegprocess-module-reference"><code class="xref py py-mod docutils literal notranslate"><span class="pre">ffmpegio.ffmpegprocess</span></code> Module Reference</a><ul>
<li><a class="reference internal" href="#ffmpegio.ffmpegprocess.run"><code class="docutils literal notranslate"><span class="pre">run()</span></code></a></li>
<li><a class="reference internal" href="#ffmpegio.ffmpegprocess.run_two_pass"><code class="docutils literal notranslate"><span class="pre">run_two_pass()</span></code></a></li>
<li><a class="reference internal" href="#ffmpegio.ffmpegprocess.Popen"><code class="docutils literal notranslate"><span class="pre">Popen</span></code></a><ul>
<li><a class="reference internal" href="#ffmpegio.ffmpegprocess.Popen.ffmpeg_args"><code class="docutils literal notranslate"><span class="pre">Popen.ffmpeg_args</span></code></a></li>
<li><a class="reference internal" href="#ffmpegio.ffmpegprocess.Popen.kill"><code class="docutils literal notranslate"><span class="pre">Popen.kill()</span></code></a></li>
<li><a class="reference internal" href="#ffmpegio.ffmpegprocess.Popen.send_signal"><code class="docutils literal notranslate"><span class="pre">Popen.send_signal()</span></code></a></li>
<li><a class="reference internal" href="#ffmpegio.ffmpegprocess.Popen.terminate"><code class="docutils literal notranslate"><span class="pre">Popen.terminate()</span></code></a></li>
<li><a class="reference internal" href="#ffmpegio.ffmpegprocess.Popen.wait"><code class="docutils literal notranslate"><span class="pre">Popen.wait()</span></code></a></li>
</ul>
</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"><code class="xref py py-mod docutils literal notranslate"><span class="pre">ffmpegio.ffmpegprocess</span></code>: Direct invocation of FFmpeg subprocess</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/adv-ffmpeg.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="ffmpegio-ffmpegprocess-direct-invocation-of-ffmpeg-subprocess">
<span id="adv-ffmpeg"></span><h1><code class="xref py py-mod docutils literal notranslate"><span class="pre">ffmpegio.ffmpegprocess</span></code>: Direct invocation of FFmpeg subprocess<a class="headerlink" href="#ffmpegio-ffmpegprocess-direct-invocation-of-ffmpeg-subprocess" title="Link to this heading"></a></h1>
<p>Instead of indirectly calling FFmpeg with <code class="xref py py-mod docutils literal notranslate"><span class="pre">ffmpegio</span></code>’s <a class="reference internal" href="basicio.html#basicio"><span class="std std-ref">Basic I/O Functions</span></a>,
you can directly invoke a FFmpeg subprocess with <code class="xref py py-mod docutils literal notranslate"><span class="pre">ffmpegio.ffmpegprocess</span></code> module,
which mocks Python’s builtin <code class="xref py py-mod docutils literal notranslate"><span class="pre">subprocess</span></code> module.</p>
<table class="autosummary longtable docutils align-default">
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#ffmpegio.ffmpegprocess.run" title="ffmpegio.ffmpegprocess.run"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ffmpegio.ffmpegprocess.run</span></code></a></p></td>
<td><p>run FFmpeg subprocess with standard pipes with a single transaction</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#ffmpegio.ffmpegprocess.run_two_pass" title="ffmpegio.ffmpegprocess.run_two_pass"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ffmpegio.ffmpegprocess.run_two_pass</span></code></a></p></td>
<td><p>run FFmpeg subprocess with standard pipes with a single transaction twice for 2-pass encoding</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#ffmpegio.ffmpegprocess.Popen" title="ffmpegio.ffmpegprocess.Popen"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ffmpegio.ffmpegprocess.Popen</span></code></a></p></td>
<td><p>Execute FFmpeg in a new process.</p></td>
</tr>
</tbody>
</table>
<p>While both <a class="reference internal" href="#ffmpegio.ffmpegprocess.run" title="ffmpegio.ffmpegprocess.run"><code class="xref py py-func docutils literal notranslate"><span class="pre">ffmpegio.ffmpegprocess.run()</span></code></a> and <a class="reference internal" href="#ffmpegio.ffmpegprocess.Popen" title="ffmpegio.ffmpegprocess.Popen"><code class="xref py py-class docutils literal notranslate"><span class="pre">ffmpegio.ffmpegprocess.Popen</span></code></a>
constructor accepts the <code class="code docutils literal notranslate"><span class="pre">args</span></code> argument of Python’s <code class="xref py py-func docutils literal notranslate"><span class="pre">subprocess.run()</span></code> and
<code class="xref py py-class docutils literal notranslate"><span class="pre">subprocess.Popen</span></code> constructor, the FFmpeg command argument can also be specified
with a Python dict: see <a class="reference internal" href="adv-args.html#adv-args"><span class="std std-ref">its specification page</span></a> for the details.</p>
<p><a class="reference internal" href="#ffmpegio.ffmpegprocess.run_two_pass" title="ffmpegio.ffmpegprocess.run_two_pass"><code class="xref py py-func docutils literal notranslate"><span class="pre">ffmpegio.ffmpegprocess.run_two_pass()</span></code></a> runs FFmpeg twice to perform two-pass video
encoding. The audio encoding is automatically disabled during the first pass by default. It
also offers a finer control of which options to turn on/off during the first pass.</p>
<section id="ffmpegio-ffmpegprocess-module-reference">
<h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">ffmpegio.ffmpegprocess</span></code> Module Reference<a class="headerlink" href="#ffmpegio-ffmpegprocess-module-reference" title="Link to this heading"></a></h2>
<dl class="py function">
<dt class="sig sig-object py" id="ffmpegio.ffmpegprocess.run">
<span class="sig-prename descclassname"><span class="pre">ffmpegio.ffmpegprocess.</span></span><span class="sig-name descname"><span class="pre">run</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">ffmpeg_args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">hide_banner</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">progress</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">overwrite</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">capture_log</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">stdin</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">stdout</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">stderr</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">input</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="o"><span class="pre">**</span></span><span class="n"><span class="pre">other_popen_kwargs</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#ffmpegio.ffmpegprocess.run" title="Link to this definition"></a></dt>
<dd><p>run FFmpeg subprocess with standard pipes with a single transaction</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>ffmpeg_args</strong> (<em>dict</em>) – FFmpeg argument options</p></li>
<li><p><strong>hide_banner</strong> (<em>bool</em><em>, </em><em>optional</em>) – False to output ffmpeg banner in stderr, defaults to True</p></li>
<li><p><strong>progress</strong> (<em>callable object</em><em>, </em><em>optional</em>) – <p>progress callback function, defaults to None. This function
takes two arguments:</p>
<blockquote>
<div><p>progress(<a class="reference external" href="data:dict">data:dict</a>, done:bool) -> None</p>
</div></blockquote>
</p></li>
<li><p><strong>overwrite</strong> (<em>bool</em><em>, </em><em>optional</em>) – True to overwrite if output url exists, defaults to None
(auto-select)</p></li>
<li><p><strong>capture_log</strong> (<em>bool</em><em>, </em><em>optional</em>) – True to capture log messages on stderr, False to send
logs to console, defaults to None (no show/capture)</p></li>
<li><p><strong>stdin</strong> (<em>readable file-like object</em><em>, </em><em>optional</em>) – source file object, defaults to None</p></li>
<li><p><strong>stdout</strong> (<em>writable file-like object</em><em>, </em><em>optional</em>) – sink file object, defaults to None</p></li>
<li><p><strong>stderr</strong> (<em>writable file-like object</em><em>, </em><em>optional</em>) – file to log ffmpeg messages, defaults to None</p></li>
<li><p><strong>input</strong> (<em>bytes-convertible object</em><em>, </em><em>optional</em>) – input data buffer must be given if FFmpeg is configured to receive
data stream from Python. It must be bytes convertible to bytes.</p></li>
<li><p><strong>**other_popen_kwargs</strong> (<em>dict</em><em>, </em><em>optional</em>) – other keyword arguments of <a class="reference internal" href="#ffmpegio.ffmpegprocess.Popen" title="ffmpegio.ffmpegprocess.Popen"><code class="xref py py-class docutils literal notranslate"><span class="pre">Popen</span></code></a>, defaults to {}</p></li>
</ul>
</dd>
<dt class="field-even">Rparam<span class="colon">:</span></dt>
<dd class="field-even"><p>completed process</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>subprocess.CompleteProcess</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ffmpegio.ffmpegprocess.run_two_pass">
<span class="sig-prename descclassname"><span class="pre">ffmpegio.ffmpegprocess.</span></span><span class="sig-name descname"><span class="pre">run_two_pass</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">ffmpeg_args</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">pass1_omits</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">pass1_extras</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">overwrite</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">stdin</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="o"><span class="pre">**</span></span><span class="n"><span class="pre">other_run_kwargs</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#ffmpegio.ffmpegprocess.run_two_pass" title="Link to this definition"></a></dt>
<dd><p>run FFmpeg subprocess with standard pipes with a single transaction twice for 2-pass encoding</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>ffmpeg_args</strong> (<em>dict</em>) – FFmpeg argument options</p></li>
<li><p><strong>pass1_omits</strong> (<em>seq</em><em>(</em><em>str</em><em>) or </em><em>seq</em><em>(</em><em>seq</em><em>(</em><em>str</em><em>)</em><em>) or </em><em>dict</em><em>(</em><em>int:seq</em><em>(</em><em>str</em><em>)</em><em>) </em><em>optional</em>) – per-file list of output arguments to ignore in pass 1. If not applicable to every
output file, use a nested dict with int keys to specify which output,
defaults to None (remove ‘c:a’ or ‘acodec’).</p></li>
<li><p><strong>pass1_extras</strong> (<em>dict</em><em>(</em><em>str</em><em>) or </em><em>seq</em><em>(</em><em>dict</em><em>(</em><em>str</em><em>)</em><em>) or </em><em>dict</em><em>(</em><em>int:dict</em><em>(</em><em>str</em><em>)</em><em>)</em><em>, </em><em>optional</em>) – per-file list of additional output arguments to include in pass 1. If it does
not apply to every output files, use a nested dict with int keys to specify
which output, defaults to None (add ‘an’ if <cite>pass1_omits</cite> also None)</p></li>
<li><p><strong>hide_banner</strong> (<em>bool</em><em>, </em><em>optional</em>) – False to output ffmpeg banner in stderr, defaults to True</p></li>
<li><p><strong>progress</strong> (<em>callable object</em><em>, </em><em>optional</em>) – <p>progress callback function, defaults to None. This function
takes two arguments:</p>
<blockquote>
<div><p>progress(<a class="reference external" href="data:dict">data:dict</a>, done:bool) -> None</p>
</div></blockquote>
</p></li>
<li><p><strong>overwrite</strong> (<em>bool</em><em>, </em><em>optional</em>) – True to overwrite if output url exists, defaults to None
(auto-select)</p></li>
<li><p><strong>capture_log</strong> (<em>bool</em><em>, </em><em>optional</em>) – True to capture log messages on stderr, False to send
logs to console, defaults to None (no show/capture)</p></li>
<li><p><strong>stdin</strong> (<em>readable file-like object</em><em>, </em><em>optional</em>) – source file object, defaults to None</p></li>
<li><p><strong>stderr</strong> (<em>writable file-like object</em><em>, </em><em>optional</em>) – file to log ffmpeg messages, defaults to None</p></li>
<li><p><strong>input</strong> (<em>bytes-convertible object</em><em>, </em><em>optional</em>) – input data buffer must be given if FFmpeg is configured to receive
data stream from Python. It must be bytes convertible to bytes.</p></li>
<li><p><strong>**other_popen_kwargs</strong> (<em>dict</em><em>, </em><em>optional</em>) – other keyword arguments of <a class="reference internal" href="#ffmpegio.ffmpegprocess.Popen" title="ffmpegio.ffmpegprocess.Popen"><code class="xref py py-class docutils literal notranslate"><span class="pre">Popen</span></code></a>, defaults to {}</p></li>
</ul>
</dd>
<dt class="field-even">Rparam<span class="colon">:</span></dt>
<dd class="field-even"><p>completed process</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>subprocess.CompleteProcess</p>
</dd>
</dl>
</dd></dl>
<dl class="py class">
<dt class="sig sig-object py" id="ffmpegio.ffmpegprocess.Popen">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">ffmpegio.ffmpegprocess.</span></span><span class="sig-name descname"><span class="pre">Popen</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">ffmpeg_args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">hide_banner</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">progress</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">overwrite</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">capture_log</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">stdin</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">stdout</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">stderr</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">on_exit</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="o"><span class="pre">**</span></span><span class="n"><span class="pre">other_popen_args</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#ffmpegio.ffmpegprocess.Popen" title="Link to this definition"></a></dt>
<dd><p>Execute FFmpeg in a new process.</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>ffmpeg_args</strong> (<em>dict</em>) – FFmpeg arguments</p></li>
<li><p><strong>hide_banner</strong> (<em>bool</em><em>, </em><em>optional</em>) – False to output ffmpeg banner in stderr, defaults to True</p></li>
<li><p><strong>progress</strong> (<em>Callable</em><em>, </em><em>optional</em>) – <p>progress callback function, defaults to None. This function
takes two arguments and may return True to terminate execution:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">progress</span><span class="p">(</span><span class="n">data</span><span class="p">:</span><span class="nb">dict</span><span class="p">,</span> <span class="n">done</span><span class="p">:</span><span class="nb">bool</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="o">|</span><span class="kc">None</span>
</pre></div>
</div>
</p></li>
<li><p><strong>overwrite</strong> (<em>bool</em><em>, </em><em>optional</em>) – True to overwrite if output url exists, defaults to None
(auto-select)</p></li>
<li><p><strong>capture_log</strong> (<em>bool</em><em>, </em><em>optional</em>) – True to capture log messages on stderr, False to send
logs to console, defaults to None (no show/capture)</p></li>
<li><p><strong>stdin</strong> (<em>readable file object</em><em>, </em><em>optional</em>) – source file object, defaults to None</p></li>
<li><p><strong>stdout</strong> (<em>writable file object</em><em>, </em><em>optional</em>) – sink file object, defaults to None</p></li>
<li><p><strong>stderr</strong> (<em>writable file object</em><em>, </em><em>optional</em>) – file to log ffmpeg messages, defaults to None</p></li>
<li><p><strong>on_exit</strong> (<em>Callable</em><em> or </em><em>seq</em><em>(</em><em>Callable</em><em>)</em><em>, </em><em>optional</em>) – function(s) to execute when FFmpeg process terminates, defaults to None</p></li>
<li><p><strong>**other_popen_args</strong> (<em>dict</em><em>, </em><em>optional</em>) – other keyword arguments to <code class="xref py py-class docutils literal notranslate"><span class="pre">subprocess.Popen</span></code></p></li>
</ul>
</dd>
</dl>
<p>If <a class="reference internal" href="adv-args.html#adv-args"><span class="std std-ref">ffmpeg_args</span></a> calls for input or output to be piped (e.g., url=”-”) then <code class="code docutils literal notranslate"><span class="pre">Popen</span></code>
automatically sets <cite>stdin=PIPE</cite> or <cite>stdout=PIPE</cite>. Alternately, a file-stream object could be
specified in the argument for each of <code class="code docutils literal notranslate"><span class="pre">stdin</span></code>, <code class="code docutils literal notranslate"><span class="pre">stdout</span></code>, and <code class="code docutils literal notranslate"><span class="pre">stderr</span></code>
to redirect pipes to existing file streams. If files aren’t already open in Python,
specify their urls in <a class="reference internal" href="adv-args.html#adv-args"><span class="std std-ref">ffmpeg_args</span></a> instead of using the pipes.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="ffmpegio.ffmpegprocess.Popen.ffmpeg_args">
<span class="sig-name descname"><span class="pre">ffmpeg_args</span></span><a class="headerlink" href="#ffmpegio.ffmpegprocess.Popen.ffmpeg_args" title="Link to this definition"></a></dt>
<dd><p>The FFmpeg args argument as it was passed to <cite>Popen</cite></p>
<dl class="field-list simple">
<dt class="field-odd">Type<span class="colon">:</span></dt>
<dd class="field-odd"><p>dict</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="ffmpegio.ffmpegprocess.Popen.kill">
<span class="sig-name descname"><span class="pre">kill</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#ffmpegio.ffmpegprocess.Popen.kill" title="Link to this definition"></a></dt>
<dd><p>Kill the FFmpeg process</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="ffmpegio.ffmpegprocess.Popen.send_signal">
<span class="sig-name descname"><span class="pre">send_signal</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">sig</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">kill_monitor</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.ffmpegprocess.Popen.send_signal" title="Link to this definition"></a></dt>
<dd><p>Sends the signal signal to the FFmpeg process</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>sig</strong> (<em>int</em><em>, </em><em>optional</em>) – signal id, default SIGINT (POSIX) / CTRL_C_EVENT (Windows)</p></li>
<li><p><strong>kill_monitor</strong> (<em>bool</em><em>, </em><em>optional</em>) – True to kill the monitor thread, default False</p></li>
</ul>
</dd>
</dl>
<p>Without any argument, <cite>send_signal()</cite> will perform control-C to initiate
soft-terminate FFmpeg. FFmpeg may output additional frames before exits.</p>
<p>Note: Setting <cite>kill_monitor=True</cite> will block the caller thread until the
FFmpeg terminates.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="ffmpegio.ffmpegprocess.Popen.terminate">
<span class="sig-name descname"><span class="pre">terminate</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#ffmpegio.ffmpegprocess.Popen.terminate" title="Link to this definition"></a></dt>
<dd><p>Terminate the FFmpeg process</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="ffmpegio.ffmpegprocess.Popen.wait">
<span class="sig-name descname"><span class="pre">wait</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">timeout</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#ffmpegio.ffmpegprocess.Popen.wait" title="Link to this definition"></a></dt>
<dd><p>Wait for FFmpeg process to terminate; returns self.returncode</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>timeout</strong> (<em>float</em><em>, </em><em>optional</em>) – optional timeout in seconds, defaults to None</p>
</dd>
</dl>
<p>For FFmpeg to terminate autonomously, its stdin PIPE must be closed.</p>
<p>If the process does not terminate after timeout seconds, raise a TimeoutExpired exception.
It is safe to catch this exception and retry the wait.</p>
</dd></dl>
</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>