Security detection video storage method and system based on dynamic frame rate
By dynamically adjusting the video frame rate and filling frame processing, the problem of resource waste and inconsistent video quality caused by frame rate fluctuations in security detection video storage is solved, and more efficient resource utilization and a more stable video storage process are achieved.
Patent Information
- Application Number
- CN202510337067.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2045-03-21
AI Technical Summary
The existing security detection video preservation method leads to waste of hardware resources, inconsistent video quality and unstable frame rate during startup phase when frame rate fluctuations, affecting the integrity of video content and system stability.
The video saving method based on dynamic frame rate is adopted to monitor the video frame rate in real time, dynamically adjust the frame rate of the video saved, and perform appropriate frame replacement when the frame rate is insufficient to ensure the smoothness and integrity of the video.
It effectively reduces the consumption of storage space and computing resources, improves video quality and system stability, adapts to the camera's frame rate fluctuations under different working conditions, and reduces the risk of system failure and video loss.
Smart Images

Figure CN120201162A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of personnel security detection, and specifically to a security detection video saving method and system based on dynamic frame rate. Background Art
[0002] In the field of security monitoring technology, intelligent cameras are increasingly widely used, and their main function is to perform real-time detection and recording of personnel activities. However, due to the complexity of security detection algorithms and the limitations of hardware performance, the frame rate of cameras often fluctuates when performing detection tasks, and this fluctuation is particularly obvious in the initial stage of camera startup, where the frame rate gradually increases from 0 to near a stable value. In existing technical practices, in order to meet the requirement of saving a video segment at fixed intervals, a video saving method with a fixed frame rate is generally adopted. However, this method has some significant problems and deficiencies:
[0003] Waste of hardware resources: When the frame rate is low, if a fixed frame rate is still used for video saving, it will inevitably lead to excessive video frame filling, which not only occupies a large amount of storage space but also increases the consumption of computing resources.
[0004] Inconsistency of video quality: The fluctuation of the frame rate has a direct impact on the video saving quality. When the frame rate is unstable and a fixed frame rate is used to save the video, it will cause stuttering or frame loss during video playback, seriously affecting the overall quality of the video.
[0005] Instability of the frame rate during startup: Especially in the initial stage of camera startup, when the frame rate gradually rises from 0, using a fixed frame rate to save the video will result in insufficient frame rate in the initial part of the video, which not only affects the integrity of the video content but also increases the occupation of hardware resources and delays the time for the device to enter a stable working state.
[0006] Based on this, those skilled in the art have proposed a security detection video saving method and system based on dynamic frame rate to solve the above problems. Summary of the Invention
[0007] Aiming at the deficiencies of the prior art, the present invention provides a security detection video saving method and system based on dynamic frame rate, which solves the problems proposed in the above background art.
[0008] To achieve the above objectives, the present invention is realized through the following technical solutions: A security detection video saving method based on dynamic frame rate, comprising the following steps:
[0009] S1. Real-time collect video frames through an intelligent camera and perform security detection;
[0010] S2. Stamp each frame with a timestamp and record the detection result information;
[0011] S3. Send the timestamp, image, and detection result information to the video storage thread through a thread queue;
[0012] S4. In the video storage thread, repeatedly retrieve the timestamp, image, and detection result information and put them into a cache queue;
[0013] S5. Calculate whether the end time of the video has been reached based on the latest timestamp, and count the total number of video frames captured during this period;
[0014] S6. Calculate the appropriate frame rate for storing the video based on the total number of frames in the cache queue and the video duration, and round down to the nearest preset frame rate level as the frame rate for saving the video;
[0015] S7. Calculate the position of each frame in the video based on the timestamp of each frame and the start time of the stored video;
[0016] S8. If the number of frames is insufficient within a certain period, ensure the smoothness and integrity of the video by frame filling, while limiting the number of frames filled each time to 1;
[0017] S9. Before saving the video, calculate the number of frames that need to be filled for the complete-length video, use the last frame for frame filling, and finally save the video file and the corresponding detection information file.
[0018] Preferably, in the S1 step, the intelligent camera includes:
[0019] An image sensor for capturing video frames;
[0020] A processor for executing security detection algorithms;
[0021] A memory for storing timestamps and detection result information.
[0022] Preferably, in the S3 step, the thread queue includes:
[0023] A producer thread for sending timestamps, images, and detection result information;
[0024] A consumer thread for retrieving information from the queue.
[0025] Preferably, in the S4 step, the cache queue is used to temporarily store the timestamps, images, and detection result information retrieved from the thread queue, and the cache queue can classify the information as the current video frame or the next video frame according to the end time of the video.
[0026] Preferably, the step of calculating the appropriate frame rate in the S6 step further includes:
[0027] S601. Statistically calculate the total number of frames in the cache queue;
[0028] S602. Calculate the actual frame rate according to the video duration and the total number of frames;
[0029] S603. Compare the actual frame rate with the preset frame rate levels, and select the level closest to and not greater than the actual frame rate as the frame rate for video saving.
[0030] Preferably, the step of frame filling in the S8 step further includes:
[0031] S801. Detect whether the number of frames in a certain period is insufficient;
[0032] S802. If the number of frames is insufficient, use the current frame to fill the missing frames in the front;
[0033] S803. Limit the frame filling to only 1 frame each time to prevent the subsequent frames in the cache from being discarded due to exceeding the video duration.
[0034] A security detection video saving system based on dynamic frame rate, comprising:
[0035] A video acquisition module, used for real-time acquisition of video frames;
[0036] A video detection module, used for real-time security detection, adding a timestamp to each frame, attaching detection result information, and sending it to the video storage thread;
[0037] A frame number statistics module for video storage, calculating whether the end time of the video is reached according to the timestamp, and if so, statistically calculating the total number of video frames acquired during this period;
[0038] A dynamic frame rate adjustment module for video storage, calculating the actual frame rate according to the total number of frames and the video duration, and determining the video saving frame rate according to the preset levels;
[0039] A video saving module, calculating the position of each frame in the video according to the timestamp of each frame, performing appropriate frame filling when the number of frames is insufficient, writing the frames into the video and saving it locally, and saving the relevant detection result information.
[0040] Preferably, the video acquisition module further includes:
[0041] An intelligent camera, used for capturing video frames;
[0042] An image processing unit, used for preliminary processing of video frames.
[0043] Preferably, the video detection module further includes:
[0044] A security detection algorithm, used for analyzing security-related information in video frames;
[0045] A timestamp generator for adding timestamps to each frame that passes the detection.
[0046] Preferably, the video saving module further includes:
[0047] A frame filling processor for appropriately filling frames when the number of frames is insufficient;
[0048] A video encoder for encoding the processed video frames and saving them locally;
[0049] A detection information recorder for saving relevant detection result information.
[0050] The present invention provides a method and system for saving security detection videos based on dynamic frame rate, having the following beneficial effects:
[0051] 1. By real-time monitoring and dynamically adjusting the video frame rate, the present invention effectively avoids the situation of saving videos at a high frame rate when the frame rate is low, thus significantly reducing the consumption of storage space and computing resources. Through intelligent frame rate management, this method realizes the reasonable allocation and utilization of resources, enabling the hardware resources to serve video processing and storage more efficiently, rather than being wasted in unnecessary frame filling processes.
[0052] 2. By introducing a frame filling processing mechanism, the present invention effectively solves the problems of stuttering and frame loss caused by frame rate fluctuations, ensuring the smoothness and integrity of video playback. Through dynamic frame rate adjustment and intelligent frame filling, this method not only improves the visual quality of the video but also enhances the reliability and effectiveness of the video as evidence.
[0053] 3. The present invention can adapt to the frame rate fluctuations that occur during the startup phase and the running process of the camera. By dynamically adjusting the frame rate, it ensures the stability of the video saving process. This adaptability enables the system to operate efficiently under different working conditions, reducing the system failures and the risk of video loss caused by unstable frame rates, thereby improving the stability and reliability of the entire security monitoring system.
[0054] 4. By dynamically adjusting the frame rate, the present invention reduces the size of the video file, thereby improving the utilization rate of storage space. This means that more video data can be saved with the same storage capacity, or the investment in storage devices can be reduced while ensuring the video quality. In addition, the optimized storage strategy can also simplify data management and reduce long-term operation costs, making the security monitoring system more economical and efficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 It is the overall operation flowchart of the present invention;
[0056] Figure 2It is the flowchart of the video saving system of the present invention;
[0057] Figure 3 It is the flowchart of the intelligent camera of the present invention. Specific implementation manners
[0058] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0059] Embodiment 1:
[0060] Please refer to the attached Figure 1 - attached Figure 3 , the embodiment of the present invention provides a method for saving security detection videos based on dynamic frame rate, including the following steps:
[0061] S1. Real-time collect video frames through an intelligent camera and perform security detection;
[0062] The intelligent camera includes:
[0063] An image sensor for capturing video frames, which is a device that converts optical signals into electrical signals and can capture image information in a scene.
[0064] A processor for executing security detection algorithms, including motion monitoring, face recognition, abnormal behavior recognition, etc. The processor analyzes the video frames captured by the image sensor to identify and respond to specific security events.
[0065] A memory for storing timestamp and detection result information. The timestamp records the specific time when each frame is captured. The detection result information includes detailed data of any security event identified by the processor.
[0066] The intelligent camera continuously obtains video frames from the image sensor and executes security detection algorithms through the processor.
[0067] After the detection is completed, the processor stores the detection results (such as whether there are intruders, abnormal behaviors, etc.) and the timestamp of this frame in the memory.
[0068] S2. Stamp each frame with a timestamp and record the detection result information;
[0069] Specifically, this step ensures that each frame of video can be associated with the time when it is captured and the relevant security detection results. This is crucial for the subsequent processing and analysis of the video, especially when it is necessary to quickly locate and respond to security events.
[0070] S3. Send the timestamp, image, and detection result information to the video storage thread through the thread queue;
[0071] The thread queue includes:
[0072] A producer thread, which is used to send the timestamp, image, and detection result information. The producer thread reads this information from the memory of the intelligent camera and puts it into the queue.
[0073] A consumer thread, which is used to take out the information from the queue. The consumer thread reads the data in the queue and passes it to the video storage thread for further processing.
[0074] Through the thread queue, the producer thread sends the captured video frame information (including the timestamp and detection result) to the consumer thread. This design allows the system to effectively manage the data stream, avoid data loss, and ensure that the video frame information can be processed and stored in a timely and accurate manner.
[0075] S4. In the video storage thread, repeatedly take out the timestamp, image, and detection result information and put it into the cache queue;
[0076] The cache queue is used to temporarily store the timestamp, image, and detection result information taken out from the thread queue. At the same time, the cache queue can classify the information as the current video frame or the next video frame according to the end time of the video.
[0077] Specifically, the cache queue serves as a temporary storage area for storing the timestamp, image, and detection result information taken out from the thread queue. The main function of this queue is to temporarily store this information until it can be further processed, such as calculating the frame rate or performing video encoding.
[0078] The cache queue can classify the information as the current video frame or the next video frame according to the end time of the video. This means that the cache queue not only stores the information but also organizes the information according to the recording timestamp of the video to ensure that the video frames are processed in the correct order.
[0079] S5. Calculate whether the end time of the video is reached according to the latest timestamp and count the total number of video frames captured during this period;
[0080] S6. Calculate the appropriate frame rate for storing the video according to the total number of frames in the cache queue and the video duration, and round down to the nearest preset frame rate gear as the frame rate for video saving;
[0081] Specifically, the appropriate frame rate for storing the video is calculated based on the total number of frames in the cache queue and the video duration. This step involves determining the frame rate of the video according to the actually captured number of frames, rather than simply adopting a fixed frame rate. Round down to the nearest preset frame rate gear as the frame rate for video saving. This means that the system will select a preset frame rate gear (such as 10, 15, 20, 25, 30 frames per second) that is closest to but does not exceed the calculated frame rate as the final frame rate for video saving.
[0082] The dynamically calculated frame rate adjusts the saving quality of the video according to the actual video content and security detection requirements, thereby optimizing the use of storage space while ensuring the video quality.
[0083] The step of calculating the appropriate frame rate further includes:
[0084] S601. Count the total number of frames in the cache queue;
[0085] S602. Calculate the actual frame rate according to the video duration and the total number of frames;
[0086] S603. Compare the actual frame rate with the preset frame rate gears, and select the gear that is closest to and not greater than the actual frame rate as the frame rate for video saving.
[0087] S7. According to the timestamp of each frame, calculate the position of each frame in the video relative to the start time of the stored video;
[0088] Specifically, the purpose of the step of calculating the position of each frame in the video is to determine the exact position of each frame of video data in the final video file.
[0089] Operation: The system will compare and calculate according to the timestamp of each frame and the start time of video storage. The timestamp records the specific time point when each frame is captured, and the start time is the time point when the video segment starts. Through this comparison, the position of each frame relative to the start of the video can be determined, thus ensuring the correct sorting and continuity of video frames.
[0090] S8. If the number of frames is insufficient within a certain period of time, ensure the smoothness and integrity of the video by filling in frames, and at the same time limit that only 1 frame can be filled in each frame filling operation;
[0091] The step of filling in frames further includes:
[0092] S801. Detect whether the number of frames is insufficient within a certain period of time;
[0093] S802. If the number of frames is insufficient, use the current frame to fill in the missing frames in the front;
[0094] S803. Limit that only 1 frame can be filled in each frame filling operation to avoid subsequent frames in the cache being discarded due to exceeding the video duration.
[0095] Specifically, the purpose of frame filling is to ensure the smoothness and integrity of video playback, especially in cases where the frame rate fluctuates or is unstable during the camera startup phase.
[0096] Operation:
[0097] Detect insufficient frames: The system will detect whether there are enough frames missing within a certain period to meet the set frame rate requirements.
[0098] Use the current frame to fill: If insufficient frames are detected, the system will use the current frame to fill the missing frames in the front. This means that the current frame will be reused to ensure that there are no frame skips or freezes during video playback.
[0099] Limit the number of filled frames: To maintain the authenticity of the video content and avoid excessive distortion, the system limits the number of filled frames to 1 each time. This can prevent subsequent frames in the cache from being discarded due to exceeding the video duration, and also avoid video redundancy caused by excessive repeated frames.
[0100] The effects of frame filling are as follows:
[0101] Smoothness: Through frame filling, even in cases of low or fluctuating frame rates, the smoothness of video playback can be maintained.
[0102] Integrity: Frame filling ensures the integrity of the video content, avoiding the loss of video content due to insufficient frame rates.
[0103] Authenticity: By limiting the number of filled frames to 1 each time, the authenticity of the video content is maintained, avoiding video distortion caused by excessive repeated frames.
[0104] S9. Before saving the video, calculate the number of frames that need to be filled for the complete-length video, use the last frame for frame filling processing, and finally save the video file and the corresponding detection information file.
[0105] A security detection video saving system based on dynamic frame rate, including:
[0106] A video acquisition module, used to acquire video frames in real time;
[0107] The video acquisition module further includes:
[0108] An intelligent camera, used to capture video frames;
[0109] An image processing unit, used to perform preliminary processing on video frames.
[0110] Specifically, the image processing unit is another important component in the video acquisition module, and it is responsible for performing preliminary processing on video frames. This includes:
[0111] Image Enhancement: Improve the clarity, contrast, and brightness of the image, making the details in the image more prominent.
[0112] Noise Filtering: Reduce random noise in the image and improve image quality.
[0113] Format Conversion: Convert the image data into a format suitable for further processing and storage.
[0114] Video Detection Module, used for real-time security detection, adding timestamps to each frame, attaching detection result information, and sending it to the video storage thread;
[0115] Specifically, the video detection module is responsible for performing real-time security detection on the captured video frames, adding timestamps to each frame, attaching detection result information, and then sending this information to the video storage thread. The main functions of this module include:
[0116] Real-time Security Detection: Use various security algorithms (such as motion detection, face recognition, etc.) to analyze video frames to identify and respond to potential security threats.
[0117] Timestamp Marking: Add timestamps to each video frame to record the specific time when the frame was captured. This is crucial for the accurate positioning and analysis of events.
[0118] Detection Result Information: Record the results of security detection, such as detected motion, face recognition results, etc., and associate this information with the video frames.
[0119] Information Sending: Send the timestamps, images, and detection result information to the video storage thread through a thread queue for subsequent video saving and analysis.
[0120] The video detection module further includes:
[0121] Security Detection Algorithm, used to analyze security-related information in video frames;
[0122] Timestamp Generator, used to add timestamps to each frame that passes the detection.
[0123] Function: The timestamp generator is responsible for adding timestamps to each video frame that passes the detection to record the specific time when the frame was captured.
[0124] Role: The timestamp provides accurate time information for video frames. Through the timestamp, the specific time point when an event occurs can be determined, thereby improving the response speed and accuracy of the security monitoring system.
[0125] Video Storage Frame Counting Module, calculates whether the end time of the video is reached based on the timestamp, and if so, counts the total number of video frames captured during this time period;
[0126] The dynamic frame rate adjustment module for video storage calculates the actual frame rate based on the total number of frames and the video duration, and determines the video saving frame rate according to the preset gear.
[0127] Specifically, the video detection module is a key part of the security monitoring system responsible for analyzing video content and identifying security-related events. It includes the following two main components:
[0128] Function: The security detection algorithm is a series of computational methods for analyzing video frames and identifying specific events (such as intrusion, theft, etc.). These algorithms can be based on multiple technologies such as motion detection, behavior analysis, and face recognition.
[0129] Role: Through real-time analysis of video frames, the security detection algorithm can identify abnormal behaviors or events in the video and generate corresponding detection result information.
[0130] The video storage module is responsible for managing the storage process of video data, including two key parts: frame number statistics and dynamic frame rate adjustment:
[0131] Frame number statistics module
[0132] Function: Calculate the end time of the video based on the timestamp and count the total number of video frames captured during this period.
[0133] Role: The frame number statistics module ensures the integrity and accuracy of video data. By counting the number of frames, the length and frame rate of the video can be determined.
[0134] Dynamic frame rate adjustment module
[0135] Function: Calculate the actual frame rate based on the total number of frames and the video duration, and determine the video saving frame rate according to the preset frame rate gear.
[0136] Role: The dynamic frame rate adjustment module optimizes the video storage efficiency. By dynamically adjusting the saving frame rate according to the actual frame rate, the waste of storage space can be reduced and the video playback quality can be improved. This dynamic adjustment mechanism makes video saving more flexible and efficient, and can adapt to different monitoring scenarios and requirements.
[0137] The video saving module calculates the position of each frame in the video based on the timestamp of each frame, performs appropriate frame filling when the number of frames is insufficient, writes the frames into the video and saves it locally, and saves the relevant detection result information. The video saving module further includes:
[0138] Frame filling processor, used for performing appropriate frame filling when the number of frames is insufficient;
[0139] Video encoder, used for encoding the processed video frames and saving them locally;
[0140] A detection information recorder for saving relevant detection result information.
[0141] In summary, by real-time monitoring and dynamically adjusting the video frame rate, the situation of saving videos at a high frame rate when the frame rate is low is effectively avoided, thus significantly reducing the consumption of storage space and computing resources. Through intelligent frame rate management, this method realizes the reasonable allocation and utilization of resources, enabling the hardware resources to serve video processing and storage more efficiently, rather than being wasted in the unnecessary process of frame filling. At the same time, by introducing a frame filling processing mechanism, the problems of stuttering and frame loss caused by frame rate fluctuations are effectively solved, ensuring the smoothness and integrity of video playback.
[0142] The present invention reduces the size of video files by dynamically adjusting the frame rate, thereby improving the utilization rate of storage space. This means that more video data can be saved under the same storage capacity, or the investment in storage devices can be reduced on the premise of ensuring video quality. In addition, the optimized storage strategy can also simplify data management and reduce long-term operation costs, making the security monitoring system more economical and efficient.
[0143] Embodiment 2:
[0144] In order to prove the effect of the security detection video saving system based on dynamic frame rate of the present invention, a series of tests were carried out and compared with the fixed frame rate video saving system in the prior art. The following is a detailed description of the embodiment, including the test method, test results and data analysis.
[0145] Test environment: Under the same hardware configuration, the dynamic frame rate video saving system of the present invention and the traditional fixed frame rate video saving system are deployed.
[0146] Test content: Under different frame rate fluctuation conditions, compare the performances of the two systems in terms of video storage space occupancy, video quality, system stability and storage efficiency.
[0147] Test data: Record and analyze the following data:
[0148] Storage space occupancy: Record the storage space required to save videos of the same duration.
[0149] Video quality: Evaluate the video quality through subjective scoring and objective indicators (such as PSNR, SSIM).
[0150] System stability: Record the number of faults and video loss rate during the operation of the system.
[0151] Storage efficiency: Calculate the video duration saved per unit storage space.
[0152] Among them, the test results are shown in Table 1 below:
[0153]
[0154] Table 1
[0155] As can be seen from Table 1, the following conclusions can be drawn:
[0156] Storage space occupancy: The dynamic frame rate system reduces the storage space occupancy by 20% compared to the fixed frame rate system. This is because the dynamic frame rate system can adjust the saving strategy according to the actual frame rate, avoiding unnecessary frame filling and thus reducing the waste of storage space.
[0157] Video quality: The dynamic frame rate system performs better in terms of video quality, with the average PSNR value increased by 8.57%. This benefits from the fact that the dynamic frame rate system effectively solves the problems of frame freezing and frame loss caused by frame rate fluctuations through the frame filling processing mechanism, ensuring the smoothness and integrity of video playback.
[0158] System stability: No failures occurred during the testing process of the dynamic frame rate system, and the video loss rate was 0%, while the fixed frame rate system had 2 failures and a 5% video loss rate. This indicates that the dynamic frame rate system can better adapt to frame rate fluctuations, ensure the stability of the video saving process, and improve the reliability of the entire security monitoring system.
[0159] Storage efficiency: The storage efficiency of the dynamic frame rate system is increased by 25%, and more video data can be saved with the same storage capacity. This enables the security monitoring system to reduce the investment in storage devices and lower the long-term operation cost while ensuring video quality.
[0160] Although the embodiments of the present invention have been shown and described, it will be understood by those of ordinary skill in the art that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention, and the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A security detection video storage method based on dynamic frame rate, characterized in that: The following steps are involved: S1, collect video frames in real time and perform security detection through smart cameras; S2, timestamp each frame and record the detection result information; S3, sending the timestamp, image and detection result information to the video storage thread through the thread queue; S4, in the video storage thread, cyclically fetch the timestamp, image and detection result information, and put them into the cache queue; S5. Calculate whether the end time of the video has been reached according to the latest timestamp, and count the total number of video frames collected during the time period; S6. Calculate the appropriate frame rate for storing the video according to the total number of frames in the cache queue and the duration of the video, and round down the frame rate according to the preset frame rate level as the frame rate for saving the video; S7, calculating the position of each frame in the video according to the timestamp of each frame and the start time of the stored video; S8. If the number of frames is insufficient within a certain period of time, the video is supplemented by adding frames to ensure the smoothness and integrity of the video, and each supplementation is limited to only one frame; S9. Before saving the video, calculate the number of frames required to complete the length of the video, use the last frame for frame supplementation, and finally save the video file and the corresponding detection information file.
2. A method for saving security detection videos based on dynamic frame rate according to claim 1, characterized in that: The smart camera in step S1 includes: An image sensor for capturing video frames; A processor for executing a security detection algorithm; The memory is used to store timestamp and detection result information.
3. The method for saving security detection videos based on dynamic frame rate according to claim 1, characterized in that: The thread queue in step S3 includes: Producer thread, used to send timestamp, image and detection result information; Consumer thread, used to take information from the queue.
4. The method for saving security detection videos based on dynamic frame rate according to claim 1, characterized in that: In the step S4, the cache queue is used to temporarily store the timestamp, image and detection result information taken out from the thread queue. At the same time, the cache queue can classify the information into the current video frame or the next video frame according to the end time of the video.
5. The method for saving security detection videos based on dynamic frame rate according to claim 1, characterized in that: The step of calculating the appropriate frame rate in step S6 further includes: S601, counting the total number of frames in the cache queue; S602, calculating the actual frame rate according to the video duration and the total number of frames; S603: Compare the actual frame rate with the preset frame rate level, and select the level closest to and not greater than the actual frame rate as the frame rate for saving the video.
6. The method for saving security detection videos based on dynamic frame rate according to claim 1, characterized in that: The step of frame supplementation in step S8 further includes: S801, detecting whether the number of frames within a certain period of time is insufficient; S802: If the number of frames is insufficient, use the current frame to fill the previously missing frames; S803: Limit each frame supplement to only one frame, so as to prevent subsequent cached frames from exceeding the video duration and being discarded.
7. A security detection video storage system based on dynamic frame rate, according to a security detection video storage method based on dynamic frame rate according to any one of claims 1 to 6, characterized in that: include: Video acquisition module, used to acquire video frames in real time; The video detection module is used for real-time security detection and adds a timestamp to each frame, along with the detection result information, and sends it to the video storage thread; The frame count module of the video storage calculates whether the end time of the video has been reached based on the timestamp. If reached, the total number of video frames collected during the time period is counted; The dynamic frame rate adjustment module of video storage calculates the actual frame rate according to the total number of frames and the video duration, and determines the video storage frame rate according to the preset gear; The video saving module calculates the position of each frame in the video according to the timestamp of each frame, and makes appropriate frame additions when the number of frames is insufficient, writes the frames into the video and saves them locally, and saves the relevant detection result information.
8. A security detection video storage system based on dynamic frame rate according to claim 7, characterized in that: The video acquisition module further comprises: A smart camera for capturing video frames; The image processing unit is used to perform preliminary processing on the video frames.
9. The security detection video storage system based on dynamic frame rate according to claim 7, characterized in that: The video detection module further comprises: Security detection algorithm, used to analyze security-related information in video frames; The timestamp generator is used to timestamp each frame that passes the detection.
10. The security detection video storage system based on dynamic frame rate according to claim 7, characterized in that: The video storage module further includes: A frame interpolation processor is used to interpolate frames appropriately when the number of frames is insufficient; Video encoder, used to encode the processed video frames and save them locally; The test information recorder is used to save relevant test result information.
Citation Information
Patent Citations
Video monitoring system front end memory method and video monitoring system
CN102572357A
Dynamic frame rate storage method and device and monitoring equipment
CN110650320A
Dynamic picture playing method for cloud director
CN114449309A
Real-time video structured information extraction and storage method and system
CN114547374A
Video data storage method, video data reading method, electronic equipment and storage medium
CN115396618A