Resource icon

Organized Output Directory 1.0.1

Mr.Martin

New Member
Mr.Martin submitted a new resource:

Organized Output Directory - A script that creates subdirectories for each game in the output directory

With "Organized Output Directory" you can create order in your output directory. The script automatically creates subdirectories for each game in the output directory. To do this, it searches for Window Capture or Game Capture sources in the current scene. The top active source is then used to determine the name of the subdirectory from the window title or the process name.

❗This script only works with OBS v30.0.0 and newer versions.

View attachment 101492

Known...​


Read more about this resource...
 

Rexxed

New Member
Just did a quick test with this script, and I've gotta say, thank you so much. This is working much better than any of the other ones I've used, and if you need any feedback, please let me know and I'll reply in earnest.

Gonna use this for a while, and if all is well (besides bugs, that happens) I'm definitely going to donate to you! Excellent work so far, keep it up!
 

Mr.Martin

New Member
Thank you. Feedback in any form is always welcome. I've tried a few other scripts with similar functionality before, but I wasn't really happy with any of them. If you have any ideas or suggestions, I would be happy to try to implement them. There's still room for improvement anyway, as I've only just started learning LUA and the OBS API.
 

SplitCoreGaming

New Member
Just to say many thanks for this. Was using a extremely outdated plugin and spent past hour working on it until I found this one. Works great for replays and screenshots.
Will you be adding recording support? I use recording far more than anything, but honestly just having everything else sorted makes it much easier to just manually drop on finishing.
* Will tinker later and report. Sadly will be out for next few hours :( *
 

SplitCoreGaming

New Member
Code:
local function record_event()
    print("record_event()")

    local file_path = obs.obs_frontend_get_last_recording()
    local game_name = get_game_name()

    if game_name == nil then
        return
    end

    local new_file_path = get_base_path(file_path) .. sanitize_path_string(game_name) .. "/" .. get_filename(file_path)

    move_file(file_path, new_file_path)
end


local function event_dispatch(event)
    if event == obs.OBS_FRONTEND_EVENT_SCREENSHOT_TAKEN then
        screenshot_event()
    elseif event == obs.OBS_FRONTEND_EVENT_REPLAY_BUFFER_SAVED then
        replay_event()
    elseif event == obs.OBS_FRONTEND_EVENT_RECORDING_STOPPED then
        record_event()
    end
end

Dam that was easy. Will test with more titles later. Worked with Horizon Forbidden West PC via Game capture.
 

Rexxed

New Member
Code:
local function record_event()
    print("record_event()")

    local file_path = obs.obs_frontend_get_last_recording()
    local game_name = get_game_name()

    if game_name == nil then
        return
    end

    local new_file_path = get_base_path(file_path) .. sanitize_path_string(game_name) .. "/" .. get_filename(file_path)

    move_file(file_path, new_file_path)
end


local function event_dispatch(event)
    if event == obs.OBS_FRONTEND_EVENT_SCREENSHOT_TAKEN then
        screenshot_event()
    elseif event == obs.OBS_FRONTEND_EVENT_REPLAY_BUFFER_SAVED then
        replay_event()
    elseif event == obs.OBS_FRONTEND_EVENT_RECORDING_STOPPED then
        record_event()
    end
end

Dam that was easy. Will test with more titles later. Worked with Horizon Forbidden West PC via Game capture.
did you add this to the script, or create a new one?
 

Valeh

New Member
Thank you so much for this cool plugin!
I found that when Steam is running, the recordings are always saved to the Steam folder. Even if a third party game is running
I added the following line print(get_source_hook_infos(source)) to the search_for_capture_source_and_get_data() loop and saw that the steamwebhelper.exe process is always in the last place in the process list after the game process, so the folder name is always Steam. I suppose it is an overlay
So I decided to add the following code to ignore the steamwebhelper.exe process.

Lua:
local function search_for_capture_source_and_get_data()
    local process_name, window_name
    local sources = obs.obs_enum_sources()

    for _, source in ipairs(sources) do
        -- print(get_source_hook_infos(source))
        if obs.obs_source_active(source) then
            local tmp_process_name, tmp_window_title, tmp_hooked = get_source_hook_infos(source)
   
            --NEW CODE START
            if tmp_process_name == "steamwebhelper.exe" then goto continue end
            --NEW CODE END
            if tmp_hooked then
                process_name = tmp_process_name
                window_name = tmp_window_title
            end
            --NEW CODE START
            ::continue::
            --NEW CODE END
        end
    end

    return process_name, window_name
end


After that the script started working fine with any games.
Maybe this will help someone.

P.S. I am a web developer, but I have not worked with lua and OBS API, so this solution may be bad. I hope you will continue to improve your very useful script in the future, thanks!
 
Top