Loading [MathJax]/jax/output/CommonHTML/config.js
前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >全志V851S使用Tina-SDK支持MIPI摄像头方法教程及源码

全志V851S使用Tina-SDK支持MIPI摄像头方法教程及源码

作者头像
阿志小管家
发布于 2024-05-26 03:27:08
发布于 2024-05-26 03:27:08
17600
代码可运行
举报
运行总次数:0
代码可运行

使用Tina-SDK支持MIPI摄像头

使用Tina-SDK生成的镜像已经默认装载了GC2053的MIPI摄像头驱动,可以通过如下命令查看

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
root@TinaLinux:/# lsmod
Module                  Size  Used by
vin_v4l2              156643  0
gc2053_mipi             8567  0
vin_io                 21042  2 vin_v4l2,gc2053_mipi
videobuf2_v4l2          9304  1 vin_v4l2
videobuf2_dma_contig     8734  1 vin_v4l2
videobuf2_memops         948  1 videobuf2_dma_contig
videobuf2_core         21976  2 vin_v4l2,videobuf2_v4l2
xradio_wlan              598  0
xradio_core           430533  1 xradio_wlan
xradio_mac            221572  1 xradio_core

断电后,如下图所示将GC2053的MIPI摄像头连接到开发板上。注意一定需要断电后才能连接,否则会将摄像头烧坏。

使用camerademo测试MIPI摄像头驱动

获取camerademo的帮助,用户可以根据自己的需求选择对应参数

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
root@TinaLinux:/# camerademo -h
[CAMERA]**********************************************************
[CAMERA]*                                                        *
[CAMERA]*              this is camera test.                      *
[CAMERA]*                                                        *
[CAMERA]**********************************************************
[CAMERA]******************** camerademo help *********************
[CAMERA] This program is a test camera.
[CAMERA] It will query the sensor to support the resolution, output format and test frame rate.
[CAMERA] At the same time you can modify the data to save the path and get the number of photos.
[CAMERA] When the last parameter is debug, the output will be more detailed information
[CAMERA] There are eight ways to run:
[CAMERA]    1.camerademo --- use the default parameters.
[CAMERA]    2.camerademo debug --- use the default parameters and output debug information.
[CAMERA]    3.camerademo setting --- can choose the resolution and data format.
[CAMERA]    4.camerademo setting debug --- setting and output debug information.
[CAMERA]    5.camerademo NV21 640 480 30 bmp /tmp 5 --- param input mode,can save bmp or yuv.
[CAMERA]    6.camerademo NV21 640 480 30 bmp /tmp 5 debug --- output debug information.
[CAMERA]    7.camerademo NV21 640 480 30 bmp /tmp 5 Num --- /dev/videoNum param input mode,can save bmp or yuv.
[CAMERA]    8.camerademo NV21 640 480 30 bmp /tmp 5 Num debug --- /dev/videoNum output debug information.
[CAMERA]    8.camerademo NV21 640 480 30 bmp /tmp 5 Num 1 --- 1/2: chose memory: V4L2_MEMORY_MMAP/USERPTR
[CAMERA]**********************************************************

使用debug确定摄像头支持的参数配置

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
root@TinaLinux:/# camerademo debug
[CAMERA]**********************************************************
[CAMERA]*                                                        *
[CAMERA]*              this is camera test.                      *
[CAMERA]*                                                        *
[CAMERA]**********************************************************
[CAMERA]**********************************************************
[CAMERA] open /dev/video0!
[CAMERA]**********************************************************
[CAMERA_DEBUG] Querey device capabilities succeed
[CAMERA_DEBUG] cap.driver=sunxi-vin
[CAMERA_DEBUG] cap.card=sunxi-vin
[CAMERA_DEBUG] cap.bus_info=
[CAMERA_DEBUG] cap.version=0x00010000
[CAMERA_DEBUG] cap.capabilities=0x85201000
[CAMERA]**********************************************************
[CAMERA] The path to data saving is /tmp.
[CAMERA] The number of captured photos is 5.
[CAMERA] save bmp format
[CAMERA_DEBUG]******************[   63.469141] [VIN_ERR]vin is not support this pixelformat
********************************[   63.476141] [VIN_ERR]vin is not support this pixelformat
********
[CAMERA_DEBUG] enumera[   63.484878] [VIN_ERR]vin is not support this pixelformat
te image formats
[CAMERA_DEBUG][   63.493711] [VIN_ERR]vin is not support this pixelformat
 format index = 0, name = YUV422[   63.502495] [VIN_ERR]vin is not support this pixelformat
