Skip to content

Commit 7b0ee8b

Browse files
committed
Fixed undefined variable error
1 parent e273706 commit 7b0ee8b

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

src/ffmpegio/image.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,14 @@ def read(url, show_log=None, **options):
143143
"""
144144

145145
# get pix_fmt of the input file only if needed
146+
pix_fmt_in = s_in = None
146147
if "pix_fmt" not in options and "pix_fmt_in" not in options:
147148
try:
148149
info = probe.video_streams_basic(url, 0)[0]
149150
pix_fmt_in = info["pix_fmt"]
150151
s_in = (info["width"], info["height"])
151152
except:
152153
pix_fmt_in = 'rgb24'
153-
else:
154-
pix_fmt_in = s_in = None
155154

156155
input_options = utils.pop_extra_options(options, "_in")
157156

src/ffmpegio/video.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ def read(url, progress=None, show_log=None, **options):
164164
pix_fmt = options.get("pix_fmt", None)
165165

166166
# get pix_fmt of the input file only if needed
167+
pix_fmt_in = s_in = r_in = None
167168
if pix_fmt is None and "pix_fmt_in" not in options:
168169
try:
169170
info = probe.video_streams_basic(url, 0)[0]
@@ -172,8 +173,6 @@ def read(url, progress=None, show_log=None, **options):
172173
r_in = info["frame_rate"]
173174
except:
174175
pix_fmt_in = 'rgb24'
175-
else:
176-
pix_fmt_in = s_in = r_in = None
177176

178177
input_options = utils.pop_extra_options(options, "_in")
179178

0 commit comments

Comments
 (0)