mirror of
https://github.com/kkroening/ffmpeg-python.git
synced 2026-11-17 14:13:34 +08:00
Merge 7ddec85753d2fe3014592b21b71a2126fd2555f2 into df129c7ba30aaa9ffffb81a48f53aa7253b0b4e6
This commit is contained in:
commit
02ec990735
@ -42,7 +42,9 @@ def _get_input_args(input_node):
|
||||
if fmt:
|
||||
args += ['-f', fmt]
|
||||
if video_size:
|
||||
args += ['-video_size', '{}x{}'.format(video_size[0], video_size[1])]
|
||||
if not isinstance(video_size, basestring):
|
||||
video_size = '{}x{}'.format(video_size[0], video_size[1])
|
||||
args += ['-video_size', video_size]
|
||||
args += convert_kwargs_to_cmd_line_args(kwargs)
|
||||
args += ['-i', filename]
|
||||
else:
|
||||
|
||||
@ -372,6 +372,21 @@ def test__output__video_size(video_size):
|
||||
assert args == ['-i', 'in', '-video_size', '320x240', 'out']
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
'video_size,expected',
|
||||
[
|
||||
((320, 240), '320x240'),
|
||||
([320, 240], '320x240'),
|
||||
('320x240', '320x240'),
|
||||
('1920x1080', '1920x1080'),
|
||||
('hd720', 'hd720'),
|
||||
],
|
||||
)
|
||||
def test__input__video_size(video_size, expected):
|
||||
args = ffmpeg.input('in', video_size=video_size).output('out').get_args()
|
||||
assert args == ['-video_size', expected, '-i', 'in', 'out']
|
||||
|
||||
|
||||
def test_filter_normal_arg_escape():
|
||||
"""Test string escaping of normal filter args (e.g. ``font`` param of ``drawtext``
|
||||
filter).
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user