rpicam-hello
rpicam-hello briefly displays a preview window containing the video feed from a connected camera. To use rpicam-hello to display a preview window for five seconds, run the following command in a terminal:
$ rpicam-hello
You can pass an optional duration (in milliseconds) with the timeout option. A value of 0 runs the preview indefinitely:
$ rpicam-hello --timeout 0
Use Ctrl+C in the terminal or the close button on the preview window to stop rpicam-hello.
Display an image sensor preview
Most of the rpicam-apps display a preview image in a window. If there is no active desktop environment, the preview draws directly to the display using the Linux Direct Rendering Manager (DRM). Otherwise, rpicam-apps attempt to use the desktop environment. Both paths use zero-copy GPU buffer sharing: as a result, X forwarding is not supported.
If you run the X window server and want to use X forwarding, pass the qt-preview flag to render the preview window in a Qt window. The Qt preview window uses more resources than the alternatives.
Older systems using Gtk2 might, when linked with OpenCV, produce Glib-GObject errors and fail to show the Qt preview window. In this case edit the file /etc/xdg/qt5ct/qt5ct.conf as root and replace the line containing style=gtk2 with style=gtk3.
|
To suppress the preview window entirely, pass the nopreview flag:
$ rpicam-hello -n
The info-text option displays image information on the window title bar using % directives. For example, the following command displays the current red and blue gain values:
$ rpicam-hello --info-text "red gain %rg, blue gain %bg"
For a full list of directives, see the info-text reference.