Video recording method and device and network camera

By detecting the startup instructions of the application and reading image data in a low-power network camera, determining the target object in combination with the AI ​​detection module, and generating recorded videos, the problem of failure to capture the initial picture of moving objects in the recorded video in the prior art is solved, and the effectiveness of recording videos and video streaming efficiency are improved.

CN119906798APending Publication Date: 2025-04-29SHENZHEN OCEANWING SMART INNOVATIONS TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311421298.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-27
Publication Date
2025-04-29

AI Technical Summary

Technical Problem

Existing low-power network cameras are inefficient in capturing the initial picture of moving objects, resulting in a reduced effectiveness in recording video.

Method used

By detecting the startup command of the application in the imaging device, the image data at the current moment is read, and whether the target object exists, and when the target object exists, the video coded data is read to generate the recorded video. This method stores image data and video coded data simultaneously in the memory of the imaging device, and uses the AI ​​detection module to perform object detection to ensure that the initial picture containing the target object in the recorded video is recorded.

Benefits of technology

The effectiveness of recording videos is improved, the initial picture of the target object is captured in time, and the video streaming efficiency is improved by storing image data and video encoded data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119906798A_ABST
    Figure CN119906798A_ABST
Patent Text Reader

Abstract

The invention relates to a video recording method and device and a network camera. The method comprises the steps of reading image data stored at the current moment in a memory of the camera equipment in response to a starting instruction for detecting an application program in the camera equipment, determining whether a target object exists in the image data or not according to the image data, and then starting the camera equipment on the condition that the target object exists in the image data. And the recorded video of the camera equipment is obtained by reading the video coding data stored in the memory of the camera equipment. The video coding number is obtained by coding the image data stored at the current moment. According to the method, the image data and the video coding data obtained by coding the image data are simultaneously stored in the memory of the camera equipment, and after the AI detection module in the camera equipment is started, the image data in the memory can still be read to detect the target object, so that the recorded video comprises the initial picture of the target object; and thus, the effectiveness of video recording is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of security monitoring technology, and in particular to a video recording method, device and network camera. Background Art

[0002] IP camera (IPC) is a new generation of camera that combines traditional cameras with network technology. It can transmit the captured video images to the other side of the earth through the network, and the remote viewers do not need any professional software, just a standard network browser to monitor its video images.

[0003] Taking a low-power IPC as an example, usually, the low-power IPC is in a low-power sleep state. In the related art, a detector built into the IPC, such as a passive infrared detector (PIR), can wake up the low-power IPC from the sleep state to the working state when the PIR senses the presence of a moving object in the monitoring environment, so as to obtain a recorded video including the moving object.

[0004] However, the recorded video obtained in the related art fails to capture the initial scene where the moving object appears in time, which reduces the effectiveness of the recorded video. Summary of the invention

[0005] Based on this, it is necessary to provide a video recording method, device and network camera to address the above technical problems.

[0006] In a first aspect, the present application provides a video recording method, comprising:

[0007] In response to a start instruction of a detection application in the camera device, read the image data currently stored in the memory of the camera device;

[0008] determining whether a target object exists in the image data according to the image data;

[0009] When the target object exists in the image data, the recorded video of the camera device is obtained by reading the video coding data stored in the memory of the camera device, and the video coding data is obtained by coding the image data stored at the current moment.

[0010] In one embodiment, before detecting the startup of the application in the camera device, the method further includes:

[0011] In response to a wake-up instruction to the camera device, obtaining generation configuration parameters;

[0012] determining a target cache area in a memory of the camera device according to the generated configuration parameters;

[0013] The image data and video encoding data are stored in the target cache area according to the generated configuration parameters.

[0014] In one embodiment, the target cache area includes an image cache area and a video cache area; determining the target cache area in the memory of the camera device according to the generated configuration parameters includes:

[0015] Determine the amount of images to be stored and the amount of videos to be stored according to the generated configuration parameters;

[0016] Determine in the memory of the camera device a memory matching the amount of images to be stored as an image buffer area;

[0017] A memory matching the amount of video to be stored is determined in the memory of the camera device as a video buffer area.

[0018] In one embodiment, storing the image data and the video encoding data into the target cache area according to the image configuration parameters includes:

[0019] Raw sensor data collected by an image sensor in a camera device;

[0020] Generate image data and video encoding data according to raw sensor data and image configuration parameters;

[0021] The image data is stored in the image buffer area, and the video encoding data is stored in the video buffer area.

[0022] In one embodiment, generating configuration parameters includes the resolution of a single frame image, the number of image frames, and the number of coded frames; generating image data and video coded data according to the original sensor data and the image configuration parameters includes:

[0023] The image effect file is read by an image processor in the camera device, a single-frame image is generated according to the image effect file, a resolution of the single-frame image and original sensor data, and the single-frame image of the image frame number is obtained to form image data;

[0024] The single-frame image is encoded in a video format by a video encoder in the camera device to generate a single-frame video frame, and the single-frame video frame with the encoded frame number is obtained to form video encoding data.

