move mode to pre processing

This commit is contained in:
jb-alvarado 2022-02-13 15:58:37 +01:00
parent 4c695d0a20
commit 8ebaa7cdfe
6 changed files with 19 additions and 22 deletions

View File

@ -31,7 +31,8 @@ logging:
ffmpeg_level: "ERROR"
processing:
helptext: Default processing, for all clips that they get prepared in that way,
helptext: Set playing mode, like playlist; folder, or you own custom one.
Default processing, for all clips that they get prepared in that way,
so the output is unique. 'aspect' must be a float number. 'logo' is only used
if the path exist. 'logo_scale' scale the logo to target size, leave it blank
when no scaling is needed, format is 'number:number', for example '100:-1'
@ -42,6 +43,7 @@ processing:
the filtering, > 1 gives the option to use the same filters for multiple outputs.
This outputs can be taken in 'stream_param', names will be vout2, vout3;
aout2, aout2 etc.
mode: playlist
width: 1024
height: 576
aspect: 1.778
@ -67,10 +69,6 @@ ingest:
-listen 1
-i rtmp://localhost:1936/live/stream
play:
helptext: Set playing mode, like playlist; folder, or you own custom one.
mode: playlist
playlist:
helptext: >
'path' can be a path to a single file, or a directory. For directory put

View File

@ -25,7 +25,7 @@ from threading import Thread
from ..ingest_server import ingest_stream
from ..utils import (check_node_time, ff_proc, ffmpeg_stderr_reader, ingest,
log, lower_third, messenger, play, pre, sync_op,
log, lower_third, messenger, pre, sync_op,
terminate_processes)
@ -65,7 +65,7 @@ def output():
enc_err_thread.daemon = True
enc_err_thread.start()
Iter = import_module(f'ffplayout.player.{play.mode}').GetSourceIter
Iter = import_module(f'ffplayout.player.{pre.mode}').GetSourceIter
get_source = Iter()
try:

View File

@ -38,8 +38,8 @@ from pathlib import Path
from subprocess import PIPE, Popen
from threading import Thread
from ..utils import (ff_proc, ffmpeg_stderr_reader, log, messenger, play,
playout, sync_op, terminate_processes)
from ..utils import (ff_proc, ffmpeg_stderr_reader, log, messenger, playout,
pre, sync_op, terminate_processes)
def clean_ts():
@ -77,7 +77,7 @@ def output():
sync_op.realtime = True
try:
Iter = import_module(f'ffplayout.player.{play.mode}').GetSourceIter
Iter = import_module(f'ffplayout.player.{pre.mode}').GetSourceIter
get_source = Iter()
try:

View File

@ -25,7 +25,7 @@ from threading import Thread
from ..ingest_server import ingest_stream
from ..utils import (check_node_time, ff_proc, ffmpeg_stderr_reader, ingest,
log, messenger, play, playout, pre, terminate_processes)
log, messenger, playout, pre, terminate_processes)
def output():
@ -56,7 +56,7 @@ def output():
enc_err_thread.daemon = True
enc_err_thread.start()
Iter = import_module(f'ffplayout.player.{play.mode}').GetSourceIter
Iter = import_module(f'ffplayout.player.{pre.mode}').GetSourceIter
get_source = Iter()
try:

View File

@ -25,7 +25,7 @@ from threading import Thread
from ..ingest_server import ingest_stream
from ..utils import (check_node_time, ff_proc, ffmpeg_stderr_reader, ingest,
log, lower_third, messenger, play, playout, pre, sync_op,
log, lower_third, messenger, playout, pre, sync_op,
terminate_processes)
@ -77,7 +77,7 @@ def output():
enc_err_thread.daemon = True
enc_err_thread.start()
Iter = import_module(f'ffplayout.player.{play.mode}').GetSourceIter
Iter = import_module(f'ffplayout.player.{pre.mode}').GetSourceIter
get_source = Iter()
try:

View File

@ -140,7 +140,6 @@ mail = SimpleNamespace()
log = SimpleNamespace()
pre = SimpleNamespace()
ingest = SimpleNamespace()
play = SimpleNamespace()
playlist = SimpleNamespace()
storage = SimpleNamespace()
lower_third = SimpleNamespace()
@ -246,11 +245,6 @@ def load_config():
_cfg = load_config()
if stdin_args.play_mode:
play.mode = stdin_args.play_mode
else:
play.mode = _cfg['play']['mode']
if stdin_args.playlist:
playlist.path = stdin_args.playlist
else:
@ -296,6 +290,11 @@ def pre_audio_codec():
ingest.enable = _cfg['ingest']['enable']
ingest.stream_input = shlex.split(_cfg['ingest']['stream_input'])
if stdin_args.play_mode:
pre.mode = stdin_args.play_mode
else:
pre.mode = _cfg['play']['mode']
pre.w = _cfg['processing']['width']
pre.h = _cfg['processing']['height']
pre.aspect = _cfg['processing']['aspect']
@ -834,7 +833,7 @@ def check_sync(delta, node=None):
check that we are in tolerance time
"""
if play.mode == 'playlist' and playlist.start and playlist.length:
if pre.mode == 'playlist' and playlist.start and playlist.length:
# save time delta to global variable for syncing
# this is needed for real time filter
sync_op.time_delta = delta
@ -853,7 +852,7 @@ def check_node_time(node, get_source):
clip_length = node['out'] - node['seek']
clip_end = current_time + clip_length
if play.mode == 'playlist' and clip_end > current_time:
if pre.mode == 'playlist' and clip_end > current_time:
get_source.first = True