Skip to main content

OVOS camera skill

Project description

Camera Skill

Camera skill for OpenVoiceOS

Description

This skill allows you to take pictures using a connected webcam. You can configure various settings to customize its behavior.

Examples

  • "Take a picture"

Settings

The settings.json file allows you to configure the behavior of the Camera Skill. Below are the available settings:

Setting Name Type Default Description
video_source Integer 0 Specifies the camera to use. 0 is the default system webcam.
play_sound Boolean true Whether to play a sound when a picture is taken.
camera_sound_path String camera.wav Path to the sound file to play when taking a picture.
pictures_folder String ~/Pictures Directory where pictures are saved.

Example settings.json

{
  "video_source": 0,
  "play_sound": true,
  "camera_sound_path": "/path/to/camera.wav",
  "pictures_folder": "/home/user/Pictures",
  "keep_camera_open": false
}

Additional Steps for Raspberry Pi Users

If you plan to use this skill on a Raspberry Pi, it requires access to the libcamera package for the Picamera2 library to function correctly. Due to how libcamera is installed on the Raspberry Pi (system-wide), additional steps are necessary to ensure compatibility when using a Python virtual environment (venv).

In these examples we use the default .venv location from ovos-installer, ~/.venvs/ovos, adjust as needed

Steps to Enable libcamera in Your Virtual Environment

  1. Install Required System Packages
    Before proceeding, ensure that libcamera and its dependencies are installed on your Raspberry Pi. Run the following commands:

    sudo apt install -y python3-libcamera python3-kms++ libcap-dev
    
  2. Modify the Virtual Environment Configuration
    If you already have a virtual environment set up, enable access to system-wide packages by modifying the pyvenv.cfg file in the virtual environment directory:

    nano ~/.venvs/ovos/pyvenv.cfg
    

    Add or update the following line:

    include-system-site-packages = true
    

    Save the file and exit.

  3. Verify Access to libcamera
    Activate your virtual environment:

    source ~/.venvs/ovos/bin/activate
    

    Check if the libcamera package is accessible:

    python3 -c "import libcamera; print('libcamera is accessible')"
    

Why Are These Steps Necessary?

The libcamera package is not available on PyPI and is installed system-wide on the Raspberry Pi. Virtual environments typically isolate themselves from system-wide Python packages, so these adjustments allow the skill to access libcamera while still benefiting from the isolation provided by a venv.

Notes

  • These steps are specific to Raspberry Pi users who want to utilize the Picamera2 library for camera functionality. On other platforms, the skill defaults to using OpenCV, which does not require additional configuration.
  • Ensure that libcamera is installed on your Raspberry Pi before attempting these steps. You can test this by running:
    libcamera-still --version
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ovos-skill-camera-0.0.4a1.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ovos_skill_camera-0.0.4a1-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

Details for the file ovos-skill-camera-0.0.4a1.tar.gz.

File metadata

  • Download URL: ovos-skill-camera-0.0.4a1.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.21

File hashes

Hashes for ovos-skill-camera-0.0.4a1.tar.gz
Algorithm Hash digest
SHA256 906340d64725213a320a1935577e39ad02543e52f19e6eed10e8cd677e8dbfb3
MD5 2c9fb24b7a3dfcc32f2b560a059e405b
BLAKE2b-256 7e68fc4cf753c96aff70e78837a24524c840c92802d50a81c355f883c294c915

See more details on using hashes here.

File details

Details for the file ovos_skill_camera-0.0.4a1-py3-none-any.whl.

File metadata

File hashes

Hashes for ovos_skill_camera-0.0.4a1-py3-none-any.whl
Algorithm Hash digest
SHA256 be25e65275698ed87ec91d29068d9cc45fb6e18b0e309330b2ebf3f8db54551f
MD5 eb065a4d88e844b4a89cbc5618bf5963
BLAKE2b-256 5763b3871a7bfaee7153a6d034669debaf4157b358a2b4b78d0f646014e6dd6a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page