hotflow
New Member
hello,I'm encountering a strange issue when using Lua scripts for audio filters in OBS: adding even the simplest audio filter script causes the OBS preview and output to turn completely black. In contrast, Lua video filter scripts work perfectly without any issues. I've tried various troubleshooting steps, but the problem persists. I’m hoping the community can help analyze and suggest solutions!
Issue Description
Here’s the Minimal Audio Filter Lua script I used, saved as test_audio_filter.lua:
lua
obs = obslua
function script_description()
return "A minimal audio filter for testing."
end
function script_properties()
local props = obs.obs_properties_create()
return props
end
function script_load(settings)
obs.script_log(obs.LOG_INFO, "Minimal audio filter loaded.")
end
function create_audio_filter(source)
local filter = {}
filter.source = source
return filter
end
function update_audio_filter(filter, settings)
end
function destroy_audio_filter(filter)
end
function filter_audio(filter, data)
return true
end
function script_defaults(settings)
end
obs.obs_register_source({
id = "lua_minimal_audio_filter",
type = obs.OBS_SOURCE_TYPE_FILTER,
output_flags = obs.OBS_SOURCE_AUDIO,
create = create_audio_filter,
destroy = destroy_audio_filter,
update = update_audio_filter,
filter_audio = filter_audio,
get_name = function() return "Minimal Audio Filter" end
})
Steps to Reproduce
Issue Description
- Symptom: After adding a Lua audio filter to an audio source in OBS, the preview and output (recording/stream) immediately turn black.
- Trigger: The black screen occurs as soon as any Lua audio filter is added, including a minimal script with no processing logic.
- Comparison: Lua video filter scripts (e.g., a simple color adjustment filter) work fine and do not cause a black screen.
- Test Script: I tested a minimal audio filter script (see below), which only registers the filter and logs a message, but it still causes a black screen.
Here’s the Minimal Audio Filter Lua script I used, saved as test_audio_filter.lua:
lua
obs = obslua
function script_description()
return "A minimal audio filter for testing."
end
function script_properties()
local props = obs.obs_properties_create()
return props
end
function script_load(settings)
obs.script_log(obs.LOG_INFO, "Minimal audio filter loaded.")
end
function create_audio_filter(source)
local filter = {}
filter.source = source
return filter
end
function update_audio_filter(filter, settings)
end
function destroy_audio_filter(filter)
end
function filter_audio(filter, data)
return true
end
function script_defaults(settings)
end
obs.obs_register_source({
id = "lua_minimal_audio_filter",
type = obs.OBS_SOURCE_TYPE_FILTER,
output_flags = obs.OBS_SOURCE_AUDIO,
create = create_audio_filter,
destroy = destroy_audio_filter,
update = update_audio_filter,
filter_audio = filter_audio,
get_name = function() return "Minimal Audio Filter" end
})
Steps to Reproduce
- Load the test_audio_filter.lua script in OBS via “Tools” -> “Scripts”.
- Select an audio source (e.g., “Audio Input Capture”), right-click -> “Filters” -> add “Minimal Audio Filter”.
- Upon adding the filter, the OBS preview turns black.
- Removing the filter restores the preview to normal.
- OBS Version: [Please fill in, e.g., OBS Studio 30.0.1]
- Operating System: [Please fill in, e.g., Windows 11 64-bit]
- Graphics Card: [Please fill in, e.g., NVIDIA GTX 1660, driver version xxx]
- Audio Device: [Please fill in, e.g., Realtek High Definition Audio]
- Installed Plugins: [Please fill in, e.g., StreamFX, OBS-Websocket, or “None”]
- Tested Audio Sources: “Audio Input Capture” (microphone), “Audio Output Capture” (desktop audio)
- Other Scripts: None (removed all other Lua scripts, only testing this one)
- Checked Logs: After adding the filter, the OBS log shows “Minimal audio filter loaded” but no obvious Lua-related errors. [If errors exist, please include log snippet]
- Tested Different Audio Sources: Applied the filter to “Audio Input Capture” and “Audio Output Capture”; both caused black screens.
- Updated OBS: Confirmed using the latest OBS version (or tried updating to the latest).
- Reset Configuration: Deleted OBS configuration files and retested; issue persists.
- Disabled Plugins: Removed all third-party plugins, ran only this script; still black screen.
- Compared Video Filters: Tested a simple Lua video filter script; preview remained normal, no black screen.
- Updated Drivers: Graphics and audio drivers are up to date.
- Could this be a bug in OBS’s Lua scripting engine when handling audio filters?
- Is the audio filter somehow interfering with the video rendering pipeline?
- Could this be related to a specific OBS version or configuration?
- Has anyone else encountered a black screen issue with Lua audio filters?
- Are there known OBS versions or settings that could cause this behavior?
- How can I debug this further? Are there specific logs or tools to inspect the rendering pipeline?
- Do I need to modify the script structure or OBS settings to prevent the black screen?
- I’ve searched the OBS log for “lua” or “error” but found no clear clues. [If logs are available, please attach]
- I’m happy to provide more details (e.g., full OBS log, configuration files, or further test results) if needed.