CN109640056B - USB camera monitoring system and method based on Android platform - Google Patents

USB camera monitoring system and method based on Android platform Download PDF

Info

Publication number
CN109640056B
CN109640056B CN201811619815.2A CN201811619815A CN109640056B CN 109640056 B CN109640056 B CN 109640056B CN 201811619815 A CN201811619815 A CN 201811619815A CN 109640056 B CN109640056 B CN 109640056B
Authority
CN
China
Prior art keywords
audio data
image data
videos
functional 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.)
Active
Application number
CN201811619815.2A
Other languages
Chinese (zh)
Other versions
CN109640056A (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 Neoway Technology Co Ltd
Original Assignee
Shenzhen Neoway 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 Neoway Technology Co Ltd filed Critical Shenzhen Neoway Technology Co Ltd
Priority to CN201811619815.2A priority Critical patent/CN109640056B/en
Publication of CN109640056A publication Critical patent/CN109640056A/en
Application granted granted Critical
Publication of CN109640056B publication Critical patent/CN109640056B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/18Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast
    • H04N7/181Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast for receiving images from a plurality of remote sources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
    • H04N5/265Mixing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Studio Devices (AREA)
  • Closed-Circuit Television Systems (AREA)

Abstract

The application provides a USB camera monitored control system based on Android platform, including video acquisition unit, processing unit, display screen and memory cell, the video acquisition unit includes microphone and multichannel USB camera, processing unit is used for control the display screen previews in real time and shows the multichannel image data that multichannel USB camera was gathered, still is used for simultaneously carrying out the code synthesis with the audio data that the microphone was gathered respectively with the multichannel image data that multichannel USB camera was gathered through the mode of multithreading and obtains the multichannel video to save the multichannel video in memory cell. The application also provides a monitoring method of the USB camera monitoring system based on the Android platform. According to the method and the device, the multiple USB cameras can be previewed, shot and recorded on the Android platform simultaneously, and the multiple USB cameras do not influence each other.

Description

USB camera monitoring system and method based on Android platform
Technical Field
The application relates to the technical field of monitoring, in particular to a USB camera monitoring system based on an Android platform and a monitoring method thereof.
Background
Under the era background of rapid development of the internet of things, the application of the Android platform occupies a large market in the whole internet of things industry, the application range and the application field of the Android platform are continuously extended, and the camera serving as an important component in machine sense is ubiquitous in the current society, so that the combination of the Android platform and the camera is an inevitable choice in the era.
At present, the social cooperation requirement on multiple paths of videos is more and more extensive, and under an Android platform, real-time preview and video recording of a single path of USB camera can be realized, and real-time preview and video recording of a plurality of common cameras can also be realized, but the two combination schemes are not ideal. The first scheme mainly aims at unilateral monitoring equipment such as a recorder and the like, the scheme is relatively mature, but each camera needs to correspond to a module or a chip, and when a plurality of USB cameras need to work simultaneously, the cost is high; the second scheme can realize simultaneous operation of a plurality of common cameras, for example, a double-shooting function of a mobile phone, but one is a main camera and the other is an auxiliary camera, the auxiliary camera is mainly used for supplementing some parameters and light-entering quantity of the main camera, and a recorded video is also a video, namely, although double-channel preview can be realized, the video is only a single-channel video and the compatibility is poor.
Disclosure of Invention
The purpose of the application is to overcome the defects in the prior art, and provide a USB camera monitoring system and method based on an Android platform, which are used for achieving simultaneous work of multiple paths of USB cameras under the Android platform to obtain multiple paths of videos.
For solving above-mentioned technical problem, the application provides a USB camera monitored control system based on Android platform, including video acquisition unit, processing unit, display screen and memory cell, video acquisition unit includes microphone and multichannel USB camera, processing unit is used for control the display screen previews in real time and shows the multichannel image data that multichannel USB camera gathered, still is used for simultaneously carrying out the code synthesis with the audio data that the microphone gathered respectively with the multichannel image data that multichannel USB camera gathered through the mode of multithreading and obtains the multichannel video to save the multichannel video in memory cell.
The application also provides a monitoring method, which is applied to a USB camera monitoring system based on an Android platform, the monitoring system comprises a video acquisition unit, a processing unit, a display and a storage unit, the video acquisition unit comprises a microphone and multiple USB cameras, and the monitoring method comprises the following steps: the processing unit is used for controlling the multi-path USB camera to acquire multi-path image data, controlling the display screen to preview and display the multi-path image data in real time, and controlling the microphone to acquire audio data; when the monitoring video is determined to be started, the audio data and the multi-path image data are coded and synthesized simultaneously in a multi-thread mode through the processing unit to obtain multi-path videos, and the multi-path videos are stored in the storage unit.
According to the USB camera monitoring system and method based on the Android platform, the multichannel USB cameras can run on the Android platform simultaneously, the multichannel USB cameras can preview, photograph and record videos simultaneously, and the multichannel videos are obtained and stored. The method and the device can be applied to any Android equipment supporting OTG.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a block diagram of a structure of a USB camera monitoring system based on an Android platform in an embodiment of the present application.
Fig. 2 is a block diagram of a structure of a USB camera monitoring system based on an Android platform in another embodiment of the present application.
Fig. 3 is a block diagram of the processing unit in fig. 1.
Fig. 4 is a structural relationship diagram of the USB camera monitoring system based on the Android platform in fig. 1.
Fig. 5 is a schematic diagram of a framework of the first functional module in fig. 3.
Fig. 6 is a flow chart of a monitoring method in an embodiment of the present application.
Fig. 7 is a sub-flowchart of step S62 in fig. 6.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without inventive step, are within the scope of the present disclosure.
In the description of the embodiments of the present application, it should be understood that the terms "first" and "second" are only used for convenience in describing the present application and simplifying the description, and thus, should not be construed as limiting the present application.
Referring to fig. 1, a block diagram of a USB camera monitoring system based on an Android platform in an embodiment of the present application is shown. The application provides a pair of USB camera monitored control system 100 based on Android platform, including video acquisition unit 10, processing unit 20, display screen 30 and memory cell 40, video acquisition unit 10 includes microphone 11 and multichannel USB camera 12, microphone 11 is used for gathering audio data, and multichannel USB camera 12 is used for gathering multichannel image data.
The microphone 11, the multiple USB cameras 12 and the display screen 30 are all connected to the processing unit 20, the processing unit 20 is configured to control the display screen 30 to preview and display multiple paths of image data acquired by the multiple USB cameras 12 in real time, and is further configured to encode and synthesize audio data acquired by the microphone 11 and multiple paths of image data acquired by the multiple USB cameras 12 in a multithreading manner to obtain multiple paths of videos, and store the multiple paths of videos in the storage unit 40.
In the application, the multiple USB cameras 12 work simultaneously to acquire multiple paths of image data, the processing unit 20 controls the display screen 30 to preview and display the multiple paths of image data in real time, and encodes and synthesizes audio data acquired by the microphone 11 with the multiple paths of image data in multiple threads to obtain multiple paths of videos, and stores the multiple paths of videos in the storage unit 40.
Specifically, as shown in fig. 1, in this embodiment, the number of the microphones 11 is one, the processing unit 20 encodes and synthesizes audio data collected by one microphone 11 and multiple paths of image data collected by multiple paths of USB cameras 12 simultaneously in a multi-thread manner to obtain multiple paths of videos, and stores the multiple paths of videos in the storage unit 40, where the multiple paths of videos include the same audio data.
Referring to fig. 2, fig. 2 is a block diagram illustrating a structure of a USB camera monitoring system based on an Android platform according to another embodiment of the present application. As shown in fig. 2, in another embodiment of the present application, the number of the microphones 11 is multiple, the processing unit 20 synthesizes audio data collected by the multiple microphones 11, and then encodes and synthesizes the synthesized audio data with multiple paths of image data collected by the multiple paths of USB cameras 12 in a multithread manner to obtain multiple paths of videos, and stores the synthesized multiple paths of videos in the storage unit 40, where the audio data in the multiple paths of videos is synthesized audio data of the multiple microphones 11.
It should be noted that the processing unit 20 synthesizes audio data collected by the microphones 11, and particularly, the synthesis is realized by a high-order algorithm of sound synthesis, and is not described and illustrated in detail herein since it is not relevant to the improvement of the present application.
In yet another embodiment of the present application, when the number of the microphones 11 is multiple, each microphone 11 corresponds to one USB camera 12, the processing unit 20 encodes and synthesizes audio data collected by each microphone 11 and image data collected by the corresponding USB camera 12 in a multithreading manner to obtain multiple paths of videos, and stores the multiple paths of videos in the storage unit 40, where the audio data in the multiple paths of videos are different audio data collected by different microphones 11.
It is understood that, in order to improve the efficiency and compatibility of the synthesized video, in the embodiment of the present application, it is preferable to perform the audio data acquisition in a singleton mode, that is, to acquire the audio data by using a single microphone.
Referring to fig. 3 and 4 together, fig. 3 is a block diagram of the processing unit in fig. 1; fig. 4 illustrates a structural relationship diagram of the USB camera monitoring system based on the Android platform in fig. 1. As shown in fig. 3 and 4, the processing unit 20 includes a first functional module 21 and a second functional module 22 interacting with the first functional module 21.
In this embodiment of the application, the first functional module 21 is configured to control the multiple USB cameras 12 to acquire multiple paths of image data, and control the display screen 30 to preview and display the acquired multiple paths of image data in real time; the second functional module 22 is used for controlling the connection microphone 11 to collect audio data, and respectively encoding the audio data and the multiple paths of image data acquired through the interaction with the first functional module 21, and finally synthesizing multiple paths of videos and storing the videos in the storage unit 40.
It should be noted that, in the embodiment of the present application, the application program of the processing unit 20 is programmed by using Java and C + +, where C + + is used to write the interactive part with the hardware device, and Java is used to complete the interaction with C + + and the encoding and synthesis of the image data and the audio data.
Specifically, in the embodiment of the present application, the first functional module 21 is a program block programmed in C + + language and is configured to control a hardware device, that is, to implement control over multiple paths of USB cameras 12 and the display screen 30, so as to acquire multiple paths of image data and perform real-time preview display; the second functional module 22 is a program block programmed by Java language, and is configured to interact with the first functional module 21 to obtain multiple paths of image data, encode and synthesize audio data acquired by connecting the microphone 11 and the multiple paths of image data in a multithreading manner to obtain multiple paths of videos, and store the multiple paths of videos in the storage unit 40 through the first functional module 21.
Specifically, the second functional module 22 calls an open source C + + code through an open source Java interface provided by the Android platform to control the connection microphone 11, so as to acquire audio data.
Referring to fig. 5, fig. 5 illustrates a frame structure of the first functional module in fig. 3. As shown in fig. 5, the first functional module 21 adopts a standard mvc (Model View Controller) framework structure, which includes a Model part 211, a View part 213, and a Controller part 215.
Specifically, in the embodiment of the present application, the Model part adopts a standard V4L2(Video4Linux2) instruction to implement control over multiple USB cameras 12, and encapsulates a corresponding V4L2 instruction into a corresponding interface, which is provided to the Controller part 215, where the main interfaces include interfaces such as opening a camera (including opening and initializing), closing the camera, acquiring image data, and converting an image format.
The View part 213 controls the display screen 30 to preview and display image data acquired by the USB camera 12 in real time through a Window type instruction provided by the Android platform, packages the Window type instruction into a corresponding interface, and provides the interface to the Controller part 215, where the main interface includes an initialization interface and a preview data setting interface.
The Controller part 215 mainly functions as a coupler, and is used for receiving the instruction of the second functional module 22 and calling the corresponding interfaces provided by the two parts to complete the control of hardware devices such as the USB camera 12 and the display screen 30, and transmitting the image data acquired from the Model part 211 to the View part 213 for preview display by the display screen 30, and simultaneously buffering the current image data in the storage unit 40.
It should be noted that, the first functional module 21 controls the display screen 30 to preview image data in real time, and is specifically implemented in corresponding threads, each thread corresponds to a set of Model part 211 and View part 213, the Model part 211 continuously acquires preview image data in YUYV format, and then converts the preview image data into YUV420sp format, and the Controller part 215 transmits the converted image data acquired from the Model part 211 to the View part 213 for preview display in real time.
Wherein the Controller part 215 can control the multiple sets of Model part 211 and View part 213 at the same time.
Further, the Controller part 215 is an interface for the second functional module 22 to interact with the first functional module 21 in a jni (java Native interface) manner, so as to facilitate the second functional module 22 to obtain multiple paths of image data.
Specifically, in this embodiment of the application, the second functional module 22 sends a corresponding interface control class instruction to the Controller portion 215 to call a corresponding interface in the first functional module 21, for example, call an interface for opening a camera, acquiring image data, and the like, so as to control the multi-channel USB camera 12 to acquire the multi-channel image data through the first functional module 21.
In this embodiment, the second functional module 22 may start a plurality of threads, respectively encode and process the audio data acquired by controlling the microphone 11 through the Java interface and the multiple paths of image data acquired by interacting with the first functional module 21, combine the encoded audio data and the multiple paths of image data into multiple paths of videos, and store the multiple paths of videos in the storage unit 40 through the first functional module.
The second functional module 22 specifically implements encoding processing of audio data and image data through MediaCodec type instructions provided by the Android platform, and synthesizes video through mediamultiplexer type instructions provided by the Android platform.
In the embodiment of the present application, the audio data is in PCM format, the image data is in YUV format, and the composite video is in MP4 format, which is the most common format.
In other embodiments, the composite video may also be in other formats such as 3GP, AVI, MPEG, FLV, etc.
The storage unit 40 for storing multiple videos may be an internal memory, or an external memory such as a usb disk, a memory card, or a virtual memory.
It should be noted that, in the embodiment of the present application, the USB cameras 12 are all USB cameras that satisfy uvc (USB Video class) protocol, and different USB cameras 12 have different IDs, and each USB camera 12 is allocated with a corresponding thread, so that multiple USB cameras 12 can work simultaneously and independently without affecting each other in a multithreading manner.
It can be understood that the multiple USB cameras 12 work simultaneously and are independent of each other, specifically, the multiple USB cameras 12 can be turned on at the same time and respectively collect different image data; the multiple USB cameras 12 may also be turned on at different times and collect different image data, for example, the first camera 9:00 starts to operate, the other cameras start to operate at 9:10, and each USB camera may start to operate at any other time.
Further, the USB camera monitoring system based on the Android platform can be applied to any Android device supporting OTG, and there are many application scenarios, for example, two USB cameras 12 can be used to replace a front recorder and a rear recorder of an automobile and be connected to an Android device having the monitoring system, so that images in front of and behind the automobile can be recorded simultaneously.
Referring to fig. 6, fig. 6 is a flowchart of a monitoring method according to an embodiment of the present application. The monitoring method is used in the Android platform-based USB camera monitoring system 100, the Android platform-based USB camera monitoring system 100 includes a video acquisition unit 10, a processing unit 20, a display screen 30 and a storage unit 40, the video acquisition unit 10 includes a microphone 11 and multiple USB cameras 12, and the monitoring method includes:
the multi-channel USB camera 12 is controlled by the processing unit 20 to capture multi-channel image data, the display screen 30 is controlled to preview and display the multi-channel image data in real time, and the connection microphone 11 is controlled by the processing unit 20 to capture audio data (S61).
When it is determined that the monitor recording is started, the audio data and the plurality of paths of image data are encoded and synthesized simultaneously in a multithread manner by the processing unit 20 to obtain a plurality of paths of videos, respectively, and the plurality of paths of videos are stored in the storage unit 40 (S62).
Specifically, in this embodiment, the number of the microphones 11 is one, the processing unit 20 obtains multiple channels of videos by encoding and synthesizing the audio data collected by one microphone 11 and multiple channels of image data collected by multiple channels of USB cameras 12 in a multi-thread manner, and stores the synthesized multiple channels of videos in the storage unit 40, where the multiple channels of videos include the same audio data.
In another embodiment of the present application, the number of the microphones 11 is multiple, the processing unit 20 synthesizes audio data collected by the multiple microphones 11, then encodes and synthesizes the synthesized audio data with multiple paths of image data collected by the multiple paths of USB cameras 12 in a multithreading manner to obtain multiple paths of videos, and stores the synthesized multiple paths of videos in the storage unit 40, where the audio data in the multiple paths of videos is synthesized audio data of the multiple microphones 11.
It should be noted that the processing unit 20 synthesizes audio data collected by the microphones 11, and particularly, the synthesis is realized by a high-order algorithm of sound synthesis, and is not described and illustrated in detail herein since it is not relevant to the improvement of the present application.
In yet another embodiment of the present application, when the number of the microphones 11 is multiple, each microphone 11 corresponds to one USB camera 12, the processing unit 20 encodes and synthesizes audio data collected by each microphone 11 and image data collected by the corresponding USB camera 12 in a multithreading manner to obtain multiple paths of videos, and stores the multiple paths of videos in the storage unit 40, where the audio data in the multiple paths of videos are different audio data collected by different microphones 11.
It is understood that, in order to improve the efficiency and compatibility of the synthesized video, in the embodiment of the present application, it is preferable to perform the audio data acquisition in a singleton mode, that is, to acquire the audio data by using a single microphone.
Further, the processing unit 20 includes a first functional module 21, and the step S61 of controlling the multiple USB cameras 12 to acquire multiple paths of image data and simultaneously controlling the display screen 30 to preview and display multiple paths of image data in real time by the processing unit 20 includes: the first functional module 21 controls the multi-channel USB camera 12 to acquire multi-channel image data according to a standard V4L2 instruction, and the first functional module 21 controls the display 30 to preview and display the multi-channel image data in real time according to a Window instruction provided by the Android platform.
The first function module 21 is a program block programmed by using C + + language, and the first function module 21 adopts a standard mvc (Model View Controller) framework structure, and specifically includes a Model part 211, a View part 213, and a Controller part 215. The Model part 211 is configured to define a corresponding class instruction to control a hardware device, and specifically, in this embodiment, the Model part uses a standard V4L2(Video4Linux2) instruction to implement control on the multiple USB cameras 12, and encapsulates a corresponding V4L2 instruction into a corresponding interface, which is provided to the Controller part 215; the View part 213 controls the display screen 30 to preview and display the image data acquired by the USB camera 12 in real time through the Window type instruction provided by the Android platform, and encapsulates the Window type instruction into a corresponding interface to provide the interface to the Controller part 215; the Controller part 215 mainly functions as a coupler for calling the corresponding interfaces provided by the two parts to complete the control of hardware devices such as the USB camera 12 and the display screen 30, and transmits the image data acquired from the Model part 211 to the View part 213 for preview display by the display screen 30, and meanwhile, buffers the current image data in the storage unit 40.
Further, the processing unit 20 further includes a second functional module 22 interacting with the first functional module 21, and the step S61 of "controlling the connection microphone to collect audio data through the processing unit" includes: the second functional module 22 is connected with the microphone 11 through an open source Java interface provided by the Android platform to collect audio data.
The second functional module 22 is a program block programmed by Java language, and is configured to interact with the first functional module 21, encode and synthesize audio data acquired by connecting the microphone 11 and multiple paths of image data in a multi-thread manner to obtain multiple paths of videos, and store the multiple paths of videos in the storage unit 40 through the first functional module 21.
Referring to fig. 7, fig. 7 is a more detailed sub-flowchart of step S62 in fig. 6. As shown in fig. 7, the step S62 includes:
upon determining to start the monitoring recording, the second function module 22 interacts with the first function module 21 in the manner of JNI to acquire multi-path image data (S71).
The audio data collected by the microphone 11 and the multi-path image data acquired by the first functional module 21 are respectively subjected to encoding processing by the second functional module 22 (S73).
The second functional module 22 synthesizes the encoded audio data and the encoded image data acquired by the USB camera 12 corresponding to the thread in each thread to obtain a single-channel video (S75).
The synthesized multi-channel video is obtained in a multi-threaded manner by the second functional module 22, and is stored in the storage unit 40 by the first functional module 21 (S77).
Specifically, the second function module 22 interacts with the first function module 21 through the Controller part 215 in the first function module 21, and specifically, the second function module 22 calls corresponding interfaces of the Model part 211 and the View part 213 by sending an interface control class instruction to the Controller part 215 of the first function module 21, so as to control hardware devices such as the USB camera 12 and the display screen 30, and thus acquire multiple paths of image data.
The second functional module 22 specifically implements encoding processing of audio data and image data through MediaCodec type instructions provided by the Android platform, and synthesizes video through mediamultiplexer type instructions provided by the Android platform. In this embodiment, the audio data is in PCM format, the image data is in YUV format, and the composite video is in MP4 format, which is the most common format with less occupation.
In other embodiments of the present application, the composite video may also be in other formats such as 3GP, AVI, MPEG, FLV, etc.
The storage unit 40 for storing multiple videos may be an internal memory, or an external memory such as a usb disk, a memory card, or a virtual memory.
It should be noted that, in the embodiment of the present application, the USB cameras 12 are all USB cameras that satisfy uvc (USB Video class) protocol, and different USB cameras 12 have different IDs, and each USB camera 12 is allocated with a corresponding thread, so that the second functional module 22 can enable multiple USB cameras 12 to work simultaneously and independently in a multithreading manner.
The foregoing is an implementation of the embodiments of the present application, and it should be noted that, for those skilled in the art, several modifications and decorations can be made without departing from the principle of the embodiments of the present application, and these modifications and decorations are also regarded as the protection scope of the present application.

Claims (14)

1. A USB camera monitoring system based on an Android platform is characterized by comprising a video acquisition unit, a processing unit, a display screen and a storage unit;
the video acquisition unit comprises a microphone and a plurality of USB cameras, the microphone is used for acquiring audio data, and the plurality of USB cameras are used for acquiring a plurality of image data;
the microphone, the multiple USB cameras and the display screen are all connected with the processing unit, the processing unit is used for controlling the display screen to preview and display multiple paths of image data in real time, and the processing unit is also used for coding and synthesizing audio data and the multiple paths of image data respectively in a multithreading mode to obtain multiple paths of videos and storing the multiple paths of videos in the storage unit;
when the number of the microphones is multiple, the processing unit synthesizes audio data collected by the multiple microphones, and codes and synthesizes the synthesized audio data with multiple paths of image data collected by multiple paths of USB cameras simultaneously in a multithreading mode to obtain multiple paths of videos and stores the multiple paths of videos in the storage unit, wherein the audio data in the multiple paths of videos are synthesized audio data of the multiple microphones; alternatively, the first and second electrodes may be,
when the number of the microphones is multiple, each microphone corresponds to one USB camera, the processing unit simultaneously encodes and synthesizes audio data collected by each microphone and image data collected by the corresponding USB camera in a multithreading mode to obtain a plurality of paths of videos and stores the videos in the storage unit, and the audio data in the plurality of paths of videos are different audio data collected by different microphones;
the processing unit encodes and synthesizes audio data collected by the microphone and multi-path image data collected by a multi-path USB camera in a multi-thread mode to obtain multi-path videos and stores the multi-path videos in the storage unit, wherein the multi-path videos comprise the same audio data.
2. The Android platform-based USB camera monitoring system of claim 1, wherein the multiple USB cameras all meet UVC protocols and have different IDs, each USB camera is allocated with a corresponding thread, and the multiple USB cameras are independent of each other.
3. The Android platform-based USB camera monitoring system of claim 1, wherein the processing unit comprises a first functional module and a second functional module interacting with the first functional module.
4. The Android platform-based USB camera monitoring system of claim 3, wherein the first functional module controls a plurality of USB cameras to acquire a plurality of image data through a standard V4L2 instruction, and controls a display screen to preview and display the plurality of image data in real time; the second functional module is connected with the microphone through an open source Java interface provided by the Android platform to collect audio data, and encodes the audio data and the multi-channel image data acquired through interaction with the first functional module respectively, and finally synthesizes and stores the multi-channel video in the storage unit.
5. The Android platform-based USB camera monitoring system of claim 4, wherein the first functional module is a program block programmed in C + + language, and the second functional module is a program block programmed in Java language.
6. The Android platform-based USB camera monitoring system of claim 5, wherein the first functional module adopts a standard MVC framework.
7. The Android platform-based USB camera monitoring system of claim 6, wherein the second function module interacts with the first function module in a JNI manner to call the first function module and acquire multiple paths of image data simultaneously.
8. The Android platform-based USB camera monitoring system of claim 3, wherein the first functional module controls a display screen to preview and display multiple image data in real time through a Window type command provided by the Android platform, the second functional module realizes coding of audio data and image data through a MediaCodec type command provided by the Android platform, and synthesizes video through a MediaMuxer type command provided by the Android platform.
9. The Android platform-based USB camera monitoring system of claim 1, wherein the audio data is in PCM format, the image data is in YUV format, and the composite video can be any one of MP4, 3GP, AVI, MPEG and FLV.
10. The Android platform-based USB camera monitoring system of claim 1, wherein the system can be applied to any OTG-enabled Android device.
11. A monitoring method is applied to a USB camera monitoring system based on an Android platform, the monitoring system comprises a video acquisition unit, a processing unit, a display and a storage unit, the video acquisition unit comprises a microphone and a plurality of paths of USB cameras, and the monitoring method is characterized by comprising the following steps:
the processing unit is used for controlling the USB cameras to acquire multi-path image data, controlling the display screen to preview and display the multi-path image data in real time, and controlling the microphone to acquire audio data;
when the monitoring video is determined to be started, the audio data and the multi-path image data are coded and synthesized to obtain multi-path videos through the processing unit in a multi-thread mode, and the multi-path videos are stored in the storage unit;
when the number of the microphones is multiple, the processing unit synthesizes audio data collected by the multiple microphones, and codes and synthesizes the synthesized audio data with multiple paths of image data collected by multiple paths of USB cameras simultaneously in a multithreading mode to obtain multiple paths of videos and stores the multiple paths of videos in the storage unit, wherein the audio data in the multiple paths of videos are synthesized audio data of the multiple microphones; alternatively, the first and second electrodes may be,
when the number of the microphones is multiple, each microphone corresponds to one USB camera, the processing unit simultaneously encodes and synthesizes audio data collected by each microphone and image data collected by the corresponding USB camera in a multithreading mode to obtain a plurality of paths of videos and stores the videos in the storage unit, and the audio data in the plurality of paths of videos are different audio data collected by different microphones;
the processing unit encodes and synthesizes audio data collected by the microphone and multi-path image data collected by a multi-path USB camera in a multi-thread mode to obtain multi-path videos and stores the multi-path videos in the storage unit, wherein the multi-path videos comprise the same audio data.
12. The monitoring method according to claim 11, wherein the processing unit includes a first functional module, and the controlling the multiple USB cameras to acquire the multiple image data and the display screen to preview and display the multiple image data in real time by the processing unit includes:
the first function module controls the multi-path USB camera to acquire multi-path image data through a standard V4L2 instruction, and controls the display to preview and display multi-path data images in real time through a Window instruction provided by the Android platform.
13. The monitoring method of claim 12, wherein the processing unit further comprises a second functional module interacting with the first functional module, and the controlling the connection microphone to collect audio data by the processing unit comprises:
and the second functional module is connected with a microphone through an open source Java interface provided by the Android platform to acquire audio data.
14. The monitoring method according to claim 13, wherein each USB camera is assigned with a corresponding thread, and the "simultaneously encoding and synthesizing audio data and multiple paths of image data respectively in a multi-thread manner by the processing unit to obtain multiple paths of videos, and storing the multiple paths of videos in the storage unit" includes:
when the monitoring video is determined to be started, the second function module interacts with the first function module in a JNI mode to acquire multi-channel image data;
the audio data collected by the microphone and the multi-channel image data obtained by the first functional module are respectively coded by the second functional module;
synthesizing the encoded audio data and the encoded image data acquired by the USB camera corresponding to the thread in each thread through a second functional module to obtain a single-channel video;
and obtaining the synthesized multi-channel video in a multi-thread mode through the second functional module, and storing the multi-channel video in the storage unit through the first functional module.
CN201811619815.2A 2018-12-27 2018-12-27 USB camera monitoring system and method based on Android platform Active CN109640056B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811619815.2A CN109640056B (en) 2018-12-27 2018-12-27 USB camera monitoring system and method based on Android platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811619815.2A CN109640056B (en) 2018-12-27 2018-12-27 USB camera monitoring system and method based on Android platform

Publications (2)

Publication Number Publication Date
CN109640056A CN109640056A (en) 2019-04-16
CN109640056B true CN109640056B (en) 2021-05-18

Family

ID=66078563

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811619815.2A Active CN109640056B (en) 2018-12-27 2018-12-27 USB camera monitoring system and method based on Android platform

Country Status (1)

Country Link
CN (1) CN109640056B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110266915B (en) * 2019-06-25 2022-03-11 北京字节跳动网络技术有限公司 Method and device for controlling video acquisition content on android device
CN110674650A (en) * 2019-08-26 2020-01-10 深圳市有方科技股份有限公司 Multi-channel scanning equipment and method for applying same
CN110611746B (en) * 2019-09-03 2021-06-29 深圳市云网万店电子商务有限公司 Multi-camera synchronization method and distributed system
CN110816458B (en) * 2019-10-24 2022-05-06 上海势航网络科技有限公司 Vehicle blind area monitoring system, device and control method thereof
CN114731339B (en) * 2020-02-18 2024-01-30 华为技术有限公司 Information transmission method and related equipment
CN112104840B (en) * 2020-09-09 2022-10-04 深圳市有方科技股份有限公司 Video acquisition method and mobile baseband workstation
CN112217990B (en) * 2020-09-27 2024-04-09 北京小米移动软件有限公司 Task scheduling method, task scheduling device and storage medium
CN113014801B (en) * 2021-02-01 2022-11-29 维沃移动通信有限公司 Video recording method, video recording device, electronic equipment and medium
CN115766988A (en) * 2022-11-14 2023-03-07 深圳市广和通无线股份有限公司 Video preview method, device and equipment and storage medium
CN117499774A (en) * 2023-12-31 2024-02-02 成都天软信息技术有限公司 Video recording control system and method of vehicle-mounted intelligent terminal

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN200983189Y (en) * 2006-04-30 2007-11-28 程雄 Remote alarming monitoring audio and video linkage integrator
CN105338311A (en) * 2015-10-12 2016-02-17 北京奇虎科技有限公司 Internet protocol camera, data transmission method thereof and system
CN205582161U (en) * 2016-04-18 2016-09-14 讯之美物联网服务有限公司 System of internet of things
CN106982316A (en) * 2017-05-03 2017-07-25 张德明 A kind of sound field collection based on ball base camera renders supervising device
CN107846557A (en) * 2017-11-29 2018-03-27 深圳市创维群欣安防科技股份有限公司 A kind of collection distribution method, system and the storage device of multichannel audio-video frequency signal
CN108965832A (en) * 2018-09-14 2018-12-07 长沙世邦通信技术有限公司 A kind of pickup system Voice Surveillance method and device

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101030324A (en) * 2007-04-23 2007-09-05 凌子龙 Electronic police device on crossroad for vehicle horning against traffic regulation
CN201919110U (en) * 2010-11-03 2011-08-03 北京华夏电通科技有限公司 Trial host machine for digital court system
CN105376494B (en) * 2015-11-30 2018-11-23 诚迈科技(南京)股份有限公司 A method of multichannel USB camera is supported based on Android system
CN105426194A (en) * 2015-12-03 2016-03-23 北京利云技术开发公司 Method and system for driving cameras based on Android OTG interface
CN105791580A (en) * 2016-03-21 2016-07-20 北京华盛普讯技术股份有限公司 USB camera acquisition method based on mobile device having Android system
CN206115520U (en) * 2016-10-14 2017-04-19 汪得峻 Automobile driving equipment of shooting with video -corder
CN108881957A (en) * 2017-11-02 2018-11-23 北京视联动力国际信息技术有限公司 A kind of mixed method and device of multimedia file

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN200983189Y (en) * 2006-04-30 2007-11-28 程雄 Remote alarming monitoring audio and video linkage integrator
CN105338311A (en) * 2015-10-12 2016-02-17 北京奇虎科技有限公司 Internet protocol camera, data transmission method thereof and system
CN205582161U (en) * 2016-04-18 2016-09-14 讯之美物联网服务有限公司 System of internet of things
CN106982316A (en) * 2017-05-03 2017-07-25 张德明 A kind of sound field collection based on ball base camera renders supervising device
CN107846557A (en) * 2017-11-29 2018-03-27 深圳市创维群欣安防科技股份有限公司 A kind of collection distribution method, system and the storage device of multichannel audio-video frequency signal
CN108965832A (en) * 2018-09-14 2018-12-07 长沙世邦通信技术有限公司 A kind of pickup system Voice Surveillance method and device

Also Published As

Publication number Publication date
CN109640056A (en) 2019-04-16

Similar Documents

Publication Publication Date Title
CN109640056B (en) USB camera monitoring system and method based on Android platform
CN110109636B (en) Screen projection method, electronic device and system
CN111917988B (en) Remote camera application method, system and medium of cloud mobile phone
CN101827242B (en) Method for realizing video phone system based on IPTV set-top box
CN110430441B (en) Cloud mobile phone video acquisition method, system, device and storage medium
US20170134654A1 (en) Video recording method and device
CN103248863B (en) A kind of picture pick-up device, communication system and corresponding image processing method
CN113099146B (en) Video generation method and device and related equipment
CN114071197B (en) Screen projection data processing method and device
WO2022068613A1 (en) Audio processing method and electronic device
CN113643728A (en) Audio recording method, electronic device, medium, and program product
CN111479059B (en) Photographing processing method and device, electronic equipment and storage medium
WO2024055797A9 (en) Method for capturing images in video, and electronic device
CN113810589A (en) Electronic device, video shooting method and medium thereof
WO2023160295A1 (en) Video processing method and apparatus
CN117911299A (en) Video processing method and device
CN114866681A (en) Cross-device collaborative shooting method, related device and system
US20230185518A1 (en) Video playing method and device
EP2538670B1 (en) Data processing unit
CN110463226A (en) Sound recording apparatus, audio system, audio recording method and carrier arrangement
CN103647906A (en) Multipath audio and video synthetic method for embedded hard-disk video recorder
US20180268819A1 (en) Communication terminal, communication method, and computer program product
CN202210851U (en) Control device for standard-definition/ high-definition audio video coder and decoder
CN111279680A (en) Square cutting photographing method, photographing system and photographing device
CN101242512A (en) Enhanced method for processing video phone image

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