From d3b134a2684a6f905749fd8c4d6c24196eecb7d5 Mon Sep 17 00:00:00 2001 From: jb-alvarado Date: Tue, 14 Aug 2018 21:30:32 +0200 Subject: [PATCH] add time_shift for delay stream --- ffplayout.conf | 4 ++++ ffplayout.py | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ffplayout.conf b/ffplayout.conf index 870d0a70..63887fac 100644 --- a/ffplayout.conf +++ b/ffplayout.conf @@ -63,6 +63,9 @@ ffmpeg_copy_settings = ["-c", "copy", "-bsf:v", "h264_mp4toannexb", "-threads", # filler_path are for the GUI only at the moment # filler_clip get handle different, when a new length needs to calculate # blackclip is for stream copy mode +# time_shift adds or subtract seconds to the clip start, +# this is usefull for example for hls, because it have a big delay +# the value will be added to the clip begin [PLAYLIST] playlist_path = /playlists clips_root = /ADtvMedia @@ -70,6 +73,7 @@ filler_path = /ADtvMedia/ADtv/03 - Musikalische Lückenfüller filler_clip = /ADtvMedia/ADtv/01 - Intro/seperator.clock.5-00.mp4 blackclip = /opt/dummy20.mkv day_start = 6 +time_shift = -35 # buffer settings diff --git a/ffplayout.py b/ffplayout.py index 9adc652e..1041f800 100755 --- a/ffplayout.py +++ b/ffplayout.py @@ -80,7 +80,8 @@ _playlist = SimpleNamespace( path=cfg.get('PLAYLIST', 'playlist_path'), start=cfg.getint('PLAYLIST', 'day_start'), filler=cfg.get('PLAYLIST', 'filler_clip'), - blackclip=cfg.get('PLAYLIST', 'blackclip') + blackclip=cfg.get('PLAYLIST', 'blackclip'), + shift=cfg.get('PLAYLIST', 'time_shift') ) _buffer = SimpleNamespace( @@ -509,7 +510,8 @@ def iter_src_commands(): # loop through all clips in playlist for clip_node in clip_nodes: src = clip_node.get('src') - begin = is_float(clip_node.get('begin'), last_time, True) + begin = is_float( + clip_node.get('begin'), last_time, True) + _playlist.shift duration = is_float(clip_node.get('dur'), dummy_len, True) seek = is_float(clip_node.get('in'), 0, True) out = is_float(clip_node.get('out'), dummy_len, True)