开源 企业版 高校版 私有云 模力方舟 AI 队友
代码拉取完成,页面将自动刷新
捐赠
捐赠前请先登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
1 Star 0 Fork 0

ArduCAM/libcamera

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
已有帐号? 立即登录
main
分支 (3)
main
next
ctt-fixes
克隆/下载
克隆/下载
提示
下载代码请复制以下命令到终端执行
为确保你提交的代码身份被 Gitee 正确识别,请执行以下命令完成配置
初次使用 SSH 协议进行代码克隆、推送等操作时,需按下述提示完成 SSH 配置
1 生成 RSA 密钥
2 获取 RSA 公钥内容,并配置到 SSH公钥
在 Gitee 上使用 SVN,请访问 使用指南
使用 HTTPS 协议时,命令行会出现如下账号密码验证步骤。基于安全考虑,Gitee 建议 配置并使用私人令牌 替代登录密码进行克隆、推送等操作
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # 私人令牌
贡献代码
同步代码
对比差异 通过 Pull Request 同步
同步更新到分支
通过 Pull Request 同步
将会在向当前分支创建一个 Pull
Request,合入后将完成同步
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
未知许可证

libcamera

A complex camera support library for Linux, Android, and ChromeOS

Cameras are complex devices that need heavy hardware image processing operations. Control of the processing is based on advanced algorithms that must run on a programmable processor. This has traditionally been implemented in a dedicated MCU in the camera, but in embedded devices algorithms have been moved to the main CPU to save cost. Blurring the boundary between camera devices and Linux often left the user with no other option than a vendor-specific closed-source solution.

To address this problem the Linux media community has very recently started collaboration with the industry to develop a camera stack that will be open-source-friendly while still protecting vendor core IP. libcamera was born out of that collaboration and will offer modern camera support to Linux-based systems, including traditional Linux distributions, ChromeOS and Android.

Getting Started

To fetch the sources, build and install:

git clone https://git.libcamera.org/libcamera/libcamera.git
cd libcamera
meson build
ninja -C build install

Dependencies

The following Debian/Ubuntu packages are required for building libcamera. Other distributions may have differing package names:

A C++ toolchain: [required]
Either {g++, clang}
Meson Build system: [required]

meson (>= 0.56) ninja-build pkg-config

If your distribution doesn't provide a recent enough version of meson, you can install or upgrade it using pip3.

pip3 install --user meson
pip3 install --user --upgrade meson
for the libcamera core: [required]
libyaml-dev python3-yaml python3-ply python3-jinja2
for IPA module signing: [recommended]

Either libgnutls28-dev or libssl-dev, openssl

Without IPA module signing, all IPA modules will be isolated in a separate process. This adds an unnecessary extra overhead at runtime.

for improved debugging: [optional]

libdw-dev libunwind-dev

libdw and libunwind provide backtraces to help debugging assertion failures. Their functions overlap, libdw provides the most detailed information, and libunwind is not needed if both libdw and the glibc backtrace() function are available.

for device hotplug enumeration: [optional]
libudev-dev
for documentation: [optional]
python3-sphinx doxygen graphviz texlive-latex-extra
for gstreamer: [optional]
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
for cam: [optional]

libevent-dev is required to support cam, however the following optional dependencies bring more functionality to the cam test tool:

  • libdrm-dev: Enables the KMS sink
  • libjpeg-dev: Enables MJPEG on the SDL sink
  • libsdl2-dev: Enables the SDL sink
for qcam: [optional]
qtbase5-dev libqt5core5a libqt5gui5 libqt5widgets5 qttools5-dev-tools libtiff-dev
for tracing with lttng: [optional]
liblttng-ust-dev python3-jinja2 lttng-tools
for android: [optional]
libexif-dev libjpeg-dev
for lc-compliance: [optional]
libevent-dev

Basic testing with cam utility

The cam utility can be used for basic testing. You can list the cameras detected on the system with cam -l, and capture ten frames from the first camera and save them to disk with cam -c 1 --capture=10 --file. See cam -h for more information about the cam tool.

In case of problems, a detailed debug log can be obtained from libcamera by setting the LIBCAMERA_LOG_LEVELS environment variable:

:~$ LIBCAMERA_LOG_LEVELS=*:DEBUG cam -l

Using GStreamer plugin

To use GStreamer plugin from source tree, set the following environment so that GStreamer can find it. This isn't necessary when libcamera is installed.

export GST_PLUGIN_PATH=$(pwd)/build/src/gstreamer

The debugging tool gst-launch-1.0 can be used to construct a pipeline and test it. The following pipeline will stream from the camera named "Camera 1" onto the OpenGL accelerated display element on your system.

gst-launch-1.0 libcamerasrc camera-name="Camera 1" ! glimagesink

To show the first camera found you can omit the camera-name property, or you can list the cameras and their capabilities using:

gst-device-monitor-1.0 Video

This will also show the supported stream sizes which can be manually selected if desired with a pipeline such as:

