ラズパイ新OS「Bullseye」でのカメラモジュールの使い方|libcameraの使い方も詳しく解説

ラズパイのOS「Bullseye」でのカメラモジュールの使い方

こんにちは! けい(Twitter)です。

今回は、ラズパイの新しいOS「Bullseye」のカメラドライバ「libcamera」について、使い方を紹介していきます。

新OS「Bullseys」に標準搭載「libcamera」

「Bullseye」OSについて

2021/11/08、ラズベリーパイ公式から新OS「Bullseye」の発表がありました。(リンク)

前回は「Buster」が2019にリリースされたので、約2年ぶりの大幅アップデートとなります。

といっても、そこまで大きな変化はありません。

変わったこととして、

  • 外観
  • 通知
  • アップデータプラグイン
  • ビデオドライバ
  • カメラドライバ
  • Chromiumドライバ

などがあります。

この中でも「カメラドライバ」について詳しく見ていきましょう。

新しいカメラドライバ「libcamera」

Raspberry Pi 「Bullseye」では、新たなカメラドライバ「libcamera」が導入されます。

今までのおなじみの「raspistill」や「Picamera」などが置き換わり、「libcamera」としてオープンソースのカメラドライバに生まれ変わりました。

これにより、ラズパイでより強力なコマンドラインツールとしてカメラモジュールを制御することができるようになります。

今までは、画像を撮るなら「raspistill」、動画を撮るなら「raspivid」というように、それぞれに特化したコマンドラインツールが用意されていました。

しかし「libcamera」によって、カメラシステムの機能を統合したアプリケーションとして使えるようになっています。

「libcamera」のインストール方法

次の選択肢に沿って、インストールを行ってください。

  1. Raspberry Pi OS「Bullseye」をお使いの方
  2. Raspberry Pi OS「Buster」をお使いの方

ちなみに次のコマンドでOSのバージョンを調べることができます。

lsb_release -a

Raspberry Pi OS「Bullseye」をお使いの方

新しくリリースされたOS「Bullseye」をすでにインストールされた方は、「libcamera」がすでにビルドされた状態です。

そのため、 「libcamera」をインストールする必要はありません

ラズパイ公式のカメラモジュールを使用する場合は、何も設定をしなくても「libcamera」を使えるので、次の項目を飛ばしてください。

サードパーティ製のカメラモジュールを使用する場合は次の項目にある「/boot/config.txt」を編集する必要があります。

Raspberry Pi OS「Buster」をお使いの方

「Buster」がすでにインストールされている方でも、aptコマンドで「libcamera」をインストールすることができます。

まずは、おなじみのコマンドで「Buster」を最新版にアップデートします。

sudo apt update
sudo apt full-upgrade

これによりaptリポジトリが最新になったので、「libcamera-apps」をインストールします。

sudo apt install libcamera-apps

これで「libcamera-apps」のコマンドは使えるようになりましたが、「Buster」以前のOSではここで「/boot/config.txt」を編集する必要があります。

下の表に沿ってお使いのカメラモジュールに対応した文字を追加します。

定番のV2はもちろん、HQカメラモジュールや、サードパーティー製のカメラモジュールにも対応しています。

Camera Moduleconfig.txtに追加する文字
V1 camera (OV5647)dtoverlay=ov5647
V2 camera (IMX219)dtoverlay=imx219
HQ camera (IMX477)dtoverlay=imx477
IMX290 and IMX327dtoverlay=imx290,clock-frequency=74250000 or dtoverlay=imx290,clock-frequency=37125000 (both modules share the imx290 kernel driver; please refer to instructions from the module vendor for the correct frequency)
IMX378dtoverlay=imx378
OV9281dtoverlay=ov9281
出典:ラズパイ公式ドキュメント
今回使ったカメラモジュール
created by Rinker
Raspberry Pi
¥3,300 (2024/04/26 14:16:30時点 Amazon調べ-詳細)

私の場合は、一般的なカメラモジュール【Raspberry Pi Camera V2】を使用しているので、「dtoverlay=imx219」という文字を「/boot/config.txt」に追加します。

sudo nano /boot/config.txt

