Lua filter: OBS_SOURCE_TYPE_FILTER + OBS_SOURCE_ASYNC_VIDEO but filter_video is never called

YorVeX

Member
Am I doing anything wrong?

Lua:
obs = obslua

function script_description()
  return [[Test Async filter_video
           A test filter to show that filter_video is never called.]]
end

source_info = {}
source_info.id = 'test-async-filter_video'
source_info.type = obs.OBS_SOURCE_TYPE_FILTER
source_info.output_flags = obs.OBS_SOURCE_ASYNC_VIDEO

source_info.get_name = function()
  return "Test Async filter_video"
end

source_info.create = function(settings, source)
  print("create")
end

source_info.filter_video = function(data, frame)
    print("filter_video")
    return frame
end

obs.obs_register_source(source_info)

For the sake of simplicity in this post I dumbed the test script down to only the most basic methods but I would still expect that OBS would call my filter_video callback here and therefore I would get the "filter_video" message in the log. But this doesn't happen, I only get the "create" message after adding the filter to a source.
Originally I tried with a more complete version that also had get_width and get_height with print calls in all of these where I also got the corresponding log entries telling me that these callbacks were actually called by OBS. Also when I added a video_render callback that was called too, but that's not what I need.

I looked at a C implementation of a filter with OBS_SOURCE_ASYNC_VIDEO and couldn't see any big differences, but unfortunately couldn't find a single Lua script with this combination I could use to compare my script to, all Lua based filters I found use OBS_SOURCE_VIDEO.

Am I missing something or is this a bug in the Lua implementation that so far nobody ever noticed, because nobody seems to have ever created an async filter using Lua?
 
Top