local INPUT5_SIGNAL_NUM = 5
local SBS_SIGNAL_NUM = NUM_CAMERAS
local STATIC_SIGNAL_NUM = NUM_CAMERAS + 1
+local VIDEO_SIGNAL_NUM = NUM_CAMERAS + 2
-- Preview-only signal showing the current signal with the overlay.
-- Not valid for live_signal_num!
-local OVERLAY_SIGNAL_NUM = NUM_CAMERAS + 2
+local OVERLAY_SIGNAL_NUM = NUM_CAMERAS + 3
-- Valid values for transition_type. (Cuts are done directly, so they need no entry.)
local NO_TRANSITION = 0
cef_input:execute_javascript_async("play()")
local bg_video = VideoInput.new(cef_path .. "/flow-720.mp4", Nageru.VIDEO_FORMAT_YCBCR)
+-- local iptv_video = VideoInput.new("http://10.34.129.69:9060/1/v.flv", Nageru.VIDEO_FORMAT_YCBCR)
+local iptv_video = VideoInput.new("http://home.samfundet.no/~sesse/videostuff", Nageru.VIDEO_FORMAT_YCBCR)
function reload_cef()
cef_input:reload()
end
end
-function make_fade_input(chain, signal, live, deint, scale)
+function make_fade_input(chain, signal, live, deint, scale, video)
local input, wb_effect, resample_effect, last
- if live then
+ if video then
+ input = chain:add_video_input(iptv_video, false)
+ last = input
+ elseif live then
input = chain:add_live_input(false, deint)
input:connect_signal(signal)
last = input
-- A chain to fade between two inputs, of which either can be a picture
-- or a live input. In practice only used live, but we still support the
-- hq parameter.
-function make_fade_chain(input0_live, input0_deint, input0_scale, input1_live, input1_deint, input1_scale, has_overlay, hq)
+function make_fade_chain(input0_live, input0_deint, input0_scale, input0_video, input1_live, input1_deint, input1_scale, input1_video, has_overlay, hq)
local chain = EffectChain.new(16, 9)
- local input0 = make_fade_input(chain, INPUT0_SIGNAL_NUM, input0_live, input0_deint, input0_scale)
- local input1 = make_fade_input(chain, INPUT1_SIGNAL_NUM, input1_live, input1_deint, input1_scale)
+ local input0 = make_fade_input(chain, INPUT0_SIGNAL_NUM, input0_live, input0_deint, input0_scale, input0_video)
+ local input1 = make_fade_input(chain, INPUT1_SIGNAL_NUM, input1_live, input1_deint, input1_scale, input1_video)
-- If fading between two live inputs, the overlay is put on top.
-- If fading between the static picture and a live input,
-- Chains to fade between two inputs, in various configurations.
local fade_chains = make_cartesian_product({
- {"static", "live", "livedeint"}, -- input0_type
+ {"video", "static", "live", "livedeint"}, -- input0_type
{true, false}, -- input0_scale
- {"static", "live", "livedeint"}, -- input1_type
+ {"video", "static", "live", "livedeint"}, -- input1_type
{true, false}, -- input1_scale
{true, false}, -- has_overlay
{true} -- hq
local input1_live = (input1_type ~= "static")
local input0_deint = (input0_type == "livedeint")
local input1_deint = (input1_type == "livedeint")
- return make_fade_chain(input0_live, input0_deint, input0_scale, input1_live, input1_deint, input1_scale, has_overlay, hq)
+ local input0_video = (input0_type == "video")
+ local input1_video = (input1_type == "video")
+ return make_fade_chain(input0_live, input0_deint, input0_scale, input0_video, input1_live, input1_deint, input1_scale, input1_video, has_overlay, hq)
end)
function make_sbs_input(chain, signal, deint, has_overlay, hq)
end)
-- A chain to show a single input on screen.
-function make_simple_chain(input_deint, input_scale, has_overlay, hq)
+function make_simple_chain(input_deint, input_video, input_scale, has_overlay, hq)
local chain = EffectChain.new(16, 9)
- local input = chain:add_live_input(false, input_deint)
+ local input;
+ if input_video then
+ input = chain:add_video_input(iptv_video, false)
+ else
+ input = chain:add_live_input(false, input_deint)
+ end
input:connect_signal(0) -- First input card. Can be changed whenever you want.
local resample_effect, resize_effect
-- Make all possible combinations of single-input chains.
local simple_chains = make_cartesian_product({
- {"live", "livedeint"}, -- input_type
+ {"video", "live", "livedeint"}, -- input_type
{true, false}, -- input_scale
{true, false}, -- has_overlay
{true, false} -- hq
}, function(input_type, input_scale, has_overlay, hq)
local input_deint = (input_type == "livedeint")
- return make_simple_chain(input_deint, input_scale, has_overlay, hq)
+ local input_video = (input_type == "video")
+ return make_simple_chain(input_deint, input_video, input_scale, has_overlay, hq)
end)
-- A chain to show a single static picture on screen. Never with HTML overlay.
function get_input_type(signals, signal_num)
if signal_num == STATIC_SIGNAL_NUM then
return "static"
+ elseif signal_num == VIDEO_SIGNAL_NUM then
+ return "video"
elseif signals:get_interlaced(signal_num) then
return "livedeint"
else
-- Returns the number of outputs in addition to the live (0) and preview (1).
-- Called only once, at the start of the program.
function num_channels()
- return NUM_CAMERAS + 3 -- sbs, static picture and overlay
+ return NUM_CAMERAS + 4 -- sbs, static picture, video and overlay
end
function is_plain_signal(num)
- return num >= INPUT0_SIGNAL_NUM and num <= INPUT5_SIGNAL_NUM
+ return (num >= INPUT0_SIGNAL_NUM and num <= INPUT5_SIGNAL_NUM) or (num == VIDEO_SIGNAL_NUM)
end
-- Helper function to write e.g. “720p60”. The difference between this
return "Side-by-side"
elseif signal_num == STATIC_SIGNAL_NUM then
return "Static picture"
+ elseif signal_num == VIDEO_SIGNAL_NUM then
+ return "IPTV input"
elseif signal_num == OVERLAY_SIGNAL_NUM then
return "Overlay"
end
if signal_num == STATIC_SIGNAL_NUM then
return (channel == NUM_CAMERAS)
end
+ if signal_num == VIDEO_SIGNAL_NUM then
+ return (channel == NUM_CAMERAS + 1)
+ end
return false
end
local overlay_really_enabled = overlay_enabled and simple_signal_has_overlay(live_signal_num)
local chain = simple_chains[input_type][input_scale][overlay_really_enabled][true]
prepare = function()
- chain.input:connect_signal(live_signal_num)
+ if input_type ~= "video" then
+ chain.input:connect_signal(live_signal_num)
+ set_neutral_color_from_signal(chain.wb_effect, live_signal_num)
+ end
set_scale_parameters_if_needed(chain, width, height)
- set_neutral_color_from_signal(chain.wb_effect, live_signal_num)
prepare_overlay_live(chain, t, 1.0)
end
return chain.chain, prepare
local input_scale = needs_scale(signals, signal_num, width, height)
local chain = simple_chains[input_type][input_scale][show_overlay][false]
prepare = function()
- chain.input:connect_signal(signal_num)
+ if input_type ~= "video" then
+ chain.input:connect_signal(signal_num)
+ set_neutral_color(chain.wb_effect, neutral_colors[signal_num + 1])
+ end
set_scale_parameters_if_needed(chain, width, height)
- set_neutral_color(chain.wb_effect, neutral_colors[signal_num + 1])
prepare_overlay_static(chain, t)
end
return chain.chain, prepare