Difference between revisions of "Template:Linux-RK3399MIPICamera"
From FriendlyELEC WiKi
(updated by API) |
(→Linux下使用MIPI摄像头OV13850) |
||
Line 1: | Line 1: | ||
− | === | + | ===Work with MIPI Camera OV13850 Under Linux=== |
− | + | Hardware Setting: | |
− | + | The present Linux kernel only supports '''MIPI-CSI1''' so a camera module can only be connected to a MIPI-CSI1 port and here is the hardware setting:<br /> | |
{{#switch: {{{1}}} | {{#switch: {{{1}}} | ||
| NanoPC-T4 = | | NanoPC-T4 = | ||
Line 17: | Line 17: | ||
--> | --> | ||
− | + | FriendlyELEC provides a test script "gst-camera.sh" to test a camera's functions. You can run it in a commandline to test picture taking and video recording. You can install the script by running the following command: | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
sudo wget http://112.124.9.243:8888/rk3399/gst-camera.sh -O `which gst-camera.sh` | sudo wget http://112.124.9.243:8888/rk3399/gst-camera.sh -O `which gst-camera.sh` |
Revision as of 01:04, 16 November 2018
1 Work with MIPI Camera OV13850 Under Linux
Hardware Setting:
The present Linux kernel only supports MIPI-CSI1 so a camera module can only be connected to a MIPI-CSI1 port and here is the hardware setting:
FriendlyELEC provides a test script "gst-camera.sh" to test a camera's functions. You can run it in a commandline to test picture taking and video recording. You can install the script by running the following command:
sudo wget http://112.124.9.243:8888/rk3399/gst-camera.sh -O `which gst-camera.sh`
1.1 gst-camera.sh 参数说明
参数 功能 --index或-i 选择要使用的摄像头的序号,可选值为0和1,当同时连接两个摄像头时,指定为1表示要操作第二个摄像头 --mode或-m 指定摄像头的分辨率,比如720P 30FPS 则使用参数为 width=1280,height=720,framerate=30/1 --action或-a 指定命令要执行的动作,可选参数为: preview、photo和video,分别对应预览、拍照和录像 --output或-o 指定输出的文件名,用于拍照和录像时指定输出文件名 --verbose或-v 指定为yes时,会输出调用gst-launch-1.0命令的完整命令行
1.2 gst-camera.sh 使用方法
- 预览图像
gst-camera.sh --action preview
- 拍照
用以下命令拍照一张照片,存储为文件 1.jpg:
gst-camera.sh --action photo -output 1.jpg
- 录像并预览
用以下命令启动边预览边录像,存储为视频文件 1.ts,录像时使用了硬件编码:
gst-camera.sh --action video -output 1.ts
- 显示完整的命令
加入 --verbose yes 的参数,会显示最终的 gsteamer 命令,例如:
gst-camera.sh --action video --output 1.ts --verbose yes
你会得到以下完整的 gsteamer 命令,这对你开发会有帮助:
gst-launch-1.0 rkisp num-buffers=512 io-mode=4 path-iqf=/etc/cam_iq/ov13850.xml \ ! video/x-raw,format=NV12,width=1280,height=720,framerate=30/1 \ ! tee name=t t. ! queue ! kmssink t. ! queue ! mpph264enc \ ! queue ! h264parse ! mpegtsmux ! filesink location=1.ts