[0025] In one embodiment, obtaining recorded video of the camera device by reading video encoding data stored in a memory of the camera device includes:

[0026] Reading video encoding data of a preset length from the memory of the camera device;

[0027] Generate a recorded video based on the video encoding data of a preset duration.

[0028] In one embodiment, the method further comprises:

[0029] After the image data in the memory of the camera device is read, the read single frame image in the image data is deleted.

[0030] In one embodiment, the method further comprises:

[0031] After the video encoding data in the memory of the camera device is read, or the video encoding data is not read within a preset time period, the read single video frame in the video encoding data is deleted.

[0032] In one of the embodiments, before generating the wake-up instruction, the method further includes:

[0033] After the camera device is powered on, the hardware driver and the image effect file are loaded in parallel to initialize the video encoder; wherein the hardware driver includes the driver of the image processor and the driver of the image sensor.

[0034] In a second aspect, the present application further provides a video recording device, comprising:

[0035] A data reading module, for responding to a start instruction of a detection application in the camera device, to read the image data currently stored in the memory of the camera device;

[0036] A target detection module is used to determine whether a target object exists in the image data according to the image data;

[0037] The video recording module is used to obtain the recorded video of the camera device by reading the video coding data stored in the memory of the camera device when there is a target object in the image data. The video coding number is obtained by encoding the image data stored at the current moment.

[0038] In a third aspect, the present application further provides a network camera, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any of the above-mentioned video recording methods when executing the computer program.

[0039] In a fourth aspect, the present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the video recording method are implemented.

[0040] In the above-mentioned video recording method, device, network camera and storage medium, by responding to the startup instruction of the detection application in the camera device, the image data stored in the memory of the camera device at the current moment is read, and whether the target object exists in the image data is determined according to the image data. Then, when the target object exists in the image data, the recorded video of the camera device is obtained by reading the video coding data stored in the memory of the camera device. Among them, the video coding number is obtained after encoding according to the image data stored at the current moment. In the above-mentioned method, the memory of the camera device stores the image data and the video coding data obtained after encoding the image data at the same time. After the AI ​​detection module in the camera device is started, the image data in the memory can still be read to detect the target object, so that when the image data includes the target object, the video coding data is read to generate the recorded video, so that the recorded video includes the initial picture where the target object appears, thereby improving the effectiveness of the recorded video, and because the video coding data obtained after encoding the image data is also stored in the memory of the camera device, it is convenient to directly read and generate the recorded video later, thereby improving the video outflow efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 is a schematic flow chart of a video recording method in one embodiment;

[0042] Figure 2 A schematic diagram of a process for storing image data and video encoding data in one embodiment;

[0043] Figure 3 A schematic diagram of a process for determining an image cache area and a video cache area in one embodiment;

[0044] Figure 4 A schematic diagram of a process of storing image data and video encoding data into a target cache area in one embodiment;

[0045] Figure 5 A schematic diagram of a process for generating image data and video encoding data in one embodiment;

[0046] Figure 6 A schematic diagram of a process for generating a recorded video in one embodiment;

[0047] Figure 7 is a structural block diagram of a video recording device in one embodiment;

[0048] Figure 8 FIG. 4 is a diagram showing the internal structure of a network camera in one embodiment. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0050] In one embodiment, Figure 1 As shown, a video recording method is provided. This embodiment uses the method applied to a camera device as an example for illustration. It can be understood that the method can also be applied to other devices that can realize video acquisition, specifically to a central processing unit (CPU) in the device. In this embodiment, the method includes the following steps:

[0051] S110 . In response to a start instruction of a detection application in the camera device, read image data currently stored in a memory of the camera device.

[0052] The detection application corresponds to a detection function module in the camera device for performing target object detection.

[0053] Optionally, after the preparatory work such as loading, initializing and starting the detection function module in the camera device is completed, the start-up instruction of the detection application is triggered. The camera device responds to the start-up instruction of the detection application to obtain the image data stored in the memory at the current moment for the subsequent application of the detection function module to detect the target object.

[0054] Exemplarily, the above-mentioned camera device can be a low-power IPC. When its built-in PIR detects infrared changes in the monitoring environment, it triggers a wake-up instruction, which is used to instruct the low-power IPC to enter the working state from the sleep state. The camera device responds to the wake-up instruction to enter the working state, control the internal image signal processor (ISP) to obtain the image of the monitoring environment, and encode it to obtain the video, thereby forming image data and video encoding data stored in the cache area of ​​the memory for subsequent video recording.

[0055] S120: Determine whether a target object exists in the image data according to the image data.

[0056] The target object is used to represent the object of interest to the user and can be preset. For example, the target object can be an object, such as a vehicle or a person, or a phenomenon, such as a fire or lightning.

[0057] Optionally, after acquiring the image data, the camera device may control the image processor to start the detection function module to detect the target object on the acquired image data to determine whether the target object exists in the image data.

