MCPcopy Create free account
hub / github.com/kkroening/ffmpeg-python / run

Function run

ffmpeg/_run.py:290–326  ·  view source on GitHub ↗

Invoke ffmpeg for the supplied node graph. Args: capture_stdout: if True, capture stdout (to be used with ``pipe:`` ffmpeg outputs). capture_stderr: if True, capture stderr. quiet: shorthand for setting ``capture_stdout`` and ``capture_stderr``. input

(
    stream_spec,
    cmd='ffmpeg',
    capture_stdout=False,
    capture_stderr=False,
    input=None,
    quiet=False,
    overwrite_output=False,
)

Source from the content-addressed store, hash-verified

288
289@output_operator()
290def run(
291 stream_spec,
292 cmd='ffmpeg',
293 capture_stdout=False,
294 capture_stderr=False,
295 input=None,
296 quiet=False,
297 overwrite_output=False,
298):
299 """Invoke ffmpeg for the supplied node graph.
300
301 Args:
302 capture_stdout: if True, capture stdout (to be used with
303 ``pipe:`` ffmpeg outputs).
304 capture_stderr: if True, capture stderr.
305 quiet: shorthand for setting ``capture_stdout`` and ``capture_stderr``.
306 input: text to be sent to stdin (to be used with ``pipe:``
307 ffmpeg inputs)
308 **kwargs: keyword-arguments passed to ``get_args()`` (e.g.
309 ``overwrite_output=True``).
310
311 Returns: (out, err) tuple containing captured stdout and stderr data.
312 """
313 process = run_async(
314 stream_spec,
315 cmd,
316 pipe_stdin=input is not None,
317 pipe_stdout=capture_stdout,
318 pipe_stderr=capture_stderr,
319 quiet=quiet,
320 overwrite_output=overwrite_output,
321 )
322 out, err = process.communicate(input)
323 retcode = process.poll()
324 if retcode:
325 raise Error('ffmpeg', out, err)
326 return out, err
327
328
329__all__ = ['compile', 'Error', 'get_args', 'run', 'run_async']

Callers

nothing calls this directly

Calls 2

run_asyncFunction · 0.85
ErrorClass · 0.85

Tested by

no test coverage detected