nanoエディタが開いたら、キーを押して、一番最後までスクロールします。

最後の行に、お使いのカメラに対応した文字を追加します。

追加出来たら、Ctrl+OEnterCtrl+Xの順番に入力して編集を保存します。

sudo reboot now

最後にターミナル上で、再起動コマンドを入力すれば準備完了です。

カメラの接続と、「設定」でカメラの有効化もお忘れなく。

「libcamera-apps」を試してみる

「libcamera-apps」にはいくつかの新しいアプリケーションが含まれています。

  • 簡単なカメラコマンド 「libcamera-hello」
  • 高解像度の静止画コマンド 「libcamera-jpeg」
  • 高度な静止画コマンド 「libcamera-still」
  • 高度な動画コマンド 「libcamera-vid」

順に見ていきましょう。

簡単なカメラコマンド libcamera-hello

カメラ版のHello World!

libcamera-hello

このコマンドはカメラ版のHello worldで、カメラが正しく機能しているかを確認するコマンドです。
プレビューが5秒間表示されます。

無期限のプレビュー

次に、オプションを使用して無限時間プレビューを表示してみます。

libcamera-hello -t 0

終了したい時は、プレビューの✖か、ターミナルでCtrl+Cを入力します。
無期限でプレビューを表示することで、レンズの絞りと焦点を微調整することができます。

libcamera-hello -h
Valid options are:
  -h [ --help ] [=arg(=1)] (=0)         Print this help message
  --version [=arg(=1)] (=0)             Displays the build version number
  -v [ --verbose ] [=arg(=1)] (=0)      Output extra debug and diagnostics
  -c [ --config ] [=arg(=config.txt)]   Read the options from a file. If no filename is specified, default to 
                                        config.txt. In case of duplicate options, the ones provided on the command line
                                        will be used. Note that the config file must only contain the long form 
                                        options.
  --info-text arg (=#%frame (%fps fps) exp %exp ag %ag dg %dg)
                                        Sets the information string on the titlebar. Available values:
                                        %frame (frame number)
                                        %fps (framerate)
                                        %exp (shutter speed)
                                        %ag (analogue gain)
                                        %dg (digital gain)
                                        %rg (red colour gain)
                                        %bg (blue colour gain)
                                        %focus (focus FoM value)
                                        %aelock (AE locked status)
  --width arg (=0)                      Set the output image width (0 = use default value)
  --height arg (=0)                     Set the output image height (0 = use default value)
  -t [ --timeout ] arg (=5000)          Time (in ms) for which program runs
  -o [ --output ] arg                   Set the output file name
  --post-process-file arg               Set the file name for configuring the post-processing
  --rawfull [=arg(=1)] (=0)             Force use of full resolution raw frames
  -n [ --nopreview ] [=arg(=1)] (=0)    Do not show a preview window
  -p [ --preview ] arg (=0,0,0,0)       Set the preview window dimensions, given as x,y,width,height e.g. 0,0,640,480
  -f [ --fullscreen ] [=arg(=1)] (=0)   Use a fullscreen preview window
  --qt-preview [=arg(=1)] (=0)          Use Qt-based preview window (WARNING: causes heavy CPU load, fullscreen not 
                                        supported)
  --hflip [=arg(=1)] (=0)               Request a horizontal flip transform
  --vflip [=arg(=1)] (=0)               Request a vertical flip transform
  --rotation arg (=0)                   Request an image rotation, 0 or 180
  --roi arg (=0,0,0,0)                  Set region of interest (digital zoom) e.g. 0.25,0.25,0.5,0.5
  --shutter arg (=0)                    Set a fixed shutter speed
  --analoggain arg (=0)                 Set a fixed gain value (synonym for 'gain' option)
  --gain arg                            Set a fixed gain value
  --metering arg (=centre)              Set the metering mode (centre, spot, average, custom)
  --exposure arg (=normal)              Set the exposure mode (normal, sport)
  --ev arg (=0)                         Set the EV exposure compensation, where 0 = no change
  --awb arg (=auto)                     Set the AWB mode (auto, incandescent, tungsten, fluorescent, indoor, daylight, 
                                        cloudy, custom)
  --awbgains arg (=0,0)                 Set explict red and blue gains (disable the automatic AWB algorithm)
  --flush [=arg(=1)] (=0)               Flush output data as soon as possible
  --wrap arg (=0)                       When writing multiple output files, reset the counter when it reaches this 
                                        number
  --brightness arg (=0)                 Adjust the brightness of the output images, in the range -1.0 to 1.0
  --contrast arg (=1)                   Adjust the contrast of the output image, where 1.0 = normal contrast
  --saturation arg (=1)                 Adjust the colour saturation of the output, where 1.0 = normal and 0.0 = 
                                        greyscale
  --sharpness arg (=1)                  Adjust the sharpness of the output image, where 1.0 = normal sharpening
  --framerate arg (=30)                 Set the fixed framerate for preview and video modes
  --denoise arg (=auto)                 Sets the Denoise operating mode: auto, off, cdn_off, cdn_fast, cdn_hq
  --viewfinder-width arg (=0)           Width of viewfinder frames from the camera (distinct from the preview window 
                                        size
  --viewfinder-height arg (=0)          Height of viewfinder frames from the camera (distinct from the preview window 
                                        size)
  --tuning-file arg (=-)                Name of camera tuning file to use, omit this option for libcamera default 
                                        behaviour
  --lores-width arg (=0)                Width of low resolution frames (use 0 to omit low resolution stream
  --lores-height arg (=0)               Height of low resolution frames (use 0 to omit low resolution stream

高解像度の静止画コマンド libcamera-jpeg

フル解像度でJPEG画像を保存する

libcamera-jpeg -o test1.jpg

フル解像度のJPEG画像をキャプチャできます。
3280×2464の画像が保存できました。(ブログにアップする都合上縮小して表示しています。)
デフォルトでは、5秒間のプレビューが表示された後、フル解像度の画像が「test1.jpg」というファイルで保存されます。

オプションで「時間」と「解像度」を指定する

オプションで「時間」と「解像度」を指定してみます。

libcamera-jpeg -o test2.jpg -t 2000 --width 640 --height 480
  • -t プレビューの表示時間 [ms]
  • –width 横の解像度
  • –height 縦の解像度

この場合は、プレビューの表示時間が2000ms=2秒で、640×480の解像度のJPEGファイルとして「test2.jpg」が保存されます。

libcamera-jpeg -h
Valid options are:
  -h [ --help ] [=arg(=1)] (=0)         Print this help message
  --version [=arg(=1)] (=0)             Displays the build version number
  -v [ --verbose ] [=arg(=1)] (=0)      Output extra debug and diagnostics
  -c [ --config ] [=arg(=config.txt)]   Read the options from a file. If no filename is specified, default to 
                                        config.txt. In case of duplicate options, the ones provided on the command line
                                        will be used. Note that the config file must only contain the long form 
                                        options.
  --info-text arg (=#%frame (%fps fps) exp %exp ag %ag dg %dg)
                                        Sets the information string on the titlebar. Available values:
                                        %frame (frame number)
                                        %fps (framerate)
                                        %exp (shutter speed)
                                        %ag (analogue gain)
                                        %dg (digital gain)
                                        %rg (red colour gain)
                                        %bg (blue colour gain)
                                        %focus (focus FoM value)
                                        %aelock (AE locked status)
  --width arg (=0)                      Set the output image width (0 = use default value)
  --height arg (=0)                     Set the output image height (0 = use default value)
  -t [ --timeout ] arg (=5000)          Time (in ms) for which program runs
  -o [ --output ] arg                   Set the output file name
  --post-process-file arg               Set the file name for configuring the post-processing
  --rawfull [=arg(=1)] (=0)             Force use of full resolution raw frames
  -n [ --nopreview ] [=arg(=1)] (=0)    Do not show a preview window
  -p [ --preview ] arg (=0,0,0,0)       Set the preview window dimensions, given as x,y,width,height e.g. 0,0,640,480
  -f [ --fullscreen ] [=arg(=1)] (=0)   Use a fullscreen preview window
  --qt-preview [=arg(=1)] (=0)          Use Qt-based preview window (WARNING: causes heavy CPU load, fullscreen not 
                                        supported)
  --hflip [=arg(=1)] (=0)               Request a horizontal flip transform
  --vflip [=arg(=1)] (=0)               Request a vertical flip transform
  --rotation arg (=0)                   Request an image rotation, 0 or 180
  --roi arg (=0,0,0,0)                  Set region of interest (digital zoom) e.g. 0.25,0.25,0.5,0.5
  --shutter arg (=0)                    Set a fixed shutter speed
  --analoggain arg (=0)                 Set a fixed gain value (synonym for 'gain' option)
  --gain arg                            Set a fixed gain value
  --metering arg (=centre)              Set the metering mode (centre, spot, average, custom)
  --exposure arg (=normal)              Set the exposure mode (normal, sport)
  --ev arg (=0)                         Set the EV exposure compensation, where 0 = no change
  --awb arg (=auto)                     Set the AWB mode (auto, incandescent, tungsten, fluorescent, indoor, daylight, 
                                        cloudy, custom)
  --awbgains arg (=0,0)                 Set explict red and blue gains (disable the automatic AWB algorithm)
  --flush [=arg(=1)] (=0)               Flush output data as soon as possible
  --wrap arg (=0)                       When writing multiple output files, reset the counter when it reaches this 
                                        number
  --brightness arg (=0)                 Adjust the brightness of the output images, in the range -1.0 to 1.0
  --contrast arg (=1)                   Adjust the contrast of the output image, where 1.0 = normal contrast
  --saturation arg (=1)                 Adjust the colour saturation of the output, where 1.0 = normal and 0.0 = 
                                        greyscale
  --sharpness arg (=1)                  Adjust the sharpness of the output image, where 1.0 = normal sharpening
  --framerate arg (=30)                 Set the fixed framerate for preview and video modes
  --denoise arg (=auto)                 Sets the Denoise operating mode: auto, off, cdn_off, cdn_fast, cdn_hq
  --viewfinder-width arg (=0)           Width of viewfinder frames from the camera (distinct from the preview window 
                                        size
  --viewfinder-height arg (=0)          Height of viewfinder frames from the camera (distinct from the preview window 
                                        size)
  --tuning-file arg (=-)                Name of camera tuning file to use, omit this option for libcamera default 
                                        behaviour
  --lores-width arg (=0)                Width of low resolution frames (use 0 to omit low resolution stream
  --lores-height arg (=0)               Height of low resolution frames (use 0 to omit low resolution stream
  -q [ --quality ] arg (=93)            Set the JPEG quality parameter
  -x [ --exif ] arg                     Add these extra EXIF tags to the output file
  --timelapse arg (=0)                  Time interval (in ms) between timelapse captures
  --framestart arg (=0)                 Initial frame counter value for timelapse captures
  --datetime [=arg(=1)] (=0)            Use date format for output file names
  --timestamp [=arg(=1)] (=0)           Use system timestamps for output file names
  --restart arg (=0)                    Set JPEG restart interval
  -k [ --keypress ] [=arg(=1)] (=0)     Perform capture when ENTER pressed
  -s [ --signal ] [=arg(=1)] (=0)       Perform capture when signal received
  --thumb arg (=320:240:70)             Set thumbnail parameters as width:height:quality
  -e [ --encoding ] arg (=jpg)          Set the desired output encoding, either jpg, png, rgb, bmp or yuv420
  -r [ --raw ] [=arg(=1)] (=0)          Also save raw file in DNG format
  --latest arg                          Create a symbolic link with this name to most recent saved file
  --immediate [=arg(=1)] (=0)           Perform first capture immediately, with no preview phase

高度な静止画コマンド libcamera-still

raspistillの互換コマンド

libcamera-still -o test3.jpg

libcamera-still」は以前のラズパイで標準的なカメラコマンド「raspistill」の互換コマンドです。
完全ではないですが、ほとんどのオプションが類似しています。

JPEG以外の保存形式で保存する

-eオプションで保存形式を変更できます。
(png, bmp, rgb,yuv420)などに変更可能。

libcamera-still -e png -o test.png

タイムラプスを撮ってみる

タイムラプスで撮影するコマンドです。

libcamera-still -t 30000 --timelapse 3000 -o image%04d.jpg
  • -t 30000 トータルの撮影時間 [ms] 30000ms = 30s
  • –timelapse 3000 撮影間隔 [ms] 3000ms = 3s
  • -o image%04d.jpg 連番でファイルを出力 (image0000.jpg image0001.jpg ・・・)
libcamera-still -h
Valid options are:
  -h [ --help ] [=arg(=1)] (=0)         Print this help message
  --version [=arg(=1)] (=0)             Displays the build version number
  -v [ --verbose ] [=arg(=1)] (=0)      Output extra debug and diagnostics
  -c [ --config ] [=arg(=config.txt)]   Read the options from a file. If no filename is specified, default to 
                                        config.txt. In case of duplicate options, the ones provided on the command line
                                        will be used. Note that the config file must only contain the long form 
                                        options.
  --info-text arg (=#%frame (%fps fps) exp %exp ag %ag dg %dg)
                                        Sets the information string on the titlebar. Available values:
                                        %frame (frame number)
                                        %fps (framerate)
                                        %exp (shutter speed)
                                        %ag (analogue gain)
                                        %dg (digital gain)
                                        %rg (red colour gain)
                                        %bg (blue colour gain)
                                        %focus (focus FoM value)
                                        %aelock (AE locked status)
  --width arg (=0)                      Set the output image width (0 = use default value)
  --height arg (=0)                     Set the output image height (0 = use default value)
  -t [ --timeout ] arg (=5000)          Time (in ms) for which program runs
  -o [ --output ] arg                   Set the output file name
  --post-process-file arg               Set the file name for configuring the post-processing
  --rawfull [=arg(=1)] (=0)             Force use of full resolution raw frames
  -n [ --nopreview ] [=arg(=1)] (=0)    Do not show a preview window
  -p [ --preview ] arg (=0,0,0,0)       Set the preview window dimensions, given as x,y,width,height e.g. 0,0,640,480
  -f [ --fullscreen ] [=arg(=1)] (=0)   Use a fullscreen preview window
  --qt-preview [=arg(=1)] (=0)          Use Qt-based preview window (WARNING: causes heavy CPU load, fullscreen not 
                                        supported)
  --hflip [=arg(=1)] (=0)               Request a horizontal flip transform
  --vflip [=arg(=1)] (=0)               Request a vertical flip transform
  --rotation arg (=0)                   Request an image rotation, 0 or 180
  --roi arg (=0,0,0,0)                  Set region of interest (digital zoom) e.g. 0.25,0.25,0.5,0.5
  --shutter arg (=0)                    Set a fixed shutter speed
  --analoggain arg (=0)                 Set a fixed gain value (synonym for 'gain' option)
  --gain arg                            Set a fixed gain value
  --metering arg (=centre)              Set the metering mode (centre, spot, average, custom)
  --exposure arg (=normal)              Set the exposure mode (normal, sport)
  --ev arg (=0)                         Set the EV exposure compensation, where 0 = no change
  --awb arg (=auto)                     Set the AWB mode (auto, incandescent, tungsten, fluorescent, indoor, daylight, 
                                        cloudy, custom)
  --awbgains arg (=0,0)                 Set explict red and blue gains (disable the automatic AWB algorithm)
  --flush [=arg(=1)] (=0)               Flush output data as soon as possible
  --wrap arg (=0)                       When writing multiple output files, reset the counter when it reaches this 
                                        number
  --brightness arg (=0)                 Adjust the brightness of the output images, in the range -1.0 to 1.0
  --contrast arg (=1)                   Adjust the contrast of the output image, where 1.0 = normal contrast
  --saturation arg (=1)                 Adjust the colour saturation of the output, where 1.0 = normal and 0.0 = 
                                        greyscale
  --sharpness arg (=1)                  Adjust the sharpness of the output image, where 1.0 = normal sharpening
  --framerate arg (=30)                 Set the fixed framerate for preview and video modes
  --denoise arg (=auto)                 Sets the Denoise operating mode: auto, off, cdn_off, cdn_fast, cdn_hq
  --viewfinder-width arg (=0)           Width of viewfinder frames from the camera (distinct from the preview window 
                                        size
  --viewfinder-height arg (=0)          Height of viewfinder frames from the camera (distinct from the preview window 
                                        size)
  --tuning-file arg (=-)                Name of camera tuning file to use, omit this option for libcamera default 
                                        behaviour
  --lores-width arg (=0)                Width of low resolution frames (use 0 to omit low resolution stream
  --lores-height arg (=0)               Height of low resolution frames (use 0 to omit low resolution stream
  -q [ --quality ] arg (=93)            Set the JPEG quality parameter
  -x [ --exif ] arg                     Add these extra EXIF tags to the output file
  --timelapse arg (=0)                  Time interval (in ms) between timelapse captures
  --framestart arg (=0)                 Initial frame counter value for timelapse captures
  --datetime [=arg(=1)] (=0)            Use date format for output file names
  --timestamp [=arg(=1)] (=0)           Use system timestamps for output file names
  --restart arg (=0)                    Set JPEG restart interval
  -k [ --keypress ] [=arg(=1)] (=0)     Perform capture when ENTER pressed
  -s [ --signal ] [=arg(=1)] (=0)       Perform capture when signal received
  --thumb arg (=320:240:70)             Set thumbnail parameters as width:height:quality
  -e [ --encoding ] arg (=jpg)          Set the desired output encoding, either jpg, png, rgb, bmp or yuv420
  -r [ --raw ] [=arg(=1)] (=0)          Also save raw file in DNG format
  --latest arg                          Create a symbolic link with this name to most recent saved file
  --immediate [=arg(=1)] (=0)           Perform first capture immediately, with no preview phase

高度な動画コマンド libcamera-vid

raspividの互換コマンド

libcamera-vid」は以前のラズパイで標準的なカメラコマンド「raspivid」の互換コマンドです。
完全ではないですが、ほとんどのオプションが類似しています。

libcamera-vid -t 10000 -o test.h264

10秒間の動画を撮影し、「test.h264」として保存するコマンドです。
オプションで「h264、mjpeg、yuv420」のファイル形式を選択できます。

ストリーミング配信する

動画をストリーミング配信することもできます。

1. 次のコマンドをラズパイで実行します。

libcamera-vid -t 0 --inline --listen -o tcp://0.0.0.0:8888

2. 他のコンピュータでVLCを開き、「メディア」→「ネットワークストリームを開く」の順にクリックします。

3. 次のようにURLを入力し、「再生」をクリックします。

tcp/h264://raspberrypi.local:8888

数秒の遅延はありますが、遠隔でペットを観察する用途などに使えそうです。

libcamera-vid -h
Valid options are:
  -h [ --help ] [=arg(=1)] (=0)         Print this help message
  --version [=arg(=1)] (=0)             Displays the build version number
  -v [ --verbose ] [=arg(=1)] (=0)      Output extra debug and diagnostics
  -c [ --config ] [=arg(=config.txt)]   Read the options from a file. If no filename is specified, default to 
                                        config.txt. In case of duplicate options, the ones provided on the command line
                                        will be used. Note that the config file must only contain the long form 
                                        options.
  --info-text arg (=#%frame (%fps fps) exp %exp ag %ag dg %dg)
                                        Sets the information string on the titlebar. Available values:
                                        %frame (frame number)
                                        %fps (framerate)
                                        %exp (shutter speed)
                                        %ag (analogue gain)
                                        %dg (digital gain)
                                        %rg (red colour gain)
                                        %bg (blue colour gain)
                                        %focus (focus FoM value)
                                        %aelock (AE locked status)
  --width arg (=0)                      Set the output image width (0 = use default value)
  --height arg (=0)                     Set the output image height (0 = use default value)
  -t [ --timeout ] arg (=5000)          Time (in ms) for which program runs
  -o [ --output ] arg                   Set the output file name
  --post-process-file arg               Set the file name for configuring the post-processing
  --rawfull [=arg(=1)] (=0)             Force use of full resolution raw frames
  -n [ --nopreview ] [=arg(=1)] (=0)    Do not show a preview window
  -p [ --preview ] arg (=0,0,0,0)       Set the preview window dimensions, given as x,y,width,height e.g. 0,0,640,480
  -f [ --fullscreen ] [=arg(=1)] (=0)   Use a fullscreen preview window
  --qt-preview [=arg(=1)] (=0)          Use Qt-based preview window (WARNING: causes heavy CPU load, fullscreen not 
                                        supported)
  --hflip [=arg(=1)] (=0)               Request a horizontal flip transform
  --vflip [=arg(=1)] (=0)               Request a vertical flip transform
  --rotation arg (=0)                   Request an image rotation, 0 or 180
  --roi arg (=0,0,0,0)                  Set region of interest (digital zoom) e.g. 0.25,0.25,0.5,0.5
  --shutter arg (=0)                    Set a fixed shutter speed
  --analoggain arg (=0)                 Set a fixed gain value (synonym for 'gain' option)
  --gain arg                            Set a fixed gain value
  --metering arg (=centre)              Set the metering mode (centre, spot, average, custom)
  --exposure arg (=normal)              Set the exposure mode (normal, sport)
  --ev arg (=0)                         Set the EV exposure compensation, where 0 = no change
  --awb arg (=auto)                     Set the AWB mode (auto, incandescent, tungsten, fluorescent, indoor, daylight, 
                                        cloudy, custom)
  --awbgains arg (=0,0)                 Set explict red and blue gains (disable the automatic AWB algorithm)
  --flush [=arg(=1)] (=0)               Flush output data as soon as possible
  --wrap arg (=0)                       When writing multiple output files, reset the counter when it reaches this 
                                        number
  --brightness arg (=0)                 Adjust the brightness of the output images, in the range -1.0 to 1.0
  --contrast arg (=1)                   Adjust the contrast of the output image, where 1.0 = normal contrast
  --saturation arg (=1)                 Adjust the colour saturation of the output, where 1.0 = normal and 0.0 = 
                                        greyscale
  --sharpness arg (=1)                  Adjust the sharpness of the output image, where 1.0 = normal sharpening
  --framerate arg (=30)                 Set the fixed framerate for preview and video modes
  --denoise arg (=auto)                 Sets the Denoise operating mode: auto, off, cdn_off, cdn_fast, cdn_hq
  --viewfinder-width arg (=0)           Width of viewfinder frames from the camera (distinct from the preview window 
                                        size
  --viewfinder-height arg (=0)          Height of viewfinder frames from the camera (distinct from the preview window 
                                        size)
  --tuning-file arg (=-)                Name of camera tuning file to use, omit this option for libcamera default 
                                        behaviour
  --lores-width arg (=0)                Width of low resolution frames (use 0 to omit low resolution stream
  --lores-height arg (=0)               Height of low resolution frames (use 0 to omit low resolution stream
  -b [ --bitrate ] arg (=0)             Set the bitrate for encoding, in bits/second (h264 only)
  --profile arg                         Set the encoding profile (h264 only)
  --level arg                           Set the encoding level (h264 only)
  -g [ --intra ] arg (=0)               Set the intra frame period (h264 only)
  --inline [=arg(=1)] (=0)              Force PPS/SPS header with every I frame (h264 only)
  --codec arg (=h264)                   Set the codec to use, either h264, mjpeg or yuv420
  --save-pts arg                        Save a timestamp file with this name
  -q [ --quality ] arg (=50)            Set the MJPEG quality parameter (mjpeg only)
  -l [ --listen ] [=arg(=1)] (=0)       Listen for an incoming client network connection before sending data to the 
                                        client
  -k [ --keypress ] [=arg(=1)] (=0)     Pause or resume video recording when ENTER pressed
  -s [ --signal ] [=arg(=1)] (=0)       Pause or resume video recording when signal received
  -i [ --initial ] arg (=record)        Use 'pause' to pause the recording at startup, otherwise 'record' (the default)
  --split [=arg(=1)] (=0)               Create a new output file every time recording is paused and then resumed
  --segment arg (=0)                    Break the recording into files of approximately this many milliseconds
  --circular [=arg(=1)] (=0)            Write output to a circular buffer which is saved on exit