Python: captionbob.render
captionbob.render.plugin_catalog
The plugins of captionbob by name.
A plugin of captionbob/plugins acts on the whole video. Each plugin is named by the name of its file in captionbob/plugins with no suffix. The table PLUGINS holds the settings class and the plugin class of each plugin and says which plugins read the sound of the video.
Source file: captionbob/render/plugin_catalog.py
PluginEntry
class PluginEntry(NamedTuple)
One plugin of the table.
Args:
name: The name of the file of the plugin in captionbob/plugins, with no suffix.settings_class: The frozen settings dataclass of the plugin.plugin_class: The plugin class. Its build_filter_graph gives the text of its ffmpeg filter graph.needs_audio: True when the plugin reads the sound of the video, so that its build_filter_graph takes the label of the sound as its fourth value.
find_plugin
def find_plugin(name: str) -> PluginEntry
Give the plugin of a name.
Args:
name: The name of the file of the plugin in captionbob/plugins, with no suffix.
Returns:
The entry of the plugin.
Raises:
ValueError: When no plugin has the name.
build_plugin
def build_plugin(entry: PluginEntry, settings: Any) -> Any
Make the plugin of an entry with its settings.
Args:
entry: The entry of the plugin.settings: The settings of the plugin, an object of its settings class.
Returns:
The plugin. Its build_filter_graph gives its filter graph text.
Raises:
TypeError: When the settings are not an object of the settings class of the plugin.