Show HN: CrabCamera – Cross-platform camera plugin for Tauri desktop apps (crates.io)

67 points by MKuykendall ↗ HN
After building several Tauri desktop apps, I kept hitting the same wall: there's no reliable way to access cameras across Windows, macOS, and Linux. Every project meant reinventing camera integration, dealing with platform-specific APIs, and debugging permission issues.

  So I built CrabCamera – a Tauri plugin that handles all the camera complexity for you.

  What it does:

  - One API, three platforms: Same Rust code works on Windows (DirectShow), macOS (AVFoundation), and Linux (V4L2)
  - Permission handling: Automatically requests camera permissions on each platform
  - Format conversion: Takes care of the messy bits between platform formats and what your app needs
  - Error handling: Proper Rust error types instead of mysterious crashes
  - Hot-plugging: Detects when cameras are connected/disconnected

  The problem it solves:

  Before CrabCamera, adding camera support to a Tauri app meant:
  1. Writing separate native code for each platform
  2. Managing three different permission systems
  3. Handling format conversions manually
  4. Debugging platform-specific edge cases
  5. Maintaining it all as OS APIs change

  Now it's just:
  use crabcamera::Camera;

  let camera = Camera::new()?;
  let frame = camera.capture_frame().await?;

  Why I built it:

  I was working on a plant monitoring app (botanica) that needed reliable camera access for time-lapse photography. Existing solutions were either abandoned, platform-specific, or required complex native
  bindings.

  The Tauri ecosystem is growing fast, but camera support was this obvious gap. Every desktop app eventually needs camera access – video calls, document scanning, AR features, security monitoring.

  Technical highlights:

  - Uses nokhwa for the heavy lifting but wraps it in Tauri-friendly APIs
  - Proper async/await support throughout
  - Memory-efficient streaming for video capture
  - Built-in image processing pipeline
  - Extensible plugin architecture

  What's next:

  - WebRTC integration for video calls
  - Built-in barcode/QR code scanning
  - Face detection hooks
  - Performance optimizations for 4K streams

  The crate is MIT licensed and available on crates.io. I'd love feedback from other Tauri developers who've wrestled with camera integration.

  Links:
  - Crates.io: https://crates.io/crates/crabcamera
  - GitHub: https://github.com/Michael-A-Kuykendall/crabcamera
  - Documentation: https://docs.rs/crabcamera

9 comments

[ 3.3 ms ] story [ 31.0 ms ] thread
idk why when I see a lot of emojis in readmes I think vibecode
The wall of text here, as well as the wall of text on the submission, keeps using the word Tauri but not saying what this is. Wikipedia says Tauri are Crimean settlers. Think I found it now: https://tauri.app

That page says that "By using the OS’s native web renderer, the size of a Tauri app can be little as 600KB." sounds like an alternative for Electron basically

Good point about explaining Tauri better! For context: Tauri = Rust + Web frontend (like Electron but smaller/faster) Problem: Desktop apps need camera access, but web APIs are limited CrabCamera: Provides native camera control for Tauri desktop apps Real example: Our Budsy plant identification app uses CrabCamera to capture photos for botanical analysis - something web camera APIs can't do effectively. Thanks for the feedback on clarity!

  What's next:
  - WebRTC integration for video calls
  - Built-in barcode/QR code scanning
  - Face detection hooks
That sounds to me like final application usages that should be independent from this project, which is just a HAL for camera access. Conflating the two into the same code seems to raise the bar incredibly high for the scope of this one, so not sure how that will work out. WebRTC alone is a very complicated beast, for which the camera acquisition is just a very small part.
ou were absolutely right about WebRTC complexity! Since that feedback, we've refocused CrabCamera on its core mission - desktop camera access for Tauri apps. Changes made based on your feedback: Removed WebRTC from core scope Focused on clean camera capture API Left streaming protocols to dedicated libraries Current CrabCamera v0.3.0: 45/45 tests passing Production-ready in Budsy plant identification app Clean separation of concerns Thanks for steering us toward better architecture!
for cross-application as desktop only I think QtMultimedia is still the most feature rich and the best option.

If need only mobile (iOS / Android) then react-native-vision-camera probably the best bet.

If need only simple camera access then opencv

Great alternatives list! Each serves different use cases: QtMultimedia: Excellent for C++/Qt developers, but requires Qt framework react-native-vision-camera: Perfect for mobile, but CrabCamera targets desktop OpenCV: Great for computer vision, but heavy for simple camera access CrabCamera's niche: Rust developers building Tauri desktop apps who want: Zero Qt dependencies Native Rust integration Minimal bundle size Cross-platform camera control Different tools for different ecosystems! Currently powering our Budsy plant identification app.