1
0
mirror of https://github.com/kkroening/ffmpeg-python.git synced 2025-04-06 04:15:44 +08:00

Merge 6916ab27680aa4e2512bbb4097cd431afe05d7b8 into df129c7ba30aaa9ffffb81a48f53aa7253b0b4e6

This commit is contained in:
Ezequiel Ramos 2022-07-13 22:05:11 +02:00 committed by GitHub
commit aee4987db5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -4,7 +4,7 @@ from ._run import Error
from ._utils import convert_kwargs_to_cmd_line_args
def probe(filename, cmd='ffprobe', timeout=None, **kwargs):
def probe(filename, cmd='ffprobe', timeout=None, capture_stderr=False, **kwargs):
"""Run ffprobe on the specified file and return a JSON representation of the output.
Raises:
@ -24,6 +24,8 @@ def probe(filename, cmd='ffprobe', timeout=None, **kwargs):
out, err = p.communicate(**communicate_kwargs)
if p.returncode != 0:
raise Error('ffprobe', out, err)
if capture_stderr:
return json.loads(out.decode('utf-8')), err
return json.loads(out.decode('utf-8'))