Video output currently active

Harold

Active Member
Likely the vertical canvas output

Other outputs include:
Streaming
Recording
Replay Buffer
Virtual Camera
NDI
Teleport
 

Suslik V

Active Member
You may try this .lua script (save it as obs-get-output-status.lua or give it similar name to be able to use it with OBS main menu Tools>Scripts). I'm using "notepad++" application to write these kind of scripts but you may use any simple text editor you wish:
Lua:
local obs = obslua

local ffi = require("ffi")

ffi.cdef[[
struct obs_output;
typedef struct obs_output obs_output_t;

void obs_enum_outputs(bool (*enum_proc)(void *, obs_output_t *), void *param);

const char *obs_output_get_id(const obs_output_t *output);

bool obs_output_active(const obs_output_t *output);

const char *obs_output_get_name(const obs_output_t *output);

uint32_t obs_output_get_flags(const obs_output_t *output);
]]

local obsffi
if ffi.os == "OSX" then
    obsffi = ffi.load("obs.0.dylib")
else
    obsffi = ffi.load("obs")
end

-- Callback function. When it returns True then enumeration continues
local count_outputs = function(param, output)
    local id_raw = obsffi.obs_output_get_id(output)
    local status_raw = obsffi.obs_output_active(output)
    local id_s = "none"
    local status_s = "inactive"
    local name_s = "unknown"
    local flags_s = "0"
    if id_raw ~= nil then
        id_s = ffi.string(id_raw)
        if status_raw then
            status_s = "ACTIVE"
        end
        local name_raw = obsffi.obs_output_get_name(output)
        if name_raw ~= nil then
            name_s = ffi.string(name_raw)
        end
        local flags_raw = obsffi.obs_output_get_flags(output)
        if flags_raw ~= nil then
            flags_s = tostring(flags_raw)
        end
    end
    print("[" .. status_s .. "] " .. name_s .. " (id: " .. id_s .. ", flags: " .. flags_s .. ")")
    return true
end

function log_all_outputs()
    print("Enumerating outputs...")
    local i = ffi.new("int[1]", 0)
    obsffi.obs_enum_outputs(count_outputs, i)
    print("...complete!")
end

function log_output_status_button_clicked(props, p)
    log_all_outputs()
    return false
end

----------------------------------------------------------

-- A function named script_properties defines the properties that the user
-- can change for the entire script module itself
function script_properties()
    local props = obs.obs_properties_create()
    obs.obs_properties_add_button(props, "log_output_button", "Log Output Status Now", log_output_status_button_clicked)
    return props
end

function script_description()
    return "Logs all outputs on button press"
end

Add the script to the list of running scripts via the main menu Tools > Scripts (there is Add, Remove etc buttons). After you have added recently created script-file to the list of scripts, on the right half of the Scripts window will appear new button named "Log Output Status Now".
When the "Log Output Status Now" button is pressed (in the Scripts window) the script will try to enumerate all obs outputs and then writes brief info to the log-file, like this (log-file of OBS can be found in main menu Help):
Code:
Example!!!
[obs-get-output-status.lua] Enumerating outputs...
[obs-get-output-status.lua] [ACTIVE] Source Record (id: ffmpeg_muxer, flags: 55)
[obs-get-output-status.lua] [inactive] adv_file_output (id: ffmpeg_muxer, flags: 55)
[obs-get-output-status.lua] [inactive] Replay Buffer (id: replay_buffer, flags: 55)
[obs-get-output-status.lua] ...complete!
Here the word [ACTIVE] means that the output is still active and this is not a UI bug... output is still running.
 
Last edited:
Top