Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ffmpeg/_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
15 changes: 15 additions & 0 deletions ffmpeg/tests/test_ffmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down