Coder Social home page Coder Social logo

coral / blackmagic-camera-control Goto Github PK

View Code? Open in Web Editor NEW
15.0 3.0 1.0 72 KB

Interface with your Blackmagic camera over Bluetooth in Rust

License: MIT License

Rust 100.00%
blackmagic camera control rust cinema bluetooth ble blackmagicdesign blackmagic-design

blackmagic-camera-control's Introduction

Interface with your Blackmagic camera over Bluetooth in Rust!

This library allows you to easily communicate with your Blackmagic camera over Bluetooth.

  • Implements the full camera spec for easy access to commands with static type checking Command::Video(Video::Iso(640)))
  • Uses btleplug for Bluetooth to work across platforms.
  • Consumes PROTOCOL.json for code generation so it's easy to add more functions to the library

Usage

You can test the library easy by opening examples/control.rs, replacing the CAMERA_NAME const with your cameras bluetooth name and then running cargo run --example control

//Create a new camera with the device name
let mut camera = BluetoothCamera::new(CAMERA_NAME).await.unwrap();

//Connect with a set timeout
camera.connect(Duration::from_secs(10)).await.unwrap();

//Change the ISO to 320
camera.write(255, Operation::AssignValue, Command::Video(Video::Iso(640))).await.unwrap();

How does it work?

The library consumes the PROTOCOL.json file which documents the camera protocol in a machine readable format. From there it generates the commands as rust enums during the build stage (see /build). This allows us to have statically typed addressing of camera features without manually writing the code, rather relying on the conversion from the camera protocol manual. The library takes care of packaging down the commands into the camera protocol.

Contributing

Just open a PR LUL

License

All under MIT

blackmagic-camera-control's People

Contributors

coral avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

marccolemont

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.