Merge 7ddec85753d2fe3014592b21b71a2126fd2555f2 into df129c7ba30aaa9ffffb81a48f53aa7253b0b4e6

This commit is contained in:
曾楚笑 2026-09-23 05:15:09 +08:00 committed by GitHub
commit 02ec990735
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 1 deletions

View File

@ -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:

View File

@ -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).