{"id":13502886,"url":"https://github.com/bennetthardwick/rust-obs-plugins","last_synced_at":"2025-04-04T13:11:07.950Z","repository":{"id":44406570,"uuid":"242730459","full_name":"bennetthardwick/rust-obs-plugins","owner":"bennetthardwick","description":"A safe wrapper around the OBS API, useful for creating OBS sources, filters and effects. ","archived":false,"fork":false,"pushed_at":"2024-04-15T11:50:15.000Z","size":383,"stargazers_count":178,"open_issues_count":5,"forks_count":33,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-05-11T18:53:43.568Z","etag":null,"topics":["obs","obs-stream-effects","obs-studio","obs-studio-plugin","rust","traits","wrapper"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bennetthardwick.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-24T12:27:03.000Z","updated_at":"2024-06-12T16:06:28.765Z","dependencies_parsed_at":"2024-03-09T12:31:58.622Z","dependency_job_id":"4ab9e4c2-1290-477c-a7be-a868c0b8232c","html_url":"https://github.com/bennetthardwick/rust-obs-plugins","commit_stats":{"total_commits":189,"total_committers":13,"mean_commits":"14.538461538461538","dds":0.2698412698412699,"last_synced_commit":"694466f733827df80ff25c69132fbadb7c53d91a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bennetthardwick%2Frust-obs-plugins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bennetthardwick%2Frust-obs-plugins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bennetthardwick%2Frust-obs-plugins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bennetthardwick%2Frust-obs-plugins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bennetthardwick","download_url":"https://codeload.github.com/bennetthardwick/rust-obs-plugins/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247182344,"owners_count":20897379,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["obs","obs-stream-effects","obs-studio","obs-studio-plugin","rust","traits","wrapper"],"created_at":"2024-07-31T22:02:28.438Z","updated_at":"2025-04-04T13:11:07.926Z","avatar_url":"https://github.com/bennetthardwick.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# Rust OBS Wrapper\n\n[![Build Status](https://travis-ci.org/bennetthardwick/rust-obs-plugins.svg?branch=master)](https://travis-ci.org/bennetthardwick/rust-obs-plugins)\n[![Wrapper Docs](https://docs.rs/obs-wrapper/badge.svg)](https://docs.rs/obs-wrapper)\n\nA safe wrapper around the OBS API, useful for creating OBS sources, filters and effects. The wrapper is quite incomplete and will most likely see dramatic API changes in the future.\n\nThis repo also includes plugins creating using the wrapper in the `/plugins` folder.\n\n## Plugins\n| Folder                    | Description                                                      |\n|---------------------------|------------------------------------------------------------------|\n| /scroll-focus-filter      | an OBS filter that will zoom into the currently focused X window |\n| /rnnoise-denoiser-filter  | an OBS filter for removing background noise from your Mic        |\n\n## Usage\n\nIn your `Cargo.toml` file add the following section, substituting `\u003cmodule-name\u003e` for the name of\nthe module:\n\n```toml\n[dependencies]\nobs-wrapper = \"0.4\"\n\n[lib]\nname = \"\u003cmodule-name\u003e\"\ncrate-type = [\"cdylib\"]\n```\n\nThe process for creating a plugin is:\n\n1. Create a struct that implements Module\n1. Create a struct that will store the plugin state\n1. Implement the required traits for the module\n1. Enable the traits which have been enabled in the module `load` method\n\n```rust\nuse obs_wrapper::{\n    // Everything required for modules\n    prelude::*,\n    // Everything required for creating a source\n    source::*,\n    // Macro for registering modules\n    obs_register_module,\n    // Macro for creating strings\n    obs_string,\n};\n\n// The module that will handle creating the source.\nstruct TestModule {\n    context: ModuleRef\n}\n\n// The source that will be shown inside OBS.\nstruct TestSource;\n\n// Implement the Sourceable trait for TestSource, this is required for each source.\n// It allows you to specify the source ID and type.\nimpl Sourceable for TestSource {\n    fn get_id() -\u003e ObsString {\n        obs_string!(\"test_source\")\n    }\n\n    fn get_type() -\u003e SourceType {\n        SourceType::Filter\n    }\n\n    fn create(create: \u0026mut CreatableSourceContext\u003cSelf\u003e, source: SourceContext) -\u003e Self {\n        Self\n    }\n}\n\n// Allow OBS to show a name for the source\nimpl GetNameSource for TestSource {\n    fn get_name() -\u003e ObsString {\n        obs_string!(\"Test Source\")\n    }\n}\n\n// Implement the Module trait for TestModule. This will handle the creation of the source and\n// has some methods for telling OBS a bit about itself.\nimpl Module for TestModule {\n    fn new(context: ModuleRef) -\u003e Self {\n        Self { context }\n    }\n\n    fn get_ctx(\u0026self) -\u003e \u0026ModuleRef {\n        \u0026self.context\n    }\n\n    // Load the module - create all sources, returning true if all went well.\n    fn load(\u0026mut self, load_context: \u0026mut LoadContext) -\u003e bool {\n        // Create the source\n        let source = load_context\n            .create_source_builder::\u003cTestSource\u003e()\n            // Since GetNameSource is implemented, this method needs to be called to\n            // enable it.\n            .enable_get_name()\n            .build();\n\n        // Tell OBS about the source so that it will show it.\n        load_context.register_source(source);\n\n        // Nothing could have gone wrong, so return true.\n        true\n    }\n\n    fn description() -\u003e ObsString {\n        obs_string!(\"A great test module.\")\n    }\n\n    fn name() -\u003e ObsString {\n        obs_string!(\"Test Module\")\n    }\n\n    fn author() -\u003e ObsString {\n        obs_string!(\"Bennett\")\n    }\n}\n\nobs_register_module!(TestModule);\n```\n\n### Installation\n\n1. Run `cargo build --release`\n2. Copy `/target/release/\u003cmodule-name\u003e.so` to your OBS plugins folder (`/usr/lib/obs-plugins/`)\n3. The plugin should be available for use from inside OBS\n\n## License\n\nLike [obs-studio](https://github.com/obsproject/obs-studio), `obs-wrapper` is licensed under GNU General Public License v2.0.\n\nSee [LICENSE](./LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbennetthardwick%2Frust-obs-plugins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbennetthardwick%2Frust-obs-plugins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbennetthardwick%2Frust-obs-plugins/lists"}