Method and apparatus for estimating remaining storage duration of video, and electronic device

By acquiring motion and light sensor data from video recording equipment, calculating motion and noise factors, and using a bitrate prediction model to estimate the remaining storage time in real time, the problem of prediction latency in existing technologies is solved, and timely warnings and accuracy of storage space are achieved.

CN122245356APending Publication Date: 2026-06-19SHENZHEN STREAMING VIDEO TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN STREAMING VIDEO TECH
Filing Date
2026-02-27
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

In existing video recording equipment, statistical analysis methods based on recorded video data result in delays in predicting storage space consumption, failing to provide timely and accurate warnings of storage duration and affecting the continuous operation of the equipment.

Method used

By acquiring motion sensor data and ambient light sensor data from the video recording device, calculating motion intensity factor and noise factor, and using a preset bitrate prediction model to calculate the predicted bitrate in real time, the remaining storage recording time is determined, thus achieving feedforward storage time estimation.

Benefits of technology

It significantly improves the real-time performance and accuracy of storage duration estimation, and can provide timely warnings in the event of device movement or changes in lighting to prevent storage space from running out.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122245356A_ABST
    Figure CN122245356A_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, and electronic device for estimating the remaining storage time of a video. The method mainly acquires motion sensor data and ambient light sensor data of the video recording device, calculates motion intensity factor and noise factor based on these data, and then uses a preset bitrate prediction model to obtain the predicted bitrate and finally determine the remaining storage recording time. This achieves feedforward storage time estimation that does not depend on the encoded video data, significantly improving the real-time performance of the estimation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of video processing technology, and in particular relates to a method, apparatus and electronic device for estimating the remaining storage time of a video. Background Technology

[0002] In the use of video recording equipment such as video surveillance cameras and dashcams, accurately estimating how much recording time the remaining storage space can support is a crucial function to ensure the continuous normal operation of the equipment. This function helps users plan storage management in advance and avoid losing critical video clips due to running out of storage space.

[0003] In related technologies, the mainstream technical solutions for achieving the above functions mainly rely on statistical analysis of historical video data already recorded by the device, and then use this to infer future storage consumption trends. These methods depend on post-hoc calculations of the size or bitrate of the generated video files.

[0004] However, since the generation of video data itself requires a certain processing time, the aforementioned method based on historical statistics suffers from a significant delay in updating its predictions when dealing with sudden changes in the recording scene. This lag makes it difficult for the device to issue timely warnings as soon as storage space begins to be rapidly depleted, reducing the accuracy and reliability of storage duration estimation. Summary of the Invention

[0005] This application provides a method, apparatus, and electronic device for estimating the remaining storage time of a video, which can improve the real-time performance of estimating the remaining storage time of a video.

[0006] A first aspect of this application provides a method for estimating the remaining storage time of a video, applied to a video recording device. The method includes: acquiring motion sensor data and ambient light sensor data of the video recording device; calculating a motion intensity factor based on the motion sensor data and a noise factor based on the ambient light sensor data, wherein the motion intensity factor is used to characterize the change in video image complexity caused by the movement of the video recording device, and the noise factor is used to characterize the image noise level caused by insufficient ambient light; calculating a predicted bitrate based on the motion intensity factor and the noise factor using a preset bitrate prediction model; and determining the remaining recording time of the video recording device based on the predicted bitrate.

[0007] In the technical solution of this application, the motion sensor data and ambient light sensor data of the video recording device are mainly obtained, and the motion intensity factor and noise factor are calculated accordingly. Then, the predicted bit rate is obtained by using a preset bit rate prediction model, and the remaining storage recording time is finally determined. This achieves feedforward storage time estimation that does not depend on the encoded video data, which significantly improves the real-time performance of the estimation.

[0008] Optionally, in one possible implementation of the first aspect, the calculation of the motion intensity factor based on motion sensor data includes: calculating the original vibration intensity based on motion sensor data within a preset time window; and normalizing the original vibration intensity to obtain the motion intensity factor. Thus, by calculating the original vibration intensity based on motion sensor data within a preset time window and performing normalization to obtain the motion intensity factor, the original signal of device motion is transformed into a standardized, dimensionless quantitative indicator, providing a unified and comparable feature input for subsequent bitrate prediction, and enhancing the adaptability and consistency of the method across different devices.

[0009] Optionally, in another possible implementation of the first aspect, the calculation of the noise factor based on ambient light sensor data includes: determining the current photosensitivity parameter related to the image noise level based on the ambient light sensor data; and performing mapping processing based on the current photosensitivity parameter to obtain the noise factor. Thus, by determining the current photosensitivity parameter related to the image noise level based on the ambient light sensor data, and performing mapping processing based on this parameter to obtain the noise factor, an effective feature channel that correlates ambient lighting conditions (or sensor gain) with the coding bitrate is established, enabling the prediction model to perceive the potential impact of lighting changes on the bitrate in advance.

[0010] Optionally, in another possible implementation of the first aspect, before calculating the predicted bitrate using a preset bitrate prediction model based on the motion intensity factor and noise factor, the method further includes: obtaining the timestamps of video frames output by the video encoder of the video recording device; aligning the timestamps of the motion sensor data and the ambient light sensor data with the timestamps of the video frames; and assigning corresponding motion intensity factors and noise factors to each video frame based on the alignment result. Thus, by aligning the timestamps of the motion sensor and ambient light sensor data with the timestamps of the video frames before calculating the predicted bitrate, and assigning corresponding motion intensity factors and noise factors to each video frame, it is ensured that the physical characteristics used for prediction are strictly synchronized in time with the video frames to be predicted, fundamentally avoiding prediction deviations caused by data asynchrony.

[0011] Optionally, in another possible implementation of the first aspect, the above-mentioned calculation of the predicted bitrate based on the motion intensity factor and noise factor using a preset bitrate prediction model includes: multiplying the motion intensity factor by a preset motion influence coefficient to obtain the motion influence amount; multiplying the noise factor by a preset noise influence coefficient to obtain the noise influence amount; multiplying the motion intensity factor by the noise factor and by a preset coupling coefficient to obtain the coupling influence amount; summing the motion influence amount, noise influence amount, and coupling influence amount, adding one, and then multiplying by a preset baseline static bitrate to obtain the predicted bitrate. Thus, by multiplying the motion intensity factor and noise factor by their respective influence coefficients to obtain independent influence amounts, and calculating their coupled influence amounts, and finally combining this with the baseline static bitrate to generate the predicted bitrate, a prediction model capable of simultaneously quantifying the independent effects of motion and noise, as well as their nonlinear interactions, is constructed, significantly improving the bitrate prediction accuracy in complex scenarios (such as simultaneous intense motion and low light).

[0012] Optionally, in another possible implementation of the first aspect, before determining the remaining recordable storage time of the video recording device based on the predicted bitrate, the method further includes: obtaining the actual bitrate output by the video encoder of the video recording device; and dynamically correcting the predicted bitrate based on the ratio between the actual bitrate and the predicted bitrate. Thus, by dynamically correcting the predicted bitrate based on the ratio between the actual bitrate output by the video encoder and the predicted bitrate before determining the remaining storage time, a feedback calibration mechanism is introduced, enabling the prediction system to adapt online to model deviations caused by factors such as scene texture differences, thereby improving the long-term accuracy and robustness of the prediction results.

[0013] Optionally, in another possible implementation of the first aspect, the aforementioned remaining recording time is a long-term remaining recording time. The determination of the remaining recording time of the video recording device based on the predicted bitrate includes: calculating the current remaining time based on the current remaining storage capacity and the predicted bitrate; obtaining the illumination trend prediction information of the environment where the video recording device is located; adjusting the predicted value of the noise factor based on the illumination trend prediction information, and recalculating the predicted bitrate for future time periods based on the adjusted noise factor; and determining the long-term remaining recording time based on the recalculated predicted bitrate. Therefore, by combining the obtained illumination trend prediction information to adjust the predicted value of the noise factor, and recalculating the predicted bitrate for future time periods accordingly to determine the long-term remaining recording time, the periodic variation trend of ambient illumination is incorporated into the estimation, achieving a more conservative and accurate long-term early warning of future storage consumption, suitable for planning scenarios requiring long-term continuous recording.

[0014] Optionally, in another possible implementation of the first aspect, the acquisition of the illumination trend prediction information of the environment where the video recording device is located includes: acquiring the current geographical location information and current time information of the video recording device; calculating the solar altitude angle at multiple future time points based on the geographical location information and current time information; and generating illumination trend prediction information based on the changing trend of the solar altitude angle. Thus, by calculating the solar altitude angle at multiple future time points based on the current geographical location information and current time information of the video recording device, and generating illumination trend prediction information accordingly, objective, reliable, and non-requirement-based references to external environmental illumination changes are provided for long-term bitrate estimation, enhancing the scientific rigor and feasibility of long-term trend prediction.

[0015] A second aspect of this application provides a device for estimating the remaining storage time of a video, applied to a video recording device, the device comprising:

[0016] The data acquisition module is used to acquire motion sensor data and ambient light sensor data from the video recording device.

[0017] The factor calculation module is used to calculate the motion intensity factor based on motion sensor data and the noise factor based on ambient light sensor data. The motion intensity factor is used to characterize the change in video image complexity caused by the movement of the video recording device, and the noise factor is used to characterize the image noise level caused by insufficient ambient light.

[0018] The model processing module is used to calculate the predicted bitrate based on the motion intensity factor and noise factor using a preset bitrate prediction model.

[0019] The duration estimation module is used to determine the remaining recording time of the video recording device based on the predicted bitrate.

[0020] A third aspect of this application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the video remaining storage duration estimation method of the first aspect described above.

[0021] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the video remaining storage duration estimation method of the first aspect described above.

[0022] The fifth aspect of this application provides a computer program product that, when run on an electronic device, causes the electronic device to execute the video remaining storage duration estimation method of the first aspect described above.

[0023] It is understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description

[0024] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0025] Figure 1 This is a schematic diagram of the architecture of a video remaining storage time estimation system provided in an embodiment of this application; Figure 2 This is a flowchart illustrating a method for estimating the remaining storage time of a video provided in an embodiment of this application; Figure 3 This is a timing diagram of parallel processing of a system provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of a video remaining storage time estimation device provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0026] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0027] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0028] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0029] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."

[0030] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0031] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0032] It should be understood that the sequence number of each step in this embodiment does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of this application embodiment.

[0033] In related technologies, accurately estimating how much recording time remaining in video recording equipment such as video surveillance and dashcams is crucial for ensuring the continuous normal operation of the devices. The mainstream technical solution for achieving this function primarily relies on statistical analysis of historical video data already recorded by the device to infer future storage consumption trends. This type of method depends on post-hoc calculations of the size or bitrate of already generated video files.

[0034] In view of this, embodiments of this application provide a method, apparatus, and electronic device for estimating the remaining storage time of a video. The method mainly acquires motion sensor data and ambient light sensor data of the video recording device, calculates motion intensity factor and noise factor based on these data, and then uses a preset bitrate prediction model to obtain the predicted bitrate and finally determine the remaining storage recording time. This achieves feedforward storage time estimation that does not depend on the encoded video data, significantly improving the real-time performance of the estimation.

[0035] The following example illustrates the application scenario of the video remaining storage time estimation method provided in this application embodiment. In application scenarios where dashcams continuously record while the vehicle is in motion, traditional methods based on the size of recorded video files suffer from significant lag. For instance, when a vehicle suddenly enters a dimly lit tunnel or a bumpy road, the sudden drop in lighting and violent movement will immediately cause the video encoding bitrate to spike. However, traditional methods can only detect this change after high-bitrate video data is generated, resulting in a delay in storage space warnings. The solution adopted in this application embodiment, by acquiring the device's acceleration and light sensor data in real time and directly calculating the predicted bitrate, can predict the impending increase in bitrate the instant the vehicle enters a tunnel or bumpy road. This enables millisecond-level real-time updates and timely warnings of remaining storage time, effectively avoiding the risk of running out of storage space due to delayed warnings.

[0036] To illustrate the technical solution of this application, specific embodiments are described below.

[0037] Reference Figure 1 This diagram illustrates the architecture of a video remaining storage time estimation system provided in an embodiment of this application. Figure 1 As shown, the system logically comprises a sensor data acquisition layer, a feature extraction and synchronization module, and a multi-dimensional mapping inference engine. The sensor data acquisition layer includes motion sensor units and ambient light sensing units, responsible for acquiring raw motion and lighting data from the physical world in real time. The feature extraction and synchronization module preprocesses the raw data, synchronizes it in time, and calculates the core features representing changes in the image. The multi-dimensional mapping inference engine, as the core algorithm unit, runs a pre-established bitrate prediction model, mapping physical features to the predicted bitrate and ultimately calculating the remaining duration. These modules work together to form a complete feedforward path from physical sensing to digital prediction.

[0038] exist Figure 1 Based on the system architecture shown, Figure 2 The diagram shows a flowchart illustrating a method for estimating the remaining storage time of a video according to an embodiment of this application.

[0039] like Figure 2 As shown, this method for estimating the remaining storage time of a video is applied to a video recording device and may specifically include the following steps: Step 201: Obtain motion sensor data and ambient light sensor data from the video recording device.

[0040] In this application embodiment, video recording equipment refers to electronic devices with video acquisition, encoding and local or network storage functions. Typical applications include, but are not limited to, dashcams, on-site / portable recorders, security monitoring cameras and action cameras.

[0041] In this embodiment, motion sensor data is used to directly or indirectly quantify the physical motion state of the video recording device itself, and it originates from the device's built-in motion sensor unit. This motion sensor unit can be an Inertial Measurement Unit (IMU), which can acquire the device's linear acceleration and angular velocity in three-dimensional space in real time. In this step, the main focus is on acquiring the triaxial acceleration data output by the IMU, i.e., the acceleration components of the device in the three orthogonal directions of front-back, left-right, and up-down, for subsequent analysis of the device's vibration or motion intensity.

[0042] In this embodiment, ambient light sensor data is used to directly or indirectly quantify the lighting conditions of the environment in which the video recording device is located, and it originates from the ambient light sensing unit built into the device. The ambient light sensing unit can be an independent ambient light sensor used to directly measure the ambient illuminance, and its output data is an illuminance value in lux; or, the ambient light sensing unit can also be coupled with the image processing pipeline to indirectly and accurately reflect the ambient light level by synchronously reading the current gain value of the image sensor (usually expressed as the ISO sensitivity value or the image signal processing (ISP) gain factor), because when the light is insufficient, the image sensor will automatically or manually increase the gain to enhance the signal strength, and the increase in gain is directly related to the increase in image noise level.

[0043] It should be noted that in practical implementation, the sensor data acquisition layer operates continuously at a preset fixed frequency. For motion sensors, such as triaxial accelerometers, the sampling rate can be set to 100 Hz, meaning 100 sets of acceleration data are acquired per second to capture possible instantaneous and severe vibrations. For ambient light sensing, if a separate light sensor is used, its sampling rate can be set according to actual needs; if the method of reading the gain of an image sensor is used, its data update frequency is usually synchronized with the video frame rate, for example, 30 times per second. The system reads the raw measurement values ​​of these sensors in real time through hardware interfaces, such as the Inter-Integrated Circuit (I2C), Serial Peripheral Interface (SPI), etc., or through system drivers, and adds a high-precision timestamp to each data packet.

[0044] It should be understood that this step acquires the most basic physical sensing data, and its acquisition process is completely independent and precedes the acquisition, processing, and encoding of video images. For example, in dashcam applications, when a vehicle is about to enter a bumpy road, the vibration of the tires is immediately transmitted through the vehicle body to the device, causing a sudden change in the acceleration data output by the inertial measurement unit; similarly, when a vehicle is about to enter a tunnel, the illuminance value sensed by the ambient light sensor or the gain value of the image sensor will begin to decrease. These changes are captured by the system within milliseconds of the physical event occurring, without waiting for the corresponding video frame to be captured by the image sensor, processed by the image signal processor, and encoded before being perceived. This source-level data acquisition mechanism is the physical basis for the real-time feedforward prediction achieved in the embodiments of this application.

[0045] In one embodiment, to ensure the accuracy of subsequent predictions, the acquired sensor data needs to meet certain quality requirements. For motion sensor data, preliminary filtering is typically required to remove high-frequency noise, such as separating the static gravitational acceleration component from the dynamic vibration acceleration component using a low-pass filter. For ambient light sensor data, if it comes from a separate sensor, calibration compensation may be necessary based on the optical window characteristics of the device.

[0046] For example, considering cost and integration, most existing dashcams or on-site / portable recorders already have built-in inertial measurement units for collision detection or image stabilization, as well as ambient light sensors or image signal processors with readable gain for automatic screen brightness adjustment. Therefore, this step does not require additional hardware costs; it only requires firmware or software upgrades to authorize and access the data streams from these existing sensors. The system will then send the timestamped raw data streams acquired from these sensors to the subsequent feature extraction module for processing.

[0047] Step 202: Calculate the motion intensity factor based on the motion sensor data and the noise factor based on the ambient light sensor data.

[0048] Among them, the motion intensity factor is a dimensionless quantitative indicator used to characterize the changes in video image complexity caused by the movement of the video recording device, and the noise factor is also a dimensionless quantitative indicator used to characterize the image noise level caused by insufficient ambient lighting. The core task of this step is to convert the raw sensor data obtained in step 201 into these two standardized and computable factors through a specific feature extraction algorithm, providing direct input features for subsequent bitrate prediction.

[0049] In one embodiment, the raw acceleration data collected by the motion sensor directly reflects the instantaneous motion state of the device. However, this data includes both gravitational acceleration components caused by changes in device posture and dynamic acceleration components caused by device vibration. If the raw data is used directly, its values ​​are related to the device's installation angle, lacking comparability and failing to quantify the core concept of vibration intensity. Therefore, the motion intensity factor can be calculated as follows: based on motion sensor data within a preset time window, the raw vibration intensity is calculated; the raw vibration intensity is then normalized to obtain the motion intensity factor. Thus, by calculating the raw vibration intensity based on motion sensor data within a preset time window and performing normalization to obtain the motion intensity factor, the raw signal of device motion is transformed into a standardized, dimensionless quantitative indicator. This provides a unified and comparable feature input for subsequent bitrate prediction, enhancing the method's adaptability and consistency across different devices.

[0050] Specifically, firstly, the three-axis acceleration data within the time window... Low-pass filtering is performed to separate the static gravitational acceleration component. This component characterizes the stationary attitude of the device. Subsequently, the dynamic vibration acceleration is calculated, and the original vibration intensity within this time window is calculated using the following formula. : ; in, For the first Original vibration intensity per second (unit: ); This represents the number of samples within the sampling window. This is the instantaneous acceleration value; This represents the gravitational acceleration component. The formula calculates the average magnitude of the dynamic acceleration vector, effectively filtering out attitude effects and purely reflecting the overall intensity of vibration of the equipment in three-dimensional space. Next, the original vibration intensity... Normalization is performed to obtain the exercise intensity factor. : ; in, For the first Motion intensity factor per second (range) ); The maximum vibration intensity threshold calibrated for the equipment (typically 5). This normalization operation maps physical vibration intensities measured under different devices and installation methods to a unified, dimensionless value. Within a certain range. For example, when the dashcam is in a stable driving state, The value is very small. Approaching 0; when a vehicle suddenly drives over a speed bump or bumpy road surface, Increased rapidly It rapidly approaches 1. Thus, by separating the vibration component from the acceleration data and normalizing its amplitude, a stable, comparable feature quantity that can directly reflect the potential motion complexity of the image is obtained, laying the foundation for accurately predicting the bitrate increment caused by motion.

[0051] In one embodiment, the relationship between ambient light sensor data (illuminance or gain value) and the final coding bitrate is non-linear. Particularly under low-light conditions, increasing the image sensor gain significantly increases image noise, and noise, as a high-frequency detail, greatly depletes the coding bitrate. To characterize this non-linear effect, the noise factor can be calculated as follows: based on the ambient light sensor data, determine the current photosensitivity parameter related to the image noise level; perform mapping processing based on the current photosensitivity parameter to obtain the noise factor. Thus, by determining the current photosensitivity parameter related to the image noise level based on the ambient light sensor data and performing mapping processing based on this parameter to obtain the noise factor, an effective feature channel is established that correlates ambient lighting conditions (or sensor gain) with the coding bitrate, enabling the prediction model to anticipate the potential impact of lighting changes on the bitrate.

[0052] Specifically, the current photosensitivity parameters are usually expressed as the current gain value of the image sensor. (Linear multiples, such as 1x, 4x, 16x, typically take values ​​in the range of...) The system uses the following formula to map the gain value to the noise factor. : ; in, For the first Noise factor per second (range) ); This is the current gain value; For gain-noise mapping slope coefficients; This is the gain-noise mapping offset coefficient; and The function is used to restrict the calculation result to Within the range. The formula is designed based on a key observation: the image noise level increases approximately logarithmically with the increase in gain, therefore, by performing logarithmic operations... This converts the linear increase in gain into a linear contribution to the noise level. (Coefficient) and Obtained through calibration before the equipment leaves the factory, so that when Noise factor at (lowest gain) The noise factor is approximately 0; as the gain increases, the noise factor... Gradually increase. For example, when a dashcam enters a tunnel from a well-lit road, It could increase rapidly from 1x to 8x, according to the formula. Approximately 0.9, assuming , =0, then The quantization factor, increasing from 0 to approximately 0.27, quantifies the additional coding burden introduced by low light. Thus, by using a logarithmic function to simulate the nonlinear relationship between gain and noise and normalizing it, a quantization factor is obtained that accurately characterizes the bit rate inflation trend under low light conditions, enabling the prediction model to anticipate the potential pressure on bit rate from changes in illumination.

[0053] In one embodiment, to ensure that the causes perceived by the physical sensors (the physical environment state at a specific moment) and the results of video encoding (video frames acquired and encoded at the same moment) are strictly synchronized in time, thereby avoiding prediction bias, before performing step 203, the timestamps of the video frames output by the video encoder of the video recording device can be obtained; the timestamps of the motion sensor data and the ambient light sensor data are aligned with the timestamps of the video frames; based on the result of the alignment operation, a corresponding motion intensity factor and noise factor are assigned to each video frame. Thus, by aligning the timestamps of the motion sensor and ambient light sensor data with the timestamps of the video frames before calculating the prediction bitrate, and assigning a corresponding motion intensity factor and noise factor to each video frame, it is ensured that the physical cause features used for prediction are strictly synchronized in time with the video frames to be predicted, fundamentally avoiding prediction bias caused by data asynchrony.

[0054] It should be noted that the system needs to obtain the precise timestamp of each video frame output by the video encoder of the video recording device. Simultaneously, each data packet from the motion sensor and ambient light sensor also carries its acquisition time timestamp. The system performs an alignment operation, the core of which is to precisely match the timeline of the physical sensor data stream with the timeline of the video frame stream. This is typically achieved by comparing timestamps, for example, for the 1st... The motion intensity factor calculated based on the frame video allocation time closest to the midpoint of the frame's exposure time. and noise factor Through this alignment and allocation operation, the embodiments of this application ensure that the physical environment state at a specific moment used for prediction corresponds strictly in time with the video frame acquired and encoded at the same moment to be predicted, thereby laying a reliable data foundation for subsequent feedforward prediction with millisecond-level accuracy. For example, when the vibration of a vehicle driving over a speed bump is captured by an accelerometer, the system can immediately allocate the high motion intensity factor calculated from this vibration to the video frame being exposed by the image sensor at this moment, and make a prediction of the bitrate of the frame, without waiting for the frame to complete encoding.

[0055] Step 203: Calculate the predicted bitrate using a preset bitrate prediction model based on the motion intensity factor and noise factor.

[0056] In this embodiment, the bitrate prediction model is a mathematical model pre-established and stored in the system for mapping physical features to video coding bitrate. The core idea of ​​this model is that the instantaneous bitrate of the video stream can be comprehensively expressed by a baseline static bitrate, superimposed with the increments caused by the motion intensity factor and noise factor respectively, and the nonlinear coupling increment generated by their combined effect. This step uses the motion intensity factor calculated in step 202... and noise factor As input, the model performs calculations and outputs a predicted instantaneous bitrate value. Its unit is kilobits per second (kbps).

[0057] In one embodiment, to achieve low-complexity real-time computation on embedded devices while ensuring prediction accuracy in complex scenes, the bitrate prediction model can employ a lightweight linear regression structure. Based on the motion intensity factor and noise factor, the predicted bitrate is calculated using a pre-defined bitrate prediction model. Specifically, the calculation process includes: multiplying the motion intensity factor by a pre-defined motion influence coefficient to obtain the motion influence; multiplying the noise factor by a pre-defined noise influence coefficient to obtain the noise influence; multiplying the motion intensity factor by the noise factor and then by a pre-defined coupling coefficient to obtain the coupling influence; summing the motion influence, noise influence, and coupling influence, adding one, and then multiplying by a pre-defined baseline static bitrate to obtain the predicted bitrate. Thus, by multiplying the motion intensity factor and noise factor by their respective influence coefficients to obtain independent influences, calculating their coupling influence, and finally combining this with the baseline static bitrate to generate the predicted bitrate, a prediction model capable of simultaneously quantifying the independent effects of motion and noise, as well as their nonlinear interactions, is constructed, significantly improving bitrate prediction accuracy in complex scenes (such as those with simultaneous intense motion and low light).

[0058] Specifically, firstly, the exercise intensity factor With the preset motion influence coefficient Multiplying them together gives the motion effect on the bitrate. At the same time, the noise factor With the preset noise impact coefficient Multiplying them together gives the noise effect on the bit rate. Then, in order to characterize the nonlinear superposition effect when motion and dark light occur simultaneously, the motion intensity factor was... With noise factor Multiply, and then combine with the preset coupling coefficient. Multiply to obtain the coupling effect. Finally, sum all the above influencing factors, add 1, and then multiply by the preset baseline static bitrate. This yields the final predicted bitrate. The above calculation process corresponds to the following basic prediction model formula: ; in, The minimum bitrate for a static image under the current video resolution and frame rate configuration, with sufficient lighting; for example, a value of 2000 kbps; motion impact factor. Noise Influence Coefficient and coupling coefficient All model coefficients were obtained through extensive scenario testing and regression analysis calibration before the equipment left the factory. Specifically, the motion influence coefficient... This characterizes the amplification factor of bit rate per unit motion intensity factor (typically 1.5), and the noise impact coefficient. This characterizes the amplification factor of bit rate per unit noise factor (typically 2.0), while the coupling coefficient... This is used to correct the intensity factor of the exercise. and noise factor When both are high, the bit rate may experience superlinear growth (typical value such as 0.5).

[0059] Through the above model design, the system can achieve accurate predictions with extremely low computational cost (a few multiplications and additions). For example, when the dashcam is driving on a flat road during the day, the motion intensity factor... The noise factor is approximately 0.1. Approximately 0.05, substituting into the formula yields the predicted bitrate. Approximately the baseline static bit rate The motion intensity factor was 1.25 times that of the baseline, with the prediction bitrate only slightly higher than the baseline. However, when the vehicle entered bumpy roads at night, the motion intensity factor... It may surge to 0.8, while the noise factor may also increase due to dim lighting. Increased to 0.6, at which point the predicted bitrate... It will expand rapidly to the baseline static bitrate. This is approximately 3.64 times higher than the previous estimate, accurately predicting the risk of rapid storage space depletion under the dual pressures of motion and low light. Therefore, by constructing a lightweight linear regression model containing independent and coupled influence terms, efficient and accurate quantification of video coding bitrate fluctuations in complex physical environments is achieved, providing crucial algorithmic support for the core beneficial effect—eliminating prediction lag.

[0060] In one embodiment, considering that different shooting scenarios (such as textured forests and simple skies) have an inherent impact on the coding bitrate, and that a purely physical sensor model may not be able to fully capture this difference in texture complexity, in order to improve the long-term accuracy and adaptability of the prediction system in different scenarios, after obtaining the predicted bitrate... Then, dynamic correction can be performed. Specifically, the actual bitrate output by the video encoder of the video recording device is obtained; based on the ratio of the actual bitrate to the predicted bitrate, the predicted bitrate is dynamically corrected. Thus, by dynamically correcting the predicted bitrate based on the ratio of the actual bitrate output by the video encoder to the predicted bitrate before determining the remaining storage time, a feedback calibration mechanism is introduced. This allows the prediction system to adapt online to model deviations caused by factors such as scene texture differences, improving the long-term accuracy and robustness of the prediction results.

[0061] Specifically, the system continuously acquires the actual average bitrate output by the video encoder of the video recording device within the most recent time period (e.g., the past second). Subsequently, the system determined the data based on the actual average bitrate. With predicted bit rate The proportional relationship is used to dynamically adjust the predicted bitrate. One specific adjustment method is to use this proportional value as a real-time texture complexity adjustment coefficient. This is used to scale the subsequent predicted bitrate, resulting in the final bitrate used for duration calculation. The specific formula is as follows: ; in, This is the final predicted bitrate after dynamic correction; The actual bitrate output by the video encoder in the previous second; correction factor. It is a dynamically updated value, and its update strategy can employ methods such as exponentially weighted moving average, for example, it can be calculated using the following formula: ; in, A small smoothing factor (e.g., 0.1) is used to balance rapid response to real-world biases with filtering out short-term bitrate jitter. By introducing this feedback correction loop based on real-world encoding results, the system can automatically compensate for prediction biases caused by scene texture differences in the pure physical model online. This ensures that the estimated output not only responds quickly but also maintains long-term accuracy under various shooting conditions, greatly enhancing the robustness and practicality of the solution.

[0062] Step 204: Determine the remaining recording time of the video recording device based on the predicted bitrate.

[0063] In this embodiment, the goal of this step is to combine the predicted bitrate (and possibly corrected) calculated in step S203 with the currently available storage space resources to ultimately output the remaining recording time that the user can intuitively understand. Its core is to estimate the sustainable write time under a given capacity based on the predicted data throughput. Considering the diversity of application scenarios, the output of this step can be divided into a basic remaining duration based on the current instantaneous conditions, and a long-term remaining recordable duration that incorporates the trend of ambient light cycle changes.

[0064] In one embodiment, the system needs to provide real-time, instantaneous alerts regarding storage consumption. Step 204 may specifically include: firstly, calculating the current remaining duration based on the current remaining storage capacity and the predicted bitrate. Specifically, the system reads the current remaining available space of the storage medium. (Units are typically kilobytes (KB)). Then, the dynamically adjusted final predicted bitrate is used. (Unit: kilobits per second, kbps), calculate the basic remaining time using the following formula. : ; Among them, molecules The unit conversion was completed, changing the storage capacity from byte-based to bit-based (because 1 byte = 8 bits, an engineering approximation is used here, treating 1 KB as 1000 bytes, offsetting the thousands in kbps for simplified calculation; for precise calculation, it can be adjusted to 8.192); denominator It is the final predicted bitrate after dynamic correction. That is, the number of bits consumed per second; the result of dividing the two is... The unit is seconds (s), representing the expected continuous recording duration that the remaining storage space can support while maintaining the current predicted bitrate. For example, if the device has 4,000,000 KB (approximately 4 GB) of remaining space, the current final predicted bitrate... If it is 4000kbps, then the remaining base duration is... This equates to approximately 2.22 hours. Therefore, by directly linking the predicted bitrate to the physical storage capacity, a real-time, intuitive storage consumption warning indicator is provided to users, enabling them to respond promptly to situations of storage space shortage.

[0065] In another embodiment, for applications requiring continuous operation for hours or even longer, such as parking monitoring and long-term on-site recording, the duration estimate based solely on the current instantaneous environment may be overly optimistic, as it does not consider the long-term, deterministic impact of periodic changes in future lighting conditions (such as from day to night) on the bitrate. Therefore, considering scenarios where the remaining storage recording time is the long-term remaining recording time, the long-term remaining recording time can be determined as follows: Calculate the current remaining time based on the current remaining storage capacity and the predicted bitrate; obtain the lighting trend prediction information of the environment where the video recording device is located; adjust the predicted value of the noise factor based on the lighting trend prediction information, and recalculate the predicted bitrate for future time periods based on the adjusted noise factor; determine the long-term remaining recording time based on the recalculated predicted bitrate. Therefore, by combining the acquired illumination trend prediction information to adjust the predicted value of the noise factor, and recalculating the predicted bitrate for future time periods to determine the remaining long-term recordable duration, the periodic change trend of ambient illumination is taken into account in the prediction, thus achieving a more conservative and accurate long-term early warning of future storage consumption, which is suitable for planning scenarios that require long-term continuous recording.

[0066] Furthermore, the illumination trend prediction information of the environment where the video recording device is located can be obtained in the following ways: obtain the current geographical location information and current time information of the video recording device; calculate the solar altitude angle at multiple future time points based on the geographical location information and current time information; and generate illumination trend prediction information based on the changing trend of the solar altitude angle. Thus, by calculating the solar altitude angle at multiple future time points based on the current geographical location information and current time information of the video recording device, and generating illumination trend prediction information accordingly, objective, reliable, and non-requires additional real-time sensor references for external environmental illumination changes are provided for long-term bitrate estimation, enhancing the scientific rigor and feasibility of long-term trend prediction.

[0067] Specifically, the system first calculates a current remaining duration as a reference baseline based on the current remaining storage capacity and the current predicted bitrate, using the aforementioned formula. Then, the system obtains the predicted illumination trend information of the environment where the video recording device is located. This information is obtained by combining the current geographical location information (latitude and longitude) provided by the device's built-in GPS module with the current time information provided by the system clock, and by calling a pre-set solar position algorithm (such as a sunrise / sunset algorithm) to calculate the solar altitude angle at multiple equally spaced time points in the future (e.g., every hour on the hour within the next 24 hours). The solar altitude angle is a key parameter describing the sun's position relative to the horizon, and its changes directly determine the intensity trend of natural ambient light. Based on the calculated future solar altitude angle sequence, the system predicts the noise factor for the corresponding time period in the future using a predefined mapping model. This mapping model establishes an empirical relationship between the solar altitude angle and the typical gain or noise level of the image sensor (e.g., when the solar altitude angle is below 0 degrees, it is considered nighttime, and the noise factor is high). In long-term forecasts, unpredictable random motion is typically ignored, assuming a motion intensity factor over future time periods. The value is approximately 0. Next, the system predicts the noise factor for each future time period. Substitute the values ​​into the bitrate prediction model (ignoring motion and coupling terms) to calculate the predicted bitrate for each future time period. And calculate their average value. .future Average predicted bitrate over a time period The calculation formula is as follows: ; in, The number of future time periods to be divided (dimensionless, typically 6 to 12). This is used to adjust the texture complexity obtained from the current update. Finally, the system adopts a more conservative prediction strategy, using the future average predicted bitrate. Recalculate the remaining time to obtain the long-term remaining recordable time. : ; Therefore, by introducing long-term illumination trend prediction based on geographical location and time, and making forward-looking estimates of future bitrates, the system provides users with a more conservative, reliable, and diurnal cycle-adaptive long-term storage planning reference. This effectively avoids the planning risk of premature storage exhaustion due to failure to consider the natural decay of ambient light. For example, when parking monitoring begins in the afternoon, the system not only provides a longer estimate based on the current bright light but also anticipates the rise in bitrate after nightfall, thus providing a significantly shorter and safer long-term estimate, prompting users to prepare larger storage capacity or take other measures.

[0068] The method for estimating the remaining storage time of video disclosed in the above embodiments of this application mainly obtains motion sensor data and ambient light sensor data of the video recording device, calculates motion intensity factor and noise factor accordingly, and then uses a preset bitrate prediction model to obtain the predicted bitrate and finally determine the remaining storage recording time. This achieves feedforward storage time estimation that does not depend on the encoded video data, and significantly improves the real-time performance of the estimation.

[0069] In one possible implementation of this application, Figure 3 A timing diagram of parallel processing of a system provided in an embodiment of this application is shown. Figure 3 As shown, the entire process is triggered by changes in the physical environment, such as severe vibration of the equipment or a significant decrease in ambient light. Once the sensor detects this change, the system simultaneously initiates two parallel processing branches: In the prediction branch, sensor data is immediately sent to the prediction engine (i.e., the multidimensional mapping inference engine). The prediction engine quickly calculates physical features and generates a predicted bitrate, then immediately updates the display of the remaining storage time. This series of prediction operations occurs before the corresponding video frame is fully encoded. Simultaneously, in the encoding branch, the image sensor captures the image, which is then processed by the image signal processor and compressed and encoded by the video encoder. After encoding, the actual bitrate data is sent as feedback to the prediction engine. Upon receiving this feedback, the prediction engine compares the actual bitrate with the predicted value and dynamically updates its internal texture complexity correction coefficients accordingly, thereby optimizing the accuracy of subsequent predictions. This parallel pipeline architecture of "perception-prediction" and "acquisition-encoding-feedback," combined with feedforward prediction and feedback calibration, ensures that the system can respond and warn of sudden environmental changes at the millisecond level, and can continuously learn and adapt to different scenarios, thus maintaining high accuracy while ensuring real-time performance.

[0070] See Figure 4 The diagram shows a schematic of a video remaining storage time estimation device provided in an embodiment of this application. For ease of explanation, only the parts related to the embodiment of this application are shown.

[0071] A device for estimating the remaining storage time of a video file is used in video recording equipment and may specifically include the following modules: The data acquisition module 401 is used to acquire motion sensor data and ambient light sensor data of the video recording device.

[0072] The factor calculation module 402 is used to calculate the motion intensity factor based on motion sensor data and the noise factor based on ambient light sensor data. The motion intensity factor is used to characterize the change in video image complexity caused by the movement of the video recording device, and the noise factor is used to characterize the image noise level caused by insufficient ambient light.

[0073] The model processing module 403 is used to calculate the predicted bitrate based on the motion intensity factor and noise factor using a preset bitrate prediction model.

[0074] The duration estimation module 404 is used to determine the remaining recording time of the video recording device based on the predicted bitrate.

[0075] The video remaining storage duration estimation device disclosed in the above embodiments of this application mainly obtains motion sensor data and ambient light sensor data of the video recording device, calculates motion intensity factor and noise factor accordingly, and then uses a preset bitrate prediction model to obtain the predicted bitrate and finally determine the remaining storage recording duration. This achieves feedforward storage duration estimation that does not depend on the encoded video data, significantly improving the real-time performance of the estimation.

[0076] Furthermore, in one possible implementation of this application embodiment, the factor calculation module 402 may specifically include the following units: The first calculation unit is used to calculate the original vibration intensity based on motion sensor data within a preset time window.

[0077] The first processing unit is used to normalize the original vibration intensity to obtain the motion intensity factor.

[0078] Therefore, by calculating the original vibration intensity based on motion sensor data within a preset time window and performing normalization processing to obtain the motion intensity factor, the original signal of device motion is transformed into a standardized, dimensionless quantitative indicator, providing a unified and comparable feature input for subsequent bit rate prediction, and enhancing the adaptability and consistency of the method across different devices.

[0079] Furthermore, in another possible implementation of this application embodiment, the factor calculation module 402 may specifically include the following units: The first determining unit is used to determine the current photosensitivity parameters related to the image noise level based on the ambient light sensor data.

[0080] The second processing unit is used to perform mapping processing based on the current photosensitivity parameters to obtain the noise factor.

[0081] Therefore, by determining the current photosensitive parameters related to the image noise level based on ambient light sensor data, and performing mapping processing based on these parameters to obtain the noise factor, an effective feature channel is established that associates ambient lighting conditions (or sensor gain) with the coding bit rate, enabling the prediction model to perceive the potential impact of lighting changes on the bit rate in advance.

[0082] Furthermore, in another possible implementation of this application embodiment, the above-mentioned device for estimating the remaining storage time of the video may further include the following modules: The time alignment module is used to obtain the timestamps of the video frames output by the video encoder of the video recording device; to align the timestamps of the motion sensor data and the ambient light sensor data with the timestamps of the video frames; and to assign corresponding motion intensity factors and noise factors to each video frame based on the alignment results.

[0083] Therefore, by aligning the timestamps of the motion sensor and ambient light sensor data with the timestamps of the video frames before calculating the prediction bitrate, and assigning corresponding motion intensity factors and noise factors to each video frame, it is ensured that the physical causal features used for prediction are strictly synchronized with the video frames to be predicted in time, thus fundamentally avoiding prediction deviations caused by data asynchrony.

[0084] Furthermore, in another possible implementation of this application embodiment, the model processing module 403 may specifically include the following units: The second calculation unit is used to multiply the motion intensity factor by a preset motion influence coefficient to obtain the motion influence amount, and to multiply the noise factor by a preset noise influence coefficient to obtain the noise influence amount.

[0085] The third calculation unit is used to multiply the motion intensity factor and the noise factor, and then multiply them by a preset coupling coefficient to obtain the coupling effect.

[0086] The fourth calculation unit is used to sum the motion influence, noise influence, and coupling influence, add one, and then multiply by the preset baseline static bitrate to obtain the predicted bitrate.

[0087] Therefore, by multiplying the motion intensity factor and noise factor by their respective influence coefficients to obtain the independent influence quantities, and calculating the coupled influence quantities of the two, the predicted bitrate is finally generated by combining the baseline static bitrate. This constructs a prediction model that can simultaneously quantify the independent effects of motion and noise and their nonlinear interactions, significantly improving the bitrate prediction accuracy in complex scenarios (such as simultaneous intense motion and low light).

[0088] Furthermore, in another possible implementation of this application embodiment, the above-mentioned device for estimating the remaining storage time of the video may further include the following modules: The dynamic correction module is used to obtain the actual bitrate output by the video encoder of the video recording device; and to dynamically correct the predicted bitrate based on the ratio between the actual bitrate and the predicted bitrate.

[0089] Therefore, by dynamically correcting the predicted bitrate based on the ratio between the actual bitrate output by the video encoder and the predicted bitrate before determining the remaining storage time, a feedback calibration mechanism is introduced, enabling the prediction system to adapt online to model deviations caused by factors such as scene texture differences, thereby improving the long-term accuracy and robustness of the prediction results.

[0090] Furthermore, in another possible implementation of this application embodiment, the remaining recordable storage time is a long-term remaining recordable time, and the duration estimation module 404 may specifically include the following units: The fifth calculation unit is used to calculate the current remaining duration based on the current remaining storage capacity and the predicted bitrate.

[0091] The first acquisition unit is used to acquire the light trend prediction information of the environment where the video recording device is located.

[0092] The third processing unit is used to adjust the predicted value of the noise factor based on the illumination trend prediction information, and to recalculate the predicted bit rate for future time periods based on the adjusted noise factor.

[0093] The second determining unit is used to determine the long-term remaining recordable time based on the recalculated predicted bitrate.

[0094] Therefore, by combining the acquired illumination trend prediction information to adjust the predicted value of the noise factor, and recalculating the predicted bitrate for future time periods to determine the remaining long-term recordable duration, the periodic change trend of ambient illumination is taken into account in the prediction, thus achieving a more conservative and accurate long-term early warning of future storage consumption, which is suitable for planning scenarios that require long-term continuous recording.

[0095] Furthermore, in another possible implementation of this application embodiment, the first acquisition unit can be specifically used to: acquire the current geographical location information and current time information of the video recording device; calculate the solar altitude angle at multiple future time points based on the geographical location information and current time information; and generate illumination trend prediction information based on the changing trend of the solar altitude angle.

[0096] Therefore, by calculating the solar altitude angle at multiple future time points based on the current geographical location and time information of the video recording device, and generating illumination trend prediction information accordingly, objective, reliable, and non-required reference for external environmental illumination changes are provided for long-term bitrate estimation, thereby enhancing the scientific nature and feasibility of long-term trend prediction.

[0097] The video remaining storage duration estimation device provided in this application embodiment can be applied in the foregoing method embodiment. For details, please refer to the description of the above method embodiment, which will not be repeated here.

[0098] Figure 5 This is a schematic diagram of the structure of the electronic device provided in an embodiment of this application. For example... Figure 5 As shown, the electronic device 500 of this embodiment includes: at least one processor 510 ( Figure 5 The diagram shows only one processor, a memory 520, and a computer program 521 stored in the memory 520 and executable on the at least one processor 510. When the processor 510 executes the computer program 521, it implements the steps in the above-described method embodiment for estimating the remaining storage time of the video.

[0099] The electronic device 500 can be a desktop computer, laptop, handheld computer, cloud server, or other computing device. This electronic device may include, but is not limited to, a processor 510 and a memory 520. Those skilled in the art will understand that... Figure 5 This is merely an example of electronic device 500 and does not constitute a limitation on electronic device 500. It may include more or fewer components than shown in the figure, or combine certain components, or different components. For example, it may also include input / output devices, network access devices, etc.

[0100] The processor 510 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0101] In some embodiments, the memory 520 may be an internal storage unit of the electronic device 500, such as a hard disk or memory of the electronic device 500. In other embodiments, the memory 520 may be an external storage device of the electronic device 500, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device 500. Furthermore, the memory 520 may include both internal and external storage units of the electronic device 500. The memory 520 is used to store the operating system, applications, boot loader, data, and other programs, such as the program code of the computer program. The memory 520 can also be used to temporarily store data that has been output or will be output.

[0102] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0103] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0104] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0105] In the embodiments provided in this application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings or direct couplings or communication connections may be through some interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0106] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0107] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0108] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.

[0109] The implementation of all or part of the processes in the methods of the above embodiments can also be accomplished by a computer program product. When the computer program product is run on an electronic device, the electronic device can implement the steps in the various method embodiments described above.

[0110] The embodiments described above are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A method for estimating the remaining storage time of a video, applied to a video recording device, characterized in that, The method includes: Acquire motion sensor data and ambient light sensor data from the video recording device; The motion intensity factor is calculated based on the motion sensor data, and the noise factor is calculated based on the ambient light sensor data. The motion intensity factor is used to characterize the change in video image complexity caused by the movement of the video recording device, and the noise factor is used to characterize the image noise level caused by insufficient ambient light. Based on the motion intensity factor and the noise factor, the predicted bit rate is calculated using a preset bit rate prediction model; The remaining recording time of the video recording device is determined based on the predicted bitrate.

2. The method according to claim 1, characterized in that, The step of calculating the motion intensity factor based on the motion sensor data includes: The original vibration intensity is calculated based on the motion sensor data within a preset time window. The original vibration intensity is normalized to obtain the motion intensity factor.

3. The method according to claim 1, characterized in that, The step of calculating the noise factor based on the ambient light sensor data includes: Based on the ambient light sensor data, determine the current photosensitivity parameters related to the image noise level; The noise factor is obtained by performing mapping processing based on the current photosensitivity parameters.

4. The method according to claim 1, characterized in that, Before calculating the predicted bitrate using a preset bitrate prediction model based on the motion intensity factor and the noise factor, the method further includes: Obtain the timestamps of the video frames output by the video encoder of the video recording device; Align the timestamps of the motion sensor data and the ambient light sensor data with the timestamps of the video frames. Based on the result of the alignment operation, a corresponding motion intensity factor and noise factor are assigned to each video frame.

5. The method according to claim 1, characterized in that, The step of calculating the predicted bitrate using a preset bitrate prediction model based on the motion intensity factor and the noise factor includes: The motion intensity factor is multiplied by a preset motion influence coefficient to obtain the motion influence amount, and the noise factor is multiplied by a preset noise influence coefficient to obtain the noise influence amount. Multiply the motion intensity factor by the noise factor, and then multiply by a preset coupling coefficient to obtain the coupling influence amount; The predicted bitrate is obtained by summing the motion influence, noise influence, and coupling influence, adding one, and then multiplying by a preset baseline static bitrate.

6. The method according to claim 1, characterized in that, Before determining the remaining recording time of the video recording device based on the predicted bitrate, the method further includes: Obtain the actual bitrate output by the video encoder of the video recording device; The predicted bitrate is dynamically adjusted based on the ratio between the actual bitrate and the predicted bitrate.

7. The method according to claim 1, characterized in that, The remaining recording time is the long-term remaining recording time. Determining the remaining recording time of the video recording device based on the predicted bitrate includes: Calculate the remaining duration based on the current remaining storage capacity and the predicted bitrate; Obtain the illumination trend prediction information of the environment where the video recording device is located; Based on the illumination trend prediction information, the predicted value of the noise factor is adjusted, and the predicted bitrate for the future time period is recalculated based on the adjusted noise factor. The remaining long-term recordable duration is determined based on the recalculated predicted bitrate.

8. The method according to claim 7, characterized in that, The step of obtaining the illumination trend prediction information of the environment where the video recording device is located includes: Obtain the current geographical location information and current time information of the video recording device; Based on the geographical location information and the current time information, calculate the solar altitude angle at multiple future time points; Based on the changing trend of the solar altitude angle, the illumination trend prediction information is generated.

9. A device for estimating the remaining storage time of a video, applied to a video recording device, characterized in that, The device includes: The data acquisition module is used to acquire motion sensor data and ambient light sensor data of the video recording device; The factor calculation module is used to calculate a motion intensity factor based on the motion sensor data and a noise factor based on the ambient light sensor data. The motion intensity factor is used to characterize the change in video image complexity caused by the movement of the video recording device, and the noise factor is used to characterize the image noise level caused by insufficient ambient light. The model processing module is used to calculate the predicted bitrate based on the motion intensity factor and the noise factor using a preset bitrate prediction model. The duration estimation module is used to determine the remaining recording time of the video recording device based on the predicted bitrate.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 8.