Merge 58c52ed46ffd155e4f868b435780c9a5547687b6 into df129c7ba30aaa9ffffb81a48f53aa7253b0b4e6

This commit is contained in:
cmehay 2022-07-29 09:24:20 +09:00 committed by GitHub
commit 938acd2d3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 1 deletions

View File

@ -289,7 +289,13 @@ class FilterNode(Node):
out_kwargs = {}
for k, v in list(kwargs.items()):
k = escape_chars(k, '\\\'=:')
v = escape_chars(v, '\\\'=:')
if isinstance(v, dict):
v = ','.join(['{}={}'.format(
escape_chars(vk, '\\\'=:'),
escape_chars(v[vk], '\\\'=:')
) for vk in sorted(v)])
else:
v = escape_chars(v, '\\\'=:')
out_kwargs[k] = v
arg_params = [escape_chars(v, '\\\'=:') for v in out_args]

View File

@ -131,6 +131,19 @@ def test_repeated_args():
'dummy2.mp4',
]
def test_filter_sub_options():
subtitle_filter = ffmpeg.input('dummy.mp4').filter('subtitles', force_style={
'Alignement': '6', 'Fontsize': '48'}).output('dummy2.mp4')
assert subtitle_filter.get_args() == [
'-i',
'dummy.mp4',
'-filter_complex',
r'[0]subtitles=force_style=Alignement=6\,Fontsize=48[s0]',
'-map',
'[s0]',
'dummy2.mp4'
]
def test__get_args__simple():
out_file = ffmpeg.input('dummy.mp4').output('dummy2.mp4')