Skip to content

Commit ffc38c2

Browse files
Takeshi Ikuma (LSUHSC)Takeshi Ikuma (LSUHSC)
authored andcommitted
- open() to convert unused rate argument to ffmpeg option
1 parent 05e6d2d commit ffc38c2

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/ffmpegio/__init__.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,16 @@ def open(
238238
f"Invalid FFmpeg streaming mode: {mode}. Only 1 of 'rwf' may be specified."
239239
)
240240

241-
# auto-detect operation
242-
if not (read or write or filter):
241+
if (read or write or filter):
242+
# convert unused rate argument to ffmpeg option
243+
if read and rate_in is not None:
244+
kwds['r_in' if video else 'ar_in'] = rate_in
245+
rate_in = None
246+
elif write and rate is not None:
247+
kwds['r' if video else 'ar'] = rate
248+
rate = None
249+
else:
250+
# auto-detect operation
243251
if rate_in is None:
244252
read = True
245253
elif rate is None:

0 commit comments

Comments
 (0)