From a1f1390b8e0cb09b73f9be2a6395a7f918ad7cc6 Mon Sep 17 00:00:00 2001 From: jb-alvarado Date: Wed, 9 Sep 2020 22:05:42 +0200 Subject: [PATCH] use font file only if exists --- ffplayout/filters.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ffplayout/filters.py b/ffplayout/filters.py index d854fa84..38b74d21 100644 --- a/ffplayout/filters.py +++ b/ffplayout/filters.py @@ -31,11 +31,14 @@ from .utils import _global, _pre, _text def text_filter(): filter_chain = [] + font = '' if _text.add_text and _text.over_pre: + if _text.fontfile and os.path.isfile(_text.fontfile): + font = ":fontfile='{}'".format(_text.fontfile) filter_chain = [ - "null,zmq=b=tcp\\\\://'{}',drawtext=text='':fontfile='{}'".format( - _text.address.replace(':', '\\:'), _text.fontfile)] + "null,zmq=b=tcp\\\\://'{}',drawtext=text=''{}".format( + _text.address.replace(':', '\\:'), font)] return filter_chain