From ba5655271a8daa38068778678d822474985053e2 Mon Sep 17 00:00:00 2001 From: Tang ZZ Date: Thu, 10 Sep 2026 15:44:02 +0800 Subject: [PATCH] docs(dragon-q6a): update camera tutorials with apt install and camera usage steps --- docs/dragon/q6a/accessories/camera-12m-577.md | 106 ++++++++------- docs/dragon/q6a/accessories/camera-13m-214.md | 106 ++++++++------- docs/dragon/q6a/accessories/camera-4k.md | 106 ++++++++------- docs/dragon/q6a/accessories/camera-8m-219.md | 123 +++++++----------- .../dragon/q6a/accessories/camera-12m-577.md | 106 ++++++++------- .../dragon/q6a/accessories/camera-13m-214.md | 106 ++++++++------- .../dragon/q6a/accessories/camera-4k.md | 106 ++++++++------- .../dragon/q6a/accessories/camera-8m-219.md | 123 +++++++----------- 8 files changed, 470 insertions(+), 412 deletions(-) diff --git a/docs/dragon/q6a/accessories/camera-12m-577.md b/docs/dragon/q6a/accessories/camera-12m-577.md index 2410f7034..640be9d73 100644 --- a/docs/dragon/q6a/accessories/camera-12m-577.md +++ b/docs/dragon/q6a/accessories/camera-12m-577.md @@ -8,81 +8,99 @@ import Camera12M577 from '../../../common/accessories/\_camera-12m-577.mdx'; -## 预览摄像头 +## 使用摄像头 -使用 libcamera 预览摄像头画面。 +使用 GStreamer 或 libcamera 的 qcam 工具预览或录制摄像头画面。以下预览命令请在系统桌面终端中运行。 -### 安装依赖 +### 系统更新 + +进入 `Rsetup -> System -> System Update` 更新系统。 + +### 使用 GStreamer + +#### 安装依赖 + + + +```bash +sudo apt install -y \ + gstreamer1.0-tools \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad +``` + + + +#### 预览摄像头 + + + +```bash +gst-launch-1.0 libcamerasrc ! video/x-raw,width=1920,height=1080,framerate=30/1 ! queue ! videoconvert ! queue ! autovideosink +``` + + + +#### 录制视频 + +软件编码(x264enc)— 1080p: ```bash -sudo apt update -sudo apt install build-essential git pkg-config -y -sudo apt install meson ninja-build -y -sudo apt install python3-pip python3-yaml python3-jinja2 python3-ply python3-pyparsing -y -sudo apt install libyaml-dev libevent-dev -y -sudo apt install libudev-dev libgnutls28-dev openssl libexpat1-dev -y -sudo apt install libdrm-dev -y -sudo apt install libjpeg-dev -y -sudo apt install libglib2.0-dev -y -sudo apt install qt6-base-dev qt6-base-dev-tools qt6-wayland-dev -y -sudo apt install \ - qtbase5-dev \ - qtbase5-dev-tools \ - qtchooser \ - qt5-qmake \ - qttools5-dev \ - qtdeclarative5-dev \ - libqt5opengl5-dev \ - qml-module-qtquick-controls \ - libgles2-mesa-dev \ - qml-module-qtquick2 -y +gst-launch-1.0 -e libcamerasrc \ + ! videoconvert ! video/x-raw,format=I420,width=1920,height=1080,framerate=30/1 \ + ! x264enc bitrate=8000 speed-preset=fast \ + ! mp4mux ! filesink location=/tmp/camera-x264.mp4 ``` -### 编译安装 libcamera +硬件编码 H264(Venus)— 1080p: ```bash -git clone https://git.linuxtv.org/libcamera.git -cd libcamera -git checkout 02277d4c1a5ae7fee582f635936877435a12db64 # Optional. The following test steps are based on this version of libcamera. -meson setup build --wipe \ - -Dpipelines=simple \ - -Dcam=enabled \ - -Dgstreamer=disabled \ - -Dv4l2=enabled \ - -Dlc-compliance=disabled \ - -Dqcam=enabled -ninja -C build -j$(nproc) -sudo ninja -C build install -sudo ldconfig +gst-launch-1.0 -e libcamerasrc \ + ! videoconvert ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 \ + ! v4l2h264enc ! h264parse ! mp4mux \ + ! filesink location=/tmp/camera-h264.mp4 ``` -### 设置权限 +硬件编码 H265(Venus)— 1080p: ```bash -sudo chmod 666 /dev/dma_heap/* +gst-launch-1.0 -e libcamerasrc \ + ! videoconvert ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 \ + ! v4l2h265enc ! h265parse ! mp4mux \ + ! filesink location=/tmp/camera-h265.mp4 ``` -### 启动摄像头 +### 使用 libcamera + +#### 安装依赖 + + + +```bash +sudo apt install -y libcamera-tools gstreamer1.0-libcamera libcamera-ipa +``` + + -打开系统桌面终端,进入 libcamera 的 build 目录,启动 qcam。 +#### 预览摄像头 ```bash -cd libcamera/build/src/apps/qcam/ -./qcam --stream pixelformat=YUYV,width=1920,height=1080 +qcam --stream pixelformat=YUYV,width=1920,height=1080 ``` diff --git a/docs/dragon/q6a/accessories/camera-13m-214.md b/docs/dragon/q6a/accessories/camera-13m-214.md index 8b57148ed..9e288c36e 100644 --- a/docs/dragon/q6a/accessories/camera-13m-214.md +++ b/docs/dragon/q6a/accessories/camera-13m-214.md @@ -8,81 +8,99 @@ import Camera13M214 from '../../../common/accessories/\_camera-13m-214.mdx'; -## 预览摄像头 +## 使用摄像头 -使用 libcamera 预览摄像头画面。 +使用 GStreamer 或 libcamera 的 qcam 工具预览或录制摄像头画面。以下预览命令请在系统桌面终端中运行。 -### 安装依赖 +### 系统更新 + +进入 `Rsetup -> System -> System Update` 更新系统。 + +### 使用 GStreamer + +#### 安装依赖 + + + +```bash +sudo apt install -y \ + gstreamer1.0-tools \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad +``` + + + +#### 预览摄像头 + + + +```bash +gst-launch-1.0 libcamerasrc ! video/x-raw,width=1920,height=1080,framerate=30/1 ! queue ! videoconvert ! queue ! autovideosink +``` + + + +#### 录制视频 + +软件编码(x264enc)— 1080p: ```bash -sudo apt update -sudo apt install build-essential git pkg-config -y -sudo apt install meson ninja-build -y -sudo apt install python3-pip python3-yaml python3-jinja2 python3-ply python3-pyparsing -y -sudo apt install libyaml-dev libevent-dev -y -sudo apt install libudev-dev libgnutls28-dev openssl libexpat1-dev -y -sudo apt install libdrm-dev -y -sudo apt install libjpeg-dev -y -sudo apt install libglib2.0-dev -y -sudo apt install qt6-base-dev qt6-base-dev-tools qt6-wayland-dev -y -sudo apt install \ - qtbase5-dev \ - qtbase5-dev-tools \ - qtchooser \ - qt5-qmake \ - qttools5-dev \ - qtdeclarative5-dev \ - libqt5opengl5-dev \ - qml-module-qtquick-controls \ - libgles2-mesa-dev \ - qml-module-qtquick2 -y +gst-launch-1.0 -e libcamerasrc \ + ! videoconvert ! video/x-raw,format=I420,width=1920,height=1080,framerate=30/1 \ + ! x264enc bitrate=8000 speed-preset=fast \ + ! mp4mux ! filesink location=/tmp/camera-x264.mp4 ``` -### 编译安装 libcamera +硬件编码 H264(Venus)— 1080p: ```bash -git clone https://git.linuxtv.org/libcamera.git -cd libcamera -git checkout 02277d4c1a5ae7fee582f635936877435a12db64 # Optional. The following test steps are based on this version of libcamera. -meson setup build --wipe \ - -Dpipelines=simple \ - -Dcam=enabled \ - -Dgstreamer=disabled \ - -Dv4l2=enabled \ - -Dlc-compliance=disabled \ - -Dqcam=enabled -ninja -C build -j$(nproc) -sudo ninja -C build install -sudo ldconfig +gst-launch-1.0 -e libcamerasrc \ + ! videoconvert ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 \ + ! v4l2h264enc ! h264parse ! mp4mux \ + ! filesink location=/tmp/camera-h264.mp4 ``` -### 设置权限 +硬件编码 H265(Venus)— 1080p: ```bash -sudo chmod 666 /dev/dma_heap/* +gst-launch-1.0 -e libcamerasrc \ + ! videoconvert ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 \ + ! v4l2h265enc ! h265parse ! mp4mux \ + ! filesink location=/tmp/camera-h265.mp4 ``` -### 启动摄像头 +### 使用 libcamera + +#### 安装依赖 + + + +```bash +sudo apt install -y libcamera-tools gstreamer1.0-libcamera libcamera-ipa +``` + + -打开系统桌面终端,进入 libcamera 的 build 目录,启动 qcam。 +#### 预览摄像头 ```bash -cd libcamera/build/src/apps/qcam/ -./qcam --stream pixelformat=YUYV,width=1920,height=1080 +qcam --stream pixelformat=YUYV,width=1920,height=1080 ``` diff --git a/docs/dragon/q6a/accessories/camera-4k.md b/docs/dragon/q6a/accessories/camera-4k.md index 643d7a8c9..30f02589f 100644 --- a/docs/dragon/q6a/accessories/camera-4k.md +++ b/docs/dragon/q6a/accessories/camera-4k.md @@ -8,81 +8,99 @@ import Camera4K from '../../../common/accessories/\_camera-4k.mdx'; -## 预览摄像头 +## 使用摄像头 -使用 libcamera 预览摄像头画面。 +使用 GStreamer 或 libcamera 的 qcam 工具预览或录制摄像头画面。以下预览命令请在系统桌面终端中运行。 -### 安装依赖 +### 系统更新 + +进入 `Rsetup -> System -> System Update` 更新系统。 + +### 使用 GStreamer + +#### 安装依赖 + + + +```bash +sudo apt install -y \ + gstreamer1.0-tools \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad +``` + + + +#### 预览摄像头 + + + +```bash +gst-launch-1.0 libcamerasrc ! video/x-raw,width=1920,height=1080,framerate=30/1 ! queue ! videoconvert ! queue ! autovideosink +``` + + + +#### 录制视频 + +软件编码(x264enc)— 1080p: ```bash -sudo apt update -sudo apt install build-essential git pkg-config -y -sudo apt install meson ninja-build -y -sudo apt install python3-pip python3-yaml python3-jinja2 python3-ply python3-pyparsing -y -sudo apt install libyaml-dev libevent-dev -y -sudo apt install libudev-dev libgnutls28-dev openssl libexpat1-dev -y -sudo apt install libdrm-dev -y -sudo apt install libjpeg-dev -y -sudo apt install libglib2.0-dev -y -sudo apt install qt6-base-dev qt6-base-dev-tools qt6-wayland-dev -y -sudo apt install \ - qtbase5-dev \ - qtbase5-dev-tools \ - qtchooser \ - qt5-qmake \ - qttools5-dev \ - qtdeclarative5-dev \ - libqt5opengl5-dev \ - qml-module-qtquick-controls \ - libgles2-mesa-dev \ - qml-module-qtquick2 -y +gst-launch-1.0 -e libcamerasrc \ + ! videoconvert ! video/x-raw,format=I420,width=1920,height=1080,framerate=30/1 \ + ! x264enc bitrate=8000 speed-preset=fast \ + ! mp4mux ! filesink location=/tmp/camera-x264.mp4 ``` -### 编译安装 libcamera +硬件编码 H264(Venus)— 1080p: ```bash -git clone https://git.linuxtv.org/libcamera.git -cd libcamera -git checkout 02277d4c1a5ae7fee582f635936877435a12db64 # Optional. The following test steps are based on this version of libcamera. -meson setup build --wipe \ - -Dpipelines=simple \ - -Dcam=enabled \ - -Dgstreamer=disabled \ - -Dv4l2=enabled \ - -Dlc-compliance=disabled \ - -Dqcam=enabled -ninja -C build -j$(nproc) -sudo ninja -C build install -sudo ldconfig +gst-launch-1.0 -e libcamerasrc \ + ! videoconvert ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 \ + ! v4l2h264enc ! h264parse ! mp4mux \ + ! filesink location=/tmp/camera-h264.mp4 ``` -### 设置权限 +硬件编码 H265(Venus)— 1080p: ```bash -sudo chmod 666 /dev/dma_heap/* +gst-launch-1.0 -e libcamerasrc \ + ! videoconvert ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 \ + ! v4l2h265enc ! h265parse ! mp4mux \ + ! filesink location=/tmp/camera-h265.mp4 ``` -### 启动摄像头 +### 使用 libcamera + +#### 安装依赖 + + + +```bash +sudo apt install -y libcamera-tools gstreamer1.0-libcamera libcamera-ipa +``` + + -打开系统桌面终端,进入 libcamera 的 build 目录,启动 qcam。 +#### 预览摄像头 ```bash -cd libcamera/build/src/apps/qcam/ -./qcam --stream pixelformat=YUYV,width=1920,height=1080 +qcam --stream pixelformat=YUYV,width=1920,height=1080 ``` diff --git a/docs/dragon/q6a/accessories/camera-8m-219.md b/docs/dragon/q6a/accessories/camera-8m-219.md index a5998ef09..f0fe26ca3 100644 --- a/docs/dragon/q6a/accessories/camera-8m-219.md +++ b/docs/dragon/q6a/accessories/camera-8m-219.md @@ -8,124 +8,99 @@ import Camera8M219 from '../../../common/accessories/\_camera-8m-219.mdx'; -## 预览摄像头 +## 使用摄像头 -使用 libcamera 预览摄像头画面。 +使用 GStreamer 或 libcamera 的 qcam 工具预览或录制摄像头画面。以下预览命令请在系统桌面终端中运行。 -### 安装依赖 +### 系统更新 + +进入 `Rsetup -> System -> System Update` 更新系统。 + +### 使用 GStreamer + +#### 安装依赖 ```bash -sudo apt update -sudo apt install build-essential git pkg-config -y -sudo apt install meson ninja-build -y -sudo apt install python3-pip python3-yaml python3-jinja2 python3-ply python3-pyparsing -y -sudo apt install libyaml-dev libevent-dev -y -sudo apt install libudev-dev libgnutls28-dev openssl libexpat1-dev -y -sudo apt install libdrm-dev -y -sudo apt install libjpeg-dev -y -sudo apt install libglib2.0-dev -y -sudo apt install qt6-base-dev qt6-base-dev-tools qt6-wayland-dev -y -sudo apt install \ - qtbase5-dev \ - qtbase5-dev-tools \ - qtchooser \ - qt5-qmake \ - qttools5-dev \ - qtdeclarative5-dev \ - libqt5opengl5-dev \ - qml-module-qtquick-controls \ - libgles2-mesa-dev \ - qml-module-qtquick2 -y +sudo apt install -y \ + gstreamer1.0-tools \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad ``` -### 编译安装 libcamera +#### 预览摄像头 ```bash -git clone https://git.linuxtv.org/libcamera.git -cd libcamera -git checkout 02277d4c1a5ae7fee582f635936877435a12db64 # Optional. The following test steps are based on this version of libcamera. -meson setup build --wipe \ - -Dpipelines=simple \ - -Dcam=enabled \ - -Dgstreamer=disabled \ - -Dv4l2=enabled \ - -Dlc-compliance=disabled \ - -Dqcam=enabled -ninja -C build -j$(nproc) -sudo ninja -C build install -sudo ldconfig +gst-launch-1.0 libcamerasrc ! video/x-raw,width=1920,height=1080,framerate=30/1 ! queue ! videoconvert ! queue ! autovideosink ``` -### 修改配置文件 +#### 录制视频 -进入 `libcamera` 目录,修改 `libcamera/src/ipa/simple/data/imx219.yaml`文件。 +软件编码(x264enc)— 1080p: ```bash -cd libcamera -sudo nano src/ipa/simple/data/imx219.yaml +gst-launch-1.0 -e libcamerasrc \ + ! videoconvert ! video/x-raw,format=I420,width=1920,height=1080,framerate=30/1 \ + ! x264enc bitrate=8000 speed-preset=fast \ + ! mp4mux ! filesink location=/tmp/camera-x264.mp4 ``` -将下面内容复制到 `src/ipa/simple/data/imx219.yaml`文件。 +硬件编码 H264(Venus)— 1080p: + + ```bash -# SPDX-License-Identifier: CC0-1.0 -%YAML 1.1 ---- -version: 1 -algorithms: - - BlackLevel: - - Awb: - # 手动引导白平衡(非常重要) - gains: - red: 1.8 - green: 1.0 - blue: 1.4 - - Ccm: - ccms: - - ct: 6500 - ccm: [ - 1.35, -0.25, -0.10, - -0.10, 0.80, -0.10, - -0.05, -0.30, 1.35 - ] - - Agc: - # 防止自动曝光拉灰 - target: 0.55 - speed: 0.2 -... +gst-launch-1.0 -e libcamerasrc \ + ! videoconvert ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 \ + ! v4l2h264enc ! h264parse ! mp4mux \ + ! filesink location=/tmp/camera-h264.mp4 ``` -### 设置权限 + + +硬件编码 H265(Venus)— 1080p: ```bash -sudo chmod 666 /dev/dma_heap/* +gst-launch-1.0 -e libcamerasrc \ + ! videoconvert ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 \ + ! v4l2h265enc ! h265parse ! mp4mux \ + ! filesink location=/tmp/camera-h265.mp4 ``` -### 启动摄像头 +### 使用 libcamera + +#### 安装依赖 + + + +```bash +sudo apt install -y libcamera-tools gstreamer1.0-libcamera libcamera-ipa +``` + + -打开系统桌面终端,进入 libcamera 的 build 目录,启动 qcam。 +#### 预览摄像头 ```bash -cd libcamera/build/src/apps/qcam/ -./qcam --stream pixelformat=YUYV,width=1920,height=1080 +qcam --stream pixelformat=YUYV,width=1920,height=1080 ``` diff --git a/i18n/en/docusaurus-plugin-content-docs/current/dragon/q6a/accessories/camera-12m-577.md b/i18n/en/docusaurus-plugin-content-docs/current/dragon/q6a/accessories/camera-12m-577.md index b11aa3e29..cce21bbff 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/dragon/q6a/accessories/camera-12m-577.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/dragon/q6a/accessories/camera-12m-577.md @@ -8,81 +8,99 @@ import Camera12M577 from '../../../common/accessories/\_camera-12m-577.mdx'; -## Preview the camera +## Using the camera -Use libcamera to preview the camera image. +Use GStreamer or the libcamera qcam tool to preview or record the camera image. Run the following preview commands in the system desktop terminal. -### Install dependencies +### System update + +Go to `Rsetup -> System -> System Update` to update the system. + +### Using GStreamer + +#### Install dependencies + + + +```bash +sudo apt install -y \ + gstreamer1.0-tools \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad +``` + + + +#### Preview the camera + + + +```bash +gst-launch-1.0 libcamerasrc ! video/x-raw,width=1920,height=1080,framerate=30/1 ! queue ! videoconvert ! queue ! autovideosink +``` + + + +#### Record video + +Software encoding (x264enc) - 1080p: ```bash -sudo apt update -sudo apt install build-essential git pkg-config -y -sudo apt install meson ninja-build -y -sudo apt install python3-pip python3-yaml python3-jinja2 python3-ply python3-pyparsing -y -sudo apt install libyaml-dev libevent-dev -y -sudo apt install libudev-dev libgnutls28-dev openssl libexpat1-dev -y -sudo apt install libdrm-dev -y -sudo apt install libjpeg-dev -y -sudo apt install libglib2.0-dev -y -sudo apt install qt6-base-dev qt6-base-dev-tools qt6-wayland-dev -y -sudo apt install \ - qtbase5-dev \ - qtbase5-dev-tools \ - qtchooser \ - qt5-qmake \ - qttools5-dev \ - qtdeclarative5-dev \ - libqt5opengl5-dev \ - qml-module-qtquick-controls \ - libgles2-mesa-dev \ - qml-module-qtquick2 -y +gst-launch-1.0 -e libcamerasrc \ + ! videoconvert ! video/x-raw,format=I420,width=1920,height=1080,framerate=30/1 \ + ! x264enc bitrate=8000 speed-preset=fast \ + ! mp4mux ! filesink location=/tmp/camera-x264.mp4 ``` -### Build and install libcamera +Hardware encoding H264 (Venus) - 1080p: ```bash -git clone https://git.linuxtv.org/libcamera.git -cd libcamera -git checkout 02277d4c1a5ae7fee582f635936877435a12db64 # Optional. The following test steps are based on this version of libcamera. -meson setup build --wipe \ - -Dpipelines=simple \ - -Dcam=enabled \ - -Dgstreamer=disabled \ - -Dv4l2=enabled \ - -Dlc-compliance=disabled \ - -Dqcam=enabled -ninja -C build -j$(nproc) -sudo ninja -C build install -sudo ldconfig +gst-launch-1.0 -e libcamerasrc \ + ! videoconvert ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 \ + ! v4l2h264enc ! h264parse ! mp4mux \ + ! filesink location=/tmp/camera-h264.mp4 ``` -### Set permissions +Hardware encoding H265 (Venus) - 1080p: ```bash -sudo chmod 666 /dev/dma_heap/* +gst-launch-1.0 -e libcamerasrc \ + ! videoconvert ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 \ + ! v4l2h265enc ! h265parse ! mp4mux \ + ! filesink location=/tmp/camera-h265.mp4 ``` -### Start the camera +### Using libcamera + +#### Install dependencies + + + +```bash +sudo apt install -y libcamera-tools gstreamer1.0-libcamera libcamera-ipa +``` + + -Open the system desktop terminal, go to the libcamera build directory, and start qcam. +#### Preview the camera ```bash -cd libcamera/build/src/apps/qcam/ -./qcam --stream pixelformat=YUYV,width=1920,height=1080 +qcam --stream pixelformat=YUYV,width=1920,height=1080 ``` diff --git a/i18n/en/docusaurus-plugin-content-docs/current/dragon/q6a/accessories/camera-13m-214.md b/i18n/en/docusaurus-plugin-content-docs/current/dragon/q6a/accessories/camera-13m-214.md index 98cab47f4..43bc830f5 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/dragon/q6a/accessories/camera-13m-214.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/dragon/q6a/accessories/camera-13m-214.md @@ -8,81 +8,99 @@ import Camera13M214 from '../../../common/accessories/\_camera-13m-214.mdx'; -## Preview the camera +## Using the camera -Use libcamera to preview the camera image. +Use GStreamer or the libcamera qcam tool to preview or record the camera image. Run the following preview commands in the system desktop terminal. -### Install dependencies +### System update + +Go to `Rsetup -> System -> System Update` to update the system. + +### Using GStreamer + +#### Install dependencies + + + +```bash +sudo apt install -y \ + gstreamer1.0-tools \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad +``` + + + +#### Preview the camera + + + +```bash +gst-launch-1.0 libcamerasrc ! video/x-raw,width=1920,height=1080,framerate=30/1 ! queue ! videoconvert ! queue ! autovideosink +``` + + + +#### Record video + +Software encoding (x264enc) - 1080p: ```bash -sudo apt update -sudo apt install build-essential git pkg-config -y -sudo apt install meson ninja-build -y -sudo apt install python3-pip python3-yaml python3-jinja2 python3-ply python3-pyparsing -y -sudo apt install libyaml-dev libevent-dev -y -sudo apt install libudev-dev libgnutls28-dev openssl libexpat1-dev -y -sudo apt install libdrm-dev -y -sudo apt install libjpeg-dev -y -sudo apt install libglib2.0-dev -y -sudo apt install qt6-base-dev qt6-base-dev-tools qt6-wayland-dev -y -sudo apt install \ - qtbase5-dev \ - qtbase5-dev-tools \ - qtchooser \ - qt5-qmake \ - qttools5-dev \ - qtdeclarative5-dev \ - libqt5opengl5-dev \ - qml-module-qtquick-controls \ - libgles2-mesa-dev \ - qml-module-qtquick2 -y +gst-launch-1.0 -e libcamerasrc \ + ! videoconvert ! video/x-raw,format=I420,width=1920,height=1080,framerate=30/1 \ + ! x264enc bitrate=8000 speed-preset=fast \ + ! mp4mux ! filesink location=/tmp/camera-x264.mp4 ``` -### Build and install libcamera +Hardware encoding H264 (Venus) - 1080p: ```bash -git clone https://git.linuxtv.org/libcamera.git -cd libcamera -git checkout 02277d4c1a5ae7fee582f635936877435a12db64 # Optional. The following test steps are based on this version of libcamera. -meson setup build --wipe \ - -Dpipelines=simple \ - -Dcam=enabled \ - -Dgstreamer=disabled \ - -Dv4l2=enabled \ - -Dlc-compliance=disabled \ - -Dqcam=enabled -ninja -C build -j$(nproc) -sudo ninja -C build install -sudo ldconfig +gst-launch-1.0 -e libcamerasrc \ + ! videoconvert ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 \ + ! v4l2h264enc ! h264parse ! mp4mux \ + ! filesink location=/tmp/camera-h264.mp4 ``` -### Set permissions +Hardware encoding H265 (Venus) - 1080p: ```bash -sudo chmod 666 /dev/dma_heap/* +gst-launch-1.0 -e libcamerasrc \ + ! videoconvert ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 \ + ! v4l2h265enc ! h265parse ! mp4mux \ + ! filesink location=/tmp/camera-h265.mp4 ``` -### Start the camera +### Using libcamera + +#### Install dependencies + + + +```bash +sudo apt install -y libcamera-tools gstreamer1.0-libcamera libcamera-ipa +``` + + -Open the system desktop terminal, go to the libcamera build directory, and start qcam. +#### Preview the camera ```bash -cd libcamera/build/src/apps/qcam/ -./qcam --stream pixelformat=YUYV,width=1920,height=1080 +qcam --stream pixelformat=YUYV,width=1920,height=1080 ``` diff --git a/i18n/en/docusaurus-plugin-content-docs/current/dragon/q6a/accessories/camera-4k.md b/i18n/en/docusaurus-plugin-content-docs/current/dragon/q6a/accessories/camera-4k.md index 7a6d565c0..37e294f5d 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/dragon/q6a/accessories/camera-4k.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/dragon/q6a/accessories/camera-4k.md @@ -8,81 +8,99 @@ import Camera4K from '../../../common/accessories/\_camera-4k.mdx'; -## Preview the camera +## Using the camera -Use libcamera to preview the camera image. +Use GStreamer or the libcamera qcam tool to preview or record the camera image. Run the following preview commands in the system desktop terminal. -### Install dependencies +### System update + +Go to `Rsetup -> System -> System Update` to update the system. + +### Using GStreamer + +#### Install dependencies + + + +```bash +sudo apt install -y \ + gstreamer1.0-tools \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad +``` + + + +#### Preview the camera + + + +```bash +gst-launch-1.0 libcamerasrc ! video/x-raw,width=1920,height=1080,framerate=30/1 ! queue ! videoconvert ! queue ! autovideosink +``` + + + +#### Record video + +Software encoding (x264enc) - 1080p: ```bash -sudo apt update -sudo apt install build-essential git pkg-config -y -sudo apt install meson ninja-build -y -sudo apt install python3-pip python3-yaml python3-jinja2 python3-ply python3-pyparsing -y -sudo apt install libyaml-dev libevent-dev -y -sudo apt install libudev-dev libgnutls28-dev openssl libexpat1-dev -y -sudo apt install libdrm-dev -y -sudo apt install libjpeg-dev -y -sudo apt install libglib2.0-dev -y -sudo apt install qt6-base-dev qt6-base-dev-tools qt6-wayland-dev -y -sudo apt install \ - qtbase5-dev \ - qtbase5-dev-tools \ - qtchooser \ - qt5-qmake \ - qttools5-dev \ - qtdeclarative5-dev \ - libqt5opengl5-dev \ - qml-module-qtquick-controls \ - libgles2-mesa-dev \ - qml-module-qtquick2 -y +gst-launch-1.0 -e libcamerasrc \ + ! videoconvert ! video/x-raw,format=I420,width=1920,height=1080,framerate=30/1 \ + ! x264enc bitrate=8000 speed-preset=fast \ + ! mp4mux ! filesink location=/tmp/camera-x264.mp4 ``` -### Build and install libcamera +Hardware encoding H264 (Venus) - 1080p: ```bash -git clone https://git.linuxtv.org/libcamera.git -cd libcamera -git checkout 02277d4c1a5ae7fee582f635936877435a12db64 # Optional. The following test steps are based on this version of libcamera. -meson setup build --wipe \ - -Dpipelines=simple \ - -Dcam=enabled \ - -Dgstreamer=disabled \ - -Dv4l2=enabled \ - -Dlc-compliance=disabled \ - -Dqcam=enabled -ninja -C build -j$(nproc) -sudo ninja -C build install -sudo ldconfig +gst-launch-1.0 -e libcamerasrc \ + ! videoconvert ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 \ + ! v4l2h264enc ! h264parse ! mp4mux \ + ! filesink location=/tmp/camera-h264.mp4 ``` -### Set permissions +Hardware encoding H265 (Venus) - 1080p: ```bash -sudo chmod 666 /dev/dma_heap/* +gst-launch-1.0 -e libcamerasrc \ + ! videoconvert ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 \ + ! v4l2h265enc ! h265parse ! mp4mux \ + ! filesink location=/tmp/camera-h265.mp4 ``` -### Start the camera +### Using libcamera + +#### Install dependencies + + + +```bash +sudo apt install -y libcamera-tools gstreamer1.0-libcamera libcamera-ipa +``` + + -Open the system desktop terminal, go to the libcamera build directory, and start qcam. +#### Preview the camera ```bash -cd libcamera/build/src/apps/qcam/ -./qcam --stream pixelformat=YUYV,width=1920,height=1080 +qcam --stream pixelformat=YUYV,width=1920,height=1080 ``` diff --git a/i18n/en/docusaurus-plugin-content-docs/current/dragon/q6a/accessories/camera-8m-219.md b/i18n/en/docusaurus-plugin-content-docs/current/dragon/q6a/accessories/camera-8m-219.md index 1765fad21..259498ce8 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/dragon/q6a/accessories/camera-8m-219.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/dragon/q6a/accessories/camera-8m-219.md @@ -8,124 +8,99 @@ import Camera8M219 from '../../../common/accessories/\_camera-8m-219.mdx'; -## Preview the camera +## Using the camera -Use libcamera to preview the camera image. +Use GStreamer or the libcamera qcam tool to preview or record the camera image. Run the following preview commands in the system desktop terminal. -### Install dependencies +### System update + +Go to `Rsetup -> System -> System Update` to update the system. + +### Using GStreamer + +#### Install dependencies ```bash -sudo apt update -sudo apt install build-essential git pkg-config -y -sudo apt install meson ninja-build -y -sudo apt install python3-pip python3-yaml python3-jinja2 python3-ply python3-pyparsing -y -sudo apt install libyaml-dev libevent-dev -y -sudo apt install libudev-dev libgnutls28-dev openssl libexpat1-dev -y -sudo apt install libdrm-dev -y -sudo apt install libjpeg-dev -y -sudo apt install libglib2.0-dev -y -sudo apt install qt6-base-dev qt6-base-dev-tools qt6-wayland-dev -y -sudo apt install \ - qtbase5-dev \ - qtbase5-dev-tools \ - qtchooser \ - qt5-qmake \ - qttools5-dev \ - qtdeclarative5-dev \ - libqt5opengl5-dev \ - qml-module-qtquick-controls \ - libgles2-mesa-dev \ - qml-module-qtquick2 -y +sudo apt install -y \ + gstreamer1.0-tools \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad ``` -### Build and install libcamera +#### Preview the camera ```bash -git clone https://git.linuxtv.org/libcamera.git -cd libcamera -git checkout 02277d4c1a5ae7fee582f635936877435a12db64 # Optional. The following test steps are based on this version of libcamera. -meson setup build --wipe \ - -Dpipelines=simple \ - -Dcam=enabled \ - -Dgstreamer=disabled \ - -Dv4l2=enabled \ - -Dlc-compliance=disabled \ - -Dqcam=enabled -ninja -C build -j$(nproc) -sudo ninja -C build install -sudo ldconfig +gst-launch-1.0 libcamerasrc ! video/x-raw,width=1920,height=1080,framerate=30/1 ! queue ! videoconvert ! queue ! autovideosink ``` -### Modify configuration file +#### Record video -Enter the `libcamera` directory and edit `libcamera/src/ipa/simple/data/imx219.yaml`. +Software encoding (x264enc) - 1080p: ```bash -cd libcamera -sudo nano src/ipa/simple/data/imx219.yaml +gst-launch-1.0 -e libcamerasrc \ + ! videoconvert ! video/x-raw,format=I420,width=1920,height=1080,framerate=30/1 \ + ! x264enc bitrate=8000 speed-preset=fast \ + ! mp4mux ! filesink location=/tmp/camera-x264.mp4 ``` -Copy the following content into `src/ipa/simple/data/imx219.yaml`. +Hardware encoding H264 (Venus) - 1080p: + + ```bash -# SPDX-License-Identifier: CC0-1.0 -%YAML 1.1 ---- -version: 1 -algorithms: - - BlackLevel: - - Awb: - # Manual white balance guidance (important) - gains: - red: 1.8 - green: 1.0 - blue: 1.4 - - Ccm: - ccms: - - ct: 6500 - ccm: [ - 1.35, -0.25, -0.10, - -0.10, 0.80, -0.10, - -0.05, -0.30, 1.35 - ] - - Agc: - # Prevent grayish auto exposure - target: 0.55 - speed: 0.2 -... +gst-launch-1.0 -e libcamerasrc \ + ! videoconvert ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 \ + ! v4l2h264enc ! h264parse ! mp4mux \ + ! filesink location=/tmp/camera-h264.mp4 ``` -### Set permissions + + +Hardware encoding H265 (Venus) - 1080p: ```bash -sudo chmod 666 /dev/dma_heap/* +gst-launch-1.0 -e libcamerasrc \ + ! videoconvert ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 \ + ! v4l2h265enc ! h265parse ! mp4mux \ + ! filesink location=/tmp/camera-h265.mp4 ``` -### Start the camera +### Using libcamera + +#### Install dependencies + + + +```bash +sudo apt install -y libcamera-tools gstreamer1.0-libcamera libcamera-ipa +``` + + -Open the system desktop terminal, go to the libcamera build directory, and start qcam. +#### Preview the camera ```bash -cd libcamera/build/src/apps/qcam/ -./qcam --stream pixelformat=YUYV,width=1920,height=1080 +qcam --stream pixelformat=YUYV,width=1920,height=1080 ```