mirror of
https://github.com/kkroening/ffmpeg-python.git
synced 2025-04-06 04:15:44 +08:00
Fix drawbox=>drawtext
This commit is contained in:
parent
5f4bfd1fb3
commit
c19dcaca30
@ -320,7 +320,7 @@ def drawtext(parent_node, text=None, x=0, y=0, escape_text=True, **kwargs):
|
|||||||
kwargs['x'] = x
|
kwargs['x'] = x
|
||||||
if y != 0:
|
if y != 0:
|
||||||
kwargs['y'] = y
|
kwargs['y'] = y
|
||||||
return filter_(parent_node, drawbox.__name__, **kwargs)
|
return filter_(parent_node, drawtext.__name__, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
@operator()
|
@operator()
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
from builtins import str
|
||||||
|
|
||||||
|
|
||||||
def escape_chars(text, chars):
|
def escape_chars(text, chars):
|
||||||
"""Helper function to escape uncomfortable characters."""
|
"""Helper function to escape uncomfortable characters."""
|
||||||
text = str(text)
|
text = str(text)
|
||||||
|
BIN
ffmpeg/tests/sample_data/out1.mp4
Normal file
BIN
ffmpeg/tests/sample_data/out1.mp4
Normal file
Binary file not shown.
BIN
ffmpeg/tests/sample_data/out2.mp4
Normal file
BIN
ffmpeg/tests/sample_data/out2.mp4
Normal file
Binary file not shown.
@ -140,7 +140,7 @@ def test_filter_normal_arg_escape():
|
|||||||
)
|
)
|
||||||
assert args[:3] == ['-i', 'in', '-filter_complex']
|
assert args[:3] == ['-i', 'in', '-filter_complex']
|
||||||
assert args[4:] == ['-map', '[v0]', 'out']
|
assert args[4:] == ['-map', '[v0]', 'out']
|
||||||
match = re.match(r'\[0\]drawbox=font=a((.|\n)*)b:text=test\[v0\]', args[3], re.MULTILINE)
|
match = re.match(r'\[0\]drawtext=font=a((.|\n)*)b:text=test\[v0\]', args[3], re.MULTILINE)
|
||||||
assert match is not None, 'Invalid -filter_complex arg: {!r}'.format(args[3])
|
assert match is not None, 'Invalid -filter_complex arg: {!r}'.format(args[3])
|
||||||
return match.group(1)
|
return match.group(1)
|
||||||
|
|
||||||
@ -174,7 +174,7 @@ def test_filter_text_arg_str_escape():
|
|||||||
)
|
)
|
||||||
assert args[:3] == ['-i', 'in', '-filter_complex']
|
assert args[:3] == ['-i', 'in', '-filter_complex']
|
||||||
assert args[4:] == ['-map', '[v0]', 'out']
|
assert args[4:] == ['-map', '[v0]', 'out']
|
||||||
match = re.match(r'\[0\]drawbox=text=a((.|\n)*)b\[v0\]', args[3], re.MULTILINE)
|
match = re.match(r'\[0\]drawtext=text=a((.|\n)*)b\[v0\]', args[3], re.MULTILINE)
|
||||||
assert match is not None, 'Invalid -filter_complex arg: {!r}'.format(args[3])
|
assert match is not None, 'Invalid -filter_complex arg: {!r}'.format(args[3])
|
||||||
return match.group(1)
|
return match.group(1)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user