Skip to content

libcamera apps

13 commands

Capture stills and video from Raspberry Pi camera modules with rpicam-still, rpicam-vid and friends (formerly libcamera-*).

  • camera
  • Raspberry Pi

Install libcamera apps

sudo apt install rpicam-apps

Detecting2

rpicam-hello --list-cameras

Lists connected cameras with their sensor modes and resolutions.

Link
rpicam-hello -t 0

Shows a live preview until you stop it. On older releases the command is libcamera-hello.

Link

Stills7

rpicam-still -o <file>

Takes a JPEG after a short preview for auto-exposure.

Link
rpicam-still -n -t 1 -o <file>

No preview and minimal delay — useful in scripts.

Link
rpicam-still --width <w> --height <h> -o <file>

Sets the resolution.

Link
rpicam-still -r -o <file>

Also saves a DNG raw file.

Link
rpicam-still --timelapse <ms> -t <ms> -o <pattern>

One frame a minute for an hour.

Link
rpicam-still --shutter <us> --gain <g> -o <file>

Manual exposure: a 2-second shutter at base gain.

Link
rpicam-still --hflip --vflip -o <file>

Flips the image when the camera is mounted upside down.

Link

Video4

rpicam-vid -t <ms> -o <file>

Records raw H.264 for the given milliseconds.

Link
rpicam-vid -t <ms> --codec libav -o <file>.mp4

Records straight to MP4.

Link
rpicam-vid -t 0 --inline --listen -o tcp://0.0.0.0:<port>

Streams video over TCP; open tcp://<pi>:8888 in VLC or ffplay.

Link
rpicam-vid --framerate <fps> --width <w> --height <h> -o <file>

Sets resolution and frame rate.

Link