Данный скрипт сбрасывает буфер после сохранения Replay, чтобы в новом файле начало было концовкой сохранения (чтобы не записывать одно и тоже). Тестировалось на OBS Studio 32.0.4
C-подобный:
local obs = obslua
local ffi = require("ffi")
ffi.cdef[[
bool Beep(uint32_t dwFreq, uint32_t dwDuration);
]]
local is_auto_reset = false
function start_cache()
obs.timer_remove(start_cache)
if not obs.obs_frontend_replay_buffer_active() then
obs.obs_frontend_replay_buffer_start()
ffi.C.Beep(400, 200)
end
is_auto_reset = false
end
function on_event(event)
if event == obs.OBS_FRONTEND_EVENT_REPLAY_BUFFER_SAVED then
is_auto_reset = true
obs.obs_frontend_replay_buffer_stop()
end
if event == obs.OBS_FRONTEND_EVENT_REPLAY_BUFFER_STOPPED then
if is_auto_reset then
obs.timer_add(start_cache, 100)
end
end
end
function script_load(settings)
obs.obs_frontend_add_event_callback(on_event)
end
function script_description()
return "Reset Replay Cache after save Clip."
end