Skip to content

ogomez92/descam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

descam

Cross-platform Rust CLI that captures images from your webcam and asks the OpenAI gpt-4.1 model to describe what it sees. The tool discovers connected cameras, lets you pick one, and repeats vision calls each time you press v.

Prerequisites

  • OpenAI API key.
  • An active Webcam or HDMI capture card

Installation

cargo build --release

Configuration

Provide your OpenAI credentials via one of the following (priority order):

  1. CLI flag -k / --key

  2. Environment variable OPENAI_API_KEY

  3. .env file in the project directory:

    OPENAI_API_KEY=sk-...
    PROMPT=Describe the image with details. Read any text that you see.

The prompt defaults to "Describe the image with details. Read any text that you see.". Override it with -p/--prompt or a PROMPT entry in your environment or .env file.

Usage

Launch the CLI with cargo (or the compiled binary):

cargo run --release -- [OPTIONS]

Options

  • -k, --key <API_KEY> � supply the OpenAI API key
  • -p, --prompt <PROMPT> � custom prompt text sent with each vision request
  • -h, --help � display help information

Runtime Flow

  1. The app enumerates available webcams and prompts you to choose one (if multiple).
  2. It verifies that an OpenAI API key is available; otherwise it exits.
  3. After initialization, the terminal switches to raw mode and waits for keystrokes:
    • Press v to capture a frame, send it to OpenAI, and print the description.
    • Press x, Esc, or Ctrl+C to exit.
  4. The loop continues, letting you request multiple captures in a single session.

Image Processing

  • Captured frames are resized so the longest side is at most 1024 px, preserving aspect ratio.
  • Frames are encoded as JPEG (quality 85) before upload, which keeps detail while lowering latency and bandwidth usage.

Troubleshooting

  • No webcams listed � ensure your device is connected and accessible to the operating system. Some platforms require additional permissions (e.g., Windows Camera privacy settings, macOS camera access).
  • API errors � check that your key has access to gpt-4.1 and that you have sufficient quota.
  • Build issues � install the latest stable Rust toolchain and a linker for your platform. On Linux, extra packages (e.g., libv4l-dev) may be required for camera access.

About

Cli cross platform app to get webcam contents and describe

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages