LinuxCommandLibrary

rpicam-hello

Test Raspberry Pi camera functionality

TLDR

Display a camera preview stream for a specific amount of time (in milliseconds)

$ rpicam-hello [[-t|--timeout]] [time]
copy

Tune the configuration for a particular camera sensor
$ rpicam-hello --tuning-file [/usr/share/libcamera/ipa/rpi/path/to/config.json]
copy

SYNOPSIS

rpicam-hello [options]

PARAMETERS

-t , --timeout
    Sets the duration in milliseconds for the preview to run before exiting. Default is often 5000 (5 seconds).

-c , --camera
    Selects which camera to use when multiple are available. Defaults to camera 0.

-p , --preview
    Defines the position and size of the preview window on the screen (x, y coordinates, width, height).

-f, --fullscreen
    Displays the preview window in fullscreen mode.

-w , --width
    Sets the width of the camera stream for the preview.

-h , --height
    Sets the height of the camera stream for the preview.

--shutter
    Sets the manual shutter speed in microseconds.

--gain
    Sets the manual analog gain value.

--brightness
    Adjusts the brightness of the preview. Range: -1.0 to 1.0.

--contrast
    Adjusts the contrast of the preview. Range: 0.0 to 10.0.

--saturation
    Adjusts the saturation of the preview. Range: 0.0 to 10.0.

--sharpness
    Adjusts the sharpness of the preview. Range: 0.0 to 10.0.

--framerate
    Sets the target framerate for the camera stream.

--help
    Displays a help message with available command-line options.

--version
    Displays the version information for the rpicam-hello utility.

DESCRIPTION

rpicam-hello is a fundamental command-line utility designed for Raspberry Pi computers with an attached camera module. As part of the modern libcamera stack, it serves as a simple "hello world" application to quickly verify the camera's basic functionality. When executed, it typically opens a graphical preview window on the connected display, showcasing the live video feed from the camera.

This makes it an invaluable tool for confirming that the camera hardware is correctly connected and recognized, and that the underlying libcamera software is operational. It's often the first command used when troubleshooting camera setup issues, offering a quick visual check before proceeding to more complex image or video capture tasks using related commands like rpicam-still or rpicam-vid. rpicam-hello replaced the preview capabilities previously found in the legacy raspistill utility, aligning with the Raspberry Pi Foundation's transition to the open-source libcamera framework for camera control.

CAVEATS

Requires a compatible Raspberry Pi camera module and a graphical environment (X server or Wayland) for preview display.
Without a display or X forwarding (when connecting via SSH), the command will run but the visual preview will not be visible.
rpicam-hello is primarily for preview and basic testing; use rpicam-still or rpicam-vid for actual image/video capture.

GRAPHICAL DISPLAY REQUIREMENT

The primary function of rpicam-hello is to display a live camera preview. This requires a connected display and a running graphical environment (like Wayland or X11) for the preview window to appear. When running via SSH, X forwarding (ssh -X) or a virtual desktop is necessary to view the output remotely.

UNDERLYING FRAMEWORK

This command is built upon the libcamera framework, which provides a modern, standardized interface for controlling camera hardware on Linux. This ensures better compatibility, flexibility, and future-proofing compared to the previous proprietary camera stack used on Raspberry Pi.

HISTORY

rpicam-hello is a relatively modern command, introduced as part of the Raspberry Pi's transition from the legacy `mmal` camera stack (used by raspistill/raspivid) to the more standardized, open-source libcamera framework. Its development reflects a broader industry move towards a unified camera API for Linux. It became the standard "hello world" camera test on Raspberry Pi OS releases starting with Bullseye (released in late 2021) and newer, replacing older methods for basic camera verification.

SEE ALSO

rpicam-still(1), rpicam-vid(1), rpicam-raw(1), libcamera(7)

Copied to clipboard