diff --git a/ffplayout.conf b/ffplayout.conf index e6ffd138..09e5c02b 100644 --- a/ffplayout.conf +++ b/ffplayout.conf @@ -69,6 +69,7 @@ width = 1024 height = 576 aspect = 1.778 fps = 25 +add_logo = True logo = logo.png logo_opacity = 0.7 logo_filter = overlay=W-w-12:12 @@ -114,6 +115,7 @@ shuffle = False ; on windows fontfile path need to be like this: C\:/WINDOWS/fonts/DejaVuSans.ttf ; textfile has the same pattern [TEXT] +add_text = True textfile = /media/live.txt fontsize = 24 fontcolor = white diff --git a/ffplayout.py b/ffplayout.py index bfe14e02..d1831733 100755 --- a/ffplayout.py +++ b/ffplayout.py @@ -115,6 +115,7 @@ _pre_comp = SimpleNamespace( fps=cfg.getint('PRE_COMPRESS', 'fps'), v_bitrate=cfg.getint('PRE_COMPRESS', 'width') * 50, v_bufsize=cfg.getint('PRE_COMPRESS', 'width') * 50 / 2, + add_logo=cfg.getboolean('PRE_COMPRESS', 'add_logo'), logo=cfg.get('PRE_COMPRESS', 'logo'), opacity=cfg.get('PRE_COMPRESS', 'logo_opacity'), logo_filter=cfg.get('PRE_COMPRESS', 'logo_filter'), @@ -146,6 +147,7 @@ _storage = SimpleNamespace( ) _text = SimpleNamespace( + add_text=cfg.getboolean('TEXT', 'add_text'), textfile=cfg.get('TEXT', 'textfile'), fontsize=cfg.get('TEXT', 'fontsize'), fontcolor=cfg.get('TEXT', 'fontcolor'), @@ -805,7 +807,7 @@ def overlay_filter(duration, ad, ad_last, ad_next): """ logo_filter = '[v]null[logo]' - if os.path.isfile(_pre_comp.logo) and not ad: + if _pre_comp.add_logo and os.path.isfile(_pre_comp.logo) and not ad: logo_chain = [] opacity = 'format=rgba,colorchannelmixer=aa={}'.format( _pre_comp.opacity) @@ -1404,7 +1406,7 @@ def main(): '-c:a', 's302m', '-strict', '-2', '-ar', '48000', '-ac', '2', '-f', 'mpegts', '-'] - if os.path.isfile(_text.textfile): + if _text.add_text and os.path.isfile(_text.textfile): messenger.info('Overlay text file: "{}"'.format(_text.textfile)) overlay = [ '-vf', ("drawtext=box={}:boxcolor='{}':boxborderw={}"