mirror of
https://github.com/kkroening/ffmpeg-python.git
synced 2026-11-21 00:23:33 +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:
|
if fmt:
|
||||||
args += ['-f', fmt]
|
args += ['-f', fmt]
|
||||||
if video_size:
|
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 += convert_kwargs_to_cmd_line_args(kwargs)
|
||||||
args += ['-i', filename]
|
args += ['-i', filename]
|
||||||
else:
|
else:
|
||||||
|
|||||||
@ -372,6 +372,21 @@ def test__output__video_size(video_size):
|
|||||||
assert args == ['-i', 'in', '-video_size', '320x240', 'out']
|
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():
|
def test_filter_normal_arg_escape():
|
||||||
"""Test string escaping of normal filter args (e.g. ``font`` param of ``drawtext``
|
"""Test string escaping of normal filter args (e.g. ``font`` param of ``drawtext``
|
||||||
filter).
|
filter).
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user