{"id":50290354,"url":"https://github.com/shiguredo/libcamera-rs","last_synced_at":"2026-05-28T05:34:21.616Z","repository":{"id":339157094,"uuid":"1160691867","full_name":"shiguredo/libcamera-rs","owner":"shiguredo","description":"Rust bindings for libcamera","archived":false,"fork":false,"pushed_at":"2026-05-20T00:57:42.000Z","size":71,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"develop","last_synced_at":"2026-05-28T05:34:15.280Z","etag":null,"topics":["libcamera","raspberry-pi","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":false,"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/shiguredo.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-02-18T08:59:08.000Z","updated_at":"2026-05-20T00:57:46.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/shiguredo/libcamera-rs","commit_stats":null,"previous_names":["shiguredo/libcamera-rs"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/shiguredo/libcamera-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiguredo%2Flibcamera-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiguredo%2Flibcamera-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiguredo%2Flibcamera-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiguredo%2Flibcamera-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shiguredo","download_url":"https://codeload.github.com/shiguredo/libcamera-rs/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiguredo%2Flibcamera-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33596316,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["libcamera","raspberry-pi","rust"],"created_at":"2026-05-28T05:34:16.827Z","updated_at":"2026-05-28T05:34:21.610Z","avatar_url":"https://github.com/shiguredo.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libcamera-rs\n\n[![shiguredo_libcamera](https://img.shields.io/crates/v/shiguredo_libcamera.svg)](https://crates.io/crates/shiguredo_libcamera)\n[![Documentation](https://docs.rs/shiguredo_libcamera/badge.svg)](https://docs.rs/shiguredo_libcamera)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n## About Shiguredo's open source software\n\nWe will not respond to PRs or issues that have not been discussed on Discord. Also, Discord is only available in Japanese.\n\nPlease read \u003chttps://github.com/shiguredo/oss\u003e before use.\n\n## 時雨堂のオープンソースソフトウェアについて\n\n利用前に \u003chttps://github.com/shiguredo/oss\u003e をお読みください。\n\n## 対応 libcamera バージョン\n\n\u003e [!IMPORTANT]\n\u003e **libcamera v0.7.0+rpt20260205**\n\u003e\n\u003e libcamera は動的リンクで利用しています。上記バージョンと互換性のない libcamera がインストールされている環境では正常に動作しない可能性があります。\n\n## 概要\n\nRust で実装された [libcamera](https://libcamera.org/) のバインディングです。\n\n## 特徴\n\n- libcamera 本体は `pkg-config` 経由で動的リンク\n- 自前 C ラッパーは静的コンパイルしてクレートに埋め込み\n- 安全な Rust API による所有権・ライフタイム管理\n- コールバックによるフレームキャプチャ\n- コントロール (露出、ホワイトバランス、フォーカス等) の取得・設定 ([対応コントロール一覧](docs/CONTROLS.md))\n\n## 構成\n\n```\nlibcamera-rs/\n├── c-api/       # C/C++ ラッパー (libcamera C++ API → C API)\n├── src/         # 高レベル safe Rust API + FFI (bindgen 生成)\n└── examples/    # サンプル\n```\n\n## 動作環境\n\n- Raspberry Pi OS で libcamera が動作する環境\n- `libcamera-dev` パッケージが必要\n\n```bash\nsudo apt install libcamera-dev\n```\n\n### Dev Containers\n\nDev Containers を使えば macOS arm64 でもクロスコンパイルによるビルドが可能です。\n\n## 使い方\n\n### カメラの列挙\n\n```rust\nuse shiguredo_libcamera::{CameraManager, StreamRole};\n\nlet manager = CameraManager::new().unwrap();\nlet count = manager.cameras_count();\nfor i in 0..count {\n    let camera = manager.get_camera(i).unwrap();\n    println!(\"Camera {i}: {}\", camera.id());\n}\n```\n\n### フレームキャプチャ\n\n```rust\nuse shiguredo_libcamera::{\n    CameraManager, FrameBufferAllocator, StreamRole,\n};\n\nlet manager = CameraManager::new().unwrap();\nlet mut camera = manager.get_camera(0).unwrap();\ncamera.acquire().unwrap();\n\nlet mut config = camera.generate_configuration(\u0026[StreamRole::VideoRecording]).unwrap();\nconfig.validate().unwrap();\ncamera.configure(\u0026mut config).unwrap();\n\nlet stream = config.at(0).unwrap().stream().unwrap();\nlet allocator = FrameBufferAllocator::new(\u0026camera);\nlet buffer_count = allocator.allocate(\u0026stream).unwrap();\n\ncamera.on_request_completed(move |completed| {\n    if let Some(buffer) = completed.find_buffer(\u0026stream) {\n        let meta = buffer.metadata();\n        println!(\"Frame {}: timestamp={}\", meta.sequence, meta.timestamp);\n    }\n});\n\ncamera.start().unwrap();\n// ...\ncamera.stop().unwrap();\n```\n\n### コントロールの設定\n\n```rust\nuse shiguredo_libcamera::core;\n\nlet mut controls = request.controls();\ncontrols.set_f32(\u0026core::BRIGHTNESS, 0.2);\ncontrols.set_f32(\u0026core::CONTRAST, 1.5);\ncontrols.set_f32(\u0026core::SATURATION, 1.2);\n```\n\n## サンプル\n\nサンプルの JSON 出力には [nojson](https://github.com/sile/nojson) を利用しています。\n\n### list_cameras\n\nカメラ一覧とストリーム情報を表示します。\n\n```bash\ncargo run --example list_cameras\n```\n\n### capture\n\nフレームキャプチャを行い、メタデータを表示します。\n\n```bash\ncargo run --example capture\n```\n\n### controls\n\nコントロールを設定してキャプチャし、メタデータを読み取ります。\n\n```bash\ncargo run --example controls\n```\n\n## ライセンス\n\nApache License 2.0\n\n```text\nCopyright 2026-2026, Shiguredo Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshiguredo%2Flibcamera-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshiguredo%2Flibcamera-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshiguredo%2Flibcamera-rs/lists"}