[0058] Exemplarily, the detection function module may be an artificial intelligence (AI) detection module, which includes a recognition model trained using a large number of image samples of the target object. The camera device may control the image processor to input the image data into the AI ​​detection module to obtain the recognition result output by the AI ​​detection module, and determine whether the target object exists in the image data based on the recognition result. For example, the recognition result includes the confidence of the target object. When the confidence of the target object in the recognition result corresponding to the image data is greater than or equal to the confidence threshold, the camera device determines that the target object exists in the image data; conversely, when the confidence of the target object in the recognition result corresponding to the image data is less than the confidence threshold, the camera device determines that the target object does not exist in the image data.

[0059] S130: When the target object exists in the image data, obtain the recorded video of the camera device by reading the video encoding data stored in the memory of the camera device.

[0060] The video encoding data is obtained by encoding the image data stored at the current moment. The image data is essentially an image generated based on the original sensor data collected by the image sensor, and the video encoding data is essentially a video obtained by encoding the image data.

[0061] Optionally, when the camera device determines that there is a target object in the image data, it controls the image processor to read the video encoding data stored in the memory of the camera device, and records the read video encoding data as the recorded video. The recorded video can be stored in the camera device for subsequent retrospective review by the user.

[0062] It should be noted that the memory of the camera device stores both image data and video coded data obtained by encoding the image data. The image data includes a single-frame image with a preset number of image frames, and the video coded data includes a single-frame video frame after encoding with a preset number of coding frames. The storage and reading process of the image data and the video coded data are both performed frame by frame.

[0063] In this embodiment, by responding to the start-up instruction of the detection application in the camera device, the image data stored in the memory of the camera device at the current moment is read, and whether the target object exists in the image data is determined according to the image data. Then, if the target object exists in the image data, the recorded video of the camera device is obtained by reading the video coding data stored in the memory of the camera device. Among them, the video coding number is obtained after encoding the image data stored at the current moment. In the above method, the memory of the camera device stores the image data and the video coding data obtained after encoding the image data at the same time. After the AI ​​detection module in the camera device is started, the image data in the memory can still be read to detect the target object, so that when the target object is included in the image data, the video coding data is read to generate the recorded video, so that the recorded video includes the initial picture where the target object appears, thereby improving the effectiveness of the recorded video, and because the video coding data obtained after encoding the image data is also stored in the memory of the camera device, it is convenient to directly read and generate the recorded video later, thereby improving the video outflow efficiency.

[0064] In actual applications, before the camera device records a video, the memory of the camera device has stored the image data and video encoding data at the current moment. Based on this, in one embodiment, Figure 2 As shown, before detecting the startup of the application in the camera device, the method further includes:

[0065] S210 . In response to a wake-up instruction to the camera device, obtain generation configuration parameters.

[0066] The wake-up instruction is used to instruct the camera device to enter a working state to obtain image data and video encoding data. The generated configuration parameters are configuration parameters used to generate image data and video encoding data, which are used to indicate data requirements and storage requirements and can be preset according to actual requirements.

[0067] There are many ways to trigger the wake-up instruction of the camera device. For example, the camera device can trigger the wake-up instruction based on the user operation, such as the user chooses to press the function button of the camera device to trigger the wake-up instruction, or the user remotely logs in / accesses the camera device to trigger the wake-up instruction; the camera device can also trigger the wake-up instruction based on the built-in detector, such as the PIR in the camera device detects infrared changes in the monitoring environment, which triggers the wake-up instruction.

[0068] S220 . Determine a target cache area in the memory of the camera device according to the generated configuration parameters.

[0069] Optionally, when a wake-up instruction to the camera device is triggered, the camera device obtains preset generation configuration parameters to determine storage requirements based on the generation configuration parameters, and determines a cache area that meets the memory requirements in the memory of the camera device as a target cache area.

[0070] S230: storing the image data and the video encoding data into a target cache area according to the generated configuration parameters.

[0071] The generated configuration parameters include configuration parameters for generating image data and configuration parameters for generating video encoding data.

[0072] Optionally, the camera device can control the image processor to generate image data according to the configuration parameters for generating image data in the generation configuration parameters, and generate video coding data according to the configuration parameters for generating video coding data in the generation configuration parameters, thereby obtaining image data and video coding data that meet data requirements, and storing the obtained image data and video coding data into the target cache area.

[0073] Exemplarily, the camera device may store single-frame images in the image data into the target cache area frame by frame in time sequence, and store single-frame video frames in the video encoding data into the target cache area frame by frame in time sequence.

[0074] In this embodiment, by responding to the wake-up instruction of the camera device, the generated configuration parameters are obtained, the target cache area is determined in the memory of the camera device according to the generated configuration parameters, and the image data and the video encoding data are stored in the target cache area according to the generated configuration parameters. In the above method, the image data and the video encoding data obtained after the camera device is awakened are synchronously stored in the target cache area, which prepares the data foundation for the subsequent video recording, thereby improving the effectiveness of the recorded video and the efficiency of the video outflow.

[0075] The target cache area includes an image cache area and a video cache area. Based on this, in one embodiment, Figure 3 As shown, the above S220, generating image data and video encoding data according to the generated configuration parameters, includes:

