add time_shift for delay stream

This commit is contained in:
jb-alvarado 2018-08-14 21:30:32 +02:00
parent 1531bbbf17
commit d3b134a268
2 changed files with 8 additions and 2 deletions

View File

@ -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

View File

@ -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)