P
[CAMERA_DEBUG] format index =[   63.511287] [VIN_ERR]vin is not support this pixelformat
 1, name = NV16
[CAMERA_DEBUG] [   63.519961] [VIN_ERR]vin is not support this pixelformat
format index = 2, name = NV61
[[   63.528991] [VIN_ERR]vin is not support this pixelformat
CAMERA_DEBUG] format index = 3, [   63.537520] [VIN_ERR]vin is not support this pixelformat
name = YUV420
[CAMERA_DEBUG] fo[   63.546341] [VIN_ERR]vin is not support this pixelformat
rmat index = 4, name = YVU420
[[   63.555148] [VIN_ERR]vin is not support this pixelformat
CAMERA_DEBUG] format index = 5, [   63.564044] [VIN_ERR]vin is not support this pixelformat
name = NV12
[CAMERA_DEBUG] format index = 6, name = NV21
[CAMERA_DEBUG] format index = 7, name = BGGR8
[CAMERA_DEBUG] format index = 8, name = GBRG8
[CAMERA_DEBUG] format index = 9, name = GRBG8
[CAMERA_DEBUG] format index = 10, name = RGGB8
[CAMERA_DEBUG] format index = 11, name = BGGR10
[CAMERA_DEBUG] format index = 12, name = GBRG10
[CAMERA_DEBUG] format index = 13, name = GRBG10
[CAMERA_DEBUG] format index = 14, name = RGGB10
[CAMERA_DEBUG] format index = 15, name = BGGR12
[CAMERA_DEBUG] format index = 16, name = GBRG12
[CAMERA_DEBUG] format index = 17, name = GRBG12
[CAMERA_DEBUG] format index = 18, name = RGGB12
[CAMERA_DEBUG] format index = 19, name = YUYV
[CAMERA_DEBUG] format index = 20, name = UYVY
[CAMERA_DEBUG] format index = 21, name = VYUY
[CAMERA_DEBUG] format index = 22, name = YVYU
[CAMERA_DEBUG] format index = 23, name = YUYV
[CAMERA_DEBUG] format index = 24, name = UYVY
[CAMERA_DEBUG] format index = 25, name = VYUY
[CAMERA_DEBUG] format index = 26, name = YVYU
[CAMERA_DEBUG] format index = 27, name = UYVY
[CAMERA_DEBUG] format index = 28, name = VYUY
[CAMERA_DEBUG] format index = 29, name = YVYU
[CAMERA_DEBUG] format index = 30, name = YUYV
[CAMERA_DEBUG]*********************************************************
[CAMERA_DEBUG] The sensor supports the following formats :
[CAMERA_DEBUG] Index 0 : YUV422P.
[CAMERA_DEBUG] Index 1 : NV16.
[CAMERA_DEBUG] Index 2 : NV61.
[CAMERA_DEBUG] Index 3 : YUV420.
[CAMERA_DEBUG] Index 4 : YVU420.
[CAMERA_DEBUG] Index 5 : NV12.
[CAMERA_DEBUG] Index 6 : NV21.
[CAMERA_DEBUG] Index 7 : BGGR8.
[CAMERA_DEBUG] Index 8 : GBRG8.
[CAMERA_DEBUG] Index 9 : GRBG8.
[CAMERA_DEBUG] Index 10 : RGGB8.
[CAMERA_DEBUG] Index 11 : BGGR10.
[CAMERA_DEBUG] Index 12 : GBRG10.
[CAMERA_DEBUG] Index 13 : GRBG10.
[CAMERA_DEBUG] Index 14 : RGGB10.
[CAMERA_DEBUG] Index 15 : BGGR12.
[CAMERA_DEBUG] Index 16 : GBRG12.
[CAMERA_DEBUG] Index 17 : GRBG12.
[CAMERA_DEBUG] Index 18 : RGGB12.
[CAMERA_DEBUG] Index 19 : YUYV.
[CAMERA_DEBUG] Index 20 : UYVY.
[CAMERA_DEBUG] Index 21 : VYUY.
[CAMERA_DEBUG] Index 22 : YVYU.
[CAMERA_DEBUG] Index 23 : YUYV.
[CAMERA_DEBUG] Index 24 : UYVY.
[CAMERA_DEBUG] Index 25 : VYUY.
[CAMERA_DEBUG] Index 26 : YVYU.
[CAMERA_DEBUG] Index 27 : UYVY.
[CAMERA_DEBUG] Index 28 : VYUY.
[CAMERA_DEBUG] Index 29 : YVYU.
[CAMERA_DEBUG] Index 30 : YUYV.
[CAMERA_DEBUG]**********************************************************
[CAMERA_DEBUG] The YUV422P supports the following resolutions:
[CAMERA_DEBUG] Index 0 : 1920 * 1088
[CAMERA_DEBUG] Index 1 : 1920 * 1088
[CAMERA_DEBUG] Index 2 : 1920 * 1088
[CAMERA_DEBUG]**********************************************************
[CAMERA_DEBUG] The NV16 supports the following resolutions:
[CAMERA_DEBUG] Index 0 : 1920 * 1088
[CAMERA_DEBUG] Index 1 : 1920 * 1088
[CAMERA_DEBUG] Index 2 : 1920 * 1088
[CAMERA_DEBUG]**********************************************************
[CAMERA_DEBUG] The NV61 supports the following resolutions:
[CAMERA_DEBUG] Index 0 : 1920 * 1088
[CAMERA_DEBUG] Index 1 : 1920 * 1088
[CAMERA_DEBUG] Index 2 : 1920 * 1088
[CAMERA_DEBUG]**********************************************************
[CAMERA_DEBUG] The YUV420 supports the following resolutions:
[CAMERA_DEBUG] Index 0 : 1920 * 1088
[CAMERA_DEBUG] Index 1 : 1920 * 1088
[CAMERA_DEBUG] Index 2 : 1920 * 1088
[CAMERA_DEBUG]**********************************************************
[CAMERA_DEBUG] The YVU420 supports the following resolutions:
[CAMERA_DEBUG] Index 0 : 1920 * 1088
[CAMERA_DEBUG] Index 1 : 1920 * 1088
[CAMERA_DEBUG] Index 2 : 1920 * 1088
[CAMERA_DEBUG]**********************************************************
[CAMERA_DEBUG] The NV12 supports the following resolutions:
[CAMERA_DEBUG] Index 0 : 1920 * 1088
[CAMERA_DEBUG] Index 1 : 1920 * 1088
[CAMERA_DEBUG] Index 2 : 1920 * 1088
[CAMERA_DEBUG]**********************************************************
[CAMERA_DEBUG] The NV21 supports the following resolutions:
[CAMERA_DEBUG] Index 0 : 1920 * 1088
[CAMERA_DEBUG] Index 1 : 1920 * 1088
[CAMERA_DEBUG] Index 2 : 1920 * 1088
[CAMERA_DEBUG]**********************************************************

挂载TF卡分区

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
root@TinaLinux:/# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                16.8M     16.8M         0 100% /rom
devtmpfs                 26.0M         0     26.0M   0% /dev
tmpfs                    27.2M         0     27.2M   0% /tmp
/dev/by-name/rootfs_data
                         43.5M    136.0K     41.1M   0% /overlay
overlayfs:/overlay       43.5M    136.0K     41.1M   0% /
tmpfs                    27.2M         0     27.2M   0% /run
/dev/ubi0_6              29.9M     24.0K     28.3M   0% /mnt/UDISK
/dev/mmcblk0p1            3.7G    128.0K      3.7G   0% /mnt/extsd
root@TinaLinux:/# mount /dev/mmcblk0p1 /mnt/

使用GC2053所支持的参数拍摄五张照片,并存放到TF卡分区/mnt目录下

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
root@TinaLinux:/# camerademo NV21 1920 1088 30 bmp /mnt 5
[CAMERA]**********************************************************
[CAMERA]*                                                        *
[CAMERA]*              this is camera test.                      *
[CAMERA]*                                                        *
[CAMERA]**********************************************************
[CAMERA]**********************************************************
[CAMERA] open /dev/video0!
[CAMERA]**********************************************************
[CAMERA]**********************************************************
[CAMERA] The path to data saving is /mnt.
[CAMERA] The number of captured photos is 5.
[CAMERA] save bmp format
[   81.016864] [VIN_ERR]vin is not support this pixelformat
[   81.023161] [VIN_ERR]vin is not support this pixelformat
[   81.029406] [VIN_ERR]vin is not support this pixelformat
[   81.035712] [VIN_ERR]vin is not support this pixelformat
[   81.041841] [VIN_ERR]vin is not support this pixelformat
[   81.048112] [VIN_ERR]vin is not support this pixelformat
[   81.054244] [VIN_ERR]vin is not support this pixelformat
[   81.060641] [VIN_ERR]vin is not support this pixelformat
[   81.066969] [VIN_ERR]vin is not support this pixelformat
[   81.073229] [VIN_ERR]vin is not support this pixelformat
[   81.079441] [VIN_ERR]vin is not support this pixelformat
[   81.085738] [VIN_ERR]vin is not support this pixelformat
[CAMERA]**********************************************************
[CAMERA] Using format parameters NV21.
[CAMERA] camera pixelformat: NV21
[CAMERA] Resolution size : 1920 * 1088
[CAMERA] The photo save path is /mnt.
[CAMERA] The number of photos taken is 5.
begin ion_alloc_open
pid: 992, g_alloc_context = 0xb6f28f70
[CAMERA] Camera capture framerate is 20/1
[CAMERA] VIDIOC_S_FMT succeed
[CAMERA] fmt.type = 9
[CAMERA] fmt.fmt.pix_mp.width = 1920
[CAMERA] fmt.fmt.pix_mp.height = 1088
[CAMERA] fmt.fmt.pix_mp.pixelformat = NV21
[CAMERA] fmt.fmt.pix_mp.field = 1
[CAMERA] stream on succeed
[CAMERA] camera0 capture num is [0]
[CAMERA_PROMPT] the time interval from the start to the first frame is 178 ms
[CAMERA] camera0 capture num is [1]
[CAMERA] camera0 capture num is [2]
[CAMERA] camera0 capture num is [3]
[CAMERA] camera0 capture num is [4]
[CAMERA] Capture thread finish
[CAMERA] close /dev/video0
ion_alloc_close
pid: 992, release g_alloc_context = 0xb6f28f70

