linux搭建摄像头,Linux环境下配置虚拟摄像头akvcam
Linux环境下配置虚拟摄像头akvcam
下载源码
git clone https://github.com/webcamoid/akvcam.git
编译&安装
cd akvcam/src
make
sudo make dkms_install
确认是否安装驱动成功,如果有文件,则安装驱动成功
ls /lib/modules/$(uname -r)/extra/akvcam.ko*
可以使用如下命令卸载驱动
sudo make dkms_uninstall
配置虚拟摄像头
修改配置文件
sudo mkdir -p /etc/akvcam
sudo touch /etc/akvcam/config.ini
sudo chmod -vf 644 /etc/akvcam/config.ini
修改/etc/akvcam/config.ini,内容如下:
# Virtual camera configuration file example.
#
# Please, read the instructions to the end.
[Cameras]
# First at all you must define how many virtual cameras will be created.
cameras/size = 2
# Then, define it‘s properties.
#
# A virtual camera can be of 2 types: ‘capture‘ and ‘output‘.
# A ‘capture‘ device will be seen as a normal webcam by any webcam capture
# program.
# A ‘output‘ device will receive frames from a producer program and send it to
# one or many ‘capture‘ devices.
#
# A camera can have also 3 capture/output modes: ‘mmap‘, ‘userptr‘ and ‘rw‘.
# ‘mmap‘ is the most widely supported mode by far, enabling this is more than
# enough in most cases. ‘rw‘ allow you to "echo" or "cat" frames as raw data
# directly to the device using the default frame format. Enabling ‘rw‘ mode will
# disable emulated camera controls in the ‘capture‘ device (brightness,
# contrast, saturation, etc.).
# A device can support all 3 modes at same time.
#
# ‘formats‘ is a comma separated list of index in the format list bellow.
#
# It‘s also possible to set the device number by setting the ‘videonr‘ property,
# if for example videonr=7 the the device will be created as "/dev/video7".
# If ‘videonr‘ is already taken, negative or not set, the driver will assign the
# first free device number.
cameras/1/type = output
cameras/1/mode = mmap, userptr, rw
cameras/1/description = Virtual Camera (output device)
cameras/1/formats = 2
cameras/1/videonr = 7
cameras/2/type = capture
cameras/2/mode = mmap, rw
cameras/2/description = Virtual Camera
cameras/2/formats = 1, 2
[Formats]
# Define how many formats will be supported by the camera.
formats/size = 2
# Now define the frame pixel formats, resolutions and frame rates supported by
# the camera.
#
# Supported capture formats:
#
# RGB32
# RGB24
# RGB16
# RGB15
# BGR32
# BGR24
# UYVY
# YUY2
#
# Supported output formats:
#
# RGB24
# BGR24
#
# YUY2 640x480 is one of the most widely supported formats in webcam capture
# programs. First format defined is the default frame format for
# ‘capture‘/‘output‘.
# ‘width‘, ‘height‘ and ‘fps‘ are unsigned integers.
formats/1/format = YUY2
formats/1/width = 640
formats/1/height = 480
formats/1/fps = 30
# The parameters can also be specified as a comma separated list, so it‘s
# possible to combine the parameters to define several formats in one group.
# ‘fps‘ can also be defined as a fraction.
# The following lines will define 4 formats:
#
# RGB24 640x480 20 FPS
# RGB24 640x480 7.5 FPS
# YUY2 640x480 20 FPS
# YUY2 640x480 7.5 FPS
formats/2/format = RGB24, YUY2
formats/2/width = 640
formats/2/height = 480
formats/2/fps = 20/1, 15/2
# Finally, to create a fully working virtual camera, you must connect one
# ‘output‘ to one or many ‘capture‘ devices.
# Connections are made by index, separated by a colon. The first index is the
# ‘output‘ device, the following index are ‘capture‘ devices.
[Connections]
connections/size = 1
connections/1/connection = 1:2
# You can also define a default frame when a ‘capture‘ device is not receiving
# any input. Only 24 bpp and 32 bpp BMP files are supported.
[General]
# 修改此处的图片路径,只能是BMP格式的图片
default_frame = /etc/akvcam/default_frame.bmp
# This config will take effect on modprobe/insmod.
调试驱动
sudo modprobe akvcam loglevel=7
用法和例子
在前面的驱动和配置文件正常的情况下,使用如下命令加载驱动:
cd akvcam/src
sudo modprobe videodev
# 先卸载,再安装
sudo rmmod akvcam.ko
sudo insmod akvcam.ko
到此处已经虚拟摄像头已经配置好了,打开相机应用查看是否生效,
开机加载(非必需步骤)
要在启动时加载模块,请创建一个/etc/modules-load.d/akvcam.conf文件,然后在其中写入akvcam:
echo akvcam > /etc/modules-load.d/akvcam.conf
原文:https://www.cnblogs.com/Hiraly/p/14638342.html
linux搭建摄像头,Linux环境下配置虚拟摄像头akvcam相关推荐
- linux环境下配置虚拟主机域名
linux环境下面配置虚拟主机域名 第一步: 在root目录下面(即根目录) ls(查看文件) cd进入etc目录 find hosts文件 vi hosts 打开hosts文件并进行编辑 在打开的文 ...
- linux tbb 安装_Linux环境下配置Google Test、TBB、OpenMP和OpenCV
最近逐渐把开发环境从Windows转到Linux下,原因是Visual Studio提供的环境太庞大,总感觉看不到全貌,并且对于C++11的支持实在是太慢了.而在Linux下,有非常大的选择空间,编辑 ...
- LAMP环境下配置虚拟主机和域名的跳转
一.配置虚拟主机 vim /usr/local/apache2/conf/extra/httpd-vhost.conf <VirtualHost *:80> ServerAdmin ...
- linux环境下配置虚拟主机域名,Linux下三种虚拟主机的配置方法
1:基于相同IP不同Port的虚拟主机 vim /etc/httpd/conf/httpd.conf 更改Listen字段(此设置表示使用80以及8888端口) 更改虚拟主机部分为: 保存以上设置 创 ...
- 【OS】Linux环境下配置固定IP地址--静态IP地址(不能上外网问题)
[OS]Linux环境下配置固定IP地址--静态IP地址(不能上外网问题) ---red hat重启网卡 service network restart /etc/rc.d/init.d/networ ...
- linux 环境下配置ftp服务器
之前写了 linux 环境下安装和配置mysql数据库以及远程登录,以及linux 环境下配置python虚拟环境,这一篇记录一下 linux系统中如何安装配置 ftp . 安装ftp // ...
- linux websphere 端口号,Linux环境下配置websphere7.0的一些命令
Linux环境下配置websphere7.0的一些命令! 1.创建概要文件 通过命令行建立Dmgr服务器,进入${WAS_Home}/bin目录,运行 ./manageprofiles.sh -cre ...
- Linux离线安装NTP服务,内网环境下配置本地时间同步
参考文章:Linux离线安装NTP服务,无外网环境下配置本地时间同步 | 航行学园 1.常用命令 rpm -qa | grep ntp #查询已安装的ntp版本信息等 rpm -e --nodeps ...
- 阿里云ECS服务器Linux环境下配置php服务器(三)--项目部署篇
在前两篇里,我们分别介绍了如何购买阿里云服务器,安装基本软件和配置(请看阿里云ECS服务器Linux环境下配置php服务器(一)--基础配置篇) 以及如何安装使用phpMyAdmin(请看阿里云ECS ...
- 【PHP】linux搭建PHP运行环境
[PHP]linux搭建PHP运行环境 之前在windows下写了hello world,终归是不够用啊,因为开发环境是Linux,怎么办呢~~~学习学习再学习 写在前面的话:我从百度文库的一个文章里 ...
最新文章
- 物联网安全的后备计划是什么?
- 邓海建:让网约车成为智慧城市的“老司机”
- DNS协议详解及报文格式分析
- SCCM2012升级SP1系列之配置管理SCCM2012①发现和管理SCCM2012客户端
- Fiddler建好代理后,能连到手机,但手机不能上网了,求破有果
- fopen在linux中打开文件夹,plain C:用fopen()打开一个目录
- 2011年9月19日 面试重点:asp.net运行原理和生命周期
- Redmine for windows 一键安装
- oracle查看角色内容,oracle创建,查看用户和角色,用户角色赋权
- YARN REST API
- Redis Info命令陈述
- 分析vue-cli@2.9.3 搭建的webpack项目工程 1
- 通过duet软件实现ipad作为mac的副屏并修改分辨率
- ArcGIS API For JavaScript 利用GP服务生成等值线、等值面(一)之生成等值线
- 贪心 汽车加油 java_贪心算法-汽车加油
- 数据库用户配额问题ORA-01536: space quota exceeded for tablespace 'TFR_DATA' #
- 计算机专业考研英语二国家线,考研英语二国家线多少,2020年考研英语国家线多少?...
- 前端需要懂的 APP 容器原理
- 串ababaaababaa的next和串ababaabab的nextval
- html制作美容热点产品,美容热点产品.html