boolean option for showing logo and text, #34
This commit is contained in:
parent
a630b6a777
commit
644738c3db
@ -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
|
||||
|
@ -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={}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user