Battery camera and video recording method thereof, video monitoring system and storage medium
By configuring the pre-recording mode in the battery camera, recording videos from a period of time before the alarm was detected, the problem that the battery camera could not record the video before the alarm was solved, and a more comprehensive monitoring screen traceback was achieved, enhancing users' understanding of the alarm situation.
Patent Information
- Application Number
- CN202510162896.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-13
- Publication Date
- 2025-06-03
AI Technical Summary
When the battery camera triggers an alarm event in standby state, it cannot record the video screen some time before the alarm, resulting in the user being unable to understand the alarm situation.
By configuring the pre-recording mode in the battery camera, the battery camera will be awakened to enter the pre-recording mode for video recording based on the pre-set pre-recording schedule time, stop pre-recording power and pre-recording duration. When an alarm event is triggered, find the video with a pre-recorded duration from the alarm time as the pre-recorded video in the video recording.
When the preset conditions are met, the battery camera can trace back the video surveillance screen within the pre-recording time before alarm in the pre-recording mode, so that users can better understand the alarm situation.
Smart Images

Figure CN120091223A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the technical field of security video surveillance, and in particular to a battery camera, a video recording method thereof, a video surveillance system, and a storage medium. Background Art
[0002] A battery camera is a portable surveillance device. Compared with a camera powered by a fixed power supply, a battery camera relies on a built-in rechargeable battery for power supply, so it can work independently without an external power supply, and is suitable for flexible deployment and mobile surveillance.
[0003] Currently, a battery camera only records video when an alarm event is triggered. When an alarm event is triggered during standby of the battery camera, its key components (such as an image sensor and an encoding chip) are awakened, and the battery camera starts to collect surveillance images and perform encoding, and records video according to the video stream obtained by encoding. Since it takes time to wake up the battery camera and start encoding, the video recording start time is after the alarm time, and the images during a period before the alarm and during the period from the alarm to the start of encoding cannot be recorded. If the target in front of the lens moves fast, the target may have moved out of the frame before the video recording starts, which may result in no target in the video recording this time, and the user cannot know what happened during this alarm and may think it is a false alarm. Summary of the Invention
[0004] In view of the above problems, the embodiments of the present application provide a battery camera, a video recording method thereof, a video surveillance system, and a storage medium, aiming to solve the problem that the existing video recording method of a battery camera cannot record the video images during a period before the alarm.
[0005] According to one aspect of the embodiments of the present application, a video recording method of a battery camera is provided, and the method includes: when the current time of the battery camera is within a preset pre-recording plan time and the current power of the battery camera is greater than a preset stop pre-recording power, wake up the battery camera to enter a pre-recording mode for video recording and storage; when the battery camera triggers an alarm event, search for a video with a pre-recording duration from the alarm time forward in the video recording to obtain a pre-recorded video.
[0006] In an optional manner, the video recording method further includes: when a switch parameter of the pre-recording mode indicates that the pre-recording plan is turned on, obtain the current time and the current power of the battery camera; determine whether the current time is within the preset pre-recording plan time, and determine whether the current power is greater than the preset stop pre-recording power.
[0007] In an alternative manner, the video recording method further includes: if the current time is within the pre-recording planned time and the current battery level is greater than the stop pre-recording battery level, a first flag is generated by the micro-control unit of the battery camera and sent to the encoding chip of the battery camera; in response to receiving the first flag, the encoding chip sets the pre-recording identification bit to keep the encoding chip operating in the pre-recording mode; if the current time exceeds the pre-recording planned time or the current battery level is less than or equal to the stop pre-recording battery level, the micro-control unit generates a second flag and sends it to the encoding chip; in response to receiving the second flag, the encoding chip is controlled to exit the pre-recording mode and the battery camera enters the standby state.
[0008] In an alternative manner, the video recording method further includes: when exiting the pre-recording mode due to the current battery level being less than or equal to the stop pre-recording battery level, after the battery camera is charged, it is determined whether the current battery level is greater than a preset battery level threshold and whether the current time is within the pre-recording planned time, the battery level threshold being greater than the stop pre-recording battery level; if the current time is within the pre-recording planned time and the current battery level is greater than the battery level threshold, the battery camera is re-awakened to enter the pre-recording mode.
[0009] In an alternative manner, the step of awakening the battery camera to enter the pre-recording mode for video recording and storage specifically includes: awakening the battery camera to enter the pre-recording mode; controlling the image acquisition unit of the battery camera to perform video recording at a preset pre-recording frame rate; encoding the video recording by the encoding chip of the battery camera to obtain a video bitstream, and storing the video bitstream in the memory of the battery camera.
[0010] In an alternative manner, finding the pre-recorded video that is pre-recorded for a pre-recording duration from the alarm time in the video recording includes: calculating the start pre-recording time by the encoding chip of the battery camera according to the alarm time and the pre-recording duration; obtaining the video bitstream starting from the start pre-recording time from the memory by the encoding chip; and transcoding the video bitstream by the encoding chip to obtain the pre-recorded video.
[0011] In an alternative manner, the video recording method further includes: restarting the battery camera at a random moment within a preset time period, the interval between the random moment and the most recent power-on startup time of the battery camera being greater than a preset duration.
[0012] In an alternative manner, the video recording method further includes: receiving a pre-recording planned time, a stop pre-recording power level, and a pre-recording duration preset by a user from a pre-recording mode configuration interface displayed on an electronic device, and storing them in an encoding chip of the battery camera, where the electronic device establishes a network communication connection with the battery camera.
[0013] In an alternative manner, the video recording method further includes: receiving and storing a pre-recording planned time, a stop pre-recording power level, and a pre-recording duration sent by a Hub router, where the pre-recording planned time, the stop pre-recording power level, and the pre-recording duration sent by the Hub router all come from the electronic device, the electronic device obtains the pre-recording planned time, the stop pre-recording power level, and the pre-recording duration preset by the user through the pre-recording mode configuration interface, and the Hub router establishes a network communication connection with the battery camera and the electronic device.
[0014] In an alternative manner, when the battery camera triggers an alarm event, finding a pre-recorded video from the video recording for a pre-recording duration before the alarm time further includes: when the battery camera triggers an alarm event, reporting the alarm event to the Hub router; receiving a start pre-recording time sent by the Hub router, where the start pre-recording time is determined according to the pre-recording duration and the alarm time; finding a video starting from the start pre-recording time in the video recording to obtain the pre-recorded video.
[0015] According to another aspect of the embodiments of the present application, there is provided a battery camera, including: a memory and at least one processor; the memory stores computer-executable instructions; the at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the video recording method of the battery camera as described above.
[0016] According to yet another aspect of the embodiments of the present application, there is provided a computer-readable storage medium, where executable instructions are stored in the storage medium, and the executable instructions execute the video recording method of the battery camera as described above when running.
[0017] According to yet another aspect of the embodiments of the present application, there is provided a video monitoring system, where the battery camera is connected to an electronic device through a network, and: the electronic device is used to set a pre-recording planned time, a stop pre-recording power level, and a pre-recording duration of the battery camera, and send them to the battery camera; the battery camera is used to obtain the current time and current power level of the battery camera, and if the current time is within the pre-recording planned time and the current power level is greater than the stop pre-recording power level, wake up the battery camera to enter the pre-recording mode for video recording and storage, and when the battery camera triggers an alarm event, find a pre-recorded video from the video recording for the pre-recording duration before the alarm time.
[0018] In an alternative manner, the video surveillance system further includes a Hub router, which establishes a network communication connection with the battery camera and the electronic device, where: the Hub router is configured to receive the pre-recording scheduled time, the power level for stopping pre-recording, and the pre-recording duration from the electronic device and forward them to the battery camera. When the battery camera triggers an alarm event, the Hub router receives the reported alarm from the battery camera and obtains the alarm time, determines the start pre-recording time according to the pre-recording duration and the alarm time, and sends the determined start pre-recording time to the battery camera; the battery camera is further configured to find the video starting from the start pre-recording time in the video recording to obtain the pre-recorded video.
[0019] In an alternative manner, the electronic device is further configured to display a pre-recording mode configuration interface of the battery camera, and the pre-recording mode configuration interface includes a pre-recording mode switch control, a power level configuration control for stopping pre-recording, a pre-recording duration configuration control, a schedule configuration control, and a frame rate configuration control, where: the pre-recording mode switch control is used to turn on or off the pre-recording mode of the battery camera; the power level configuration control for stopping pre-recording is used to set the power level for stopping pre-recording of the battery camera; the pre-recording duration configuration control is used to set the pre-recording duration of the battery camera; the schedule configuration control is used to set the pre-recording scheduled time of the battery camera; the frame rate configuration control is used to set the video recording frame rate of the battery camera.
[0020] In the embodiments of the present application, by configuring the pre-recording scheduled time, the power level for stopping pre-recording, and the pre-recording duration in the pre-recording mode of the battery camera, when the current time is within the pre-recording scheduled time and the current power level is greater than the power level for stopping pre-recording, the battery camera enters the pre-recording mode to perform video recording and storage. When an intrusion target appears in the monitored area and triggers an alarm event, it is possible to find the video with the pre-recording duration before the alarm time from the stored video recording as the pre-recorded video. Through the above method, the battery camera can work in the pre-recording mode when meeting the preset conditions, and in the pre-recording mode, it can retrieve the video surveillance images within the pre-recording duration before each alarm, so that the user can better understand the alarm situation and know the behavior of the intrusion target in the monitored area before the alarm is triggered.
[0021] The above description is only an overview of the technical solutions of the embodiments of the present application. In order to be able to understand the technical means of the embodiments of the present application more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features, and advantages of the embodiments of the present application more obvious and understandable, the following specifically illustrates the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The accompanying drawings are only used to illustrate the embodiments and are not considered to limit the present application. Moreover, throughout the drawings, the same reference numerals are used to represent the same components. In the drawings:
[0023] Figure 1 Shows a schematic diagram of the application scenario of the video surveillance system provided by the embodiment of the present application;
[0024] Figure 2 Shows a schematic diagram of the structure of the battery camera provided by the embodiment of the present application;
[0025] Figure 3 Shows a schematic diagram of the interface for configuring the pre-recording mode on the electronic device in the embodiment of the present application;
[0026] Figure 4 Shows a schematic flowchart of the video recording method of the battery camera provided by the embodiment of the present application;
[0027] Figure 5 Shows a detailed flowchart of the video recording method of the battery camera provided by the embodiment of the present application;
[0028] Figure 6 Shows another schematic diagram of the application scenario of the video surveillance system provided by the embodiment of the present application;
[0029] Figure 7 Shows a schematic flowchart of the video recording method of the battery camera provided by the embodiment of the present application;
[0030] Figure 8 Shows a detailed flowchart of the video recording method of the battery camera provided by the embodiment of the present application. Detailed Embodiments
[0031] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein.
[0032] Figure 1The figure shows a schematic diagram of the application scenario of the video surveillance system provided by the embodiments of the present application. In the embodiments of the present application, the video surveillance system includes a battery camera 1, an electronic device 2, and a network 3. The battery camera 1 establishes a communication connection with the electronic device 2 through the network 3. The battery camera 1 can be a camera for security surveillance powered by a battery, an IP camera, or other video surveillance devices. The electronic device 2 can be a touch-screen mobile phone, a smart phone, a tablet computer, a portable electronic device, or other electronic devices with a display screen, and is usually also referred to as a client. The network 3 includes, but is not limited to, one or more of a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a 4G / 5G network, WIFI, Bluetooth, and a peer-to-peer (P2P) communication network.
[0033] In the embodiments of the present application, both the battery camera 1 and the electronic device 2 can include one or more processors, which may be a microcontroller unit (MCU), a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application, and are not limited herein. The one or more processors included in the electronic device can be of the same type of processor, such as one or more CPUs; or they can be of different types of processors, such as one or more CPUs and one or more ASICs, and are not limited herein.
[0034] At least one processor of the battery camera 1 is used to execute computer-executable instructions, so that at least one processor performs the operations of the video recording method of the battery camera.
[0035] In the embodiments of the present application, the battery camera 1 is installed in a surveillance area (such as a home, an office, a shopping mall, etc.), so that the battery camera 1 can capture surveillance videos in the surveillance area and send the captured videos to the electronic device 2 through the network 3 for the user to view.
[0036] Figure 2 The figure shows a schematic diagram of the structure of the battery camera provided by the embodiments of the present application. As Figure 2 shown, the battery camera 1 can include an MCU 11, an encoding chip 12, a memory 13, a battery 14, an image acquisition unit 15, and a sensing unit 16.
[0037] The MCU 11 is used to execute a computer program, and specifically can execute the relevant steps in the embodiment of the video recording method of the battery camera provided in this application. The computer program may include computer-executable instructions. The MCU has low power consumption, which can extend the battery life. Moreover, the highly integrated design of the MCU reduces the need for external components, lowering the cost and volume of the battery camera 1. At the same time, the processing power of the MCU can meet the embedded monitoring requirements of the battery camera 1. In some other embodiments, other control units such as a CPU or an ASIC can also be used to implement the functions of the MCU 11.
[0038] The image acquisition unit 15 consists of an image sensor (such as a CMOS or CCD sensor) and related signal processing circuits, and is used to capture the light in the monitoring area environment and convert it into a video electrical signal to shoot the video image of the monitoring area.
[0039] The encoding chip 12 is used to execute a computer program, and specifically can execute the relevant steps in the embodiment of the video recording method of the battery camera provided in this application. The main function of the encoding chip 12 is to convert the video electrical signal captured by the image acquisition unit 15 into a video digital signal, and perform compression encoding to obtain a video bitstream, so as to reduce the amount of video data and facilitate network transmission.
[0040] The memory 13 is used to store the video bitstream. The memory 13 may include a high-speed random access memory (Random Access Memory, RAM), and may also include a non-volatile memory, such as at least one disk memory. The RAM can adopt a double data rate synchronous dynamic random access memory (Double Data Rate Synchronous Dynamic Random-Access Memory, DDR SDRAM, abbreviated as DDR).
[0041] The battery 14 provides electrical energy for each electrical component in the battery camera 1 (such as the MCU 11, the encoding chip 12, the memory 13, the image acquisition unit 15, and the sensing unit 16). The battery 14 can be a rechargeable lithium-ion battery or a lithium polymer battery.
[0042] The sensing unit 16 is used to detect targets (such as vehicles, people, animals, etc.) in the monitoring area and trigger alarm events. In this embodiment, the sensing unit 16 can be a passive infrared (Passive Infrared, PIR) sensor, a motion detection (Motion Detection, MD) module, or a human detection module, etc. Taking the PIR sensor as an example, if a human body enters the monitoring area, the sensing unit 16 can sense the infrared heat source radiated by the human body, that is, trigger the alarm event of someone entering the monitoring area.
[0043] The battery camera 1 may also include other units, such as a communication unit for wirelessly transmitting data through the network 3 to an external connected device or the cloud, a microphone for capturing voice input, and so on.
[0044] In the embodiment of the present application, the battery camera 1 is pre-configured with a pre-recording mode, and the MCU 11 and the encoding chip 12 both store the condition parameters of the pre-recording mode. After the battery camera 1 is powered on and started, the MCU 11 determines whether the conditions for entering the pre-recording mode are met according to the current state of the battery camera 1 and the condition parameters of the pre-recording mode. In the pre-recording mode, if a target enters the monitoring area, the sensing unit 16 is triggered to alarm, and the encoding chip 12 searches backward from the trigger alarm time for the video stream of the pre-recording duration for video transcoding to obtain the pre-recorded video. The user can view the pre-recorded video in the playback function, FTP service, and cloud service of the application (APP) installed in the electronic device 2 to understand the situation of the monitoring area for a period of time before the trigger alarm.
[0045] Figure 3 The schematic diagram of the interface for configuring the pre-recording mode in the embodiment of the present application is shown. Among them Figure 3 Figure (a) shows the pre-recording mode configuration interface on the electronic device 2. The pre-recording mode configuration interface includes a pre-recording mode switch control 21, a stop pre-recording power configuration control 22, a frame rate configuration control 23, and a schedule configuration control 24.
[0046] The pre-recording mode switch control 21 is used for the user to configure the opening and closing of the pre-recording mode for the battery camera 1. Before the pre-recording mode switch control 21 is operated, the pre-recording plan of the battery camera 1 is not enabled, and the pre-recording mode is in an unconfigured state. In response to the user's operation on the pre-recording mode switch control 21, the electronic device 2 receives the pre-recording mode switch parameter. For example, after the user operates the pre-recording mode switch control 21, the value of the pre-recording mode switch parameter received by the electronic device 2 is 1, indicating that the user enables the pre-recording plan. At the same time, the electronic device 2 also switches the stop pre-recording power configuration control 22, the frame rate configuration control 23, and the schedule configuration control 24 from the inoperable state to the operable state, so that the user can configure the condition parameters of the pre-recording mode through the above controls.
[0047] The stop pre-recording power configuration control 22 is used for the user to configure the stop pre-recording power of the pre-recording mode for the battery camera 1. The stop pre-recording power has a configurable range, and the stop pre-recording power configuration control 22 can slide within this range. In response to the user's operation on the stop pre-recording power configuration control 22, the electronic device 2 receives the stop pre-recording power configured by the user.
[0048] The frame rate configuration control 23 is used for the user to configure the video recording frame rate (i.e., the pre-recording frame rate) of the pre-recording mode for the battery camera 1. The electronic device 2 receives the video recording frame rate configured by the user in the pre-recording mode in response to the user's operation on the frame rate configuration control 23.
[0049] The schedule configuration control 24 is used for the user to configure the pre-recording schedule time of the pre-recording mode for the battery camera 1. The electronic device 2 displays the schedule configuration interface as shown in Figure 3 (b) in response to the user's operation on the schedule configuration control 24. The schedule configuration interface includes an always-on control 25 and a custom control 26. The electronic device 2 receives the pre-recording schedule time of 7×24 hours configured by the user in the condition for entering the pre-recording mode in response to the user's operation on the always-on control 25. The user can configure when to turn on the pre-recording mode at multiple time periods within a week by operating the custom control 26. The electronic device 2 makes the "+" control 27 in the schedule configuration interface switch from the inoperable state to the operable state in response to the user's operation on the custom control 26. The user can add a custom pre-recording schedule time by clicking the "+" control 27, such as Figure 3 "Thursday, Friday, Saturday 00:00 - 10:59" and "Sunday, Monday, Tuesday 08:00 - 23:59" shown in (b) above. If the battery camera 1 meets the remaining conditions in the condition for entering the pre-recording mode during the above two time periods, the battery camera 1 enters the pre-recording mode. No matter whether the battery camera 1 meets the remaining conditions in the condition for entering the pre-recording mode or not during the remaining time periods, the battery camera 1 will not enter the pre-recording mode.
[0050] As Figure 3 shown in (a) above, the pre-recording mode configuration interface also includes a pre-recording duration configuration control 28. The pre-recording duration configuration control 28 is used for the user to configure the pre-recording duration of the pre-recording mode for the battery camera 1. The electronic device 2 receives the pre-recording duration configured by the user in response to the user's operation on the pre-recording duration configuration control 28. The custom configuration of the pre-recording duration can be realized in this way. For example, the pre-recording duration configured by the user shown in the figure is 10s.
[0051] After the electronic device 2 obtains the pre-recording mode switch parameter, stop pre-recording power, pre-recording frame rate, pre-recording schedule time, and pre-recording duration configured by the user, it sends the above condition parameters of the pre-recording mode to the battery camera 1 through the network 3.
[0052] After the battery camera 1 receives the conditional parameters of the pre-recording mode, the encoding chip 12 of the battery camera 1 stores the pre-recording mode switch parameter, the power level for stopping pre-recording, the pre-recording frame rate, the pre-recording planned time, and the pre-recording duration. For example, the encoding chip 12 can store the conditional parameters of the above pre-recording mode in the parameter partition of its Flash. The encoding chip 12 also transmits the power level for stopping pre-recording and the pre-recording planned time to the MCU 11 for the MCU 11 to store and use later.
[0053] Figure 4 The flowchart of the video recording method of the battery camera provided by the embodiment of the present application is shown. This method is applied to the battery camera 1. As Figure 4 shown, the method includes the following steps:
[0054] S401, receive and store the conditional parameters of the pre-recording mode of the battery camera.
[0055] The battery camera receives the conditional parameters of the pre-recording mode configured by the user sent by the electronic device. The conditional parameters of the pre-recording mode include the pre-recording planned time, the power level for stopping pre-recording, and the pre-recording duration.
[0056] S402, obtain the current time and the current power level of the battery camera.
[0057] The condition for the battery camera to enter the pre-recording mode is that the current time is within the pre-recording planned time and the current power level is greater than the power level for stopping pre-recording. Therefore, this step obtains the current time and the current power level of the battery camera to further determine whether the condition for entering the pre-recording mode is satisfied.
[0058] S403, determine whether the current time is within the pre-recording planned time and whether the current power level is greater than the power level for stopping pre-recording.
[0059] S404, if the current time is within the pre-recording planned time and the current power level is greater than the power level for stopping pre-recording, wake up the battery camera to enter the pre-recording mode for video recording and storage.
[0060] When the pre-recording plan is started, if the current battery level of the battery camera is greater than or equal to the stop pre-recording battery level and the current time of the battery camera 1 is within the pre-recording plan time, it indicates that the condition for entering the pre-recording mode is met, and the battery camera enters the pre-recording mode. In the pre-recording mode, the image acquisition unit 15 of the battery camera 1 acquires the video of the monitoring area and encodes it to obtain a video stream, and stores the video stream in the memory, which can be the internal memory, SD card or external memory of the battery camera 1, etc. In this embodiment, the video stream is stored in a rolling manner to keep the time of the stored video stream in the latest time period. The specific method can be that when the pre-recording storage space of the memory for temporarily storing the pre-recording video stream is full, the newly written video stream will overwrite the video stream with the earliest time, or the video stream with the earliest time will be cleared so that the latest video stream can be written into the pre-recording storage space and stored.
[0061] S405. When the battery camera triggers an alarm event, search for the video with the pre-recording duration from the alarm time in the stored video recording to obtain the pre-recorded video.
[0062] If an alarm event is triggered (such as triggering a PIR alarm), it indicates that there is an intrusion target in the monitoring area, and recording is required for the user to view. In this embodiment, the battery camera 1 searches for the video stream with the pre-recording duration from the alarm time in the video stream stored in the memory for video transcoding to obtain the pre-recorded video for video playback, so that the user can view the monitoring screen with the pre-recording duration before the alarm time.
[0063] In some embodiments, the condition parameters of the pre-recording mode further include a pre-recording mode switch parameter. When the pre-recording mode switch parameter indicates that the pre-recording plan has been started, S402 continuously obtains the current time and current battery level of the battery camera.
[0064] In some embodiments, the condition parameters of the pre-recording mode configured in S401 further include a pre-recording frame rate, and this step records video according to the configured pre-recording frame rate.
[0065] In the embodiment of the present application, by configuring the conditional parameters of the pre-recording mode in the battery camera, the conditional parameters of the pre-recording mode include the pre-recording planned time, the power at which pre-recording stops, and the pre-recording duration, and obtaining the current time and the current power of the battery camera. When the current time is within the pre-recording planned time and the current power is greater than the power at which pre-recording stops, the battery camera enters the pre-recording mode. In the pre-recording mode, the battery camera collects the video of the monitoring area and encodes it to obtain a video stream, and stores the video stream in the memory of the battery camera. When an intrusion target appears in the monitoring area and triggers an alarm event, it is possible to find the video stream of the pre-recording duration before the alarm time from the video stream stored in the memory for video transcoding to obtain the pre-recorded video. Through the above method, the battery camera can work in the pre-recording mode when meeting the preset conditions, and in the pre-recording mode, it can retrieve the video monitoring screen within the pre-recording duration before the alarm each time an alarm event is triggered, so that the user can better understand the alarm situation and know the behavior of the intrusion target in the monitoring area before the alarm event is triggered.
[0066] Figure 5 The detailed flowchart of the video recording method of the battery camera provided by the embodiment of the present application is shown. In the embodiment of the present application, this method is applied to the battery camera 1. This video recording method can be jointly executed by the MCU 11 and the encoding chip 12 in the battery camera 1. As Figure 5 shown, the method includes the following steps:
[0067] S501, the encoding chip receives and stores the conditional parameters of the pre-recording mode.
[0068] The conditional parameters of the pre-recording mode include the pre-recording mode switch parameter, the pre-recording planned time, the power at which pre-recording stops, the pre-recording duration, and the pre-recording frame rate. In this embodiment, the conditional parameters of the pre-recording mode can be configured by the user on the electronic device 2. After the electronic device 2 sends the conditional parameters configured by the user to the battery camera 1, the encoding chip 12 stores the above conditional parameters. In other embodiments, the conditional parameters of the pre-recording mode can also be pre-set in the battery camera 1.
[0069] S502, the encoding chip sends the power at which pre-recording stops and the pre-recording planned time to the MCU.
[0070] In this embodiment, the encoding chip 12 determines whether the pre-recording plan is in an on state or an off state according to the switch parameter of the pre-recording mode. If the switch parameter of the pre-recording mode indicates that the pre-recording plan has been turned on, the encoding chip 12 sends the stop pre-recording power and the pre-recording plan time to the MCU 11 so that the MCU 11 can execute the operation process in the pre-recording mode. If the switch parameter of the pre-recording mode indicates that the pre-recording plan has not been turned on, the encoding chip 12 does not execute this step. When the MCU 11 does not receive the stop pre-recording power and the pre-recording plan time, it will not execute the operation process in the pre-recording mode. For example, if the value of the switch parameter of the pre-recording mode is "1", it means that the battery camera 1 has turned on the pre-recording mode, and the encoding chip 12 executes S502.
[0071] S503. The MCU determines whether the conditions for entering the pre-recording mode are met based on the current power and the current time of the battery camera. If so, it executes S504; otherwise, it executes S510.
[0072] After receiving the stop pre-recording power and the pre-recording plan time, the MCU 11 can determine in real time whether the conditions for entering the pre-recording mode are met, so that the battery camera 1 can enter the pre-recording mode in a timely manner when the conditions for entering the pre-recording mode are met. The MCU 11 can also periodically determine whether the battery camera 1 meets the conditions for entering the pre-recording mode to reduce the power consumption of the MCU. For example, through the method of timer interruption, each time an interruption is triggered, the MCU 11 reads the current power and the current time of the battery camera 1, and then determines whether the battery camera 1 meets the conditions for entering the pre-recording mode.
[0073] The conditions for entering the pre-recording mode are that the current time of the battery camera 1 is within the pre-recording plan time and the current power of the battery camera 1 is greater than or equal to the stop pre-recording power. When the pre-recording mode of the battery camera 1 has been turned on, the MCU 11 obtains the current power and the current time of the battery camera 1 and determines the conditions for entering the pre-recording mode. If the current time is within the pre-recording plan time and the current power is greater than the stop pre-recording power, it means that the battery camera 1 meets the conditions for entering the pre-recording mode, and the battery camera 1 can enter the pre-recording mode. If the current time of the battery camera 1 is outside the pre-recording plan time, or the current power of the battery camera 1 is less than the stop pre-recording power, it means that the battery camera 1 does not meet the conditions for entering the pre-recording mode, and the battery camera 1 does not enter the pre-recording mode.
[0074] S504. The MCU sends a first flag to the encoding chip.
[0075] If the MCU 11 determines that the battery camera 1 meets the conditions for entering the pre-recording mode, it generates a first flag and sends it to the encoding chip 12, for example, prerecord_mode_flag = 1. The first flag is used to identify the entry into the pre-recording mode. After receiving the first flag, the encoding chip 12 executes the operation process in the pre-recording mode.
[0076] If the encoding chip 12 is in the standby state, the MCU 11 first wakes up the encoding chip 12 and then sends a first tag to the encoding chip 12. The MCU can wake up the encoding chip by sending a wake-up signal to the encoding chip 12.
[0077] S505, the MCU process of the encoding chip broadcasts the first tag to the ROUTE process and the REC process.
[0078] The ROUTE process is used to manage process message communication, and the REC process is used for video recording. The ROUTE process and the REC process execute the operation flow in the pre-recording mode according to the first tag.
[0079] If the battery camera 1 is also configured with a File Transfer Protocol (FTP) service and / or a CLOUD service, the MCU process of the encoding chip 12 also broadcasts the first tag to the FTP process and the CLOUD process, so that the FTP process and the CLOUD process execute the operation flow in the pre-recording mode according to the first tag. For example, when an alarm is triggered, the pre-recorded video recorded by the REC process is uploaded to a remote FTP server via the FTP protocol or uploaded to a cloud server.
[0080] S506, the ROUTE process controls the encoding chip to remain in the working state according to the first tag.
[0081] In response to receiving the first tag, the ROUTE process sets the pre-recording identification bit (for example, the busy bit of PRE_RECORD. The busy bit is a register bit used by the encoding chip to tell the MCU 11 the currently processed service), for example, sets the pre-recording identification bit to 1. If the pre-recording identification bit is 0 and no other services are running, it will cause the encoding chip to standby. The main function of the encoding chip 12 is to encode the video frames collected by the image acquisition unit 12 into a video bitstream. Therefore, when the encoding chip is in standby, the image acquisition unit will also enter the standby state (usually when the image acquisition unit and the encoding chip are in standby, it is called that the battery camera is in the standby mode).
[0082] When the image acquisition unit 15 and the encoding chip 12 of the battery camera 1 are on standby, both are in a low-power state, which can save power consumption and extend the service life of the device, and can quickly return to the normal working state when video monitoring is required. When the image acquisition unit 15 and the encoding chip 12 are on standby, the sensing unit 16 remains in the working state for PIR detection; the MCU 11 also remains in the working state for processing external events such as network connection, PIR0 alarm, etc. When specific conditions are met, such as detecting that a target enters the monitoring area (for example, detecting motion), receiving a remote control command, or reaching a preset wake-up time, the image acquisition unit 15 and the encoding chip 12 will be woken up from the standby state and enter the normal working state to restore the full-function operation of the battery camera 1, including video acquisition, encoding, transmission, and storage of the video stream.
[0083] In this step, by setting the pre-recording flag position to 1, the encoding chip 12 is kept working in the pre-recording mode without entering the standby state, so as to achieve that the battery camera 1 does not standby.
[0084] S507, the REC process encodes the video frames acquired by the image acquisition unit to obtain a video bitstream.
[0085] During the continuous operation of the battery camera 1 without standby, the image acquisition unit 16 continuously acquires video frames of the monitoring area, and the encoding chip 12 encodes the acquired video frames to obtain a video bitstream.
[0086] To meet the playback requirements in different scenarios, the encoding chip 12 can use two encoding methods to obtain a main bitstream and a sub-bitstream, and store both video bitstreams in the memory. The main bitstream has higher quality and a larger bit rate, and can provide a clearer picture and a higher frame rate. The sub-bitstream has a lower bit rate and a smaller resolution compared to the main bitstream. Users can choose to view the main bitstream or the sub-bitstream according to actual needs and network conditions. If a higher recognition of details in the monitoring picture is required, the user can choose to view the main bitstream; if the bandwidth is limited or the requirement for picture quality is not high, the user can choose to view the sub-bitstream.
[0087] S508, the encoding chip stores the video bitstream in the memory.
[0088] In the embodiments of the present application, a pre-recording storage space for temporarily storing pre-recorded video streams can be set for the memory in advance. The capacity of the pre-recording storage space is greater than or equal to the size of the video stream corresponding to the maximum pre-recording duration configurable by the user, that is, the duration of the video stream that the pre-recording storage space can store is greater than or equal to the maximum pre-recording duration configurable by the user. No matter which pre-recording duration the user configures within the maximum pre-recording duration, the video stream temporarily stored in the pre-recording storage space of the memory can meet the generation requirements of the pre-recorded video. For example, if the maximum pre-recording duration configurable by the user is 15s, and the size X of the maximum 15s video stream generated by the battery camera is determined according to the video coding format, resolution, pre-recording frame rate, compression ratio, etc. of the battery camera, then the capacity of the pre-recording storage space is set to X or a value larger than X.
[0089] The temporary storage of the video stream in the memory can adopt the circular buffer technology. As new video streams are continuously input, when the buffer reaches its capacity limit, a data overwrite operation is performed, where the oldest video stream data is replaced by the new video stream data, thereby realizing the recycling of the buffer and maintaining the continuous recording of the video stream.
[0090] S509, when a PIR alarm is triggered, the REC process searches in the memory for the video stream of the pre-recording duration starting from the alarm time and performs video transcoding to obtain the pre-recorded video.
[0091] Since the memory temporarily stores the video stream of the latest pre-recording duration, the REC process can obtain the video stream of the pre-recording duration starting from the alarm time and record the video of this segment of the video stream. When the REC process records, it records according to the frame rate in the conditional parameters of the pre-recording mode stored in the encoding chip.
[0092] Specifically, the REC process can calculate the starting pre-recording time according to the alarm time and the pre-recording duration, then obtain the video stream starting from the starting pre-recording time from the memory, and perform video transcoding on this segment of the video stream according to the pre-recording frame rate, so as to obtain the recorded video of the pre-recording duration starting from the alarm time.
[0093] If the battery camera is configured with an FTP service and / or a CLOUD service, the FTP process uploads the pre-recorded video recorded by the REC process to a remote FTP server through the FTP protocol, and / or the CLOUD process uploads the pre-recorded video to the cloud server.
[0094] In the above steps, S504 - S509 are the processes executed after the battery camera enters the pre-recording mode.
[0095] S510, the MCU controls the encoding chip to standby.
[0096] When the MCU 11 determines that the battery camera 1 does not meet the entry conditions for the pre-recording mode, it does not send the first flag to the encoding chip 12 (i.e., does not execute S504) to enable the encoding chip 12 to execute the operation process in the pre-recording mode. Instead, it controls the encoding chip 12 to standby to save power consumption.
[0097] In some embodiments, when the MCU 11 determines that the battery camera 1 does not meet the entry conditions for the pre-recording mode, it can control the encoding chip 12 to standby by sending a second flag to the encoding chip 12, such as prerecord_mode_flag = 0. After receiving the second flag, the encoding chip 12 does not set the pre-recording flag bit and enters the standby state.
[0098] After the battery camera 1 enters the pre-recording mode, in addition to executing S504 - S509, the MCU 11 also determines whether the battery camera 1 meets the exit conditions for the pre-recording mode based on the battery level and time of the battery camera 1. If the battery camera 1 meets the exit conditions for the pre-recording mode, it no longer executes S507 - S509. Instead, it executes S510 to exit the pre-recording mode, and the MCU 11 continues to execute S503 to continuously monitor whether the battery camera 1 can enter the pre-recording mode. If the battery camera 1 does not meet the exit conditions for the pre-recording mode, it will continue to execute the operation process in the pre-recording mode. For example, in the aforementioned steps S507 - S509, the image acquisition unit 15 continuously acquires the images of the monitoring area, the encoding chip 12 continuously encodes and temporarily stores the video stream, reads the video stream of the pre-recording duration to generate a pre-recorded video when the PIR alarm is triggered. At the same time, the MCU 11 continuously determines whether the current battery level and current time of the battery camera 1 meet the exit conditions for the pre-recording mode. The exit conditions for the pre-recording mode include that the current battery level of the battery camera 1 is less than the stop pre-recording battery level, or the current time of the battery camera 1 is outside the pre-recording planned time. If the previous time of the battery camera 1 exceeds the pre-recording planned time or the current battery level is less than or equal to the stop pre-recording battery level, it means that the battery camera 1 meets the exit conditions for the pre-recording mode, and the battery camera 1 enters the standby mode to exit the pre-recording mode. If the current battery level of the battery camera 1 is greater than or equal to the stop pre-recording battery level, and the current time of the battery camera 1 is within the pre-recording planned time, it means that the battery camera 1 does not meet the exit conditions for the pre-recording mode, and the battery camera 1 remains working in the pre-recording mode.
[0099] Specifically, in the pre-recording mode, when the MCU 11 determines that the current time exceeds the pre-recording planned time or the current battery level is less than or equal to the stop pre-recording battery level, it can send a second flag to the encoding chip 12, such as prerecord_mode_flag = 0. In response to receiving the second flag, the encoding chip 12 controls the encoding chip 12 to exit the pre-recording mode and enables the battery camera 1 to enter the standby state.
[0100] The MCU 11 can determine whether the condition for exiting the pre-recording mode is met in an event-driven manner or an interrupt-triggered manner. For example, when the current battery power is less than the stop pre-recording power, the MCU will receive a battery power change event or interrupt, triggering the MCU 11 to determine whether the condition for exiting the pre-recording mode is met; the MCU 11 uses a timer to set an event at the end time point of each planned time period in the pre-recording schedule. When this end time point is reached, the MCU 11 will receive a time arrival event or interrupt, triggering the MCU 11 to determine whether the condition for exiting the pre-recording mode is met.
[0101] In the above manner, when the current time of the battery camera 1 goes out of the pre-recording schedule time and the current battery power is less than the stop pre-recording power, the battery camera 1 exits the pre-recording mode and performs normal standby wake-up operations. At the same time, the MCU 11 also continuously monitors whether the battery camera 1 can enter the pre-recording mode.
[0102] In some embodiments, when the battery power of the battery camera 1 drops to the stop pre-recording power and exits the pre-recording mode in the pre-recording mode, the conditions for entering the pre-recording mode when executing S503 are different from those when not entering the pre-recording mode. The conditions for entering the pre-recording mode include a first condition and a second condition. When not entering the pre-recording mode, the MCU 11 determines whether the first condition is met based on the current battery power and current time of the battery camera 1; after the battery power of the battery camera drops to the stop pre-recording power and exits the pre-recording mode, the MCU 11 determines whether the second condition is met based on the current battery power and current time of the battery camera 1. The first condition is that the current time is within the pre-recording schedule time and the current battery power is greater than the stop pre-recording power, and the second condition is that the current time is within the pre-recording schedule time and the current battery power is greater than the battery power threshold. The battery power threshold is the stop pre-recording power configured by the user plus a buffer value.
[0103] Specifically, the power judgment thresholds for the first condition and the second condition are different. The power judgment threshold for the first condition is the stop pre-recording power configured by the user. The power judgment threshold for the second condition is the stop pre-recording power configured by the user plus a buffer value. For example, after exiting the pre-recording mode due to low battery power and charging, when the current battery power of the battery camera 1 > stop pre-recording power + 5 mAh, it re-enters the pre-recording mode.
[0104] The reason for increasing the power judgment threshold by the above buffer value is that during power monitoring, the battery power may experience small fluctuations due to various reasons (such as unstable battery chemical reactions, circuit noise, temperature changes, etc.). If the power judgment threshold is set too close to the stop pre-recording power, these minor fluctuations may cause the battery camera 1 to frequently switch between entering and exiting the pre-recording mode. After the power of the battery camera 1 drops to the stop pre-recording power and exits the pre-recording mode, by setting the power judgment threshold for re-entering the pre-recording mode slightly higher than the stop pre-recording power, that is, appropriately increasing the power judgment threshold, it is ensured that the battery camera 1 enters the pre-recording mode only when the power actually rises above the stop pre-recording power, thereby avoiding false triggers caused by short-term fluctuations and ensuring the stability and reliability of the pre-recording function of the battery camera 1.
[0105] If the pre-recording mode of the battery camera 1 runs abnormally, resulting in the battery camera 1 not actually executing the operation process in the pre-recording mode, the video footage of the pre-recording duration before the PIR alarm cannot be obtained when the PIR alarm is triggered. In some embodiments, to prevent the battery camera 1 from remaining in operation for a long time after the pre-recording mode runs abnormally, the video recording method of the battery camera 1 further includes the following steps:
[0106] Restart the battery camera 1 at a random moment within a preset time period, and the interval between the random moment and the most recent startup time of the battery camera 1 is greater than a preset duration.
[0107] The preset time period is set according to the actual scenario, and it is preferably set during a time period when it is not easy to trigger the PIR alarm. For example, the battery camera can be restarted at a random time within one hour after 3:00 am. The preset duration can be several hours. For example, at a random moment within one hour after 3:00 am, and this random moment satisfies being more than three hours away from this startup, restart the battery camera. If the preset time period is within one hour after the first time, then by using the current utc time as a seed when the battery camera is powered on, a random number can be generated, the random number is taken modulo 3600 (the total number of seconds in one hour), and the remainder is used as the offset time starting from the first time, thereby obtaining the random moment. Since the abnormality of the battery camera 1 usually occurs after running for a period of time, by limiting that the restart moment needs to be after the battery camera 1 has been powered on for a certain time, unnecessary restarts soon after startup are avoided.
[0108] In the above manner, it is possible to prevent the battery camera 1 from remaining in operation for a long time after an abnormal operation in the pre-recording mode. After restarting, the battery camera 1 can usually resume normal operation, enabling the battery camera 1 to operate normally after entering the pre-recording mode. In addition, in a scenario with multiple battery cameras 1, since the battery cameras 1 may access the server when restarting, if all the battery cameras 1 restart at a fixed time, a large number of battery cameras 1 will access the server at the same moment, causing an excessive load on the server. Restarting the battery cameras 1 at random times can avoid server overload.
[0109] The above method of restarting the battery camera 1 is particularly suitable for a scenario where the pre-recording time schedule is configured for 7×24 hours, that is, the battery camera operates in the pre-recording mode continuously for 7×24 hours, preventing the battery camera 1 from continuing to operate when the pre-recording mode is abnormal.
[0110] Figure 6 Fig. shows another application scenario diagram of the video surveillance system provided by the embodiments of the present application. As Figure 6 shown, the battery camera 1 is connected to the Hub router 4 and then establishes a communication connection with the electronic device 2 via the network 3. Among them, the Hub router 4 is used to forward data packets between each battery camera 1 and the electronic device 2. Of course, this scenario may also include multiple battery cameras 1 and / or multiple electronic devices 2. For example, in an outdoor scenario, multiple battery cameras 1 are set in multiple areas, and security personnel can access each battery camera 1 through their respective mobile phones (electronic devices 2).
[0111] Figure 1 In the scenario shown, the battery camera 1 operates in the stand-alone mode. After the user configures the conditional parameters of the pre-recording mode through the electronic device 2, the electronic device 2 directly sends the conditional parameters of the pre-recording mode to the battery camera 1. Different from this, Figure 6 In the scenario shown, after the battery camera 1 is connected to the Hub router 4, the Hub router 4 manages multiple battery cameras 1, and the battery camera 1 operates in the Hub mode. When a new function is configured for the battery camera 1, the Hub router 4 also needs to synchronize the configuration of this function. After the user configures the conditional parameters of the pre-recording mode through the electronic device 2, the electronic device 2 sends the conditional parameters of the pre-recording mode to the Hub router 4, and the Hub router 4 then sends the conditional parameters of the pre-recording mode to the battery camera 1.
[0112] Figure 7 Fig. shows a schematic flowchart of the video recording method of the battery camera provided by the embodiments of the present application. This method is applied to the battery camera 1 and the Hub router 2. As Figure 7 shown, in the video recording method of the battery camera based on the scenario shown in Figure 6 the battery camera 1 first executes steps S401 - S404 (same asFigure 4 (the same as the steps shown). After S404, the method further includes the following steps;
[0113] S406, when the battery camera 1 triggers an alarm event, the battery camera 1 reports the alarm to the Hub router 4.
[0114] S407, the Hub router 4 determines the starting pre-recording time according to the pre-recording duration and the alarm time, and sends the determined starting pre-recording time to the battery camera 1.
[0115] S408, the battery camera 1 searches in the memory for the video stream starting from the starting pre-recording time for video transcoding to obtain the pre-recorded video.
[0116] Through the above method, the pre-recording function is realized in the scenario where the battery camera 1 communicates with external devices through the Hub router 4, and the Hub router 4 sends the starting pre-recording time to the battery camera 1 to trigger the pre-recording function of the battery camera 1, realizing the unified management of multiple battery cameras 1 by the Hub router 4.
[0117] In some embodiments, since the starting pre-recording time is calculated by the Hub router 4, the condition parameter of the pre-recording mode sent by the Hub router 4 to the battery camera 1 may not include the pre-recording duration, that is, the pre-recording duration may not be configured in the battery camera 1.
[0118] Figure 8 shows a detailed flowchart of the video recording method of the battery camera provided by the embodiment of the present application. This method is applied to the battery camera 1 and the Hub router 4. As Figure 8 shown, in the video recording method of the battery camera based on the Figure 6 shown scenario, the battery camera first executes steps S501 - S508 (the same as the Figure 5 shown steps). After S508, the method further includes the following steps;
[0119] S511, when triggering a PIR alarm, the battery camera 1 reports the alarm to the Hub router 4.
[0120] S512, the Hub router 4 determines the starting pre-recording time according to the pre-recording duration and the alarm time, and sends the determined starting pre-recording time to the battery camera 1.
[0121] S513, the REC process searches in the memory for the video stream starting from the starting pre-recording time for video transcoding to obtain the pre-recorded video.
[0122] For example, when an IPR alarm is triggered at 11:00, the Hub router 4 determines the starting pre-recording time as 10:50 based on the pre-recorded duration of 10 s and the alarm time of 11:00, and sends 10:50 to the battery camera 1, thereby triggering the battery camera 1 to perform pre-recorded video. The REC process of the encoding chip 12 of the battery camera 1 learns the starting pre-recording time of 10:50, searches for the video stream starting from 10:50 in the memory, obtains a video stream with a duration of 10 s starting from 10:50, and records this video stream as a pre-recorded video.
[0123] An embodiment of the present application further provides a computer-readable storage medium storing executable instructions, which, when running on a battery camera, cause the battery camera to execute the video recording method of the battery camera in any of the above method embodiments.
[0124] An embodiment of the present application further provides a computer program, which can be called by a processor to cause a battery camera to execute the video recording method of the battery camera in any of the above method embodiments.
[0125] An embodiment of the present application further provides a computer program product. The computer program product includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions, which, when running on a computer, cause the computer to execute the video recording method of the battery camera in any of the above method embodiments.
[0126] Those skilled in the art can understand that the units in the devices in the embodiments can be adaptively changed and set in one or more devices different from the embodiments. The units in the embodiments can be combined into one unit, and can also be divided into multiple sub-units. Except that at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all the features disclosed in this specification (including the accompanying abstract and drawings) and all the processes or units of any method or device so disclosed. Unless otherwise explicitly stated, each feature disclosed in this specification (including the accompanying abstract and drawings) can be replaced by an alternative feature that provides the same, equivalent or similar purpose.
[0127] It should be noted that the above embodiments illustrate the present application rather than limit the present application, and those skilled in the art can design alternative embodiments without departing from the scope. The steps in the above embodiments, unless otherwise specified, should not be construed as a limitation on the execution order.
Claims
1. A recording method for a battery camera, characterized in that: The method comprises: When the current time of the battery camera is within the preset pre-recording plan time and the current power of the battery camera is greater than the preset pre-recording stop power, the battery camera is awakened to enter the pre-recording mode to record and store the video; When the battery camera triggers an alarm event, the video with a pre-recorded time from the alarm time is searched in the video recording to obtain the pre-recorded video.
2. The video recording method according to claim 1, characterized in that: The method further includes: When the switch parameter of the pre-recording mode indicates that the pre-recording plan has been turned on, obtaining the current time and current power of the battery camera; Determine whether the current time is within the preset pre-recording plan time, and determine whether the current power is greater than the preset stop pre-recording power.
3. The video recording method according to claim 1, characterized in that: The method further includes: If the current time is within the pre-recording planned time and the current power is greater than the pre-recording stop power, a first mark is generated by the micro control unit of the battery camera and sent to the encoding chip of the battery camera; In response to receiving the first mark, the encoding chip sets the pre-recording identification bit so that the encoding chip keeps working in the pre-recording mode; If the current time exceeds the pre-recording plan time or the current power is less than or equal to the power for stopping pre-recording, the micro control unit generates a second mark and sends it to the encoding chip; In response to receiving the second mark, the encoding chip is controlled to exit the pre-recording mode and the battery camera enters a standby state.
4. The video recording method according to claim 3, characterized in that: The method further includes: When the current power is less than or equal to the power for stopping pre-recording, the pre-recording mode is exited. After the battery camera is charged, it is determined whether the current power is greater than a preset power threshold and whether the current time is within the pre-recording planned time, and the power threshold is greater than the power for stopping pre-recording; If the current time is within the pre-recording planned time and the current power level is greater than the power level threshold, the battery camera is reawakened to enter the pre-recording mode.
5. The video recording method according to claim 1, characterized in that: The step of waking up the battery camera to enter the pre-recording mode to record and store the video specifically includes: Waking up the battery camera to enter the pre-recording mode; Controlling the image acquisition unit of the battery camera to record video according to a preset pre-recorded frame rate; The video recording is encoded by the encoding chip of the battery camera to obtain a video code stream, and the video code stream is stored in the memory of the battery camera.
6. The video recording method according to claim 5, characterized in that: The step of searching the video recording for a pre-recorded video with a time length from the alarm time to obtain the pre-recorded video includes: The start pre-recording time is calculated by the coding chip of the battery camera according to the alarm time and the pre-recording time; Acquiring a video code stream starting from the start pre-recording time from the memory through the encoding chip; and The video code stream is transcoded by the encoding chip to obtain the pre-recorded video.
7. The video recording method according to claim 1, characterized in that: The method further includes: The battery camera is restarted at a random time within a preset time period, and the interval between the random time and the last power-on start time of the battery camera is greater than a preset time length.
8. The video recording method according to claim 1, characterized in that: The method also includes: receiving the pre-recording plan time, the power level for stopping pre-recording and the pre-recording duration preset by the user from the pre-recording mode configuration interface displayed by the electronic device, and storing them in the encoding chip of the battery camera, wherein the electronic device establishes a network communication connection with the battery camera.
9. The video recording method according to claim 1, characterized in that: The method further includes: receiving and storing the pre-recording plan time, the amount of electricity used to stop pre-recording, and the pre-recording duration sent by the Hub router, wherein the pre-recording plan time, the amount of electricity used to stop pre-recording, and the pre-recording duration sent by the Hub router are all from an electronic device, and the electronic device obtains the pre-recording plan time, the amount of electricity used to stop pre-recording, and the pre-recording duration preset by a user through a pre-recording mode configuration interface, and the Hub router establishes a network communication connection with the battery camera and the electronic device.
10. The video recording method according to claim 8, characterized in that: When the battery camera triggers an alarm event, searching the video recording for a pre-recorded time from the alarm time to obtain the pre-recorded video further includes: When the battery camera triggers an alarm event, the alarm event is reported to the Hub router; Receiving the start pre-recording time sent by the Hub router, wherein the start pre-recording time is determined according to the pre-recording duration and the alarm time; The pre-recorded video is obtained by searching the video recording for a video starting from the pre-recording start time.
11. A battery camera, characterized in that: include: memory and at least one processor; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the recording method of the battery camera as described in any one of claims 1-10.
12. A computer-readable storage medium, characterized in that: The storage medium stores executable instructions, and the executable instructions, when running, execute the recording method of the battery camera according to any one of claims 1 to 10.
13. A video surveillance system, characterized in that: The battery camera is connected to an electronic device via a network, wherein: The electronic device is used to set the pre-recording plan time, the pre-recording stop power and the pre-recording duration of the battery camera, and send them to the battery camera; The battery camera is used to obtain the current time and current power of the battery camera. If the current time is within the pre-recording planned time and the current power is greater than the power for stopping pre-recording, the battery camera is awakened to enter the pre-recording mode to record and store the video. When the battery camera triggers an alarm event, the video recording is searched for the video from the alarm time to the pre-recording time to obtain the pre-recorded video.
14. The video surveillance system according to claim 13, characterized in that: The system further includes a Hub router, which establishes a network communication connection with the battery camera and the electronic device, wherein: The Hub router is used to receive the pre-recording plan time, the pre-recording stop power and the pre-recording duration from the electronic device and forward them to the battery camera; when the battery camera triggers an alarm event, the Hub router receives the reported alarm from the battery camera and obtains the alarm time; determines the start pre-recording time according to the pre-recording duration and the alarm time, and sends the start pre-recording time to the battery camera; The battery camera is also used to search the video recording for a video starting from the start pre-recording time to obtain the pre-recorded video.
15. The video surveillance system according to claim 13, characterized in that: The electronic device is also used to display the pre-recording mode configuration interface of the battery camera, which includes a pre-recording mode switch control, a stop pre-recording power configuration control, a pre-recording time configuration control, a plan configuration control and a frame rate configuration control, wherein: The pre-recording mode switch control is used to turn on or off the pre-recording mode of the battery camera; The stop pre-recording power configuration control is used to set the stop pre-recording power of the battery camera; The pre-recording duration configuration control is used to set the pre-recording duration of the battery camera; The plan configuration control is used to set the pre-recording plan time of the battery camera; The frame rate configuration control is used to set the recording frame rate of the battery camera.