gst-launch-1.0 libcamerasrc ! 'video/x-raw,width=1280,height=720' ! \
 glimagesink

The libcamerasrc element has two log categories, named libcamera-provider (for the video device provider) and libcamerasrc (for the operation of the camera). All corresponding debug messages can be enabled by setting the GST_DEBUG environment variable to libcamera*:7.

Presently, to prevent element negotiation failures it is required to specify the colorimetry and framerate as part of your pipeline construction. For instance, to capture and encode as a JPEG stream and receive on another device the following example could be used as a starting point:

gst-launch-1.0 libcamerasrc ! \
 video/x-raw,colorimetry=bt709,format=NV12,width=1280,height=720,framerate=30/1 ! \
 jpegenc ! multipartmux ! \
 tcpserversink host=0.0.0.0 port=5000

Which can be received on another device over the network with:

gst-launch-1.0 tcpclientsrc host=$DEVICE_IP port=5000 ! \
 multipartdemux ! jpegdec ! autovideosink

Troubleshooting

Several users have reported issues with meson installation, crux of the issue is a potential version mismatch between the version that root uses, and the version that the normal user uses. On calling ninja -C build, it can't find the build.ninja module. This is a snippet of the error message.

ninja: Entering directory `build'
ninja: error: loading 'build.ninja': No such file or directory

This can be solved in two ways:

  1. Don't install meson again if it is already installed system-wide.

2) If a version of meson which is different from the system-wide version is already installed, uninstall that meson using pip3, and install again without the --user argument.

.. SPDX-License-Identifier: CC-BY-SA-4.0 ========== Licenses ========== TL;DR summary: The libcamera core is covered by the LGPL-2.1-or-later license. IPA modules included in libcamera are covered by a free software license. Third-parties may develop IPA modules outside of libcamera and distribute them under a closed-source license, provided they do not include source code from the libcamera project. The libcamera project contains multiple libraries, applications and utilities. Licenses are expressed through SPDX tags in text-based files that support comments, and through the .reuse/dep5 file otherwise. A copy of all licenses is stored in the LICENSES directory. The following text summarizes the licenses covering the different components of the project to offer a quick overview for developers. The SPDX and DEP5 information are however authoritative and shall prevail in case of inconsistencies with the text below. The libcamera core source code, located under the include/libcamera/ and src/libcamera/ directories, is fully covered by the LGPL-2.1-or-later license, which thus covers distribution of the libcamera.so binary. Other files located in those directories, most notably the meson build files, and various related build scripts, may be covered by different licenses. None of their source code is incorporated in the in the libcamera.so binary, they thus don't affect the distribution terms of the binary. The IPA modules, located in src/ipa/, are covered by free software licenses chosen by the module authors. The LGPL-2.1-or-later license is recommended. Those modules are compiled as separate binaries and dynamically loaded by the libcamera core at runtime. The IPA module API is defined in headers located in include/libcamera/ipa/ and covered by the LGPL-2.1-or-later license. Using the data types (including classes, structures and enumerations) and macros defined in the IPA module and libcamera core API headers in IPA modules doesn't extend the LGPL license to the IPA modules. Third-party closed-source IPA modules are thus permitted, provided they comply with the licensing requirements of any software they include or link to. The libcamera Android camera HAL component is located in src/android/. The libcamera-specific source code is covered by the LGPL-2.1-or-later license. The component additionally contains header files and source code, located respectively in include/android/ and src/android/metadata/, copied verbatim from Android and covered by the Apache-2.0 license. The libcamera GStreamer and V4L2 adaptation source code, located respectively in src/gstreamer/ and src/v4l2/, is fully covered by the LGPL-2.1-or-later license. Those components are compiled to separate binaries and do not influence the license of the libcamera core. The cam and qcam sample applications, as well as the unit tests, located respectively in src/cam/, src/qcam/ and test/, are covered by the GPL-2.0-or-later license. qcam additionally includes an icon set covered by the MIT license. Those applications are compiled to separate binaries and do not influence the license of the libcamera core. Additional utilities are located in the utils/ directory and are covered by various licenses. They are not part of the libcamera core and do not influence its license. Finally, copies of various Linux kernel headers are included in include/linux/ to avoid depending on particular versions of those headers being installed in the system. The Linux kernel headers are covered by their respective license, including the Linux kernel license syscall exception. Using a copy of those headers doesn't affect libcamera licensing terms in any way compared to using the same headers installed in the system from kernel headers packages provided by Linux distributions.
举报
举报成功
我们将于2个工作日内通过站内信反馈结果给你!
请认真填写举报原因,尽可能描述详细。
请选择举报类型
取消
发送
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

简介

libcamera
暂无标签
README
未知许可证
查看未知开源许可协议
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
编辑仓库简介
简介内容
主页
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ArduCAM/libcamera.git
git@gitee.com:ArduCAM/libcamera.git
ArduCAM
libcamera
libcamera
main
点此查找更多帮助

搜索帮助

评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册

AltStyle によって変換されたページ (->オリジナル) /