[0076] S310: Determine the amount of images and videos to be stored according to the generated configuration parameters.

[0077] The image storage amount is the data size of the image data generated according to the generation configuration parameters, and the video storage amount is the data size of the video encoding data generated according to the generation configuration parameters. The storage amount can be used to determine the required memory size. Exemplarily, the storage amount is equal to the required memory size.

[0078] Optionally, the camera device may determine the data size of the generated image data according to the generation configuration parameters as the image to be stored, and determine the data size of the generated video data according to the generation configuration parameters as the video to be stored. Exemplarily, the generation configuration parameters include the resolution x of a single frame image, the number of image frames n, and the number of encoded frames N. The image processor may obtain the product of the resolution x of a single frame image and the number of image frames n, and use the data size D1 of the obtained image data as the image to be stored, and obtain the product of the resolution x of a single frame image and the number of encoded frames N, and use the data size D2 of the obtained video encoded data as the video to be stored.

[0079] S320: Determine, in the memory of the camera device, a memory that matches the amount of images to be stored as an image buffer area.

[0080] The image cache area is a cache area used to store image data.

[0081] Optionally, after obtaining the image storage amount, the camera device applies for a cache area in the memory whose size matches the image storage amount as the image cache area. Exemplarily, the camera device can directly obtain a cache area in the memory whose size is the same as the image storage amount as the image cache area.

[0082] S330: Determine, in the memory of the camera device, a memory that matches the amount of video to be stored as a video buffer area.

[0083] The video buffer area is a buffer area used to store video encoding data.

[0084] Optionally, after obtaining the amount of images to be stored, the camera device applies for a cache area in the memory whose size matches the amount of videos to be stored as the video cache area. Exemplarily, the camera device can directly obtain a cache area in the memory whose size is the same as the amount of videos to be stored as the video cache area.

[0085] In this embodiment, the amount of images to be stored and the amount of videos to be stored are determined respectively according to the generation configuration parameters, and then the memory matching the amount of images to be stored is determined in the memory of the camera device as the image cache area, and the memory matching the amount of videos to be stored is determined in the memory of the camera device as the video cache area. In the above method, the image data and the video encoding data are generated based on the generation configuration parameters, so the amount of images to be stored and the amount of videos to be stored can be accurately determined based on the generation configuration parameters, which improves the accuracy of the amount to be stored, and the image cache area matching the amount of images to be stored and the video cache area matching the amount of videos to be stored are determined in the memory of the camera device respectively, which improves the accuracy of the determined image cache area and video cache area, so as to make full use of the image cache area and the video cache area, and thus improve the memory utilization of the camera device.

[0086] In the case where the target cache area includes an image cache area and a video cache area, in one embodiment, as Figure 4 As shown, the above S220, storing the image data and the video encoding data into the target cache area according to the generated configuration parameters, includes:

[0087] S410: Collecting original sensor data through an image sensor in a camera device.

[0088] Optionally, the camera device can control the image sensor to start up to collect raw sensor data of the monitored environment. Exemplarily, the raw sensor data is RAW format data.

[0089] S420: Generate image data and video encoding data according to original sensor data and image configuration parameters.

[0090] Optionally, after obtaining the original sensor data and the generation configuration parameters, the camera device may generate image data and video encoding data according to the generation configuration parameters.

[0091] Exemplarily, the camera device generates image data according to the configuration parameters for generating image data in the generated configuration parameters, encodes the generated image data in video format, and then generates video encoding data in combination with the configuration parameters for generating video encoding data in the generated configuration parameters to obtain image data and video encoding data.

[0092] S430: Store the image data into the image buffer area, and store the video encoding data into the video buffer area.

[0093] Optionally, after generating image data and video encoding data based on the original sensor data and the generated configuration parameters, the camera device classifies and stores the image data into an image cache area and the video encoding data into a video cache area, so as to store the image data and the video encoding data independently of each other.

[0094] The generated configuration parameters include the resolution of a single frame image, the number of image frames, and the number of encoded frames. Based on this, in one embodiment, if Figure 5 As shown, the above S420, generating image data and video encoding data according to the original sensor data and the image configuration parameters, includes:

[0095] S510, reading an image effect file through an image processor in a camera device, generating a single-frame image according to the image effect file, a resolution of the single-frame image and original sensor data, and acquiring a single-frame image of an image frame number to form image data.

[0096] Among them, the image effect file is a pre-stored program file used to generate images or videos with preset effect processing.

[0097] Optionally, the camera device can control the image processor to read the image effect file, and determine the image effect requirements according to the image effect file, and determine the image resolution size requirements according to the resolution of the single-frame image in the generation configuration parameters, and then perform corresponding effect processing and size processing on the collected raw sensor data to generate a single-frame image that meets the image effect requirements and image resolution size requirements. Further, according to the image frame number in the generation configuration parameters, the single-frame image of the image frame number forms the image data subsequently stored in the target cache area.

[0098] The image processor may process the original sensor data in RAW format to obtain image data in image format. For example, the image format may be in YUV format or in RBG format.

