-- Change input every 10 minutes s = make_channel({ name = "CAM", input = { "rtsp://address-1", "rtsp://address-2", }, output = { "udp://127.0.0.1:10000", }, backup_type = "passive", }) timer({ interval = 10 * 60, callback = function() local input_id = s.active_input_id local next_input_id = input_id + 1 if next_input_id > #s.input then next_input_id = 1 end channel_kill_input(s, input_id) log.info("[" .. s.config.name .. "] Destroy input #" .. input_id) collectgarbage() channel_init_input(s, next_input_id) end, })