windows update?
This commit is contained in:
parent
f8d79c97ac
commit
420b59f982
2 changed files with 19 additions and 5 deletions
|
@ -1,5 +1,7 @@
|
|||
# OBSReplay
|
||||
|
||||
**Works on linux and windows but windows hasnt been tested**
|
||||
|
||||
A lightweight OBS script that automatically organizes recordings, replays, and screenshots into folders named after the current scene.
|
||||
|
||||
## Features
|
||||
|
|
22
main.lua
22
main.lua
|
@ -62,19 +62,31 @@ function save(event)
|
|||
if latest_file_path and latest_file_path ~= "" then
|
||||
local current_scene_name = get_current_scene_name()
|
||||
local scene_folder_path = output_path .. "/" .. current_scene_name
|
||||
|
||||
os.execute("mkdir -p '" .. scene_folder_path .. "'")
|
||||
os.execute("mv '" .. latest_file_path .. "' '" .. scene_folder_path .. "'")
|
||||
|
||||
|
||||
if package.config:sub(1, 1) == "\\" then
|
||||
os.execute(('if not exist "%s" mkdir "%s"'):format(scene_folder_path, scene_folder_path))
|
||||
else
|
||||
os.execute(('mkdir -p "%s"'):format(scene_folder_path))
|
||||
end
|
||||
|
||||
local move_command
|
||||
if package.config:sub(1, 1) == "\\" then
|
||||
move_command = ('move /Y "%s" "%s"'):format(latest_file_path, scene_folder_path)
|
||||
else
|
||||
move_command = ('mv "%s" "%s"'):format(latest_file_path, scene_folder_path)
|
||||
end
|
||||
os.execute(move_command)
|
||||
|
||||
if remux_to_mp4 and latest_file_path:match("%.mkv$") then
|
||||
local new_file_path = scene_folder_path .. "/" .. latest_file_path:match("([^/]+)%.mkv$") .. ".mp4"
|
||||
local remux_command = ffmpeg_path .. " -i '" .. scene_folder_path .. "/" .. latest_file_path:match("([^/]+)$") .. "' -c:v copy -c:a copy '" .. new_file_path .. "'"
|
||||
local remux_command = ffmpeg_path .. ' -i "' .. scene_folder_path .. "/" .. latest_file_path:match("([^/]+)$") .. '" -c:v copy -c:a copy "' .. new_file_path .. '"'
|
||||
print("Remuxing to MP4:", remux_command)
|
||||
os.execute(remux_command)
|
||||
end
|
||||
else
|
||||
print("No file found to move.")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function get_current_scene_name()
|
||||
|
|
Loading…
Add table
Reference in a new issue