Skip to content

alliedvision/alecs-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alecs Examples

Python examples demonstrating key features of the Alecs Open Smart Camera using the VmbPy API.

Beta Disclaimer

THE SOFTWARE IS PRELIMINARY AND STILL IN TESTING AND VERIFICATION PHASE AND IS PROVIDED ON AN “AS IS” AND “AS AVAILABLE” BASIS AND IS BELIEVED TO CONTAIN DEFECTS. A PRIMARY PURPOSE OF THIS EARLY ACCESS IS TO OBTAIN FEEDBACK ON PERFORMANCE AND THE IDENTIFICATION OF DEFECT SOFTWARE, HARDWARE AND DOCUMENTATION.

Prerequisites

Activate the Python virtual environment before running any example:

source .venv/bin/activate

Examples

send_stream.py — Video Streaming

Captures frames from the camera and streams them to a host PC via RTP/H.265 over UDP using a GStreamer pipeline. Hardware-accelerated H.265 encoding is performed on the NVIDIA Jetson module.

Usage:

python3 send_stream.py <target_ip>

The accompanying stream.sdp file can be opened on the host PC to receive and display the stream. The following players are supported:

VLC:

vlc stream.sdp

For minimal latency, set --network-caching to a low value.

ffmpeg:

ffplay -max_delay 0 -analyzeduration 0 -flags +low_delay -fflags +nobuffer -protocol_whitelist "file,rtp,udp" -i stream.sdp

GStreamer:

gst-launch-1.0 udpsrc port=51372 caps="application/x-rtp" ! rtph265depay ! h265parse ! d3d11h265dec ! videoconvert ! autovideosink

flash.py — Ring Light Control

Controls the external ring light output, synchronising it with the camera's exposure. Line1 is configured as an output and driven by the ExposureActive signal, so the light is on exactly while the sensor is exposing. Supports both Continuous Strobe and Flashed Strobe (overdrive) modes.

Usage:

python3 flash.py

Press <Enter> to stop acquisition.


indicator_lights.py — Indicator LED Control

Sets the RGB colour of the onboard status indicator LEDs. A specific LED can be targeted by index (0–9), or all LEDs can be set at once by omitting the index.

Usage:

# Set all LEDs to a colour
python3 indicator_lights.py <red> <green> <blue>

# Set a specific LED
python3 indicator_lights.py <LED_number> <red> <green> <blue>

Example — set all LEDs to blue:

python3 indicator_lights.py 0 0 255

Intensity values range from 0 to 255. The settings are saved persistently on the camera.


trigger_input.py — Hardware Trigger Input

Configures Line0 as a hardware trigger input and acquires one frame per trigger signal transition. Useful for synchronising image acquisition with an external process or sensor.

Usage:

python3 trigger_input.py

Toggle the trigger input line between high and low to acquire a frame. Press <Enter> to stop acquisition.

About

Python examples demonstrating key features of the Alecs Open Smart Camera

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages