Using CinePi-RAW from the terminal#

You can run cinepi-raw directly — launching the binary yourself from a terminal with your own flags, instead of letting CineMate's process manager (cinepi_multi.py) build the command line and manage the camera lifecycle for you. See How CineMate launches CinePi-raw for more information about how CineMate works.

Running it manually is useful for isolating a problem to cinepi-raw itself (rather than to CineMate's layer on top of it), or for trying a flag combination before wiring it into settings.jsonc. Since cinemate-autostart.service normally holds the camera with its own cinepi-raw child process, stop it first so the two don't fight over the sensor:

sudo systemctl stop cinemate-autostart

Restart it when you're done (sudo systemctl start cinemate-autostart), or reboot.

Checking available options#

Before running the program you can view all command‑line flags with:

cinepi-raw -h

This prints a long list of options supported by the application. It includes the standard parameters from rpicam-apps (such as resolution and exposure settings) plus additional flags specific to the CineMate.

Camera modes#

CinePi-Raw uses Libcamera to talk to your Raspberry Pi camera module. Each sensor supports one or more modes, which define the resolution and bit depth of the RAW images that the sensor can produce. A mode is written as:

--mode 2028:1080:12:U
  • width and height select the active pixel area of the sensor.
  • bit-depth is usually 10, 12 or 16 bits per pixel.
  • packing can be P for packed or U for unpacked data.

The mode must match the sensor you are using. For example, an IMX477 camera can run at 4056:3040:12 (full sensor) or at smaller cropped resolutions. When specifying a mode you typically also set the output --width and --height which control the size of the image written to disk. These can be equal to the mode values or smaller when scaling is applied.

On Raspberry Pi 5 / CM5, the cinepi-raw flag for the HQ sensor is --mode 2028:1080:12:U. On Raspberry Pi 4 / Pi 400 / CM4 it should read --mode 2028:1080:12:P. IMX296 follows the same packing rule, but with its 10-bit sensor mode: 1456:1088:10:U on Pi 5 and 1456:1088:10:P on Pi 4.

Low‑resolution (lores) stream#

--lores-width 1280 --lores-height 720

CinePi-raw can produce a secondary low‑resolution stream alongside the full‑resolution RAW frames.

Preview window#

By default the program opens an HDMI preview so you can see what the camera captures. The size and position of this window are controlled with:

-p 0,30,1920,1020

This positions the preview 30 pixels from the top of the screen with a 1920×1020 window.

Tuning file#

--tuning-file /home/pi/libcamera/src/ipa/rpi/pisp/data/{model_key}.json

Describes the camera’s colour and lens characteristics. Point to a file supplied with Libcamera (for example /home/pi/libcamera/src/ipa/rpi/pisp/data/imx477.json for the HQ camera)

Post processing#

--post-process-file /home/pi/post-processing.json

For cinepi-raw, this file defines the port used by cpp-mjpeg-streamer (default cinepi.local:8000)

If you have more than one camera connected to the Pi, and activated in /boot/firmware/config.txt, the camera connected to physical cam0 will use /home/pi/post-processing0.json and the camera connected to cam1 will use /home/pi/post-processing1.json.

CineMate‑specific flags#

The CineMate fork introduces extra options beyond stock rpicam-apps: camera-port and HDMI selection (--cam-port, --hdmi-port, --same-hdmi), on-sensor HDR (--hdr), CineMate Log (--log-encode), encode/disk worker count, affinity and priority tuning, WAV timecode offsets, a DNG camera-model override (--unique-camera-model), and a pixel-rate ceiling (--max-pixel-rate).

The full flag table with defaults is the cinepi-raw README's "Additional flags" section — that table is the canonical copy, so it is not duplicated here. cinepi-raw -h prints the same options from the binary.

DNGs are 12-bit, except in true 16-bit sensor modes (IMX585 ClearHDR), which write 16-bit. The --keep16 flag was removed — the 4 bits it kept in SDR modes are padding.

Example commands#

Below are sample commands for different sensors and modes.

IMX477 (12-bit, full width)#

cinepi-raw --mode 4056:2160:12:U --width 4056 --height 2160 \
           --lores-width 1280 --lores-height 720 \
           -p 0,30,1920,1020 \
           --post-process-file /home/pi/post-processing.json \
           --tuning-file /home/pi/libcamera/src/ipa/rpi/pisp/data/imx477.json

On Raspberry Pi 4 / Pi 400 / CM4, use --mode 4056:2160:12:P and omit the PiSP tuning file path.

IMX296 (10-bit)#

# Raspberry Pi 5 / CM5
cinepi-raw --mode 1456:1088:10:U --width 1456 --height 1088 \
           --lores-width 1280 --lores-height 720 \
           -p 0,30,1920,1020 \
           --post-process-file /home/pi/post-processing.json \
           --tuning-file /home/pi/libcamera/src/ipa/rpi/pisp/data/imx296.json

# Raspberry Pi 4 / Pi 400 / CM4
cinepi-raw --mode 1456:1088:10:P --width 1456 --height 1088 \
           --lores-width 1280 --lores-height 720 \
           -p 0,30,1920,1020 \
           --post-process-file /home/pi/post-processing.json

IMX283 (12-bit unpacked)#

cinepi-raw --mode 2736:1538:12:U --width 2736 --height 1538 \
           --lores-width 1280 --lores-height 720 \
           -p 0,30,1920,1020 \
           --post-process-file /home/pi/post-processing.json \
           --tuning-file /home/pi/libcamera/src/ipa/rpi/pisp/data/imx283.json

IMX585 (12-bit unpacked)#

cinepi-raw --mode 1928:1090:12:U --width 1928 --height 1090 \
           --lores-width 1280 --lores-height 720 \
           -p 0,30,1920,1020 \
           --post-process-file /home/pi/post-processing.json \
           --tuning-file /home/pi/libcamera/src/ipa/rpi/pisp/data/imx585.json

Now, with an SSH shell running redis-cli you should be able to capture RAW footage from the command line!

redis-cli
> set is_recording 1
> publish cp_controls is_recording