{"id":14992200,"url":"https://github.com/l1npengtul/nokhwa","last_synced_at":"2025-05-14T02:08:01.724Z","repository":{"id":37526307,"uuid":"368076031","full_name":"l1npengtul/nokhwa","owner":"l1npengtul","description":"Cross Platform Rust Library for Powerful Webcam/Camera Capture","archived":false,"fork":false,"pushed_at":"2025-04-17T08:21:24.000Z","size":7480,"stargazers_count":618,"open_issues_count":62,"forks_count":151,"subscribers_count":17,"default_branch":"senpai","last_synced_at":"2025-04-17T23:07:58.062Z","etag":null,"topics":["avfoundation","camera","camera-api","cross-platform","linux","macos","mediafoundation","rust","v4l2","webcam","webcam-capture","windows"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/l1npengtul.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE-APACHE","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,"zenodo":null},"funding":{"github":["l1npengtul"]}},"created_at":"2021-05-17T06:15:12.000Z","updated_at":"2025-04-17T08:21:28.000Z","dependencies_parsed_at":"2024-01-15T00:15:18.432Z","dependency_job_id":"6a4c60df-11c7-45fa-8086-43a1d7cb50b0","html_url":"https://github.com/l1npengtul/nokhwa","commit_stats":{"total_commits":377,"total_committers":30,"mean_commits":"12.566666666666666","dds":"0.11671087533156499","last_synced_commit":"13633ae5687a93f9d99aabcdcb8713e3f615d92c"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l1npengtul%2Fnokhwa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l1npengtul%2Fnokhwa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l1npengtul%2Fnokhwa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l1npengtul%2Fnokhwa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/l1npengtul","download_url":"https://codeload.github.com/l1npengtul/nokhwa/tar.gz/refs/heads/senpai","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254052915,"owners_count":22006717,"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":["avfoundation","camera","camera-api","cross-platform","linux","macos","mediafoundation","rust","v4l2","webcam","webcam-capture","windows"],"created_at":"2024-09-24T15:00:52.002Z","updated_at":"2025-05-14T02:07:56.709Z","avatar_url":"https://github.com/l1npengtul.png","language":"Rust","funding_links":["https://github.com/sponsors/l1npengtul","https://github.com/sponsors/l1npengtul)!"],"categories":["Sensor and Communication Protocol"],"sub_categories":[],"readme":"[![cargo version](https://img.shields.io/crates/v/nokhwa.svg)](https://crates.io/crates/nokhwa) [![docs.rs version](https://img.shields.io/docsrs/nokhwa)](https://docs.rs/nokhwa/latest/nokhwa/)\n# nokhwa\nNokhwa(녹화): Korean word meaning \"to record\".\n\nA Simple-to-use, cross-platform Rust Webcam Capture Library\n\n## Using nokhwa\nNokhwa can be added to your crate by adding it to your `Cargo.toml`:\n```toml\n[dependencies.nokhwa]\nversion = \"0.10\"\n# Use the native input backends, enable WGPU integration\nfeatures = [\"input-native\", \"output-wgpu\"]\n\n# add this to enable exporting to a JPEG/PNG\n[dependencies.image]\nversion = \"0.25\"\nfeatures = [\"default-formats\"]\n```\n\nMost likely, you will only use functionality provided by the `Camera` struct. If you need lower-level access, you may instead opt to use the raw capture backends found at `nokhwa::backends::capture::*`.\n\n## Example\n```rust\n// first camera in system\nlet index = CameraIndex::Index(0); \n// request the absolute highest resolution CameraFormat that can be decoded to RGB.\nlet requested = RequestedFormat::new::\u003cRgbFormat\u003e(RequestedFormatType::AbsoluteHighestFrameRate);\n// make the camera\nlet mut camera = Camera::new(index, requested).unwrap();\n\n// get a frame\nlet frame = camera.frame().unwrap();\nprintln!(\"Captured Single Frame of {}\", frame.buffer().len());\n// decode into an ImageBuffer\nlet decoded = frame.decode_image::\u003cRgbFormat\u003e().unwrap();\nprintln!(\"Decoded Frame of {}\", decoded.len());\n```\n\nA command line app made with `nokhwa` can be found in the `examples` folder.\n\n## API Support\nThe table below lists current Nokhwa API support.\n- The `Backend` column signifies the backend.\n- The `Input` column signifies reading frames from the camera\n- The `Query` column signifies system device list support\n- The `Query-Device` column signifies reading device capabilities\n- The `Platform` column signifies what Platform this is availible on.\n\n | Backend                              | Input              | Query             | Query-Device       | Platform            |\n |-----------------------------------------|-------------------|--------------------|-------------------|--------------------|\n | Video4Linux(`input-native`)          | ✅                 | ✅                 | ✅                | Linux               |\n | MSMF(`input-native`)                 | ✅                 | ✅                 | ✅                | Windows             |\n | AVFoundation(`input-native`)   | ✅                 | ✅                 | ✅                | Mac                 |\n | OpenCV(`input-opencv`)^              | ✅                 | ❌                 | ❌                | Linux, Windows, Mac |\n | WASM(`input-wasm`)                | ✅                 | ✅                 | ✅                | Browser(Web)        |\n\n ✅: Working, 🔮 : Experimental, ❌ : Not Supported, 🚧: Planned/WIP\n\n  ^ = May be bugged. Also supports IP Cameras. \n\n## Feature\nThe default feature includes nothing. Anything starting with `input-*` is a feature that enables the specific backend. \n\n`input-*` features:\n - `input-native`: Uses either V4L2(Linux), MSMF(Windows), or AVFoundation(Mac OS)\n - `input-opencv`: Enables the `opencv` backend. (cross-platform) \n - `input-jscam`: Enables the use of the `JSCamera` struct, which uses browser APIs. (Web)\n\nConversely, anything that starts with `output-*` controls a feature that controls the output of something (usually a frame from the camera)\n\n`output-*` features:\n - `output-wgpu`: Enables the API to copy a frame directly into a `wgpu` texture.\n - `output-threaded`: Enable the threaded/callback based camera. \n\nOther features:\n - `decoding`: Enables `mozjpeg` decoding. Enabled by default.\n - `docs-only`: Documentation feature. Enabled for docs.rs builds.\n - `docs-nolink`: Build documentation **without** linking to any libraries. Enabled for docs.rs builds.\n - `test-fail-warning`: Fails on warning. Enabled in CI.\n\nYou many want to pick and choose to reduce bloat.\n\n## Issues\nIf you are making an issue, please make sure that\n - It has not been made yet\n - Attach what you were doing, your environment, steps to reproduce, and backtrace.\nThank you!\n\n## Contributing\nContributions are welcome!\n - Please `rustfmt` all your code and adhere to the clippy lints (unless necessary not to do so)\n - Please limit use of `unsafe`\n - All contributions are under the Apache 2.0 license unless otherwise specified\n\n## Minimum Service Rust Version\n`nokhwa` may build on older versions of `rustc`, but there is no guarantee except for the latest stable rust. \n\n## Sponsors\n- $30/mo sponsors:\n  - [Cap Software](https://cap.so/)\n- $10/mo sponsors:\n  - [yunho-c](https://github.com/yunho-c)\n- $5/mo sponsors:\n  - [mason-bially](https://github.com/mason-bially)\n  \nPlease consider [donating](https://github.com/sponsors/l1npengtul)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fl1npengtul%2Fnokhwa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fl1npengtul%2Fnokhwa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fl1npengtul%2Fnokhwa/lists"}