8000 Fix drawbox=>drawtext · equalent/ffmpeg-python@c19dcac · GitHub
[go: up one dir, main page]

Skip to content

Commit c19dcac

Browse files
committed
Fix drawbox=>drawtext
1 parent 5f4bfd1 commit c19dcac

File tree

5 files changed

+6
-3
lines changed

5 files changed

+6
-3
lines changed

ffmpeg/_filters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ def drawtext(parent_node, text=None, x=0, y=0, escape_text=True, **kwargs):
320320
kwargs['x'] = x
321321
if y != 0:
322322
kwargs['y'] = y
323-
return filter_(parent_node, drawbox.__name__, **kwargs)
323+
return filter_(parent_node, drawtext.__name__, **kwargs)
324324

325325

326326
@operator()

ffmpeg/_utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
from builtins import str
2+
3+
14
def escape_chars(text, chars):
25
"""Helper function to escape uncomfortable characters."""
36
text = str(text)

ffmpeg/tests/sample_data/out1.mp4

128 KB
Binary file not shown.

ffmpeg/tests/sample_data/out2.mp4

128 KB
Binary file not shown.

ffmpeg/tests/test_ffmpeg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def _get_drawtext_font_repr(font):
140140
)
141141
assert args[:3] == ['-i', 'in', '-filter_complex']
142142
assert args[4:] == ['-map', '[v0]', 'out']
143-
match = re.match(r'\[0\]drawbox=font=a((.|\n)*)b:text=test\[v0\]', args[3], re.MULTILINE)
143+
match = re.match(r'\[0\]drawtext=font=a((.|\n)*)b:text=test\[v0\]', args[3], re.MULTILINE)
144144
assert match is not None, 'Invalid -filter_complex arg: {!r}'.format(args[3])
145145
return match.group(1)
146146

@@ -174,7 +174,7 @@ def _get_drawtext_text_repr(text):
174174
)
175175
assert args[:3] == ['-i', 'in', '-filter_complex']
176176
assert args[4:] == ['-map', '[v0]', 'out']
177-
match = re.match(r'\[0\]drawbox=text=a((.|\n)*)b\[v0\]', args[3], re.MULTILINE)
177+
match = re.match(r'\[0\]drawtext=text=a((.|\n)*)b\[v0\]', args[3], re.MULTILINE)
178178
assert match is not None, 'Invalid -filter_complex arg: {!r}'.format(args[3])
179179
return match.group(1)
180180

0 commit comments

Comments
 (0)
0