libcamera build errors

  • ninja error
$ sudo ninja -C build install -j 1

limit the ninja threads to 1, so that the whole OS won’t get stuck during build process.


  • meson error
$ meson build

meson.build:136.33: ERROR: Expecting eol got not.
if get_option('test') and 'vimc' not in pipelines
															^

refer to the github repo of libcamera : https://github.com/kbingham/libcamera we can find that meson requires gcc-8 or higher complier. However, on ubuntu MATE 18.04 the default gcc version is 7.4.0.
Hence, we have to install gcc-8 and the make it default choice

# install gcc-8
sudo apt-get install gcc-8

# change default
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 7
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 7
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 8
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 8

check which gcc is by default selected

sudo update-alternatives --config gcc


#check the gcc version
gcc --version

libcamera-hello error on raspbian bullseye
the official guide tells me to enable camera legacy in the raspi-config -> Interface Options
Here is the official guide.

  • Ensure your system is up-to-date and reboot it.
  • Run sudo raspi-config.
  • Navigate to Interface Options and select Legacy camera to enable it.
  • Reboot your Raspberry Pi again.

However, it turns out that operation like this will lead to an error when you try to start libcamera-hello. It says that :

error the system appears to be configured for the legacy camera stack

Obviously, the error tells us we don’t need configure legacy camera here, which means the official guide is wrong. The right step is:

  • Run sudo raspi-config.
  • Navigate to Interface Options and select Legacy camera to disable it.
  • Navigate to Advanced Options and select Glamer to enable it.
  • Finish and reboot

Now you will see the image after type in libcamera-hello

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要编译libcamera,可以参考以下步骤: 1. 首先,从libcamera的GitHub库中克隆代码。可以使用以下命令: ``` git clone https://git.libcamera.org/libcamera/libcamera.git ``` 2. 进入新克隆的libcamera目录: ``` cd libcamera ``` 3. 使用pip安装meson,确保版本号大于0.56。可以使用以下命令: ``` pip3 install --user meson==0.63.3 ``` 4. 创建一个构建目录,并设置安装路径: ``` meson build --prefix /your/path/to/install ``` 5. 使用ninja进行编译: ``` ninja -C build ``` 6. 安装编译后的库和可执行文件: ``` ninja -C build install ``` 请注意,上述步骤中的`/your/path/to/install`应替换为您希望安装libcamera的实际路径。 这样,您就可以成功编译libcamera了。libcamera提供了一系列的C API,用于配置摄像头并获取摄像头的帧数据,这些数据可以直接用于图像编码或视频编码。另外,树莓派官方还提供了基于libcamera的应用层工具包libcamera-apps,其中包括一组模拟了Broadcom GPU的接口,例如raspstill和raspivid。这些工具可以帮助您更方便地使用libcamera。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [树莓派4B 摄像头采集](https://blog.csdn.net/rabbit0206/article/details/127157707)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *3* [第3讲 Android Camera性能分析 编译Android模拟器](https://blog.csdn.net/qq_42194101/article/details/124358696)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值