Skip to content

Commit 6fd0935

Browse files
committed
open: fixed writer argument processing
1 parent 95e50f1 commit 6fd0935

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

src/ffmpegio/__init__.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,11 @@
7070
def open(
7171
url_fg,
7272
mode="",
73-
rate=None,
74-
shape=None,
7573
rate_in=None,
7674
shape_in=None,
75+
dtype_in=None,
76+
rate=None,
77+
shape=None,
7778
**kwds,
7879
):
7980
"""Open a multimedia file/stream for read/write
@@ -83,6 +84,14 @@ def open(
8384
:type url_fg: str or seq(str)
8485
:param mode: specifies the mode in which the FFmpeg is used, defaults to None
8586
:type mode: str, optional
87+
:param rate_in: (filter specific) input frame rate (video write) or sample rate (audio
88+
write), defaults to None
89+
:type rate_in: Fraction, float, int, optional
90+
:param shape_in: (write and filter specific) input video frame size (height x width [x ncomponents]),
91+
or audio sample size (channels,), defaults to None
92+
:type shape_in: seq of int, optional
93+
:param dtype_in: (write and filter specific) input data type, defaults to None
94+
:type dtype_in: str, optional
8695
:param rate: (filter specific) output frame rate (video write) or sample rate (audio
8796
write), defaults to None
8897
:type rate: Fraction, float, int, optional
@@ -91,14 +100,6 @@ def open(
91100
:param shape: (read and filter specific) output video frame size (height x width [x ncomponents]),
92101
or audio sample size (channels,), defaults to None
93102
:type shape: seq of int, optional
94-
:param rate_in: (filter specific) input frame rate (video write) or sample rate (audio
95-
write), defaults to None
96-
:type rate_in: Fraction, float, int, optional
97-
:param dtype_in: (write and filter specific) input data type, defaults to None
98-
:type dtype_in: str, optional
99-
:param shape_in: (write and filter specific) input video frame size (height x width [x ncomponents]),
100-
or audio sample size (channels,), defaults to None
101-
:type shape_in: seq of int, optional
102103
:param \\**options: FFmpeg options, append '_in' for input option names (see :doc:`options`)
103104
:type \\**options: dict, optional
104105
:yields: ffmpegio stream object
@@ -296,10 +297,12 @@ def open(
296297
# add other info to the arguments
297298
args = (*url_fg,) if read else (*url_fg, rate_in)
298299
for k, v in (
300+
("dtype_in", dtype_in),
301+
("shape_in", shape_in),
299302
("rate", rate),
300303
("shape", shape),
301-
("shape_in", shape_in),
302304
):
305+
303306
if v is not None:
304307
kwds[k] = v
305308

0 commit comments

Comments
 (0)