From b4c4d15541ce58589e14d0f06b0c1bd123f866be Mon Sep 17 00:00:00 2001 From: jb-alvarado Date: Mon, 29 Mar 2021 09:25:43 +0200 Subject: [PATCH] don't expose realtime filter to user --- ffplayout.yml | 4 +--- ffplayout/filters/default.py | 2 +- ffplayout/output/hls.py | 3 ++- ffplayout/utils.py | 3 +-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/ffplayout.yml b/ffplayout.yml index 8d386b05..b34b985c 100644 --- a/ffplayout.yml +++ b/ffplayout.yml @@ -42,8 +42,7 @@ processing: 'loud_*' can adjust the loudnorm filter. 'output_count' sets the outputs for the filtering, > 1 gives the option to use the same filters for multiple outputs. This outputs can be taken in 'ffmpeg_param', names will be vout2, vout3; - aout2, aout2 etc.'use_realtime' is realtime filter, it works not in all scenarios, - but for example is necessary for hls output. + aout2, aout2 etc. width: 1024 height: 576 aspect: 1.778 @@ -58,7 +57,6 @@ processing: loud_TP: -1.5 loud_LRA: 11 output_count: 1 - use_realtime: false playlist: helptext: Set 'playlist_mode' to 'False' if you want to play clips from the 'storage' diff --git a/ffplayout/filters/default.py b/ffplayout/filters/default.py index c10281ee..3745bbad 100644 --- a/ffplayout/filters/default.py +++ b/ffplayout/filters/default.py @@ -219,7 +219,7 @@ def realtime_filter(duration, track=''): """ speed_filter = '' - if pre.realtime: + if sync_op.realtime: speed_filter = f',{track}realtime=speed=1' if sync_op.time_delta < 0: diff --git a/ffplayout/output/hls.py b/ffplayout/output/hls.py index 7874027c..b243e45c 100644 --- a/ffplayout/output/hls.py +++ b/ffplayout/output/hls.py @@ -28,7 +28,7 @@ from threading import Thread from ffplayout.folder import GetSourceFromFolder, MediaStore, MediaWatcher from ffplayout.playlist import GetSourceFromPlaylist from ffplayout.utils import (ff_proc, ffmpeg_stderr_reader, get_date, log, - messenger, playlist, playout, stdin_args, + messenger, playlist, playout, stdin_args, sync_op, terminate_processes) @@ -68,6 +68,7 @@ def output(): this output is hls output, no preprocess is needed. """ year = get_date(False).split('-')[0] + sync_op.realtime = True try: if playlist.mode and not stdin_args.folder: diff --git a/ffplayout/utils.py b/ffplayout/utils.py index 4f79e31b..c17d5eb1 100644 --- a/ffplayout/utils.py +++ b/ffplayout/utils.py @@ -130,7 +130,7 @@ def get_time(time_format): # default variables and values # ------------------------------------------------------------------------------ -sync_op = SimpleNamespace(time_delta=0) +sync_op = SimpleNamespace(time_delta=0, realtime=False) mail = SimpleNamespace() log = SimpleNamespace() pre = SimpleNamespace() @@ -252,7 +252,6 @@ pre.aspect = _cfg['processing']['aspect'] pre.fps = _cfg['processing']['fps'] pre.v_bitrate = _cfg['processing']['width'] * _cfg['processing']['height'] / 10 pre.v_bufsize = pre.v_bitrate / 2 -pre.realtime = _cfg['processing']['use_realtime'] playout.mode = _cfg['out']['mode'] playout.name = _cfg['out']['service_name']