obs = obslua
local frame_counter = 0 -- 프레임 카운터 초기화
function current_milliseconds()
return os.time() * 1000 + os.clock() * 1000
end
-- 매 프레임마다 호출되는 함수
function on_render()
-- 현재 타임스탬프 가져오기
local current_time = current_milliseconds()
local recording_active = obs.obs_frontend_recording_active()
if recording_active then
-- print("녹화 중입니다.")
print("현재 타임스탬프: " .. current_time .. "frame" .. frame_counter)
frame_counter = frame_counter + 1
else
-- print("녹화 중이 아닙니다.")
end
end
-- 스크립트 로드 시 호출되는 함수
function script_load()
obs.obs_add_main_render_callback(on_render)
obs.obs_frontend_add_event_callback(on_event);
print("on_load")
-- 타임스탬프를 표시할 텍스트 소스 생성
timestamp_text_source = obs.obs_source_create("text_gdiplus", "Timestamp", nil, nil)
timestamp_text_source_settings = obs.obs_data_create()
obs.obs_data_set_string(timestamp_text_source_settings, "font", "Arial")
obs.obs_data_set_int(timestamp_text_source_settings, "font_size", 24)
obs.obs_data_set_string(timestamp_text_source_settings, "text_color", "#FFFFFF")
obs.obs_data_set_string(timestamp_text_source_settings, "text", "")
obs.obs_source_update(timestamp_text_source, timestamp_text_source_settings)
end
function on_event(event)
if event == obs.OBS_FRONTEND_EVENT_RECORDING_STARTED then
frame_counter = 0
end
end
obs = obslua
local frame_counter = 0 -- 프레임 카운터 초기화
function current_milliseconds()
return os.time() * 1000 + os.clock() * 1000
end
-- 매 프레임마다 호출되는 함수
function on_render()
-- 현재 타임스탬프 가져오기
local current_time = current_milliseconds()
end
-- 스크립트 로드 시 호출되는 함수
function script_load()
obs.obs_add_main_render_callback(on_render)
obs.obs_frontend_add_event_callback(on_event);
print("on_load")
end
function on_event(event)
if event == obs.OBS_FRONTEND_EVENT_RECORDING_STARTED then
frame_counter = 0
end
end