Momo は Raspberry Pi OS 64bit 環境で libcamera を利用したカメラ入力をサポートしています。 libcamera は Linux 向けの新しいカメラスタックで、従来の V4L2 よりも高度なカメラ制御が可能です。
./momo --use-libcamera sora ...H.264 エンコード時のみ、メモリコピーを削減する最適化が利用できます:
./momo --use-libcamera --use-libcamera-native sora ...Note
制約事項:
--use-libcamera-nativeは H.264 かつサイマルキャストが無効の場合のみ有効- ハードウェアエンコーダーとの組み合わせで最大の効果を発揮
libcamera は 75 以上のカメラパラメーターを提供しています。Momo では --libcamera-control オプションで設定できます。
--libcamera-control <キー> <値>複数のコントロールを設定する場合:
./momo --use-libcamera \
--libcamera-control ExposureTime 10000 \
--libcamera-control AnalogueGain 2.0 \
--libcamera-control AfMode Continuous \
sora ...-
bool:
0または1、trueまたはfalse--libcamera-control AeEnable 1 --libcamera-control AeEnable true -
int32: 整数値
--libcamera-control ExposureTime 10000
-
int64: 長整数値
--libcamera-control FrameDuration 33333
-
float: 小数値
--libcamera-control AnalogueGain 2.0 --libcamera-control Brightness -0.5
-
enum: 文字列または数値(主要な enum のみ文字列対応)
--libcamera-control AfMode Continuous # または --libcamera-control AfMode 2文字列対応済みの enum:
AfMode,AfRange,AfSpeedAeMeteringModeAwbModeExposureTimeMode,AnalogueGainMode
-
配列: カンマ区切り
--libcamera-control ColourGains 1.5,2.0 --libcamera-control FrameDurationLimits 33333,33333
対応済み:
float[],int32[],int64[] -
矩形(Rectangle): x,y,width,height
--libcamera-control ScalerCrop 100,100,640,480
-
複数矩形: セミコロン区切り
--libcamera-control AfWindows "100,100,200,200;300,300,200,200"[!NOTE] Rectangle 配列の場合、セミコロンで複数の矩形を区切ります
-
マトリクス: カンマ区切り(行優先)(未対応)
--libcamera-control ColourCorrectionMatrix 1.0,0,0,0,1.0,0,0,0,1.0
- Size 型
- Point 型
- マトリクス型(3x3 など)
- その他の複雑な構造体
| コントロール | 型 | 説明 | 値の例 |
|---|---|---|---|
| AeEnable | bool | 自動露出の有効/無効 | 0, 1 |
| ExposureTime | int32 | 露出時間(マイクロ秒) | 10000 (1/100秒) |
| AnalogueGain | float | アナログゲイン(1.0以上) | 2.0 |
| ExposureTimeMode | enum | 露出時間モード | Auto, Manual |
| AnalogueGainMode | enum | ゲインモード | Auto, Manual |
| AeMeteringMode | enum | 測光モード | CentreWeighted, Spot, Matrix |
| ExposureValue | float | EV補正値 | -2.0 〜 2.0 |
| コントロール | 型 | 説明 | 値の例 |
|---|---|---|---|
| AfMode | enum | AFモード | Manual, Auto, Continuous |
| AfRange | enum | フォーカス範囲 | Normal, Macro, Full |
| AfSpeed | enum | フォーカス速度 | Normal, Fast |
| AfTrigger | enum | AFトリガー | Start, Cancel |
| AfWindows | Rectangle[] | AFエリア | "256,192,512,384" |
| LensPosition | float | レンズ位置(ジオプター) | 2.0 |
| コントロール | 型 | 説明 | 値の例 |
|---|---|---|---|
| AwbEnable | bool | AWBの有効/無効 | 0, 1 |
| AwbMode | enum | AWBモード | Auto, Daylight, Cloudy, Tungsten |
| ColourTemperature | int32 | 色温度(ケルビン) | 5500 |
| ColourGains | float[2] | 赤・青ゲイン | 1.5,2.0 |
| コントロール | 型 | 説明 | 値の例 |
|---|---|---|---|
| Brightness | float | 明るさ | -1.0 〜 1.0 |
| Contrast | float | コントラスト | 1.0(標準) |
| Saturation | float | 彩度 | 1.0(標準), 0.0(モノクロ) |
| Sharpness | float | シャープネス | 0.0 〜 10.0 |
| Gamma | float | ガンマ値 | 2.2(標準) |
| コントロール | 型 | 説明 | 値の例 |
|---|---|---|---|
| FrameDurationLimits | int64[2] | フレーム時間の最小/最大(マイクロ秒) | 33333,33333 (30fps固定) |
Manualまたは0: 手動フォーカスAutoまたは1: シングルAF(一度フォーカスして停止)Continuousまたは2: コンティニュアスAF
Normalまたは0: 通常範囲Macroまたは1: マクロ(接写)Fullまたは2: 全範囲
Normalまたは0: 通常速度Fastまたは1: 高速
Autoまたは0: 自動Manualまたは1: 手動
CentreWeightedまたは0: 中央重点測光Spotまたは1: スポット測光Matrixまたは2: マトリックス測光
Autoまたは0: 自動Incandescentまたは1: 白熱灯Tungstenまたは2: タングステンFluorescentまたは3: 蛍光灯Indoorまたは4: 屋内Daylightまたは5: 昼光Cloudyまたは6: 曇天
Offまたは0: 無効MultiExposureUnmergedまたは1: 複数露出(未合成)MultiExposureまたは2: 複数露出(合成)SingleExposureまたは3: 単一露出HDRNightまたは4: ナイトモード
./momo --use-libcamera \
--libcamera-control AeEnable 1 \
--libcamera-control AeExposureMode Short \
--libcamera-control AwbMode Daylight \
--libcamera-control Contrast 1.2 \
sora ..../momo --use-libcamera \
--libcamera-control ExposureTimeMode Manual \
--libcamera-control ExposureTime 50000 \
--libcamera-control AnalogueGain 8.0 \
--libcamera-control NoiseReductionMode HighQuality \
sora ..../momo --use-libcamera \
--libcamera-control AfMode Continuous \
--libcamera-control AfRange Macro \
--libcamera-control AfSpeed Normal \
--libcamera-control Sharpness 2.0 \
sora ..../momo --use-libcamera \
--libcamera-control FrameDurationLimits 33333,33333 \
sora ..../momo --use-libcamera \
--libcamera-control AeEnable 0 \
--libcamera-control AwbEnable 0 \
--libcamera-control ExposureTime 20000 \
--libcamera-control AnalogueGain 4.0 \
--libcamera-control ColourGains 1.8,1.5 \
--libcamera-control AfMode Manual \
--libcamera-control LensPosition 2.0 \
sora ...指定したコントロール名が正しくない、またはカメラがそのコントロールをサポートしていません。 利用可能なコントロールはカメラモデルによって異なります。
Note
警告が表示されますが、他の有効な設定は適用されカメラは正常に起動します。
指定したコントロールの型がサポートされていません(Size、Point、マトリクスなど)。
Note
警告が表示されますが、他の有効な設定は適用されカメラは正常に起動します。
値の形式が正しくないか、範囲外の値を指定しています。
- 数値の範囲を確認してください
- enum の場合は有効な値を確認してください
- 配列の場合は要素数が正しいか確認してください
Note
警告が表示されますが、他の有効な設定は適用されカメラは正常に起動します。
--use-libcamera-nativeオプションの使用を検討してください(H.264のみ)- 不要なコントロールの設定を避けてください
- フレームレート制限を適切に設定してください
AeConstraintMode
AeEnable
AeExposureMode
AeFlickerDetected
AeFlickerMode
AeFlickerPeriod
AeMeteringMode
AeState
AfMetering
AfMode
AfPause
AfPauseState
AfRange
AfSpeed
AfState
AfTrigger
AfWindows
AnalogueGain
AnalogueGainMode
AwbEnable
AwbLocked
AwbMode
Brightness
ColourCorrectionMatrix
ColourGains
ColourTemperature
Contrast
DebugMetadataEnable
DigitalGain
ExposureTime
ExposureTimeMode
ExposureValue
FocusFoM
FrameDuration
FrameDurationLimits
FrameWallClock
Gamma
HdrChannel
HdrMode
LensPosition
Lux
Saturation
ScalerCrop
SensorBlackLevels
SensorTemperature
SensorTimestamp
Sharpness
AePrecaptureTrigger
AwbState
ColorCorrectionAberrationMode
FaceDetectFaceIds
FaceDetectFaceLandmarks
FaceDetectFaceRectangles
FaceDetectFaceScores
FaceDetectMode
LensShadingMapMode
MaxLatency
NoiseReductionMode
PipelineDepth
SensorRollingShutterSkew
TestPatternMode
Bcm2835StatsOutput
CnnEnableInputTensor
CnnInputTensor
CnnInputTensorInfo
CnnKpiInfo
CnnOutputTensor
CnnOutputTensorInfo
PispStatsOutput
ScalerCrops
StatsOutputEnable
SyncFrames
SyncMode
SyncReady
SyncTimer