[0099] S520, encoding the single-frame image in a video format by using a video encoder in the camera device to generate a single-frame video frame, and obtaining a single-frame video frame with a coded frame number to form video coding data.

[0100] Optionally, the camera device can control the video encoder to encode the single frame image in a video format to generate a single video frame of a corresponding format. Further, according to the number of encoded frames in the generation configuration parameter, the single video frame of the encoded frame number forms the video encoding data subsequently stored in the target cache area.

[0101] The image processor may encode the image data in the image format to obtain a video frame in the video format to form video encoding data. Exemplarily, the video format may be H264 or H265 format.

[0102] In this embodiment, the generated configuration parameters include the resolution of a single-frame image, the number of image frames and the number of encoded frames. The image effect file is read by the image processor in the camera device to generate a single-frame image according to the image effect file, the resolution of the single-frame image and the original sensor data, and the single-frame image of the image frame number is obtained to form image data, and the single-frame image is encoded in a video format by the video encoder in the camera device to generate a single-frame video frame, and then the single-frame video frame of the encoded frame number is obtained to form video encoding data.

[0103] The camera device continuously acquires data when in operation. To improve memory utilization of the camera device, the method further includes:

[0104] After the image data in the memory of the camera device is read, the read single frame image in the image data is deleted.

[0105] The image data in the memory of the camera device is read, that is, a single frame image in the image data is read to detect the target object. If the target object is detected, the encoded video data in the memory is obtained to obtain the recorded video; if the target object is not detected, there is no need to obtain the recording instruction. The above process shows that after the single frame image in the image data is read, it becomes useless information. When the image data in the memory of the camera device is read, the camera device can delete the single frame image read in the image data to release the content to store a new single frame image and form new image data.

[0106] Accordingly, in an optional embodiment, the above method further includes:

[0107] After the video encoding data in the memory of the camera device is read, or the video encoding data is not read within a preset time period, the video encoding data is deleted.

[0108] The video coding data in the memory of the camera device is read, that is, a single video frame in the video coding data is read to record and obtain a recorded video. If a single video frame in the video coding data is read, it indicates that a target object is detected in the image data and there is a recording demand, and subsequent recording is performed; if it is not read within a preset time, it indicates that a target object is not detected in the image data and there is no recording demand. The above process illustrates that a single video frame in the video coding data becomes useless information after being read or after a preset time length. The camera device can delete the single video frame read in the video coding data after the video coding data in the memory of the camera device is read, or when the video coding data is not read within a preset time length, to release the content to store a new single video frame and form new video coding data.

[0109] It should be noted that the image data and the video encoding data are stored in the target cache area in the memory of the camera device, and the above process substantially improves the cache utilization rate of the target cache area.

[0110] In this embodiment, after the image data in the memory of the camera device is read, the read single frame image in the image data is deleted, and / or after the video encoding data in the memory of the camera device is read, or the video encoding data is not read within a preset time, the video encoding data is deleted. In the above method, by deleting useless information, the memory of the camera device is released, the memory can be reused, and the memory utilization rate of the camera device is improved.

[0111] To reduce redundant information in the recorded video, in one embodiment, Figure 6 As shown, in the above S130, the recorded video of the camera device is obtained by reading the video encoding data stored in the memory of the camera device, including:

[0112] S610: Read video encoding data of a preset duration from the memory of the camera device.

[0113] Optionally, when the camera device determines that there is a target object in the image data, the video encoding data stored in the memory of the camera device is read. Specifically, single video frames in the video encoding data can be read in chronological order for a preset duration.

[0114] S620: Generate a recorded video according to the video encoding data of a preset duration.

[0115] Optionally, the camera device may record and package the read video encoding data of a preset duration together with the acquired time-synchronized audio data to form a recorded video.

[0116] Optionally, the camera device may also continue to read the video encoding data to generate a recorded video until a stop instruction triggered by the user is received.

[0117] In this embodiment, the video encoding data of the preset duration is read from the memory of the camera device, and the recorded video is generated according to the video encoding data of the preset duration. In the above method, the preset duration is used as the recording end standard, and a limited and effective recorded video can be obtained, so that the recorded video includes the target object while reducing unnecessary redundant information, and the refinement of the recorded video is correspondingly improved.

[0118] In order to improve the outflow efficiency of the camera device, in one embodiment, before generating the wake-up instruction for the control device, the method further includes:

[0119] After the camera device is powered on, the hardware driver and image effect file are loaded in parallel, and the video encoder is initialized.

[0120] The hardware driver includes the image processor driver and the image sensor driver.

[0121] It should be noted that the video encoding data stored in the memory of the camera device is available for user terminal login / access and viewing. In order to improve the synchronization of the video encoding data with the current moment, that is, to improve the outflow efficiency of the camera device and to realize the user terminal's real-time video viewing needs, it is necessary to speed up the generation process of the video encoding data and reduce user waiting.

[0122] Optionally, after the camera device is powered on, the camera device can load the hardware driver and image effect file in parallel through multiple cores, and then initialize the video encoder to complete various preparations of the camera device before triggering the wake-up command.

