gopro

Crates.iogopro
lib.rsgopro
version0.1.0
created_at2025-11-21 10:32:40.512109+00
updated_at2025-11-21 10:32:40.512109+00
descriptionAn open-source Rust implementation of the Open GoPro Interface Specification.
homepagehttps://github.com/chinifabio/gopro-rs
repositoryhttps://github.com/chinifabio/gopro-rs
max_upload_size
id1943378
size4,332
Fabio Chini (chinifabio)

documentation

README

gopro-rs

gopro-rs is a pure Rust library designed to interface with GoPro cameras programmatically. It serves as a high-performance, memory-safe alternative to the official Python open-gopro SDK, implementing the complete Open GoPro Interface Specification.

Whether you are building a desktop control app, an automated media offloader, or an embedded remote control system, this library provides the primitives you need to discover, connect, and control cameras seamlessly.

Core Goals

  • Idiomatic Rust: Leverages strong typing to ensure valid commands and states. No more runtime errors from sending invalid parameters to the camera.
  • Async-First: Built on top of tokio (and btleplug for BLE), allowing for non-blocking command execution and efficient handling of camera state notifications.
  • Dual Protocol Support:
    • BLE (Bluetooth Low Energy): Full support for command and control, settings updates, and status queries.
    • Wi-Fi (HTTP/UDP): High-bandwidth API access for media listing, downloading, and live preview stream handling.

Features

  • Zero-Boilerplate Discovery: Simple async methods to scan and pair with nearby GoPros.
  • Type-Safe Command Builder: Compile-time checks for setting values (e.g., ensuring you don't try to set a resolution that isn't supported by the current framerate).
  • Protobuf Integration: Transparent handling of the underlying Protocol Buffers used by newer GoPro firmware.
  • Cross-Platform: Works on Windows, macOS, Linux, and compatible embedded Linux targets.

Comparison to Python SDK

While the official Python SDK is excellent for scripting and rapid prototyping, gopro-rs aims to fill the gap for production-grade applications. It offers:

  • Single Binary Deployment: No Python environment or dependency management required on the target machine.
  • Concurrency: Better handling of simultaneous BLE notifications and Wi-Fi data streams.
  • Safety: Rust's borrow checker ensures thread safety when managing camera state across different parts of your application.

Usage Example

use open_gopro_rs::GoPro;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Scan and connect to the first available camera
    let mut camera = GoPro::connect_first().await?;

    // Start recording via BLE
    camera.shutter(true).await?;
    println!("Recording started...");

    // Wait 5 seconds
    tokio::time::sleep(std::time::Duration::from_secs(5)).await;

    // Stop recording
    camera.shutter(false).await?;
    println!("Recording stopped.");

    Ok(())
}

Roadmap

  • BLE Command Interface
  • Wi-Fi Media API
  • Live Preview Streamer
  • no_std support (experimental) for bare-metal embedded use.
Commit count: 0

cargo fmt