tweak drawtext
This commit is contained in:
parent
3ce59811ab
commit
3991449785
@ -117,18 +117,20 @@ shuffle = False
|
||||
# overlay text
|
||||
# for paramters check ffmpeg doc
|
||||
# with show you can enable/disable the filter
|
||||
# in some systems decimal point is a comma, have this in mind when ffmpeg complains about wrong values
|
||||
# on windows fontfile path need to be like this: C\:/WINDOWS/fonts/DejaVuSans.ttf
|
||||
# textfile has the same pattern
|
||||
[TEXT]
|
||||
show = True
|
||||
enable = gte(t,3)
|
||||
box = 1
|
||||
boxcolor = black@0,65
|
||||
boxborderw = 8
|
||||
boxcolor = black@0xbb
|
||||
boxborderw = 6
|
||||
fontsize = 24
|
||||
fontcolor = white
|
||||
fontfile = /Library/Fonts/Arial.ttf
|
||||
textfile = live.txt
|
||||
fontfile = /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
|
||||
textfile = /opt/live.txt
|
||||
x = w-w/8*mod(t,8*(w+tw)/w)
|
||||
y = (h-line_h)*0,9
|
||||
y = (h-line_h)*0.9
|
||||
|
||||
|
||||
# the final playout post compression
|
||||
|
13
ffplayout.py
13
ffplayout.py
@ -112,7 +112,6 @@ _folder = SimpleNamespace(
|
||||
|
||||
_text = SimpleNamespace(
|
||||
show=cfg.getboolean('TEXT', 'show'),
|
||||
enable=cfg.get('TEXT', 'enable'),
|
||||
box=cfg.get('TEXT', 'box'),
|
||||
boxcolor=cfg.get('TEXT', 'boxcolor'),
|
||||
boxborderw=cfg.get('TEXT', 'boxborderw'),
|
||||
@ -1035,12 +1034,12 @@ def main():
|
||||
|
||||
if _text.show:
|
||||
overlay = [
|
||||
'-vf', ("drawtext=enable='{}':box={}:boxcolor='{}':"
|
||||
"boxborderw={}:fontsize={}:fontcolor={}:fontfile='{}':"
|
||||
"textfile={}:reload=1:x='{}':y='{}'").format(
|
||||
_text.enable, _text.box, _text.boxcolor,
|
||||
_text.boxborderw, _text.fontsize, _text.fontcolor,
|
||||
_text.fontfile, _text.textfile, _text.x, _text.y)
|
||||
'-vf', ("drawtext=box={}:boxcolor='{}':boxborderw={}:fontsize={}"
|
||||
":fontcolor={}:fontfile='{}':textfile={}:reload=1"
|
||||
":x='{}':y='{}'").format(
|
||||
_text.box, _text.boxcolor, _text.boxborderw,
|
||||
_text.fontsize, _text.fontcolor, _text.fontfile,
|
||||
_text.textfile, _text.x, _text.y)
|
||||
]
|
||||
else:
|
||||
overlay = []
|
||||
|
Loading…
Reference in New Issue
Block a user