[0123] Exemplarily, after the camera device is powered on, the kernel is started through Uboot to load the image processor driver and the image sensor driver in the kernel, and the small core is started to load the image effect file, and then the video encoder is initialized in the kernel.

[0124] In this embodiment, after the camera device is powered on, the hardware driver and the image effect file are loaded in parallel, and the video encoder is initialized. The hardware driver includes the driver of the image processor and the driver of the image sensor. In the above method, various preparations of the camera device are carried out in advance, so that before the wake-up instruction is generated, all preparations of the camera device have been completed. Subsequently, the image processor and the image sensor can be directly controlled to generate video encoding data, and the time-consuming preparation is advanced, which speeds up the generation process of the video encoding data, thereby improving the outflow efficiency of the camera device.

[0125] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0126] Based on the same inventive concept, the embodiment of the present application also provides a video recording device for implementing the video recording method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations of one or more video recording device embodiments provided below can refer to the limitations of the video recording method above, and will not be repeated here.

[0127] In one embodiment, Figure 7 As shown, a video recording device is provided, including: a data reading module 701, a target detection module 702 and a video recording module 703, wherein:

[0128] The data reading module 701 is used to respond to the start instruction of the detection application in the camera device and read the image data currently stored in the memory of the camera device;

[0129] The target detection module 702 is used to determine whether there is a target object in the image data according to the image data;

[0130] The video recording module 703 is used to obtain the recorded video of the camera device by reading the video coding data stored in the memory of the camera device when there is a target object in the image data. The video coding data is obtained by encoding the image data stored at the current moment.

[0131] In one embodiment, before detecting the startup of the application program in the camera device, the apparatus further comprises:

[0132] A parameter acquisition module, used to acquire generation configuration parameters in response to a wake-up instruction to the camera device;

[0133] A target cache module determines a target cache area in a memory of the camera device according to the generated configuration parameters;

[0134] The data storage module is used to store the image data and the video encoding data into the target cache area according to the generated configuration parameters.

[0135] In one embodiment, the target cache area includes an image cache area and a video cache area; the target cache module includes:

[0136] A data quantum module, used to determine the amount of images to be stored and the amount of videos to be stored according to the generated configuration parameters;

[0137] An image submodule, used for determining a memory in the memory of the camera device that matches the amount of images to be stored as an image cache area;

[0138] The video submodule is used to determine a memory in the memory of the camera device that matches the amount of video to be stored as a video cache area.

[0139] In one embodiment, the data storage module includes:

[0140] The acquisition submodule is used to acquire the raw sensor data through the image sensor in the camera device;

[0141] A generation submodule, used for generating image data and video encoding data according to original sensor data and image configuration parameters;

[0142] The storage submodule is used to store the image data into the image cache area and store the video encoding data into the video cache area.

[0143] In one embodiment, the generation configuration parameters include the resolution of a single frame image, the number of image frames, and the number of encoded frames; the generation submodule includes:

[0144] An image generation unit, used for reading an image effect file through an image processor in a camera device, generating a single-frame image according to the image effect file, a resolution of the single-frame image and original sensor data, and acquiring single-frame images of an image frame number to form image data;

[0145] The video generation unit is used to encode a single frame image in a video format through a video encoder in a camera device, generate a single frame video frame, and obtain a single frame video frame with an encoded frame number to form video encoding data.

[0146] In one embodiment, the video recording module 703 includes:

[0147] The duration submodule is used to read the video encoding data of a preset duration from the memory of the camera device;

[0148] The generation submodule is used to generate a recorded video according to the video encoding data of a preset duration.

[0149] In one embodiment, the above device further comprises:

[0150] The first deleting module deletes the read single frame image in the image data after the image data in the memory of the camera device is read.

[0151] In one embodiment, the above device further comprises:

[0152] The second deleting module deletes a single video frame read from the video encoding data after the video encoding data in the memory of the camera device is read, or the video encoding data is not read within a preset time period.

[0153] In one embodiment, the above device further comprises:

[0154] The preloading module is used to load the hardware driver and the image effect file in parallel after the camera device is powered on, and initialize the video encoder; wherein the hardware driver includes the driver of the image processor and the driver of the image sensor.

[0155] Each module in the above video recording device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0156] In one embodiment, a network camera is provided, whose internal structure diagram can be shown as follows: Figure 8As shown. The network camera includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the network camera is used to provide computing and control capabilities. The memory of the network camera includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the network camera is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a video recording method is implemented.

[0157] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of the present application, and does not constitute a limitation on the network camera to which the scheme of the present application is applied. The specific network camera may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0158] In one embodiment, a network camera is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0159] In response to a startup instruction of a detection application in the camera device, the image data currently stored in the memory of the camera device is read; whether a target object exists in the image data is determined based on the image data; when the target object exists in the image data, the recorded video of the camera device is obtained by reading the video coding data stored in the memory of the camera device, and the video coding number is obtained by encoding the image data currently stored.

