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:
commit
aee4987db5
@ -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'))
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user