Skip to content

Commit fc2f990

Browse files
committed
fixed read(): no need to probe if pix_fmt given
1 parent 0e9bc75 commit fc2f990

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

src/ffmpegio/image.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,7 @@ def _run_read(*args, shape=None, pix_fmt_in=None, s_in=None, show_log=None, **kw
5757
return data[-1, ...]
5858

5959

60-
def create(
61-
expr,
62-
*args,
63-
pix_fmt=None,
64-
vf=None,
65-
vframe=None,
66-
show_log=None,
67-
**kwargs
68-
):
60+
def create(expr, *args, pix_fmt=None, vf=None, vframe=None, show_log=None, **kwargs):
6961
"""Create an image using a source video filter
7062
7163
:param name: name of the source filter
@@ -154,7 +146,7 @@ def read(url, show_log=None, **options):
154146
"""
155147

156148
# get pix_fmt of the input file only if needed
157-
if "pix_fmt_in" not in options:
149+
if "pix_fmt" not in options and "pix_fmt_in" not in options:
158150
info = probe.video_streams_basic(url, 0)[0]
159151
pix_fmt_in = info["pix_fmt"]
160152
s_in = (info["width"], info["height"])

0 commit comments

Comments
 (0)