[0160] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0161] In response to a wake-up instruction to the camera device, generation configuration parameters are obtained; a target cache area is determined in the memory of the camera device according to the generation configuration parameters; and image data and video encoding data are stored in the target cache area according to the generation configuration parameters.

[0162] In one embodiment, the target cache area includes an image cache area and a video cache area; when the processor executes the computer program, the processor further implements the following steps:

[0163] Determine the amount of images and videos to be stored according to the generated configuration parameters; determine the memory matching the amount of images to be stored in the memory of the camera device as the image cache area; determine the memory matching the amount of videos to be stored in the memory of the camera device as the video cache area.

[0164] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0165] The original sensor data is collected by the image sensor in the camera device; image data and video encoding data are generated according to the original sensor data and image configuration parameters; the image data is stored in the image cache area, and the video encoding data is stored in the video cache area.

[0166] In one embodiment, the generated configuration parameters include the resolution of a single frame image, the number of image frames, and the number of encoded frames; when the processor executes the computer program, the following steps are also implemented:

[0167] An image effect file is read by an image processor in a camera device, a single-frame image is generated according to the image effect file, the resolution of the single-frame image and original sensor data, and a single-frame image of the image frame number is obtained to form image data; the single-frame image is encoded in a video format by a video encoder in the camera device to generate a single-frame video frame, and a single-frame video frame of the encoded frame number is obtained to form video encoding data.

[0168] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0169] Reading video encoding data of a preset duration from the memory of the camera device; generating a recorded video according to the video encoding data of the preset duration.

[0170] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0171] After the image data in the memory of the camera device is read, the read single frame image in the image data is deleted.

[0172] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0173] After the video encoding data in the memory of the camera device is read, or the video encoding data is not read within a preset time period, the read single video frame in the video encoding data is deleted.

[0174] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0175] After the camera device is powered on, the hardware driver and the image effect file are loaded in parallel to initialize the video encoder; wherein the hardware driver includes the driver of the image processor and the driver of the image sensor.

[0176] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0177] In response to a startup instruction of a detection application in the camera device, the image data currently stored in the memory of the camera device is read; whether a target object exists in the image data is determined based on the image data; when the target object exists in the image data, the recorded video of the camera device is obtained by reading the video coding data stored in the memory of the camera device, and the video coding number is obtained by encoding the image data currently stored.

[0178] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0179] In response to a wake-up instruction to the camera device, generation configuration parameters are obtained; a target cache area is determined in the memory of the camera device according to the generation configuration parameters; and image data and video encoding data are stored in the target cache area according to the generation configuration parameters.

[0180] In one embodiment, the target cache area includes an image cache area and a video cache area; when the computer program is executed by the processor, the following steps are also implemented:

[0181] Determine the amount of images and videos to be stored according to the generated configuration parameters; determine the memory matching the amount of images to be stored in the memory of the camera device as the image cache area; determine the memory matching the amount of videos to be stored in the memory of the camera device as the video cache area.

[0182] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0183] The original sensor data is collected by the image sensor in the camera device; image data and video encoding data are generated according to the original sensor data and image configuration parameters; the image data is stored in the image cache area, and the video encoding data is stored in the video cache area.

[0184] In one embodiment, the generated configuration parameters include the resolution of a single frame image, the number of image frames, and the number of encoded frames; when the computer program is executed by the processor, the following steps are also implemented:

[0185] An image effect file is read by an image processor in a camera device, a single-frame image is generated according to the image effect file, the resolution of the single-frame image and original sensor data, and a single-frame image of the image frame number is obtained to form image data; the single-frame image is encoded in a video format by a video encoder in the camera device to generate a single-frame video frame, and a single-frame video frame of the encoded frame number is obtained to form video encoding data.

[0186] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0187] Reading video encoding data of a preset duration from the memory of the camera device; generating a recorded video according to the video encoding data of the preset duration.

[0188] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0189] After the image data in the memory of the camera device is read, the read single frame image in the image data is deleted.

[0190] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0191] After the video encoding data in the memory of the camera device is read, or the video encoding data is not read within a preset time period, the read single video frame in the video encoding data is deleted.

[0192] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0193] After the camera device is powered on, the hardware driver and the image effect file are loaded in parallel to initialize the video encoder; wherein the hardware driver includes the driver of the image processor and the driver of the image sensor.

[0194] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0195] In response to a startup instruction of a detection application in the camera device, the image data currently stored in the memory of the camera device is read; whether a target object exists in the image data is determined based on the image data; when the target object exists in the image data, the recorded video of the camera device is obtained by reading the video coding data stored in the memory of the camera device, and the video coding number is obtained by encoding the image data currently stored.

[0196] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0197] In response to a wake-up instruction to the camera device, generation configuration parameters are obtained; a target cache area is determined in the memory of the camera device according to the generation configuration parameters; and image data and video encoding data are stored in the target cache area according to the generation configuration parameters.

[0198] In one embodiment, the target cache area includes an image cache area and a video cache area; when the computer program is executed by the processor, the following steps are also implemented:

