A Frame Extraction Optimization Method and System in the Scenario of Intelligent Analysis of Video Streams
By defining the method of fetching frame period, packet and dynamic allocation of video stream groups in video stream intelligent analysis technology, the problems of high server load and long processing delay in high-density camera data processing are solved, and the stability of the system and resource utilization are improved.
Patent Information
- Application Number
- CN202410979784.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2044-07-22
AI Technical Summary
When existing video streaming intelligent analysis technology processes high-density camera data, the server load is high, the processing delay is long, the resource is wasted, and the dynamic frame-fetching optimization strategy is lacking, resulting in inefficient processing.
By traversing all cameras and models on the detection server, defining the frame acquisition period, grouping the camera configurations according to requirements, allocating video stream groups for each second during the frame acquisition period, calculating the maximum number of frames per camera, taking frames according to the number, and generating the next sequence based on the camera sequence, performing merging operations before generating the frame acquisition sequence.
It improves the stability and adaptability of the system, ensures coordinated operation between different camera models, reduces server load, avoids the risk of system crash, optimizes resource utilization, and improves identification efficiency and overall system performance.
Smart Images

Figure CN118870039B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent video stream analysis, and particularly to a frame extraction optimization method and system under the scenario of intelligent video stream analysis. Background Art
[0002] With the continuous progress of computer technology and artificial intelligence, machine vision has been improved in terms of processing power, recognition accuracy, and response speed. Especially in the field of intelligent video stream analysis, the application of advanced algorithms and high-speed processors has made it possible to process and analyze real-time video data. Traditional video surveillance systems have gradually evolved into intelligent surveillance systems that can automatically identify and analyze video content and are widely used in multiple fields such as security monitoring, intelligent transportation, and industrial automation. Currently, the application scope of machine vision technology is constantly expanding, covering from simple image recognition to complex behavior analysis, significantly improving the work efficiency and security of various industries.
[0003] Although the intelligent video stream analysis technology has made progress, there are still some significant deficiencies in the existing technology when dealing with high-density camera data. Traditional frame extraction methods usually adopt fixed time intervals or polling mechanisms. This method is prone to causing excessive server load and obvious processing delays when the number of cameras increases. In severe cases, it may even lead to system instability or crashes. The existing technology lacks effective frame extraction optimization strategies and cannot dynamically adjust the frame extraction frequency and quantity according to actual needs, resulting in resource waste and low processing efficiency. In addition, the existing camera sequence generation methods are usually relatively simple and cannot effectively utilize historical data for prediction and optimization, resulting in a significant decline in performance during long-term operation. Summary of the Invention
[0004] In view of the above problems, the present invention is proposed.
[0005] Therefore, the technical problem solved by the present invention is: the existing video stream frame extraction method has high server load, long processing delay, serious resource waste, and how to dynamically optimize frame extraction to improve processing efficiency and stability.
[0006] To solve the above technical problems, the present invention provides the following technical solution: a frame extraction optimization method under the scenario of intelligent video stream analysis, including traversing all cameras and models on the detection server, defining a frame extraction period, grouping camera configurations according to requirements; allocating video stream groups for each second within the frame extraction period, calculating the maximum number of frames that can be extracted for each camera, and extracting frames according to the quantity; generating the next sequence based on the camera sequence and performing a merging operation before generating the frame extraction sequence.
[0007] As a preferred solution of the frame extraction optimization method in the intelligent analysis scenario based on video stream according to the present invention, wherein: the definition of the frame extraction period includes constructing a frame extraction period calculation mechanism, including setting the maximum length of the default time to 600s and the minimum length to 150s, obtaining the maximum value g of the time intervals of all models of all cameras. When g is less than 150, the frame extraction period length is 150; when g is greater than or equal to 150 and less than or equal to 600, the frame extraction period length is g; when g is greater than 600, the models with time intervals greater than 600 are separated into two configuration arrays. The first configuration array has a time length of 600, and the second separated configuration array has a time length that is greater than g and is the smallest multiple of 600. The two configuration arrays calculate the frame extraction sequence in the same way.
[0008] As a preferred solution of the frame extraction optimization method in the intelligent analysis scenario based on video stream according to the present invention, wherein: the grouping according to requirements includes sorting the combinations of all camera models in ascending order of time interval. Combinations that satisfy the same camera and time intervals in multiples are divided into one group. D represents the device, m represents the model. The first value in <> represents the time interval size, and the second value represents the number of frame extractions. When the time interval is 1, that is, detection is performed every second, the combination is taken as a separate group. After grouping, check the second and subsequent combinations in each group to see if the number of frame extractions is less than or equal to the number of frame extractions of the first combination. When the number of frame extractions of the subsequent combinations in each group is less than or equal to the number of frame extractions of the first combination, leave it unchanged; when the number of frame extractions of the subsequent combinations in each group is greater than the number of frame extractions of the first combination, then check the combinations under the same camera. If the time interval of the first combination under the same camera is a divisor of the frame extraction interval of the subsequent combinations in each group and the number of frame extractions is greater than or equal to the number of frame extractions of the subsequent combinations in each group, then move the subsequent combinations in each group to the grouping under the same camera. If the moving conditions are not met, continue to find the next combination under the same camera.
[0009] As a preferred solution of the frame extraction optimization method in the intelligent analysis scenario based on video stream according to the present invention, wherein: the allocated video stream group includes creating a two-dimensional array, the length of the array is the time length that meets the frame extraction period calculation mechanism, and each array places the cameras to be detected within one second. Traverse all groups, take out the first combination, the time interval is n, take the first n arrays in the two-dimensional array, calculate the total number of frame extractions for each array, and the total number of frame extractions for the array is equal to the sum of the maximum number of frame extractions in the combinations of the same type of cameras. Place the array with the smallest total number of frame extractions in the first combination, and place the first combination in the corresponding position of the array in the two-dimensional array according to the interval; when there are two or more arrays with the same minimum value in the total number of frame extractions, take the first array with the same cameras or the same models for placement; when there are no multiple arrays with the same minimum value in the total number of frame extractions, place the array with the smallest total number of frame extractions in the first combination; for the subsequent combinations in the group, start from the position where the first combination in the group is placed and perform periodic placement.
[0010] As a preferred solution of the frame extraction optimization method in the intelligent analysis scenario based on video stream according to the present invention, wherein: the frame extraction according to the quantity includes traversing each array in the two-dimensional array, the maximum number of frame extractions for all camera models is the maximum number of frame extractions in the current second, and the frame extraction is performed according to the quantity, and all models of the cameras within the current second reuse the frames for recognition.
[0011] As a preferred solution of the frame extraction optimization method in the intelligent analysis scenario based on video stream according to the present invention, wherein: the generation of the next sequence includes after the frame extraction sequence is generated, generating a new sequence through the generated camera sequence, traversing all cameras and models, obtaining the maximum value y of the model time interval, creating a two-dimensional array with a length twice that of the provided camera sequence, traversing the first y arrays of the provided camera sequence, traversing all cameras and models inside, and performing placement in the newly created two-dimensional array based on the period. When the placement position is in the first half, no placement is performed. After the placement is completed, take the second half of the content of the two-dimensional array as the next camera sequence.
[0012] As a preferred solution of the frame extraction optimization method in the intelligent analysis scenario based on video stream according to the present invention, wherein: the merging operation includes that when there are two configuration arrays when defining the frame extraction period, two camera sequences with lengths will be generated, and a merging operation is performed before generating the frame extraction sequence, including adding the content of another sequence to the 600-length camera sequence, and adding the content of 600 sequences each time in order.
[0013] Another object of the present invention is to provide a frame extraction optimization system based on intelligent video stream analysis scenarios, which can solve the problem of low efficiency in current intelligent video stream analysis by allocating video stream groups for each second within the frame extraction period, calculating the maximum number of frames that can be extracted by each camera, and extracting frames according to the quantity.
[0014] As a preferred embodiment of the frame extraction optimization system based on intelligent video stream analysis scenarios of the present invention, it includes a grouping module, a frame extraction module, and a merging module; the grouping module is used to traverse all cameras and models on the detection server, define the frame extraction period, and group the camera configurations according to requirements; the frame extraction module is used to allocate video stream groups for each second within the frame extraction period, calculate the maximum number of frames that can be extracted by each camera, and extract frames according to the quantity; the merging module is used to generate the next sequence based on the camera sequence and perform a merging operation before generating the frame extraction sequence.
[0015] A computer device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps of the frame extraction optimization method based on intelligent video stream analysis scenarios are implemented.
[0016] A computer-readable storage medium stores a computer program thereon. When the computer program is executed by a processor, the steps of the frame extraction optimization method based on intelligent video stream analysis scenarios are implemented.
[0017] The beneficial effects of the present invention: The frame extraction optimization method based on intelligent video stream analysis scenarios provided by the present invention improves the stability and adaptability of the system by reasonably setting the frame extraction period, ensures the coordinated operation between different camera models, reduces the server load, and avoids the risk of system crashes. By optimizing the grouping of camera models, the frame extraction load balance of each group is ensured, and resource waste and processing delays caused by too high frame extraction frequencies of some cameras are avoided. By dynamically allocating video stream groups, the balanced distribution and efficient execution of frame extraction tasks are ensured, and the centralized processing of frame extraction tasks is avoided, reducing the server burden. By calculating and controlling the number of frames extracted, it is ensured that the frame extraction tasks within each second can meet the requirements of all models, optimizing resource utilization and improving recognition efficiency. By continuously generating camera sequences, the continuous progress of frame extraction tasks is ensured, avoiding interruptions and repeated generation, and improving the efficiency and stability of the system. By merging camera sequences, the consistency and integrity of the final frame extraction sequence are ensured, avoiding data loss and redundancy, and improving the overall performance of the system. The present invention achieves better results in terms of efficiency, reliability, and integrity. Description of the Drawings
[0018] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.
[0019] Figure 1 It is the overall flowchart of a frame extraction optimization method based on the intelligent analysis scenario of video streams provided by the first embodiment of the present invention.
[0020] Figure 2 It is the schematic diagram of grouped movement of a frame extraction optimization method based on the intelligent analysis scenario of video streams provided by the first embodiment of the present invention.
[0021] Figure 3 It is the statistical chart of frame extraction data before algorithm optimization of a frame extraction optimization method based on the intelligent analysis scenario of video streams provided by the second embodiment of the present invention.
[0022] Figure 4 It is the statistical chart of frame extraction data after algorithm optimization of a frame extraction optimization method based on the intelligent analysis scenario of video streams provided by the second embodiment of the present invention.
[0023] Figure 5 It is the overall flowchart of a frame extraction optimization system based on the intelligent analysis scenario of video streams provided by the third embodiment of the present invention. Detailed implementation manners
[0024] To make the above objects, features, and advantages of the present invention more obvious and understandable, the following will make a detailed description of the specific implementation manners of the present invention in conjunction with the accompanying drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of them. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the scope of protection of the present invention.
[0025] Embodiment 1
[0026] Referring to Figure 1 - Figure 2 , for an embodiment of the present invention, a frame extraction optimization method based on the intelligent analysis scenario of video streams is provided, including:
[0027] S1: Traverse all cameras and models on the detection server, define the frame extraction period, and group the camera configurations according to requirements.
[0028] Further, defining the frame acquisition period includes constructing a frame acquisition period calculation mechanism, including setting the maximum length of the default time to 600 s and the minimum length to 150 s, obtaining the maximum value g of the time intervals of all models of all cameras. When g is less than 150, the frame acquisition period length is 150; when g is greater than or equal to 150 and less than or equal to 600, the frame acquisition period length is g; when g is greater than 600, the models with time intervals greater than 600 are separated into two configuration arrays. The first configuration array has a time length of 600, and the second separated configuration array has a time length that is the smallest multiple of 600 greater than g. The two configuration arrays calculate the frame acquisition sequence in the same way.
[0029] It should be noted that grouping according to requirements includes sorting the combinations of all camera models in ascending order of time interval. Combinations that meet the conditions of the same camera and time intervals being in multiples are grouped together. According to the multiple combinations, the frame acquisition tasks with large time intervals are completely covered by small intervals. D represents the device, m represents the model, the first value in <> represents the time interval size, and the second value represents the number of frames acquired. When the time interval is 1, that is, detection is performed every second, the combination is grouped separately. After grouping, check the second and subsequent combinations in each group to see if the number of frames acquired is less than or equal to the number of frames acquired by the first combination in the group. When the number of frames acquired by the subsequent combinations in each group is less than or equal to the number of frames acquired by the first combination, leave it unchanged; when the number of frames acquired by the subsequent combinations in each group is greater than the number of frames acquired by the first combination, then check the combinations under the same camera. If the time interval of the first combination under the same camera is a divisor of the frame acquisition interval of the subsequent combinations in the group and the number of frames acquired is greater than or equal to the number of frames acquired by the subsequent combinations in the group, then move the subsequent combinations in the group to the grouping under the same camera. If the moving conditions are not met, continue to find the next combination under the same camera. Refer to Figure 2 When the number of frames acquired by m1 is 4, at this time, m3 will be reallocated from grouping 1 to grouping 5.
[0030] It should also be noted that different cycle segmentation processing is carried out to prevent the overall sequence length from being affected by a small number of large cycles, thus affecting the generation time and overall efficiency. Multiples are convenient for merging different cycle sequences. Through the frame acquisition period calculation mechanism, it is ensured that the frame acquisition period can flexibly adapt to the needs of different camera models, thereby improving the stability and processing efficiency of the system. Grouping according to requirements ensures the load balancing of the frame acquisition tasks, avoiding resource waste and processing delays.
[0031] S2: Allocate video stream groups for each second within the frame acquisition period, calculate the maximum number of frames that can be acquired by each camera, and acquire frames according to the quantity.
[0032] Further, the allocated video stream group includes creating a two-dimensional array with a length of the time length that meets the frame-taking cycle calculation mechanism. Each array places the cameras that need to be detected within one second. Traverse all groups, take out the first combination, with a time interval of n. Take the first n arrays in the two-dimensional array, and calculate the total number of frames taken for each array. The total number of frames taken for an array is equal to the sum of the maximum number of frames taken in the combinations of cameras of the same type, ensuring a relatively balanced overall load per second, reducing the peak pressure on the GPU and CPU, ensuring the stability of the overall service. Place the array with the smallest total number of frames taken in the first combination, and place the first combination in the array at the corresponding position in the two-dimensional array according to the interval. When there are two or more arrays with the same minimum total number of frames taken, take the first array with the same cameras or the same model for placement. When there are no multiple arrays with the same minimum total number of frames taken, place the array with the smallest total number of frames taken in the first combination. For subsequent combinations in the group, start from the position where the first combination in the group is placed and perform periodic placement.
[0033] It should be noted that taking frames according to the quantity includes traversing each array in the two-dimensional array. The maximum number of frames taken for all camera models is the maximum number of frames taken in the current second. Take frames according to the quantity, and all models of the cameras within the current second reuse the frames for recognition, covering the smaller frame-taking quantities with the maximum value to avoid duplicate frame-taking.
[0034] It should also be noted that by dynamically allocating the video stream group, the reasonable distribution of the frame-taking task is ensured, the resource utilization is optimized, each array in the two-dimensional array is traversed, the maximum number of frames taken for all camera models within one second is calculated, and frames are taken according to this number of frames taken, ensuring that all models reuse these frames for recognition, avoiding duplicate frame-taking, and improving the processing efficiency and accuracy of the system.
[0035] S3: Generate the next sequence based on the camera sequence and perform a merging operation before generating the frame-taking sequence.
[0036] Further, generating the next sequence includes, after generating the frame-taking sequence, continuing to generate a new sequence through the generated camera sequence. Traverse all cameras and models, obtain the maximum value y of the model time interval, create a two-dimensional array with a length twice that of the provided camera sequence. Traverse the first y arrays of the provided camera sequence, traverse all cameras and models inside, and place them in the newly created two-dimensional array based on the period. When the placement position is in the first half, do not place. After completing the placement, take the second half of the content of the two-dimensional array as the next camera sequence.
[0037] It should be noted that the merging operation includes the case where when there are two configuration arrays when defining the frame-taking period, two lengths of camera sequences will be generated, and the merging operation is performed before generating the frame-taking sequence, including adding the content of another sequence to the 600-length camera sequence, adding the content of 600 sequences each time in order.
[0038] It should also be noted that for the segmented sequence generation method, the subsequent sequence is derived from the previous sequence, reducing the memory occupancy pressure while ensuring the continuity of the sequence. The traditional method is generally a simple loop, which cannot ensure continuity. Generating the next segment of the sequence based on the camera sequence ensures the continuity of the camera sequence, avoids interruption and duplicate generation, and improves the operating efficiency of the system. Through the merging operation, the integrity and consistency of the final frame-taking sequence are ensured, avoiding data loss and redundancy, and further optimizing the system performance.
[0039] Embodiment 2
[0040] Referring to Figure 3 - Figure 4 , an embodiment of the present invention provides a frame-taking optimization method in the scenario of intelligent analysis of video streams. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through economic benefit calculation and simulation experiments.
[0041] First, the experiment integrates 5 recognition models, and there are a total of 5 cameras. Referring to Table 1, the time interval, the number of frames taken, and the equipped cameras are recorded.
[0042] Table 1 Experimental data record table
[0043] Model Name Time Interval Number of Frames Retrieved Equipped Cameras m1 3 6 D1, D2 m2 4 8 D1 m3 12 5 D1 m4 5 8 D2 m5 3 6 D3, D4
[0044] Referring to Figure 3 - Figure 4 , after running independently for 150 seconds, the frame-taking statistics per second are carried out, and Figure 3 is drawn based on the unified frame-taking data. After that, through the algorithm of our invention, frame-taking optimization is carried out, and Figure 4 is drawn based on the new frame-taking data. Referring to Table 2, the total number of frames taken, the average number of frames taken per second, the maximum number of frames taken within a second, the minimum number of frames taken within a second, and the hardware idle time of the unified frame-taking and the algorithm frame-taking are recorded and analyzed.
[0045] Table 2 Frame-taking data comparison table
[0046] Parameter Name Uniform Frame Retrieval Algorithm Frame Retrieval Total Number of Frames Retrieved 1809 1606 Average Number of Frames Retrieved per Second 12.06 10.71 Maximum Number of Frames Retrieved within a Second 45 28 Minimum Number of Frames Retrieved within a Second 0 6 Hardware Idle Duration (seconds) 60 0
[0047] As can be seen from the statistical data, during this period, the overall number of frames captured decreased by 11%, the peak pressure decreased by 37.8%, and the hardware idle time decreased by 40%. As the number of cameras and models increases, the optimization effect will become more obvious. Therefore, the present invention realizes the efficient and stable operation of the system, improves the resource utilization rate and processing efficiency by reasonably setting the frame capture period, optimizing grouping, dynamically allocating video stream groups, accurately calculating the number of frames captured, and merging camera sequences.
[0048] Embodiment 3
[0049] Referring to Figure 5 , an embodiment of the present invention provides a frame capture optimization system based on the intelligent analysis scenario of video streams, including a grouping module, a frame capture module, and a merging module.
[0050] Among them, the grouping module is used to traverse all cameras and models on the detection server, define the frame capture period, and group the camera configurations according to requirements; the frame capture module is used to allocate video stream groups for each second within the frame capture period, calculate the maximum number of frames that can be captured by each camera, and capture frames according to the quantity; the merging module is used to generate the next sequence based on the camera sequence and perform a merging operation before generating the frame capture sequence.
[0051] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.
[0052] The logic and / or steps represented in the flowchart or otherwise described herein can, for example, be considered a definitional sequence of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in connection with the instruction execution system, apparatus, or device.
[0053] More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection portion having one or more wirings (electronic device), a portable computer diskette (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable media on which a program can be printed, as the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or otherwise processing as appropriate, and then storing it in a computer memory.
[0054] It should be understood that the various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or a combination of the following techniques known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application-specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc. It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered by the scope of the claims of the present invention.
[0055] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered within the scope of the claims of the present invention.
Claims
1. A frame optimization method based on video stream intelligent analysis scenario, characterized in that: include: Traverse all cameras and models on the detection server, define the frame acquisition cycle, and group the camera configurations according to requirements; Allocate a video stream group for each second in the frame acquisition cycle, calculate the maximum number of frames for each camera, and acquire frames according to the number; Generate the next sequence based on the camera sequence and perform a merge operation before generating the frame sequence; Defining the frame period includes building a frame period calculation mechanism, including setting the default maximum time length to 600s and the minimum time length to 150s, obtaining the maximum value g of the time intervals of all models of all cameras, and when g is less than 150, the frame period length is 150; When g is greater than or equal to 150 and less than or equal to 600, the frame period length is taken as g; When g is greater than 600, all models with time intervals greater than 600 are separated into two configuration arrays. The time length of the first configuration array is 600, and the time length of the second separated configuration array is greater than g and the smallest multiple of 600. The two configuration arrays calculate the frame sequence in the same way.
2. The frame optimization method based on video stream intelligent analysis scenario according to claim 1 is characterized in that: The grouping according to the requirements includes sorting all the combinations of camera models according to the time interval from small to large, and grouping the combinations with the same cameras and multiple time intervals into one group. D represents the device, m represents the model, the first value in <> represents the time interval, and the second value represents the number of frames. When the time interval is 1, that is, detection is performed every second, the combination is grouped separately; After the groups are divided, check whether the number of frames taken in the second and subsequent combinations of each group is less than or equal to the number of frames taken in the first combination. When the number of frames taken in the subsequent combinations in each group is less than or equal to the number of frames taken in the first combination, keep it unchanged; When the number of frames taken by subsequent combinations in each group is greater than the number of frames taken by the first combination, check the combinations under the same camera. If the first combination time interval of the combination under the same camera is a divisor of the frame interval of subsequent combinations in each group, and the number of frames taken is greater than or equal to the number of frames taken by subsequent combinations in each group, move the subsequent combinations in each group to the group under the same camera. If the moving condition is not met, continue to look for the next combination under the same camera.
3. The frame optimization method based on video stream intelligent analysis scenario according to claim 2 is characterized in that: The allocation of the video stream group includes creating a two-dimensional array, the length of the array is the time length that satisfies the frame-taking period calculation mechanism, each array is placed with cameras that need to be detected within one second, traversing all groups, taking out the first combination, the time interval is n, taking the first n arrays in the two-dimensional array, calculating the total number of frames taken by each array, the total number of frames taken by the array is equal to the sum of the maximum number of frames taken in the combination of similar cameras, taking the array with the smallest total number of frames to place the first combination, and placing the first combination in the array at the corresponding position in the two-dimensional array according to the interval; When there are two arrays with the same minimum value whose total number of frames is greater than or equal to two, the first array with the same camera or the same model is taken and placed; When there are no multiple arrays with the same minimum value for the total number of frames, the array with the smallest total number of frames is placed in the first combination; Subsequent combinations in the group are placed periodically starting from the position where the first combination in the group is placed.
4. The frame optimization method based on video stream intelligent analysis scenario according to claim 3 is characterized in that: The frame taking according to quantity includes traversing each array in the two-dimensional array, the maximum frame taking number of all camera models is the maximum frame taking number of the current second, and the frames are taken according to the quantity. All the models of the camera within the current second reuse the frames for identification.
5. The frame optimization method based on video stream intelligent analysis scenario according to claim 4 is characterized in that: The generating of the next sequence includes generating a frame sequence, continuing to generate a new sequence through the generated camera sequence, traversing all cameras and models, obtaining the maximum value y of the model time interval, creating a two-dimensional array with a length twice that of the provided camera sequence, traversing the first y arrays of the provided camera sequence, traversing all internal cameras and models, placing them in the newly created two-dimensional array based on the cycle, not placing them when the placement position is in the first half, completing the two-dimensional array after placement, and taking the second half of the content as the next camera sequence.
6. The frame optimization method based on video stream intelligent analysis scenario according to claim 5 is characterized in that: The merging operation includes that when there are two configuration arrays when defining the frame acquisition period, two camera sequences of length will be generated. The merging operation is performed before generating the frame acquisition sequence, including adding the content of another sequence to the camera sequence of length 600, and adding the content of 600 sequences each time in order.
7. A system using the frame optimization method based on video stream intelligent analysis scenario according to any one of claims 1 to 6, characterized in that: Including grouping module, frame taking module and merging module; The grouping module is used to traverse all cameras and models on the detection server, define the frame acquisition period, and group the camera configurations according to the requirements; The frame taking module is used to allocate a video stream group for each second in the frame taking period, calculate the maximum number of frames taken by each camera, and take frames according to the number; The merging module is used to generate the next sequence based on the camera sequence and perform a merging operation before generating the frame sequence.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the frame optimization method based on the video stream intelligent analysis scenario described in any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the frame optimization method based on video stream intelligent analysis scenario described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Video semantic scene segmentation and labeling method
CN108537134A
Video stream processing method, device and system
CN113422935A