From 0b1a1382bcabcbc3f2c4287daf118f1e070d1ce5 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Tue, 27 Feb 2018 00:54:25 +0100 Subject: [PATCH] Update ultimate.lua to work without CasparCG. The README still needs updating. --- nageru/ultimate.lua | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/nageru/ultimate.lua b/nageru/ultimate.lua index 9bd4e17..32b1713 100644 --- a/nageru/ultimate.lua +++ b/nageru/ultimate.lua @@ -45,8 +45,14 @@ local FADE_TRANSITION = 2 -- frame and not per field, since we deinterlace. local last_resolution = {} -local caspar_input = VideoInput.new("unix:///tmp/caspar.sock", Nageru.VIDEO_FORMAT_BGRA) -caspar_input:change_rate(2.0) +local cef_input = HTMLInput.new("file:///home/sesse/dev/ultimatescore/score.html") +cef_input:set_url("file:///home/sesse/dev/ultimatescore/score.html"); +cef_input:execute_javascript_async("play()") + +function reload_cef() + cef_input:reload() + cef_input:execute_javascript_async("play()") +end -- Utility function to help creating many similar chains that can differ -- in a free set of chosen parameters. @@ -68,7 +74,7 @@ end -- An overlay with variable alpha. function make_overlay(chain, base) - local image = chain:add_video_input(caspar_input, false) + local image = chain:add_html_input(cef_input) local multiply_effect = chain:add_effect(MultiplyEffect.new()) local overlay_effect = chain:add_effect(OverlayEffect.new(), base, multiply_effect) return { @@ -233,7 +239,7 @@ end) -- A chain to show the overlay and nothing more. LQ only, -- since it is not a valid live signal. local overlay_chain_lq = EffectChain.new(16, 9) -local overlay_chain_lq_input = overlay_chain_lq:add_video_input(caspar_input, false) +local overlay_chain_lq_input = overlay_chain_lq:add_html_input(cef_input) overlay_chain_lq:finalize(false) -- Used for indexing into the tables of chains. @@ -760,3 +766,7 @@ function calc_fade_progress(t, transition_start, transition_end) return tt end + +ThemeMenu.set( + { "Reload overlay", reload_cef } +) -- 2.39.2