unify config

This commit is contained in:
jb-alvarado 2022-02-23 15:53:57 +01:00
parent 49c8d4dcc1
commit 6cce9b0fd7
6 changed files with 66 additions and 69 deletions

View File

@ -20,15 +20,15 @@ mail:
mail_level: "ERROR"
logging:
helptext: Logging to file, if 'log_to_file' False log to console. 'backup_count'
helptext: Logging to file, if 'log_to_file' false log to console. 'backup_count'
says how long log files will be saved in days. Path to /var/log/ only if you
run this program as daemon. 'log_level' can be DEBUG, INFO, WARNING,
ERROR. 'ffmpeg_level' can be INFO, WARNING, ERROR.
log_to_file: True
ERROR. 'ffmpeg_level' can be info, warning, error.
log_to_file: true
backup_count: 7
log_path: "/var/log/ffplayout/"
log_level: "DEBUG"
ffmpeg_level: "ERROR"
ffmpeg_level: "error"
processing:
helptext: Set playing mode, like playlist; folder, or you own custom one.
@ -48,15 +48,15 @@ processing:
height: 576
aspect: 1.778
fps: 25
add_logo: True
add_logo: true
logo: "docs/logo.png"
logo_scale:
logo_opacity: 0.7
logo_filter: "overlay=W-w-12:12"
add_loudnorm: False
loud_I: -18
loud_TP: -1.5
loud_LRA: 11
add_loudnorm: false
loud_i: -18
loud_tp: -1.5
loud_lra: 11
output_count: 1
ingest:
@ -64,10 +64,7 @@ ingest:
for a ingest stream. This stream will override the normal streaming until is done.
There is no authentication, this is up to you. The recommend way is to set address to localhost, stream to a local server with authentication and from there stream to this app.
enable: false
stream_input: >-
-f live_flv
-listen 1
-i rtmp://localhost:1936/live/stream
stream_input: [-f, live_flv, -listen, 1, -i, rtmp://localhost:1936/live/stream]
playlist:
helptext: >
@ -76,38 +73,38 @@ playlist:
script. Subdirectories needs this structure '/playlists/2018/01'. 'day_start'
means at which time the playlist should start, leave day_start blank when playlist
should always start at the begin. 'length' represent the target length from
playlist, when is blank real length will not consider. 'loop true' works with
playlist, when is blank real length will not consider. 'infinit true' works with
single playlist file and loops it infinitely.
path: "/playlists"
day_start: "5:59:25"
length: "24:00:00"
loop: False
infinit: false
storage:
helptext: Play ordered or randomly files from path. 'filler_clip' is for fill
the end to reach 24 hours, it will loop when is necessary. 'extensions' search
only files with this extension. Set 'shuffle' to 'True' to pick files randomly.
only files with this extension. Set 'shuffle' to 'true' to pick files randomly.
path: "/mediaStorage"
filler_clip: "/mediaStorage/filler/filler.mp4"
extensions:
- ".mp4"
- ".mkv"
shuffle: True
shuffle: true
text:
helptext: Overlay text in combination with libzmq for remote text manipulation.
On windows fontfile path need to be like this 'C\:/WINDOWS/fonts/DejaVuSans.ttf'.
In a standard environment the filter drawtext node is Parsed_drawtext_2.
'over_pre' if True text will be overlay in pre processing. Continue same text
'over_pre' if true text will be overlay in pre processing. Continue same text
over multiple files is in that mode not possible. 'text_from_filename' activate the
extraction from text of a filename. With 'style' you can define the drawtext
parameters like position, color, etc. Post Text over API will override this.
With 'regex' you can format file names, to get a title from it.
add_text: False
over_pre: False
add_text: false
over_pre: false
bind_address: "127.0.0.1:5555"
fontfile: "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf"
text_from_filename: False
text_from_filename: false
style: "x=(w-tw)/2:y=(h-line_h)*0.9:fontsize=24:fontcolor=#ffffff:box=1:boxcolor=#000000:boxborderw=4"
regex: "^(.*)_"
@ -117,35 +114,35 @@ out:
outputs can be define, by adding script in output folder with an 'output' function
inside. 'preview' works only in streaming output and creates a separate preview stream.
mode: 'stream'
preview: False
preview_param: >-
-s 512x288
-c:v libx264
-crf 24
-x264-params keyint=50:min-keyint=25:scenecut=-1
-maxrate 800k
-bufsize 1600k
-preset ultrafast
-tune zerolatency
-profile:v Main
-level 3.1
-c:a aac
-ar 44100
-b:a 128k
-flags +global_header
-f flv rtmp://preview.local/live/stream
stream_param: >-
-c:v libx264
-crf 23
-x264-params keyint=50:min-keyint=25:scenecut=-1
-maxrate 1300k
-bufsize 2600k
-preset faster
-tune zerolatency
-profile:v Main
-level 3.1
-c:a aac
-ar 44100
-b:a 128k
-flags +global_header
-f flv rtmp://localhost/live/stream
preview: false
preview_param:
[-s, 512x288,
-c:v, libx264,
-crf, 24,
-x264-params, keyint=50:min-keyint=25:scenecut=-1,
-maxrate, 800k,
-bufsize, 1600k,
-preset, ultrafast,
-tune, zerolatency,
-profile:v, Main,
-level, 3.1,
-c:a, aac,
-ar, 44100,
-b:a, 128k,
-flags, +global_header,
-f, flv, rtmp://preview.local/live/stream]
stream_param:
[-c:v, libx264,
-crf, 23,
-x264-params, keyint=50:min-keyint=25:scenecut=-1,
-maxrate, 1300k,
-bufsize, 2600k,
-preset, faster,
-tune, zerolatency,
-profile:v, Main,
-level, 3.1,
-c:a, aac,
-ar, 44100,
-b:a, 128k,
-flags, +global_header,
-f, flv, rtmp://localhost/live/stream]

View File

@ -53,7 +53,7 @@ def output():
try:
enc_cmd = [
'ffplay', '-hide_banner', '-nostats',
'-v', f'level+{log.ff_level.lower()}', '-i', 'pipe:0'
'-v', f'level+{log.ff_level}', '-i', 'pipe:0'
] + overlay
messenger.debug(f'Encoder CMD: "{" ".join(enc_cmd)}"')
@ -75,7 +75,7 @@ def output():
f'seconds: {node.get("source")}')
dec_cmd = [
'ffmpeg', '-v', f'level+{log.ff_level.lower()}',
'ffmpeg', '-v', f'level+{log.ff_level}',
'-hide_banner', '-nostats'
] + node['src_cmd'] + node['filter'] + pre.settings

View File

@ -85,7 +85,7 @@ def output():
messenger.info(f'Play: {node.get("source")}')
cmd = [
'ffmpeg', '-v', f'level+{log.ff_level.lower()}',
'ffmpeg', '-v', f'level+{log.ff_level}',
'-hide_banner', '-nostats'
] + node['src_cmd'] + node['filter'] + playout.stream_param

View File

@ -43,7 +43,7 @@ def output():
try:
enc_cmd = [
'ffmpeg', '-v', f'level+{log.ff_level.lower()}', '-hide_banner',
'ffmpeg', '-v', f'level+{log.ff_level}', '-hide_banner',
'-nostats', '-re', '-thread_queue_size', '160', '-i', 'pipe:0'
] + playout.stream_param[:-3] + ['-f', 'null', '-']
@ -66,7 +66,7 @@ def output():
f'seconds: {node.get("source")}')
dec_cmd = [
'ffmpeg', '-v', f'level+{log.ff_level.lower()}',
'ffmpeg', '-v', f'level+{log.ff_level}',
'-hide_banner', '-nostats'
] + node['src_cmd'] + node['filter'] + pre.settings

View File

@ -64,7 +64,7 @@ def output():
try:
enc_cmd = [
'ffmpeg', '-v', f'level+{log.ff_level.lower()}', '-hide_banner',
'ffmpeg', '-v', f'level+{log.ff_level}', '-hide_banner',
'-nostats', '-re', '-thread_queue_size', '160', '-i', 'pipe:0'
] + filtering + preview + playout.stream_param
@ -85,7 +85,7 @@ def output():
messenger.info(f'Play: {node.get("source")}')
dec_cmd = [
'ffmpeg', '-v', f'level+{log.ff_level.lower()}',
'ffmpeg', '-v', f'level+{log.ff_level}',
'-hide_banner', '-nostats'
] + node['src_cmd'] + node['filter'] + pre.settings

View File

@ -223,9 +223,9 @@ def load_config():
pre.logo_filter = cfg['processing']['logo_filter']
pre.logo_opacity = cfg['processing']['logo_opacity']
pre.add_loudnorm = cfg['processing']['add_loudnorm']
pre.loud_i = cfg['processing']['loud_I']
pre.loud_tp = cfg['processing']['loud_TP']
pre.loud_lra = cfg['processing']['loud_LRA']
pre.loud_i = cfg['processing']['loud_i']
pre.loud_tp = cfg['processing']['loud_tp']
pre.loud_lra = cfg['processing']['loud_lra']
storage.path = cfg['storage']['path']
storage.filler = cfg['storage']['filler_clip']
@ -266,7 +266,7 @@ else:
if stdin_args.loop:
playlist.loop = stdin_args.loop
else:
playlist.loop = _cfg['playlist']['loop']
playlist.loop = _cfg['playlist']['infinit']
log.to_file = _cfg['logging']['log_to_file']
log.backup_count = _cfg['logging']['backup_count']
@ -288,7 +288,7 @@ def pre_audio_codec():
ingest.enable = _cfg['ingest']['enable']
ingest.stream_input = shlex.split(_cfg['ingest']['stream_input'])
ingest.stream_input = _cfg['ingest']['stream_input']
if stdin_args.play_mode:
pre.mode = stdin_args.play_mode
@ -319,8 +319,8 @@ else:
playout.mode = _cfg['out']['mode']
playout.preview = _cfg['out']['preview']
playout.preview_param = shlex.split(_cfg['out']['preview_param'])
playout.stream_param = shlex.split(_cfg['out']['stream_param'])
playout.preview_param = _cfg['out']['preview_param']
playout.stream_param = _cfg['out']['stream_param']
# ------------------------------------------------------------------------------
@ -749,9 +749,9 @@ def ffmpeg_stderr_reader(std_errors, prefix):
try:
for line in std_errors:
if log.ff_level == 'INFO':
if log.ff_level == 'info':
write_log(line.decode())
elif log.ff_level == 'WARNING':
elif log.ff_level == 'warning':
write_log(line.decode())
else:
write_log(line.decode())