<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def run( stream_spec, cmd='ffmpeg', capture_stdout=False, capture_stderr=False, input=None, quiet=False, overwrite_output=False):
 """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: text to be sent to stdin (to be used with ``pipe:`` ffmpeg inputs) **kwargs: keyword-arguments passed to ``get_args()`` (e.g. ``overwrite_output=True``). Returns: (out, err) tuple containing captured stdout and stderr data. """

    process = run_async(
        stream_spec,
        cmd,
        pipe_stdin=input is not None,
        pipe_stdout=capture_stdout,
        pipe_stderr=capture_stderr,
        quiet=quiet,
        overwrite_output=overwrite_output,
    )
    out, err = process.communicate(input)
    retcode = process.poll()
    if retcode:
        raise Error('ffmpeg', out, err)
    return out, err