拍摄完成后,使用下面命令卸载分区,取下TF卡,使用读卡器即可在电脑端查看使用MIPI摄像头拍摄的照片

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
root@TinaLinux:/# umount /mnt/
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2024-05-20,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
暂无评论
推荐阅读
编辑精选文章
换一批
6.100ASK_V853-PRO开发板支持MIPI摄像头
• 使用过程中可简单的看成是vin 模块+ device 模块+af driver + flash 控制模块的方式;
韦东山
2023/05/23
1.2K0
6.100ASK_V853-PRO开发板支持MIPI摄像头
百问网全志V853开发板启动方式及基础功能测试详解
在后面的操作里,都是通过串口与板子进行“交流”。串口是串行接口的简称,是指数据一位一位地顺序传送,其特点是通信线路简单。
阿志小管家
2024/06/16
1680
百问网全志V853开发板启动方式及基础功能测试详解
全志Tina Linux Camera 摄像头模块开发指南 全网最详细版本支持百问网T113-Pro DongshanPI-NezhaD1-H DongshanPI-D1s V853-Pro等开发板
目前Tina 系统的各平台camera 硬件接口、linux 内核版本以及camera 驱动框架如下表所示:
韦东山
2022/12/28
4.7K0
全志Tina Linux Camera 摄像头模块开发指南 全网最详细版本支持百问网T113-Pro DongshanPI-NezhaD1-H DongshanPI-D1s V853-Pro等开发板
Linux MIPI CSI 开发指南
VIN 驱动可以分为 Kernel 层、Video Input Framework、Device Driver 层。
韦东山
2023/02/25
3.4K0
Linux MIPI CSI 开发指南
Linux应用开发【第七章】摄像头V4L2编程应用开发
​ Video for Linux two(Video4Linux2)简称V4L2,是V4L的改进版。V4L2是linux操作系统下一套用于采集图片、视频和音频数据的通用API接口,配合适当的视频采集设备和相应的驱动程序,可以实现图片、视频、音频等的采集。V4L2像一个优秀的快递员,将视频采集设备的图像数据安全、高效的传递给不同需求的用户。
韦东山
2021/12/15
2.6K0
Linux应用开发【第七章】摄像头V4L2编程应用开发
全志 芯片 Linux MIPI CSI摄像头接口开发指南 VIN DVP CSI MIPI V4l2
VIN 驱动可以分为 Kernel 层、Video Input Framework、Device Driver 层。
韦东山
2022/12/28
5.1K0
全志 芯片 Linux MIPI CSI摄像头接口开发指南 VIN DVP CSI MIPI V4l2
全志V851s、V853内g2d模块sample深究
g2d 主要功能: 1)旋转:支持90、180、270旋转; 2)镜像反转:H / V; 3) scale:放缩 4)格式转换:yuv 转 rgb 等,多种格式相互间转换; 5)透明叠加功能:实现两个rgb图片叠加; 6)矩形填充,等诸多功能;
阿志小管家
2024/02/02
3550
全志V851s、V853内g2d模块sample深究
vivi虚拟摄像头驱动程序
一、vivi虚拟摄像头驱动 基于V4L2(video for linux 2)摄像头驱动程序,我们减去不需要的ioctl_fops的函数,只增加ioctl函数增加的必要的摄像头流查询等函数; 1 #include <linux/module.h> 2 #include <linux/module.h> 3 #include <linux/delay.h> 4 #include <linux/errno.h> 5 #include <linux/fs.h> 6 #include <li
233333
2018/03/07
2.5K0
vivi虚拟摄像头驱动程序
Windows下使用QT+OpenCV完成人脸检测(获取摄像头的数据进行检测)_解决内存释放问题
上一版本的QT+OpenCV例子在这里:https://blog.csdn.net/xiaolong1126626497/article/details/105295367
DS小龙哥
2022/01/12
1.9K0
Windows下使用QT+OpenCV完成人脸检测(获取摄像头的数据进行检测)_解决内存释放问题
OpenCv4.4.0+Qt:摄像头控制
在上一篇中讲解了 OpenCv4.4.0+Qt5.12.2+OpenCv-Contrib-4.4.0 的 安装与测试例程,这篇中讲解摄像头的控制,摄像头列表的选择,参数控制,拍照,视频录制。
何其不顾四月天
2023/03/10
2.8K0
OpenCv4.4.0+Qt:摄像头控制
8. 100ASK_V853-PRO开发板支持MPP媒体处理平台
下载完成后,将sunxi-mpp.tar.gz压缩包放入虚拟机的任意目录,假设放在/home/book/workspaces目录下,
韦东山
2023/05/23
7890
8. 100ASK_V853-PRO开发板支持MPP媒体处理平台
全志D1-H (MQ-Pro)驱动 OV5640 摄像头
路径:lichee/linux-5.4/arch/riscv/boot/dts/sunxi/sun20iw1p1.dtsi
阿志小管家
2024/02/02
2530
全志D1-H (MQ-Pro)驱动 OV5640 摄像头
Tina-SDK开发
Tina-SDKV2.0源码网盘链接:https://pan.baidu.com/s/13uKlqDXImmMl9cgKc41tZg?pwd=qcw7
韦东山
2024/08/24
4350
Tina-SDK开发
基于C++(QT框架)设计的网络摄像头项目(支持跨平台运行)
这是基于C++(QT框架)设计的网络摄像头项目,本篇文章介绍的网络摄像头项目并不是采用RTMP或者RTSP推流编码的网络摄像头产品,而是采用HTTP协议推送图片流的方式,采用浏览器访问查看摄像头画面。
DS小龙哥
2022/01/12
2.7K1
基于C++(QT框架)设计的网络摄像头项目(支持跨平台运行)
libudev+V4L2 linux usb摄像头列表发现以及热拔插事件
最近工作计划本来是重写CameraCtrl 控制类以及实现推流。但是由于需求变动导致之前调研废弃,就暂时放这吧。
何其不顾四月天
2023/03/10
2.9K0
全志V853平台Camera模块开发框架详解
VIN是全志基于linux 内核v4l2 框架实现自己Soc 的camera 驱动框架。
阿志小管家
2024/02/02
6630
全志V853平台Camera模块开发框架详解
Jetson TX1开发笔记(六):V4L2+OpenCV3.1以MJPG格式读取USB摄像头图像并实时显示
本文介绍了如何使用Jetson TX1开发板通过V4L2和OpenCV3.1实现USB摄像头图像的采集和实时显示。首先介绍了V4L2的基础知识和摄像头驱动配置,然后介绍了OpenCV的图像解码和显示功能。最后,通过具体的示例代码展示了如何编译和运行程序,并总结了程序的结果。
Jack_Cui
2018/01/08
4.8K0
Jetson TX1开发笔记(六):V4L2+OpenCV3.1以MJPG格式读取USB摄像头图像并实时显示
全志D1-H开发板USB摄像头拍照Demo
D1-H哪吒开发板上有一个USB Host接口(即电脑上那种插鼠标键盘的USB口),同时D1-H Tina Linux支持UVC(USB Video Class,USB视频类),这样D1-H就具备了开发和使用USB摄像头的软硬件条件。
阿志小管家
2024/03/05
3300
全志D1-H开发板USB摄像头拍照Demo
FFMPEG音频视频开发:QT获取Android、Linux、Windows系统上的摄像头数据帧与声卡音频通过FFMPEG编码为MP4存储(v1.0)
声卡: win10 电脑自带声卡、罗技USB摄像头声卡、Android手机自带声卡都可以获取声音数据 摄像头: 手机摄像头、罗技USB摄像头
DS小龙哥
2022/01/12
1.8K0
FFMPEG音频视频开发:QT获取Android、Linux、Windows系统上的摄像头数据帧与声卡音频通过FFMPEG编码为MP4存储(v1.0)
7.100ASK_V853-PRO开发板支持人形检测和人脸识别
将上述资源包下载完成解压后,把示例程序100ASK_viplite-driver放在Ubuntu中的任意目录中。假设我放在/home/book/workspaces目录下,下面为人形识别和人脸识别应用程序的目录结构。
韦东山
2023/05/23
5940
7.100ASK_V853-PRO开发板支持人形检测和人脸识别
推荐阅读
相关推荐
6.100ASK_V853-PRO开发板支持MIPI摄像头
更多 >
领券
💥开发者 MCP广场重磅上线!
精选全网热门MCP server,让你的AI更好用 🚀
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
本文部分代码块支持一键运行,欢迎体验
本文部分代码块支持一键运行,欢迎体验