revert to string instead of list

This commit is contained in:
jb-alvarado 2022-03-21 20:51:36 +01:00
parent 654f54e176
commit 44b33b7bcc
6 changed files with 46 additions and 46 deletions

View File

@ -64,7 +64,7 @@ ingest:
for a ingest stream. This stream will override the normal streaming until is done. 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. 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 enable: false
stream_input: [-f, live_flv, -listen, 1, -i, rtmp://localhost:1936/live/stream] input_param: -f live_flv -listen 1 -i rtmp://localhost:1936/live/stream
playlist: playlist:
helptext: > helptext: >
@ -115,34 +115,34 @@ out:
inside. 'preview' works only in streaming output and creates a separate preview stream. inside. 'preview' works only in streaming output and creates a separate preview stream.
mode: 'stream' mode: 'stream'
preview: false preview: false
preview_param: preview_param: >-
[-s, 512x288, -s 512x288
-c:v, libx264, -c:v libx264
-crf, 24, -crf 24
-x264-params, keyint=50:min-keyint=25:scenecut=-1, -x264-params keyint=50:min-keyint=25:scenecut=-1
-maxrate, 800k, -maxrate 800k
-bufsize, 1600k, -bufsize 1600k
-preset, ultrafast, -preset ultrafast
-tune, zerolatency, -tune zerolatency
-profile:v, Main, -profile:v Main
-level, 3.1, -level 3.1
-c:a, aac, -c:a aac
-ar, 44100, -ar 44100
-b:a, 128k, -b:a 128k
-flags, +global_header, -flags +global_header
-f, flv, rtmp://preview.local/live/stream] -f flv rtmp://preview.local/live/stream
stream_param: output_param: >-
[-c:v, libx264, -c:v libx264
-crf, 23, -crf 23
-x264-params, keyint=50:min-keyint=25:scenecut=-1, -x264-params keyint=50:min-keyint=25:scenecut=-1
-maxrate, 1300k, -maxrate 1300k
-bufsize, 2600k, -bufsize 2600k
-preset, faster, -preset faster
-tune, zerolatency, -tune zerolatency
-profile:v, Main, -profile:v Main
-level, 3.1, -level 3.1
-c:a, aac, -c:a aac
-ar, 44100, -ar 44100
-b:a, 128k, -b:a 128k
-flags, +global_header, -flags +global_header
-f, flv, rtmp://localhost/live/stream] -f flv rtmp://localhost/live/stream

View File

@ -36,7 +36,7 @@ def listener(que):
server_cmd = [ server_cmd = [
'ffmpeg', '-hide_banner', '-nostats', '-v', 'level+error' 'ffmpeg', '-hide_banner', '-nostats', '-v', 'level+error'
] + ingest.stream_input + [ ] + ingest.input_param + [
'-filter_complex', f'{filter_}[vout1]', '-filter_complex', f'{filter_}[vout1]',
'-map', '[vout1]', '-map', '0:a' '-map', '[vout1]', '-map', '0:a'
] + pre.settings ] + pre.settings

View File

@ -87,7 +87,7 @@ def output():
cmd = [ cmd = [
'ffmpeg', '-v', f'level+{log.ff_level}', 'ffmpeg', '-v', f'level+{log.ff_level}',
'-hide_banner', '-nostats' '-hide_banner', '-nostats'
] + node['src_cmd'] + node['filter'] + playout.stream_param ] + node['src_cmd'] + node['filter'] + playout.output_param
messenger.debug(f'Encoder CMD: "{" ".join(cmd)}"') messenger.debug(f'Encoder CMD: "{" ".join(cmd)}"')

View File

@ -45,7 +45,7 @@ def output():
enc_cmd = [ enc_cmd = [
'ffmpeg', '-v', f'level+{log.ff_level}', '-hide_banner', 'ffmpeg', '-v', f'level+{log.ff_level}', '-hide_banner',
'-nostats', '-re', '-thread_queue_size', '160', '-i', 'pipe:0' '-nostats', '-re', '-thread_queue_size', '160', '-i', 'pipe:0'
] + playout.stream_param[:-3] + ['-f', 'null', '-'] ] + playout.output_param[:-3] + ['-f', 'null', '-']
messenger.debug(f'Encoder CMD: "{" ".join(enc_cmd)}"') messenger.debug(f'Encoder CMD: "{" ".join(enc_cmd)}"')

View File

@ -66,7 +66,7 @@ def output():
enc_cmd = [ enc_cmd = [
'ffmpeg', '-v', f'level+{log.ff_level}', '-hide_banner', 'ffmpeg', '-v', f'level+{log.ff_level}', '-hide_banner',
'-nostats', '-re', '-thread_queue_size', '160', '-i', 'pipe:0' '-nostats', '-re', '-thread_queue_size', '160', '-i', 'pipe:0'
] + filtering + preview + playout.stream_param ] + filtering + preview + playout.output_param
messenger.debug(f'Encoder CMD: "{" ".join(enc_cmd)}"') messenger.debug(f'Encoder CMD: "{" ".join(enc_cmd)}"')

View File

@ -23,6 +23,7 @@ import json
import logging import logging
import math import math
import re import re
import shlex
import signal import signal
import smtplib import smtplib
import socket import socket
@ -258,9 +259,9 @@ if playlist.start is None:
playlist.start = get_time('full_sec') playlist.start = get_time('full_sec')
if stdin_args.length: if stdin_args.length:
playlist.length = str_to_sec(stdin_args.length) playlist.length = str_to_sec(stdin_args.length)
else: else:
playlist.length = str_to_sec(_cfg['playlist']['length']) playlist.length = str_to_sec(_cfg['playlist']['length'])
if stdin_args.loop: if stdin_args.loop:
playlist.loop = stdin_args.loop playlist.loop = stdin_args.loop
@ -287,7 +288,7 @@ def pre_audio_codec():
ingest.enable = _cfg['ingest']['enable'] ingest.enable = _cfg['ingest']['enable']
ingest.stream_input = [str(e) for e in _cfg['ingest']['stream_input']] ingest.input_param = shlex.split(_cfg['ingest']['input_param'])
if stdin_args.play_mode: if stdin_args.play_mode:
pre.mode = stdin_args.play_mode pre.mode = stdin_args.play_mode
@ -310,7 +311,7 @@ pre.settings = [
'-minrate', f'{pre.v_bitrate}k', '-minrate', f'{pre.v_bitrate}k',
'-maxrate', f'{pre.v_bitrate}k', '-maxrate', f'{pre.v_bitrate}k',
'-bufsize', f'{pre.v_bufsize}k' '-bufsize', f'{pre.v_bufsize}k'
] + pre_audio_codec() + ['-f', 'mpegts', '-'] ] + pre_audio_codec() + ['-f', 'mpegts', '-']
if stdin_args.output: if stdin_args.output:
playout.mode = stdin_args.output playout.mode = stdin_args.output
@ -318,8 +319,8 @@ else:
playout.mode = _cfg['out']['mode'] playout.mode = _cfg['out']['mode']
playout.preview = _cfg['out']['preview'] playout.preview = _cfg['out']['preview']
playout.preview_param = [str(e) for e in _cfg['out']['preview_param']] playout.preview_param =shlex.split(_cfg['out']['preview_param'])
playout.stream_param = [str(e) for e in _cfg['out']['stream_param']] playout.output_param = shlex.split(_cfg['out']['output_param'])
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
@ -947,7 +948,7 @@ def src_or_dummy(node):
f'Seek in remote source "{node.get("source")}" not supported!') f'Seek in remote source "{node.get("source")}" not supported!')
node['src_cmd'] = [ node['src_cmd'] = [
'-i', node['source'] '-i', node['source']
] + set_length(86400, node['seek'], node['out']) ] + set_length(86400, node['seek'], node['out'])
elif node.get('source') and Path(node['source']).is_file(): elif node.get('source') and Path(node['source']).is_file():
if probe.format.get('duration') and not math.isclose( if probe.format.get('duration') and not math.isclose(
probe.format['duration'], node['duration'], abs_tol=3): probe.format['duration'], node['duration'], abs_tol=3):
@ -962,8 +963,8 @@ def src_or_dummy(node):
f'Seek in looped source "{node["source"]}" not supported!') f'Seek in looped source "{node["source"]}" not supported!')
node['src_cmd'] = [ node['src_cmd'] = [
'-i', node['source'] '-i', node['source']
] + set_length(node['duration'], node['seek'], ] + set_length(node['duration'], node['seek'],
node['out'] - node['seek']) node['out'] - node['seek'])
else: else:
# when list starts with looped clip, # when list starts with looped clip,
# the logo length will be wrong # the logo length will be wrong
@ -979,4 +980,3 @@ def src_or_dummy(node):
node = gen_filler(node) node = gen_filler(node)
return node return node