[go: up one dir, main page]

CN106790612B - Dynamic virtual camera mapping method and system - Google Patents

Dynamic virtual camera mapping method and system Download PDF

Info

Publication number
CN106790612B
CN106790612B CN201611250836.2A CN201611250836A CN106790612B CN 106790612 B CN106790612 B CN 106790612B CN 201611250836 A CN201611250836 A CN 201611250836A CN 106790612 B CN106790612 B CN 106790612B
Authority
CN
China
Prior art keywords
server
client
camera
module
usb
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201611250836.2A
Other languages
Chinese (zh)
Other versions
CN106790612A (en
Inventor
董立武
杨进
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Jieyun Zhilian Technology Co ltd
Original Assignee
Shenzhen Jieyun Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Jieyun Technology Co ltd filed Critical Shenzhen Jieyun Technology Co ltd
Priority to CN201611250836.2A priority Critical patent/CN106790612B/en
Publication of CN106790612A publication Critical patent/CN106790612A/en
Application granted granted Critical
Publication of CN106790612B publication Critical patent/CN106790612B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/66Remote control of cameras or camera parts, e.g. by remote control devices
    • H04N23/661Transmitting camera control signals through networks, e.g. control via the Internet

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Studio Devices (AREA)

Abstract

The invention provides a dynamic virtual camera mapping method and a system, wherein the method comprises the following steps: the server side and the client side establish communication connection; the server detects whether the server is connected with the USB camera equipment or not, and when the server detects that the USB camera equipment is connected, the server sends the insertion information of the camera equipment and the attribute information of the camera equipment to the client; after receiving insertion information and attribute information of camera equipment sent by a server, a client adds a video conversion format supported by the server to the attribute information, and combines and stores the video conversion format into equipment description information; the USB virtual bus module creates virtual camera equipment corresponding to the camera equipment according to the equipment description information; the camera application module uses the corresponding USB camera equipment through the virtual camera equipment. The dynamic virtual camera mapping method provided by the invention dynamically maps the USB camera equipment to another host machine for use in a virtual camera mode, keeps the consistency of attribute information such as the equipment name, the equipment PID, the VID and the like of the camera, and has good compatibility and convenient use.

Description

一种动态虚拟摄像头映射方法和系统A dynamic virtual camera mapping method and system

技术领域technical field

本发明涉及计算机信息技术领域,特别涉及一种动态虚拟摄像头映射方法和系统。The invention relates to the technical field of computer information, in particular to a dynamic virtual camera mapping method and system.

背景技术Background technique

随着计算机信息技术的发展,逐渐出现了一种使用远程摄像头设备的场景,就是通过一台本地终端设备,将连接在终端上的USB摄像头设备,映射给远程主机使用,远程主机中的摄像头应用软件能像使用本地设备一样,使用终端上的USB摄像头设备,这种应用方式被称为USB摄像头映射。With the development of computer information technology, a scenario of using a remote camera device has gradually emerged, that is, through a local terminal device, the USB camera device connected to the terminal is mapped to the remote host for use. The camera application in the remote host The software can use the USB camera device on the terminal like a local device. This application method is called USB camera mapping.

目前大多数虚拟摄像头技术,只会在远程主机中虚拟出永久的、具有固定属性的虚拟摄像头设备,不能动态的适应终端上实际安装的摄像头设备的属性参数,例如设备的名称、PID、VID等信息,导致和这些信息绑定的摄像头专用应用程序无法识别虚拟摄像头,从而无法兼容使用,在实际使用中很不方便。At present, most virtual camera technologies only virtualize permanent virtual camera devices with fixed properties in the remote host, and cannot dynamically adapt to the property parameters of the camera devices actually installed on the terminal, such as the device name, PID, VID, etc. information, the camera-specific application bound with this information cannot recognize the virtual camera, so it cannot be used compatibly, and it is very inconvenient in actual use.

例如,公开号为CN104199723A的专利,提供了一种基于虚拟设备的摄像头映射方法,使得用户应用程序可以如本地操作摄像头一样操作虚拟摄像头。但是其不能获取本地摄像头的物理属性信息,同时在Windows系统中创建与所述物理属性信息相该同的虚拟摄像头来实现映射;因此兼容性差,某些专用的摄像头应用软件不能使用。For example, the patent with the publication number of CN104199723A provides a camera mapping method based on a virtual device, so that the user application can operate the virtual camera as if it were operating the camera locally. However, it cannot obtain the physical property information of the local camera, and at the same time, a virtual camera with the same physical property information is created in the Windows system to realize the mapping; therefore, the compatibility is poor, and some dedicated camera application software cannot be used.

发明内容SUMMARY OF THE INVENTION

针对以上问题,本发明专利目的在于设计了一种动态虚拟摄像头映射方法和系统,将USB摄像头设备以虚拟摄像头的方式动态地在映射到另一台主机上使用,一方面由于虚拟摄像头设备保持了和USB摄像头相同的设备名称、PID和VID等属性信息,从而确保了和应用模块的良好兼容性,另一方面可以根据网络带宽选择需要的视频转化格式,方便不同场景的使用。In view of the above problems, the purpose of the patent of the present invention is to design a dynamic virtual camera mapping method and system, which dynamically maps the USB camera device to another host in the form of a virtual camera. The same device name, PID and VID attribute information as the USB camera ensures good compatibility with the application module. On the other hand, the required video conversion format can be selected according to the network bandwidth, which is convenient for use in different scenarios.

本发明具体的技术方案如下:The concrete technical scheme of the present invention is as follows:

一种动态虚拟摄像头映射方法,包括:A dynamic virtual camera mapping method, comprising:

步骤S101,服务端和客户端建立通讯连接;Step S101, the server and the client establish a communication connection;

步骤S102,服务端检测其是否连接有USB摄像头设备,当检查到连接有USB摄像头设备时,向客户端发送摄像头设备的插入信息以及摄像头设备的属性信息,所述属性信息包括设备名称、设备PID和设备VID;Step S102, the server detects whether it is connected with a USB camera device, and when it is detected that the USB camera device is connected, sends the insertion information of the camera device and the attribute information of the camera device to the client, the attribute information includes the device name, device PID and device VID;

步骤S103,客户端在接收到服务端发送的摄像头设备的插入信息和属性信息后,将服务端支持的视频转化格式并添加到所述属性信息中,合并保存为设备描述信息;Step S103, after receiving the insertion information and attribute information of the camera device sent by the server, the client adds the video conversion format supported by the server to the attribute information, and merges and saves it as device description information;

步骤S104,客户端向USB虚拟总线模块发送所述摄像头设备的插入消息和所述设备描述信息,USB虚拟总线模块根据所述设备描述信息创建与所述摄像头设备对应的虚拟摄像头设备;Step S104, the client sends the insertion message of the camera device and the device description information to the USB virtual bus module, and the USB virtual bus module creates a virtual camera device corresponding to the camera device according to the device description information;

步骤S105,摄像头应用模块通过所述虚拟摄像头设备使用对应的USB摄像头设备;Step S105, the camera application module uses the corresponding USB camera device through the virtual camera device;

步骤S106,当移除USB摄像头设备时,服务端将通知客户端和USB虚拟总线模块根据所述摄像头设备对应的属性信息自动删除对应的虚拟摄像头设备;具体包括:Step S106, when removing the USB camera device, the server will notify the client and the USB virtual bus module to automatically delete the corresponding virtual camera device according to the attribute information corresponding to the camera device; specifically including:

当移除摄像头设备时,服务端将自动检查到USB摄像头设备的移除信息,并向所述客户端发送所述移除信息和所述摄像头设备对应的属性信息;When removing the camera device, the server will automatically check the removal information of the USB camera device, and send the removal information and the attribute information corresponding to the camera device to the client;

客户端接收到所述移除信息后,向USB虚拟总线模块发送所述移除信息和对应的所述属性信息;After receiving the removal information, the client sends the removal information and the corresponding attribute information to the USB virtual bus module;

USB虚拟总线模块在接收到所述移除信息和属性信息后,根据所述属性信息删除对应的虚拟摄像头设备。After receiving the removal information and the attribute information, the USB virtual bus module deletes the corresponding virtual camera device according to the attribute information.

进一步,本发明所述摄像头应用模块通过所述虚拟摄像头设备使用对应的USB摄像头设备,具体包括:Further, the camera application module of the present invention uses the corresponding USB camera device through the virtual camera device, specifically including:

虚拟摄像头设备将请求视频数据的请求消息经USB虚拟设备总线发送给客户端,所述请求消息包括摄像头设备的属性信息和所请求的视频格式;The virtual camera device sends a request message for requesting video data to the client via the USB virtual device bus, where the request message includes attribute information of the camera device and the requested video format;

客户端将所述请求消息发送给服务端,服务端在收到所述请求消息后,获取对应的USB摄像头设备的视频数据;The client sends the request message to the server, and the server obtains the video data of the corresponding USB camera device after receiving the request message;

服务端接收到USB摄像头设备的视频数据后将所述视频数据发送给客户端,客户端收到所述视频数据后,将视频数据经USB虚拟总线和虚拟摄像头设备发送给所述摄像头应用模块。After receiving the video data of the USB camera device, the server sends the video data to the client. After receiving the video data, the client sends the video data to the camera application module via the USB virtual bus and the virtual camera device.

进一步,本发明所述服务端接收到USB摄像头设备的视频数据后将所述视频数据发送给客户端,进一步包括:Further, after receiving the video data of the USB camera device, the server of the present invention sends the video data to the client, further comprising:

所述服务端根据客户端请求的视频格式,决定是否需要执行视频格式转换;如果服务端获取的视频数据的视频格式与客户端所请求的格式一致,服务端直接将所述视频数据发送到客户端;如果获取的视频数据的视频格式与请求的格式不一致,服务端将所述视频数据转化为客户端所请求的格式后,再发送给客户端。The server determines whether to perform video format conversion according to the video format requested by the client; if the video format of the video data obtained by the server is consistent with the format requested by the client, the server directly sends the video data to the client. If the video format of the acquired video data is inconsistent with the requested format, the server will convert the video data into the format requested by the client, and then send it to the client.

进一步,本发明所述服务端和客户端建立通讯连接,具体包括:Further, the establishment of a communication connection between the server and the client according to the present invention specifically includes:

客户端初始化运行,并根据配置的服务端的地址,发起连接请求,如果连接成功,客户端和服务端建立持久化的通讯连接;如果连接失败,客户端每隔一段时间尝试重复发起连接请求;The client runs initially and initiates a connection request according to the configured server address. If the connection is successful, the client and the server establish a persistent communication connection; if the connection fails, the client attempts to repeat the connection request every once in a while;

服务端初始化运行,并根据配置的客户端的地址,发起连接请求,如果连接成功,客户端和服务端建立持久化的通讯连接;如果连接失败,服务端进入侦听状态,等待客户端发起所述的连接请求。The server initializes and runs, and initiates a connection request according to the configured client address. If the connection is successful, the client and the server establish a persistent communication connection; if the connection fails, the server enters the listening state and waits for the client to initiate the connection request.

一种动态虚拟摄像头映射系统,包括服务端模块、客户端模块、USB虚拟总线模块、虚拟摄像头设备模块;A dynamic virtual camera mapping system, comprising a server module, a client module, a USB virtual bus module, and a virtual camera device module;

所述服务端模块用于检测其是否连接有USB摄像头设备,当检查到连接有摄像头设备时,向客户端模块发送摄像头设备的插入信息以及摄像头设备的属性信息,所述属性信息包括设备名称、设备PID和设备VID;The server module is used to detect whether it is connected with a USB camera device. When it is detected that the camera device is connected, it sends the insertion information of the camera device and the attribute information of the camera device to the client module. The attribute information includes the device name, device PID and device VID;

所述客户端模块用于在接收到服务端发送的摄像头设备的插入信息和属性信息后,获取所述服务端支持的视频转化格式并添加到所述属性信息中,合并保存为设备描述信息;以及向USB虚拟总线模块发送所述摄像头设备的插入消息和所述设备描述信息;The client module is configured to obtain the video conversion format supported by the server and add it to the attribute information after receiving the insertion information and attribute information of the camera device sent by the server, and merge and save it as device description information; And sending the insertion message of the camera device and the device description information to the USB virtual bus module;

所述USB虚拟总线模块用于根据所述设备描述信息创建与所述摄像头设备对应的虚拟摄像头设备模块。The USB virtual bus module is configured to create a virtual camera device module corresponding to the camera device according to the device description information.

进一步,本发明所述服务端模块和客户端模块进一步包括:当移除USB摄像头设备时,服务端模块将通知客户端模块和USB虚拟总线模块根据所述摄像头设备对应的属性信息自动删除对应的虚拟摄像头设备。Further, the server module and the client module of the present invention further include: when the USB camera device is removed, the server module will notify the client module and the USB virtual bus module to automatically delete the corresponding attribute information according to the corresponding attribute information of the camera device. Virtual camera device.

进一步,本发明所述摄像头应用模块进一步包括:Further, the camera application module of the present invention further includes:

所述摄像头应用模块将请求视频数据的请求消息经USB虚拟总线模块发送给客户端模块,所述请求消息包括摄像头设备的属性信息和所请求的视频格式;The camera application module sends a request message for requesting video data to the client module via the USB virtual bus module, where the request message includes attribute information of the camera device and the requested video format;

客户端模块将所述请求消息发送给服务端模块,服务端模块在收到所述请求消息后,获取对应的USB摄像头设备的视频数据;The client module sends the request message to the server module, and the server module obtains the video data of the corresponding USB camera device after receiving the request message;

服务端模块接收到USB摄像头设备的视频数据后将所述视频数据发送给客户端模块,客户端模块收到所述视频数据后,将视频数据发送给所述摄像头应用模块After receiving the video data of the USB camera device, the server module sends the video data to the client module, and after receiving the video data, the client module sends the video data to the camera application module

本发明提供的动态虚拟摄像头映射方法实现了虚拟摄像头设备的动态创建和移除,同时保持和实际摄像头的设备名称、PID、VID一致;一方面可以最大限度的兼容USB摄像头专用的应用程序,另一方面可以根据网络质量选择合适的视频传输格式,适用范围广。The dynamic virtual camera mapping method provided by the present invention realizes the dynamic creation and removal of virtual camera devices, and at the same time keeps the device name, PID and VID of the actual camera consistent; On the one hand, the appropriate video transmission format can be selected according to the network quality, which has a wide range of applications.

附图说明Description of drawings

以下参照附图对本发明实施例作进一步说明,其中:The embodiments of the present invention will be further described below with reference to the accompanying drawings, wherein:

图1是本发明一种动态虚拟摄像头映射方法的流程图;Fig. 1 is the flow chart of a kind of dynamic virtual camera mapping method of the present invention;

图2是本发明一种动态虚拟摄像头映射系统的模块图。FIG. 2 is a block diagram of a dynamic virtual camera mapping system of the present invention.

具体实施方式Detailed ways

下面结合附图和具体实施例对本发明作进一步的详细说明。The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

本发明提出了一种动态虚拟摄像头映射方法,该方法将连接在A主机上的USB摄像头设备,通过网络映射到另一台B主机中作为虚拟摄像头使用,并保持虚拟摄像头与A主机上的USB摄像头设备的名称、PID、VID等基本设备属性不变。该方法具体包括:The present invention proposes a dynamic virtual camera mapping method. The method maps the USB camera device connected on the A host to another B host through the network as a virtual camera, and keeps the virtual camera and the USB on the A host. The basic device attributes such as the name, PID, and VID of the camera device remain unchanged. Specifically, the method includes:

A主机和B主机之间建立持久化的通讯消息传输通道;A persistent communication message transmission channel is established between host A and host B;

B主机能动态发现A主机上摄像头设备插入和移除的事件;Host B can dynamically discover the events of camera device insertion and removal on host A;

当检测到A主机有摄像头设备插入事件,B主机通过A主机获取USB摄像头设备的属性,并且在B主机中创建一个设备名称、PID、VID相同的虚拟摄像头设备;When detecting that there is a camera device insertion event in host A, host B obtains the properties of the USB camera device through host A, and creates a virtual camera device with the same device name, PID, and VID in host B;

当B主机中的摄像头应用模块打开虚拟摄像头设备时,B主机向A主机发送视频流请求消息,其中包括视频编码格式参数;当A主机收到B主机的视频流请求消息时,将按照相应的视频编码格式要求,将对应的USB摄像头设备视频数据发送给B主机;When the camera application module in host B opens the virtual camera device, host B sends a video stream request message to host A, including video encoding format parameters; when host A receives the video stream request message from host B, it will follow the corresponding Video encoding format requirements, send the corresponding USB camera device video data to B host;

当A主机检测到有摄像头设备移除事件,A主机将通知B主机删除对应的虚拟摄像头设备。When host A detects a camera device removal event, host A will notify host B to delete the corresponding virtual camera device.

请参阅图1,本实施例具体包括如下步骤:Please refer to FIG. 1, this embodiment specifically includes the following steps:

步骤S101,A主机上的服务端和B主机上的客户端建立通讯连接。Step S101, the server on the A host establishes a communication connection with the client on the B host.

具体包括:Specifically include:

客户端初始化运行,并根据配置的服务端的地址,发起连接请求,如果连接成功,客户端和服务端建立持久化的通讯连接;如果连接失败,客户端每隔一段时间尝试重复发起连接请求;The client runs initially and initiates a connection request according to the configured server address. If the connection is successful, the client and the server establish a persistent communication connection; if the connection fails, the client attempts to repeat the connection request every once in a while;

服务端初始化运行,并根据配置的客户端的地址,发起连接请求,如果连接成功,客户端和服务端建立持久化的通讯连接;如果连接失败,服务端进入侦听状态,等待客户端发起所述的连接请求。The server initializes and runs, and initiates a connection request according to the configured client address. If the connection is successful, the client and the server establish a persistent communication connection; if the connection fails, the server enters the listening state and waits for the client to initiate the connection request.

步骤S102,服务端检测其是否连接有USB摄像头设备,当检查到连接有摄像头设备时,向客户端发送摄像头设备的插入信息以及摄像头设备的属性信息,所述属性信息包括设备名称、设备PID和设备VID。Step S102, the server detects whether it is connected with a USB camera device, and when it detects that the camera device is connected, sends the insertion information of the camera device and the attribute information of the camera device to the client, the attribute information includes the device name, device PID and Device VID.

步骤S103,客户端在接收到服务端发送的摄像头设备的插入信息和属性信息后,将所述服务端支持的视频转化格式,合并保存为设备描述信息。具体的,例如USB摄像头设备支持YUV的视频数据格式,但是服务端既支持YUV转H.264,也支持YUV转MJPG格式,客户端将把MJPG和H.264的视频格式属性添加到设备描述信息中保存,代表该虚拟摄像头设备可以提供YUV、H.264和MJPG的视频数据格式。Step S103, after receiving the insertion information and attribute information of the camera device sent by the server, the client converts the video format supported by the server into a combined format and saves it as device description information. Specifically, for example, a USB camera device supports the YUV video data format, but the server supports both YUV to H.264 and YUV to MJPG formats. The client will add the video format attributes of MJPG and H.264 to the device description information. It means that the virtual camera device can provide video data formats of YUV, H.264 and MJPG.

步骤S104,客户端向USB虚拟总线模块发送所述摄像头设备的设备描述信息,USB虚拟总线模块根据所述设备描述信息创建与所述摄像头设备对应的虚拟摄像头设备。Step S104, the client sends the device description information of the camera device to the USB virtual bus module, and the USB virtual bus module creates a virtual camera device corresponding to the camera device according to the device description information.

步骤S105,摄像头应用模块通过使用所述虚拟摄像头设备使用USB摄像头设备。Step S105, the camera application module uses the USB camera device by using the virtual camera device.

虚拟摄像头设备创建完成后,B主机上的摄像头应用模块就可以使用虚拟摄像头设备,具体包括:After the virtual camera device is created, the camera application module on host B can use the virtual camera device, including:

运行在B主机上的摄像头应用模块通过USB设备读写接口打开虚拟摄像头设备,摄像头应用模块通过USB虚拟总线模块将请求视频数据的请求消息发送给客户端,所述请求消息包括摄像头设备的属性信息和所请求的视频格式;The camera application module running on the B host opens the virtual camera device through the USB device read-write interface, and the camera application module sends a request message requesting video data to the client through the USB virtual bus module, and the request message includes the attribute information of the camera device. and the requested video format;

客户端将所述请求消息发送给服务端,服务端在收到所述请求消息后,通过USB设备读写接口读取对应的USB摄像头设备的视频数据;The client sends the request message to the server, and after receiving the request message, the server reads the video data of the corresponding USB camera device through the USB device read-write interface;

服务端接收到USB摄像头设备的视频数据后将所述视频数据发送给客户端,客户端收到所述视频数据后,将视频数据经USB虚拟总线模块和虚拟摄像头设备模块后,发送给所述摄像头应用模块。After receiving the video data of the USB camera device, the server sends the video data to the client. After receiving the video data, the client sends the video data to the USB virtual bus module and the virtual camera device module. Camera application module.

所述服务端根据客户端请求的视频格式,决定是否需要执行视频格式转换;如果服务端获取的视频数据的视频格式与客户端所请求的格式一致,服务端直接将所述视频数据发送到客户端;如果获取的视频数据的视频格式与请求的格式不一致,服务端将所述视频数据转化为客户端所请求的格式后,再发送给客户端。The server determines whether to perform video format conversion according to the video format requested by the client; if the video format of the video data obtained by the server is consistent with the format requested by the client, the server directly sends the video data to the client. If the video format of the acquired video data is inconsistent with the requested format, the server will convert the video data into the format requested by the client, and then send it to the client.

步骤S106,当移除摄像头设备时,服务端将通知客户端和USB虚拟总线模块根据所述摄像头设备对应的属性信息自动删除对应的虚拟摄像头设备。Step S106, when the camera device is removed, the server will notify the client and the USB virtual bus module to automatically delete the corresponding virtual camera device according to the attribute information corresponding to the camera device.

具体的,当在A主机上移除USB摄像头设备时,服务端将自动检查到USB摄像头设备的移除信息,并向所述客户端发送所述移除信息和所述摄像头设备对应的属性信息,所述属性信息包括设备名称、设备PID和设备VID;Specifically, when the USB camera device is removed from the host A, the server will automatically check the removal information of the USB camera device, and send the removal information and the attribute information corresponding to the camera device to the client , the attribute information includes device name, device PID and device VID;

客户端接收到所述移除信息后,向USB虚拟总线模块发送所述移除信息和对应的所述属性信息;After receiving the removal information, the client sends the removal information and the corresponding attribute information to the USB virtual bus module;

USB虚拟总线模块在接收到所述移除信息和属性信息后,根据所述属性信息删除对应的虚拟摄像头设备。After receiving the removal information and the attribute information, the USB virtual bus module deletes the corresponding virtual camera device according to the attribute information.

一种动态虚拟摄像头映射系统,请参阅图2,本实施例包括服务端模块、客户端模块、USB虚拟总线模块、虚拟摄像头设备模块和摄像头应用模块。A dynamic virtual camera mapping system, please refer to FIG. 2, this embodiment includes a server module, a client module, a USB virtual bus module, a virtual camera device module and a camera application module.

服务端模块安装在A主机上,可以检测A主机上的USB摄像头设备的插入和移除事件,并且通过USB接口读写摄像头设备;The server module is installed on the A host, which can detect the insertion and removal events of the USB camera device on the A host, and read and write the camera device through the USB interface;

客户端模块安装在B主机上,与服务端模块建立通讯连接;The client module is installed on the B host and establishes a communication connection with the server module;

USB虚拟总线模块安装在B主机上,,可以模拟物理USB总线的运作机制,可以创建和移除虚拟摄像头设备;The USB virtual bus module is installed on the B host, which can simulate the operation mechanism of the physical USB bus, and can create and remove virtual camera devices;

所述虚拟摄像头模块安装在B主机,是指摄像头的设备程序,包含虚拟摄像头设备读写接口的驱动程序;The virtual camera module is installed on the B host, and refers to the device program of the camera, including the driver of the virtual camera device read-write interface;

摄像头应用模块安装在B主机,是指使用所述USB摄像头设备的应用程序。The camera application module is installed on the B host, and refers to the application program using the USB camera device.

所述服务端模块用于检测其是否连接有USB摄像头设备,当检查到连接有摄像头设备时,向客户端模块发送摄像头设备的插入信息以及摄像头设备的属性信息,所述属性信息包括设备名称、设备PID和设备VID;The server module is used to detect whether it is connected with a USB camera device. When it is detected that the camera device is connected, it sends the insertion information of the camera device and the attribute information of the camera device to the client module. The attribute information includes the device name, device PID and device VID;

所述客户端模块用于在接收到服务端模块发送的USB摄像头设备的插入信息和属性信息后,将所述服务端模块支持的视频转化格式,合并保存为设备描述信息;以及向USB虚拟总线模块发送所述摄像头设备的插入信息和设备描述信息,The client module is used to convert the video format supported by the server module into device description information after receiving the insertion information and attribute information of the USB camera device sent by the server module; The module sends the insertion information and device description information of the camera device,

所述USB虚拟总线模块用于根据所述设备描述信息创建与所述USB摄像头设备对应的虚拟摄像头设备模块。The USB virtual bus module is configured to create a virtual camera device module corresponding to the USB camera device according to the device description information.

进一步,本发明所述服务端模块和客户端模块进一步包括:当移除USB摄像头设备时,服务端模块将通知客户端模块和USB虚拟总线模块根据所述摄像头设备对应的属性信息自动删除对应的虚拟摄像头设备。具体的,当在A主机上移除USB摄像头设备时,服务端模块将自动检查到USB摄像头设备的移除信息,并向所述客户端模块发送所述移除信息和所述摄像头设备对应的属性信息,所述属性信息包括设备名称、设备PID和设备VID;客户端模块接收到所述移除信息后,向USB虚拟总线模块发送所述移除信息和对应的所述属性信息;USB虚拟总线模块在接收到所述移除信息和属性信息后,根据所述属性信息删除对应的虚拟摄像头设备。Further, the server module and the client module of the present invention further include: when the USB camera device is removed, the server module will notify the client module and the USB virtual bus module to automatically delete the corresponding attribute information according to the corresponding attribute information of the camera device. Virtual camera device. Specifically, when the USB camera device is removed from the host A, the server module will automatically check the removal information of the USB camera device, and send the removal information and the corresponding camera device to the client module. attribute information, the attribute information includes device name, device PID and device VID; after receiving the removal information, the client module sends the removal information and the corresponding attribute information to the USB virtual bus module; the USB virtual After receiving the removal information and the attribute information, the bus module deletes the corresponding virtual camera device according to the attribute information.

进一步,本发明所述虚拟摄像头设备模块在B主机上运行,提供包含USB摄像头设备读写接口的驱动程序,进一步包括:Further, the virtual camera device module of the present invention runs on the B host, and provides a driver that includes a USB camera device read-write interface, further comprising:

所述摄像头应用模块将请求视频数据的请求消息经虚拟摄像头设备模块和USB虚拟总线模块发送给客户端模块,所述请求消息包括摄像头设备的属性信息和所请求的视频格式;The camera application module sends a request message for requesting video data to the client module via the virtual camera device module and the USB virtual bus module, where the request message includes attribute information of the camera device and the requested video format;

客户端模块将所述请求消息发送给服务端模块,服务端模块在收到所述请求消息后,获取对应的USB摄像头设备的视频数据;The client module sends the request message to the server module, and the server module obtains the video data of the corresponding USB camera device after receiving the request message;

服务端模块接收到USB摄像头设备的视频数据后将所述视频数据发送给客户端模块,客户端模块收到所述视频数据后,将视频数据经USB虚拟总线模块和虚拟摄像头设备模块发送给所述摄像头应用模块。After the server module receives the video data of the USB camera device, it sends the video data to the client module. After the client module receives the video data, it sends the video data to the client module through the USB virtual bus module and the virtual camera device module. The camera application module described above.

以上所述本发明的具体实施方式,并不构成对本发明保护范围的限定。任何根据本发明的技术构思所做出的各种其他相应的改变与变形,均应包含在本发明权利要求的保护范围内。The specific embodiments of the present invention described above do not limit the protection scope of the present invention. Any other corresponding changes and modifications made according to the technical concept of the present invention shall be included in the protection scope of the claims of the present invention.

Claims (6)

1. A dynamic virtual camera mapping method is characterized by comprising the following steps:
step S101, a server and a client establish communication connection;
step S102, a server detects whether a USB camera device is connected, and when the USB camera device is detected to be connected, the server sends insertion information of the camera device and attribute information of the camera device to a client, wherein the attribute information comprises a device name, a device PID and a device VID;
step S103, after receiving the insertion information and the attribute information of the camera equipment sent by the server, the client adds the video conversion format supported by the server to the attribute information, and combines and stores the video conversion format as equipment description information;
step S104, the client sends the insertion information of the camera equipment and the equipment description information to a USB virtual bus module, and the USB virtual bus module creates virtual camera equipment corresponding to the camera equipment according to the equipment description information;
step S105, the camera application module uses the corresponding USB camera device through the virtual camera device, and specifically includes: the virtual camera equipment sends a request message for requesting video data to a client through a USB virtual equipment bus, wherein the request message comprises attribute information of the camera equipment and a requested video format; the client sends the request message to the server, and the server acquires video data of corresponding USB camera equipment after receiving the request message; the server side sends the video data to the client side after receiving the video data of the USB camera equipment, and the client side sends the video data to the camera application module through the USB virtual bus and the virtual camera equipment after receiving the video data;
the server sends the video data to the client after receiving the video data of the USB camera device, and the method further comprises the following steps: the server side determines whether video format conversion needs to be executed or not according to the video format requested by the client side; if the video format of the video data acquired by the server is consistent with the format requested by the client, the server directly sends the video data to the client; and if the video format of the acquired video data is inconsistent with the requested format, the server side converts the video data into the format requested by the client side and then sends the format to the client side.
2. The dynamic virtual camera mapping method according to claim 1, wherein the method further comprises:
step S106, when the USB camera equipment is removed, the server side informs the client side and the USB virtual bus module to automatically delete the corresponding virtual camera equipment according to the attribute information corresponding to the camera equipment; the method specifically comprises the following steps:
when the camera equipment is removed, the server side automatically checks the removal information of the USB camera equipment and sends the removal information and the attribute information corresponding to the camera equipment to the client side;
after receiving the removal information, the client sends the removal information and the corresponding attribute information to a USB virtual bus module;
and after receiving the removal information and the attribute information, the USB virtual bus module deletes the corresponding virtual camera equipment according to the attribute information.
3. The dynamic virtual camera mapping method according to claim 1, wherein the establishing of the communication connection between the server and the client specifically includes:
the client side initializes operation and initiates a connection request according to the configured address of the server side, if the connection is successful, the client side and the server side establish persistent communication connection; if the connection fails, the client terminal tries to repeatedly initiate a connection request at intervals;
the server side initializes operation and initiates a connection request according to the configured address of the client side, if the connection is successful, the client side and the server side establish persistent communication connection; if the connection fails, the server enters an interception state and waits for the client to initiate the connection request.
4. A dynamic virtual camera mapping system is characterized by comprising a server module, a client module, a USB virtual bus module and a virtual camera equipment module;
the server module is used for detecting whether the USB camera equipment is connected with the server module, and when the camera equipment is detected to be connected with the server module, the server module sends insertion information of the camera equipment and attribute information of the camera equipment to the client module, wherein the attribute information comprises an equipment name, an equipment PID (proportion integration differentiation) and an equipment VID (video identifier);
the client module is used for acquiring a video conversion format supported by the server and adding the video conversion format to the attribute information after receiving the insertion information and the attribute information of the camera equipment sent by the server, and merging and storing the video conversion format into equipment description information; sending the insertion information of the camera equipment and the equipment description information to a USB virtual bus module;
the USB virtual bus module is used for creating a virtual camera equipment module corresponding to the USB camera equipment according to the equipment description information;
the system operating according to the method of any one of claims 1-3.
5. The dynamic virtual camera mapping system of claim 4, wherein the server module and the client module further comprise: when the USB camera equipment is removed, the server module informs the client module and the USB virtual bus module to automatically delete the corresponding virtual camera equipment according to the attribute information corresponding to the camera equipment.
6. The dynamic virtual camera mapping system according to claim 4, wherein the camera application module further comprises:
the camera application module sends a request message for requesting video data to the client module through the USB virtual bus module, wherein the request message comprises attribute information of camera equipment and a requested video format;
the client module sends the request message to the server module, and the server module acquires video data of corresponding USB camera equipment after receiving the request message;
the server module receives video data of the USB camera equipment and then sends the video data to the client module, and the client module receives the video data and then sends the video data to the camera application module.
CN201611250836.2A 2016-12-30 2016-12-30 Dynamic virtual camera mapping method and system Expired - Fee Related CN106790612B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611250836.2A CN106790612B (en) 2016-12-30 2016-12-30 Dynamic virtual camera mapping method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611250836.2A CN106790612B (en) 2016-12-30 2016-12-30 Dynamic virtual camera mapping method and system

Publications (2)

Publication Number Publication Date
CN106790612A CN106790612A (en) 2017-05-31
CN106790612B true CN106790612B (en) 2020-07-31

Family

ID=58928137

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611250836.2A Expired - Fee Related CN106790612B (en) 2016-12-30 2016-12-30 Dynamic virtual camera mapping method and system

Country Status (1)

Country Link
CN (1) CN106790612B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107544298B (en) * 2017-06-27 2019-11-29 新华三云计算技术有限公司 A kind of camera call method and device
CN109756620B (en) * 2018-12-15 2021-07-23 深圳壹账通智能科技有限公司 Mobile phone-based virtual camera recognition method and related equipment
CN110493203A (en) * 2019-07-31 2019-11-22 湖南微算互联信息技术有限公司 A kind of cloud cell-phone camera head controlling method, system, device and storage medium
CN112099642A (en) * 2020-08-18 2020-12-18 西安万像电子科技有限公司 Remote mapping method and device for HID (high intensity discharge) equipment
CN114201249B (en) * 2020-09-17 2025-04-01 中兴通讯股份有限公司 Video device redirection method, client, virtual machine desktop and storage medium
CN115119003A (en) * 2022-05-16 2022-09-27 澳克多普有限公司 Application method and system of virtual camera in live broadcast room
CN116347015B (en) * 2023-05-26 2023-10-20 深圳市拔超科技股份有限公司 System and method for smooth switching based on multiple USB cameras
CN118972695A (en) * 2024-10-16 2024-11-15 天津卓朗昆仑云软件技术有限公司 Camera interaction method, system and server

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1801124A (en) * 2004-12-31 2006-07-12 联想(北京)有限公司 Video frequency data acquisition method employing mobile phone with camera as computer camera
CN101035039A (en) * 2007-04-20 2007-09-12 福建升腾资讯有限公司 USB mapping method
CN104199723A (en) * 2014-09-09 2014-12-10 福建升腾资讯有限公司 Camera mapping method based on virtual equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1801124A (en) * 2004-12-31 2006-07-12 联想(北京)有限公司 Video frequency data acquisition method employing mobile phone with camera as computer camera
CN101035039A (en) * 2007-04-20 2007-09-12 福建升腾资讯有限公司 USB mapping method
CN104199723A (en) * 2014-09-09 2014-12-10 福建升腾资讯有限公司 Camera mapping method based on virtual equipment

Also Published As

Publication number Publication date
CN106790612A (en) 2017-05-31

Similar Documents

Publication Publication Date Title
CN106790612B (en) Dynamic virtual camera mapping method and system
CN103124275B (en) A kind of method and apparatus obtaining file
CN104683434B (en) Network system keeps connection method, communication means, electronic equipment, keeps Connection Service device, application server, program
CN103533034A (en) Method for seamlessly using cloud terminal local camera in VDI (Virtual Device Interface) virtual desktop
CN103595760A (en) File picture sharing method based on cloud
CN105915628A (en) Mobile phone system remote-controlled debugging method, mobile phone system remote-controlled debugging system and mobile phone system remote-controlled debugging device
CN102752364A (en) Data transmission method and device
CN115484258B (en) Peripheral device processing method based on cloud desktop, electronic device and storage medium
CN105828094B (en) A smart TV-based private cloud system and its implementation method
US20160142778A1 (en) Network camera, network camera control terminal, and video recording/delivering system
CN113038192A (en) Video processing method and device, electronic equipment and storage medium
CN108737484B (en) Media data storage method and system
CN104639501B (en) A kind of method of data stream transmitting, equipment and system
JP6665190B2 (en) Network sharing implementation method and apparatus
CN102546803B (en) Remote desktop communication method based on capability set
CN110781014A (en) Multi-process distribution method and system for recording data based on Android device
CN103560933B (en) Method, device and system for displayer-free image intercepting or/and recording
CN103973772B (en) File read/write method and device
CN104581367A (en) Method and device for sharing multimedia content
CN103763610A (en) Redirection method and device for remote desktop
CN105657451B (en) Uploaded videos file is carried out at the same time the method and system of transcoding
CN103067438A (en) Network storage system, data manipulation method in network storage system, and storage device
CN106649528A (en) Picture writing and reading methods and devices
CN104714760A (en) Method and device for reading and writing storage devices
CN107733947A (en) Image acquiring method, apparatus and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20210108

Address after: 518052 12a, unit 3, building 2, Wanghai Yiyuan, No. 100, Nantou street, Honghuayuan community, Nantou street, Nanshan District, Shenzhen City, Guangdong Province

Patentee after: Shenzhen Jieyun Zhilian Technology Co.,Ltd.

Address before: 518000 room 609, 6 / F, Section 1, building 25, industrial building, science and Technology Park, high tech Zone, Nanshan District, Shenzhen City, Guangdong Province

Patentee before: SHENZHEN JIEYUN TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20200731

CF01 Termination of patent right due to non-payment of annual fee