[0199] Determine the amount of images and videos to be stored according to the generated configuration parameters; determine the memory matching the amount of images to be stored in the memory of the camera device as the image cache area; determine the memory matching the amount of videos to be stored in the memory of the camera device as the video cache area.

[0200] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0201] The original sensor data is collected by the image sensor in the camera device; image data and video encoding data are generated according to the original sensor data and image configuration parameters; the image data is stored in the image cache area, and the video encoding data is stored in the video cache area.

[0202] In one embodiment, the generated configuration parameters include the resolution of a single frame image, the number of image frames, and the number of encoded frames; when the computer program is executed by the processor, the following steps are also implemented:

[0203] An image effect file is read by an image processor in a camera device, a single-frame image is generated according to the image effect file, the resolution of the single-frame image and original sensor data, and a single-frame image of the image frame number is obtained to form image data; the single-frame image is encoded in a video format by a video encoder in the camera device to generate a single-frame video frame, and a single-frame video frame of the encoded frame number is obtained to form video encoding data.

[0204] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0205] The video encoding data of the preset duration is read from the memory of the camera device; and the recorded video is generated according to the video encoding data of the preset duration.

[0206] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0207] After the image data in the memory of the camera device is read, the read single frame image in the image data is deleted.

[0208] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0209] After the video encoding data in the memory of the camera device is read, or the video encoding data is not read within a preset time period, the read single video frame in the video encoding data is deleted.

[0210] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0211] After the camera device is powered on, the hardware driver and the image effect file are loaded in parallel to initialize the video encoder; wherein the hardware driver includes the driver of the image processor and the driver of the image sensor.

[0212] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0213] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0214] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A video recording method, characterized in that: The method comprises: In response to a start instruction of a detection application in the camera device, read the image data currently stored in the memory of the camera device; determining whether a target object exists in the image data according to the image data; In the case where the target object exists in the image data, the recorded video of the camera device is obtained by reading the video coding data stored in the memory of the camera device, and the video coding data is obtained by encoding the image data stored at the current moment.

2. The method according to claim 1, characterized in that Before detecting the startup of an application program in the camera device, the method further includes: In response to a wake-up instruction to the camera device, acquiring generation configuration parameters; determining a target cache area in the memory of the camera device according to the generated configuration parameters; The image data and the video encoding data are stored in the target cache area according to the generated configuration parameters.

3. The method according to claim 2, characterized in that The target cache area includes an image cache area and a video cache area; and determining the target cache area in the memory of the camera device according to the generated configuration parameters includes: Determine the amount of images to be stored and the amount of videos to be stored according to the generated configuration parameters; Determining a memory in the memory of the camera device that matches the amount of the image to be stored as the image buffer area; A memory matching the amount of video to be stored is determined in the memory of the camera device as the video buffer area.

4. The method according to claim 3, characterized in that The storing the image data and the video encoding data into the target cache area according to the image configuration parameters comprises: Raw sensor data collected by an image sensor in the camera device; generating the image data and the video encoding data according to the original sensor data and the image configuration parameters; The image data is stored in the image buffer area, and the video encoding data is stored in the video buffer area.

5. The method according to claim 4, characterized in that The generation configuration parameters include the resolution of a single frame image, the number of image frames, and the number of coded frames; the generation of the image data and the video coded data according to the original sensor data and the image configuration parameters includes: Reading an image effect file through an image processor in the camera device, generating a single-frame image according to the image effect file, the resolution of the single-frame image and the original sensor data, and acquiring the single-frame image of the image frame number to form the image data; The single-frame image is encoded in a video format by a video encoder in the camera device to generate a single-frame video frame, and the single-frame video frames of the encoded frame number are obtained to form the video encoding data.

6. The method according to any one of claims 1 to 5, characterized in that The step of obtaining the recorded video of the camera device by reading the video encoding data stored in the memory of the camera device comprises: Reading video encoding data of a preset duration from the memory of the camera device; The recorded video is generated according to the video encoding data of the preset duration.

7. The method according to any one of claims 1 to 5, characterized in that The method further comprises: After the image data in the memory of the camera device is read, the read single frame image in the image data is deleted.

8. The method according to any one of claims 1 to 5, characterized in that The method further comprises: After the video encoding data in the memory of the camera device is read, or the video encoding data is not read within a preset time length, the read single video frame in the video encoding data is deleted.

9. The method according to claim 5, characterized in that Before generating the wake-up instruction, the method further includes: After the camera device is powered on, the hardware driver and the image effect file are loaded in parallel to initialize the video encoder; wherein the hardware driver includes the driver of the image processor and the driver of the image sensor.

10. A video recording device, characterized in that: The device comprises: A data reading module, configured to read the image data currently stored in the memory of the camera device in response to a start instruction of a detection application in the camera device; A target detection module, used to determine whether a target object exists in the image data according to the image data; The video recording module is used to obtain the recorded video of the camera device by reading the video coding data stored in the memory of the camera device when the target object exists in the image data. The video coding data is obtained by encoding the image data stored at the current moment.

11. A network camera, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 9 are implemented.