如何在 python 代码中创建源类型图像?

How to create source type image in python code?

我正在尝试从 obs 中的 python 脚本创建源类型图像。想知道在脚本中创建源代码的正确步骤。我已经检查过,python 脚本没有合适的文档可用。

obs.obs_source_create('banner-image','xyz')
obs.obs_source_create('banner-image','xyz')

日志

TypeError: obs_source_create() takes exactly 4 arguments (2 given)

我想从脚本创建源类型图像并将该源添加到我当前的场景

这可能是一个简单的 FFI 实现,所以请尝试:

obs.obs_source_create('banner-image', 'xyz', None, None)

来源:搜索 "obs_source_create" 时首先点击 Google:

摘录:

obs_source_t *obs_source_create(const char *id, const char *name, obs_data_t *settings, obs_data_t *hotkey_data)

Creates a source of the specified type with the specified settings.

The “source” context is used for anything related to presenting or modifying video/audio. Use obs_source_release to release it.

Parameters:

  • id – The source type string identifier
  • name – The desired name of the source. If this is not unique, it will be made to be unique
  • settings – The settings for the source, or NULL if none
  • hotkey_data – Saved hotkey data for the source, or NULL if none

Returns:

  • A reference to the newly created source, or NULL if failed