Multi-channel video recording data processing method, electronic equipment and storage medium

By centrally storing the video recording data of multi-channel video surveillance equipment in one video file, and using file header and frame header information for verification and encapsulation, the shortcomings of multi-channel video surveillance equipment in the prior art in terms of storage, resource consumption, file management, privacy and security are solved, and efficient data management and retrieval is achieved.

CN119629298AInactive Publication Date: 2025-03-14SHENZHEN XINRUISHI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510135602.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-07
Publication Date
2025-03-14
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing multi-channel video surveillance equipment has shortcomings in storage, packaging, resource consumption, file management and synchronization, resulting in high system resource requirements, complex file management, and privacy and security risks.

Method used

A multi-channel video recording data processing method is proposed. By creating a video recording file, the video recording data of all channels is stored centrally, the file header and frame header information is used for checksum encapsulation, and keyframe information is recorded at the end of the video file to achieve efficient data management and retrieval.

Benefits of technology

It significantly reduces the demand for system resources and scheduling overhead, simplifies file management, improves the security and retrieval efficiency of video files, and avoids the management complexity caused by excessive files.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119629298A_ABST
    Figure CN119629298A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of video monitoring, in particular to a multi-channel video recording data processing method, electronic equipment and a storage medium, and the method comprises the steps: responding to the received video recording data of each channel, creating a video recording file, and storing the received video recording data in the created video recording file; writing file header information into the beginning part of the video file; writing the received video recording data of each channel into the middle part of the video recording file according to a sequence of writing the frame header information and then writing the frame data; and recording key frame information of the video recording data of each channel at the end part of the video recording file to form a key frame information set. The file header information comprises file verification information and video file information; the frame header information comprises frame header verification information and frame data information, so that the defects of an existing multi-channel video recording data processing method in the aspects of storage, packaging, resource consumption, file management and the like are effectively overcome.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of video surveillance technology, and in particular to a method for processing multi-channel video recording data, an electronic device and a computer-readable storage medium. Background Art

[0002] With the booming development of the video surveillance industry and the popularity of multi-channel surveillance equipment, higher and higher requirements are placed on the security and accuracy of surveillance video storage. At present, when saving audio and video data, multi-channel surveillance equipment still uses the video recording storage method of single-channel equipment, that is, the audio and video data of each channel are stored in different files. This storage method consumes more system resources to open, locate, write, read and save files in the subsequent management process, which not only increases the development workload, but also significantly increases the demand for system resources, and may cause multi-channel video synchronization problems. In addition, the audio and video data of each channel are encapsulated and saved in MP4 format. When playing back, the multi-channel surveillance equipment will parse the audio and video data of each channel in MP4 format and transmit it to the client for playback.

[0003] It can be seen that the existing multi-channel video recording data processing methods still have some shortcomings in terms of storage, packaging, resource consumption, file management and synchronization, as shown below: 1. The system resource requirements are high. The more channels there are, the more system resources and scheduling overhead required.

[0004] 2. Each channel has a corresponding video file. As the recording time increases, the number of video files continues to increase, making it more complicated to find the video later and delete and overwrite the looped video.

[0005] 3. As a universal video packaging format, MP4 format may have certain risks in terms of privacy and security.

[0006] Therefore, there is an urgent need to improve the existing multi-channel video recording data processing method in order to better meet the needs of multi-channel monitoring equipment. Summary of the invention

[0007] In view of this, the present invention proposes a method for processing multi-channel video recording data, an electronic device and a computer-readable storage medium, aiming to overcome the shortcomings of the existing method for processing multi-channel video recording data.

[0008] In order to solve the above problems, the present invention adopts the following technical solutions: In a first aspect, the present invention provides a method for processing multi-channel video recording data, comprising: In response to receiving the video recording data of each channel, a video recording file is created, and the received video recording data is stored in the created video recording file; wherein, Writing file header information at the beginning of the video file; wherein the file header information includes file verification information and video file information; Writing the received video recording data of each channel into the middle part of the video recording file in the order of first writing the frame header information and then writing the frame data; wherein the frame header information includes frame header check information and frame data information; The key frame information of the video recording data of each channel is recorded at the end of the video recording file to form a key frame information set.

[0009] Furthermore, the video file information includes at least one of a file ID, a file header length, a file header version information, media data and index information, a video media image width, and a video media image height; The frame data information includes at least one of a frame number, a frame type, media data packet information, a relative timestamp, an absolute timestamp, a channel number, a frame data length, and a reserved field; The key frame information includes the current time of the key frame, a relative timestamp, a key frame number, and an offset address of the key frame in the video file.

[0010] Furthermore, after forming the key frame information set, the method further includes: Creating a video file at every first preset time interval, and saving all video files created within a second preset time interval in the same folder; The video file name of the video file includes the start time and end time of creating the video file, and the folder name of the folder includes the earliest time and the latest time of all video files saved in the folder.

[0011] Furthermore, after all the video files created within the preset second duration are saved in the same folder, the method further includes: In response to receiving a search instruction carrying information of a search period, searching for folders within the search period according to the folder names, and obtaining the video file names of all video files stored in the searched folders; In response to receiving a positioning instruction carrying information of the positioning time, searching for a video file close to the positioning time according to the obtained video file name; The key frame information set of the found video file is read to obtain the key frame information close to the positioning time, and the key frames corresponding to the obtained key frame information are sequentially read and frame discarded to realize the positioning of the video file.

[0012] Further, searching the folders in the search period according to the folder names, and obtaining the video file names of all video files stored in the searched folders, includes: converting the search period into the form of the folder name, and searching for the folders within the search period according to the converted form; Obtain the video file names of all video files stored in the retrieved folder, and obtain the start time and end time of the corresponding video files according to the video file names; The start time and end time of each video file obtained are converted into an array according to a preset conversion rule, and an array set containing all arrays is generated.

[0013] Further, searching for a video file close to the positioning time according to the obtained video file name includes: The array close to the positioning time is searched in the array set by using the quick sort method and the binary search method, and the video file corresponding to the found array is obtained.

[0014] Further, the obtaining of key frame information close to the positioning moment includes: A binary search method is used to search the key frame information set for key frame information close to the positioning moment.

[0015] Furthermore, the step of writing the file header information at the beginning of the video file includes: Obtaining file verification information of the video file, and verifying the file verification information according to a preset first verification rule; If the verification is passed, the file header information is written into the beginning of the video file; The step of writing the received video recording data of each channel into the middle part of the video recording file in the order of first writing the frame header information and then writing the frame data includes: Obtaining frame header verification information of the video recording data of each channel, and verifying each frame header verification information according to a preset second verification rule; If the verification is passed, the received video recording data of each channel is written into the middle part of the video recording file in the order of writing the frame header information first and then writing the frame data.

[0016] In a second aspect, the present invention further provides an electronic device, comprising: a memory for storing program instructions; and The processor is used to execute the program instructions to implement the steps of the method for processing multi-channel video recording data as described above.

[0017] In a third aspect, the present invention further proposes a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the steps of the method for processing multi-channel video recording data as described above are implemented.

[0018] Compared with the prior art, the beneficial effects of the present invention are: a method for processing multi-channel video recording data, an electronic device and a computer-readable storage medium, comprising: in response to receiving video recording data of each channel, creating a video recording file, and storing the received video recording data in the created video recording file; wherein, writing file header information at the beginning of the video recording file; writing the received video recording data of each channel into the middle part of the video recording file in the order of writing frame header information first and then writing frame data; recording key frame information of the video recording data of each channel at the end of the video recording file to form a key frame information set. wherein, the file header information includes file verification information and video recording file information; the frame header information includes frame header verification information and frame data information. it can be seen that the method for processing multi-channel video recording data, the electronic device and the computer-readable storage medium significantly reduce the demand for system resources and scheduling overhead by storing the video recording data of all channels in a single video recording file instead of creating a separate file for each channel. at the same time, since the video recording data of all channels are stored in one video recording file, the number of video recording files is greatly reduced, avoiding the management complexity caused by too many files. In addition, the encapsulation method of writing file verification information in the file header information and writing frame header verification information in the frame header information helps to verify the integrity and security of the video file in subsequent playback and management, thereby improving privacy protection. Furthermore, by setting a key frame information set, the retrieval efficiency of video recording data can also be improved, which facilitates the subsequent rapid positioning of key frames. Therefore, the processing method, electronic device and computer-readable storage medium effectively overcome the shortcomings of existing multi-channel video recording data processing methods in terms of storage, packaging, resource consumption and file management by means of centralized storage, simplified file management, optimized packaging structure and improved key frame management efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings: Figure 1 It is a flowchart of a first embodiment of a method for processing multi-channel video recording data of the present invention; Figure 2A schematic flow chart of a second embodiment of a method for processing multi-channel video recording data of the present invention; Figure 3 A schematic flow chart of a third embodiment of a method for processing multi-channel video recording data of the present invention; Figure 4 A schematic flow chart of a fourth embodiment of a method for processing multi-channel video recording data of the present invention; Figure 5 It is a schematic diagram of the structure of an electronic device in a hardware operating environment involved in an embodiment of the present invention. DETAILED DESCRIPTION

[0020] The scheme in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0021] It should be noted that if the embodiments of the present invention involve directional indications (such as up, down, left, right, front, back, etc.), the directional indications are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.

[0022] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present invention, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0023] It should be noted that the embedded Linux system is an operating system based on the Linux kernel, which is specially designed and optimized for embedded devices. Embedded devices are widely used in various fields, among which multi-channel video surveillance equipment is a typical application scenario. The embedded Linux system is often used as an operating system platform for multi-channel video surveillance equipment, supporting a variety of hardware drivers, including cameras, video encoders, and network interfaces. This enables multi-channel video surveillance equipment to connect and manage multiple cameras to achieve the collection and transmission of multi-channel video recording data. In addition, multi-channel video surveillance equipment also needs to process a large amount of video data streams, and the embedded Linux system can effectively manage the system resources (such as CPU, memory, and storage) of these devices to ensure the smooth operation and data processing of multiple video channels. It can be seen that the multi-channel video recording data processing method provided in the embodiment of the present invention is particularly suitable for application in this system.

[0024] See also Figure 1 As shown, it is a flow chart of a first embodiment of a method for processing multi-channel video recording data of the present invention.

[0025] In this embodiment, the method for processing multi-channel video recording data includes: Step S100: In response to receiving the video recording data of each channel, a video recording file is created, and the received video recording data is stored in the created video recording file.

[0026] Specifically, the created video file is encapsulated and written in the format of "file header" + multiple "frame headers, frame data" + "key frame information". The beginning of the video file is a file header, followed by multiple source data from different channels, forming a large amount of "frame header + frame data". The end of the video file saves all the key frame information in the video file to form a key frame information set. This audio and video encapsulation format is not compatible with common players on the market, which enhances the security of video files.

[0027] Step S200: writing file header information into the beginning of the video file.

[0028] The file header information includes file verification information and video file information.

[0029] Specifically, during data transmission or storage, the MP4 format, as a universal video packaging format, may face privacy and security risks. For example, malware uses MP4 files to attack, or leaks sensitive information through improper access rights. By introducing file verification information (such as check digits), comparisons can be made during subsequent readings to ensure that the video file has not been tampered with or damaged, avoid potential security risks, and ensure that users obtain authentic and reliable content when playing back the video. Video file information is used to provide a basic description of the video file, such as file format, creation time, duration, resolution, frame rate, number of channels, etc. Video file information can also provide the necessary parameters for the player or processing software to correctly decode and play the video data. For example, understanding the frame rate and resolution can help the player select the appropriate decoding method and display settings.

[0030] Step S300: writing the received video recording data of each channel into the middle part of the recording file in the order of first writing the frame header information and then writing the frame data.

[0031] The frame header information includes frame header check information and frame data information.

[0032] Specifically, the received video recording data of each channel is encapsulated in the order of writing the frame header information first and then writing the frame data. This order makes the structure of the middle part of the video file clearer and facilitates subsequent parsing and processing. When reading, the player can first obtain the frame header information to understand the content of the following frame data. In addition, the frame header information includes frame header verification information. By writing the frame header information first, verification can also be performed before writing the frame data to ensure the integrity and correctness of the frame data and reduce the risk of frame data damage and dirty data.

[0033] Specifically, the frame header checksum information is used to verify the integrity and correctness of the frame data during storage and transmission. By calculating and storing the frame header checksum information, it can be compared during subsequent reading to ensure that the frame data has not been tampered with or damaged. The frame data information is used to provide a basic description of the frame data, such as the frame type (such as key frame or non-key frame), timestamp, frame size, encoding format, etc. The frame data information can also provide the necessary parameters for the player or processing software to correctly decode and display the video recording data. For example, knowing the frame type and timestamp can help the player choose the appropriate decoding method and playback order.

[0034] Step S400: recording key frame information of the video recording data of each channel at the end of the video recording file to form a key frame information set.

[0035] Specifically, a key frame contains complete image information and is usually used as the starting point of a video stream or the switching of important scenes. By recording the position and timestamp of a key frame, the player can quickly locate the key frame and quickly jump or replay it. Recording all key frame information at the end of the video file can facilitate the management and retrieval of key frames, avoiding the data redundancy and low retrieval efficiency caused by the scattered storage of key frames in the video stream.

[0036] The method for processing multi-channel video recording data of the embodiment of the present invention first embeds file header information at the beginning of each created private video file, including a check digit, format version, etc. Then, a private frame header information is added before the audio and video frame of each coded channel, including check information, frame sequence number, coded frame type, etc. After all channel video frames are combined, they are all written into the middle part of the same video file. Finally, the key frame information of all channels is recorded at the end of the video file to form a key frame information set, which is convenient for the subsequent rapid and accurate positioning and retrieval of key frames.

[0037] Compared with the prior art, the processing method of multi-channel video recording data of the embodiment of the present invention significantly reduces the demand for system resources and scheduling overhead by storing the video recording data of all channels in a single recording file instead of creating a separate file for each channel. At the same time, since the video recording data of all channels are centrally stored in a recording file, the number of recording files is greatly reduced, avoiding the management complexity caused by too many files. In addition, the encapsulation method of writing file verification information in the file header information and writing frame header verification information in the frame header information helps to verify the integrity and security of the recording file in subsequent playback and management, thereby improving privacy protection. Furthermore, by setting a key frame information set, the retrieval efficiency of the video recording data can also be improved, which is convenient for subsequent rapid positioning of key frames. Therefore, the processing method effectively overcomes the shortcomings of the existing multi-channel video recording data processing method in terms of storage, encapsulation, resource consumption and file management by means of centralized storage, simplified file management, optimized encapsulation structure and improved key frame management efficiency.

[0038] See also Figure 2 As shown, it is a flow chart of a second embodiment of a method for processing multi-channel video recording data of the present invention.

[0039] Based on the first embodiment of the method for processing multi-channel video recording data, this embodiment adds a management and retrieval positioning process for multiple video recording files. The first embodiment of the processing method mainly involves the creation, packaging and storage of a single video recording file to ensure the security, accuracy and integrity of the video recording data, laying the foundation for subsequent data management, retrieval and positioning. Based on the first embodiment, the second embodiment of the processing method enhances the management efficiency and positioning capability of multiple video recording files, allowing users to access the required video recording data more quickly and accurately.

[0040] In this embodiment, after step S400, the method further includes: Step S500: creating a video file at every first preset time interval, and saving all video files created within a second preset time interval in the same folder.

[0041] The video file name of the video file includes the start time and end time of creating the video file, and the folder name of the folder includes the earliest time and the latest time of all video files saved in the folder.

[0042] Specifically, the acquired audio and video frame data of each channel is encapsulated in the above-mentioned private format at intervals of a certain duration (the first preset duration). After all the audio and video frame data are encapsulated within a period of time (the preset second duration), they are uniformly written into the same folder. Exemplarily, the folder name of the folder is named in the format of "earliest time-latest time" (such as 20211229000000-20211230000000). The earliest time represents the start time of the earliest video file among all the video files saved in the folder. The latest time represents the end time of the latest video file among all the video files saved in the folder. The video file name of each video file is named in the format of "start time-end time" (such as 20211229000000-20211229000459.prv), and is divided and saved and managed according to the time baseline. Taking one day (preset second duration) as an example, if a video file is created every 5 minutes (preset first duration), 288 video files will be generated (calculated as 24 * 60 / 5), and these 288 video files will be saved in the same folder. In this way, the writing and saving of multiple video files of multiple channels can be completed efficiently, which is convenient for subsequent time management and retrieval positioning.

[0043] Step S600: In response to receiving a search instruction carrying information about a search period, searching for folders within the search period according to the folder names, and obtaining the video file names of all video files stored in the searched folders.

[0044] Specifically, when a search instruction carrying information about a search period is received, the system can obtain the start time and end time of the search period from the search instruction; traverse all folders and check the folder name of each folder; determine whether the earliest time and latest time of the folder name overlap with the start time and end time of the search period; if so, include the folder corresponding to the folder name in the search results.

[0045] Specifically, the folder name includes the earliest time and the latest time of all the video files saved in the folder, so as to clearly display the time span of all the video files saved in the folder. This design not only facilitates intuitive understanding of the time range of the video files in the folder, but also can be easily compared with the start time and end time of the retrieval period, so that the system can quickly determine whether there is a folder corresponding to the retrieval period, avoiding the trouble of not knowing which folder contains the required video files when facing multiple folders. It can be seen that this naming design simplifies the retrieval process, reduces the consumption of system resources, and enables users to retrieve related folders more quickly, thereby improving the efficiency of locating subsequent video files. Generally speaking, if the preset second time length is set to one day, the retrieval period is set to not span days. Such a setting makes the retrieval logic relatively simple and avoids the confusion that may be caused by cross-day retrieval.

[0046] Step S700: In response to receiving a positioning instruction carrying information of a positioning time, searching for a video file close to the positioning time according to the obtained video file name.

[0047] Specifically, similar to the naming method of folder names, the video file name of the video file includes the start time and end time of the video file, so as to clearly show the specific time period of each video file. The time information of the video file name and the time information of the folder name complement each other, so that users can find the required folder more quickly during retrieval and positioning, and quickly locate the specific video file in the found folder. This consistent naming strategy not only improves the user experience, but also significantly enhances the overall efficiency of the system, making the management and use of video files more efficient and convenient. In addition, clear time identification can also help users better classify and archive files, further optimizing the management process of video files.

[0048] Specifically, the positioning moment refers to a specific time point that the user wants to find. Based on the above retrieval results for the folder, the processing method can further search for the corresponding video file according to the specific time point. In order to find a video file that is close to the positioning moment, the system can obtain the positioning moment provided by the user from the positioning instruction; traverse all the video files in the retrieved folder, and extract the start time and end time of each video file; determine whether there is a video file whose time range overlaps with the positioning moment; if so, include the video file in the positioning result. Furthermore, the system can also select the video file closest to the positioning moment by evaluating the proximity to the positioning moment, such as calculating the difference between the positioning moment and the start time and end time of the video file.

[0049] Step S800: reading the key frame information set of the found video file, obtaining the key frame information close to the positioning time, and sequentially reading and discarding the key frames corresponding to the obtained key frame information to realize the positioning of the video file.

[0050] Specifically, after finding a video file close to the positioning time, the next step is to read the key frame information set of the video file. This process includes: opening the video file; traversing the video file, extracting the key frame information of each key frame (such as timestamp, frame number, image data, etc.); calculating the difference between the key frame timestamp and the positioning time; finding the key frame with the smallest difference, which is considered to be the key frame closest to the positioning time.

[0051] Once the key frame closest to the positioning moment is determined, sequential reading and frame dropping processing are required to achieve accurate positioning of the video file. This process includes: locating the position of the key frame in the video file based on the key frame information found; starting from the key frame, sequentially reading subsequent key frames and other frames until the required time point is reached, and frame dropping processing is performed at the same time (the frame dropping strategy can be selected based on time interval, frame type, etc.), that is, skipping some frames to speed up playback or reduce data volume.

[0052] Specifically, the positioning and reading of video files is mainly used for playback operations on the client, which is divided into two parts: 1. Retrieve file list This process is to obtain a list of all files that may need to be played back within a specific time period (the file list shows the folder names corresponding to all folders that need to be played back). The corresponding folder name is determined by the search period, and then the folder corresponding to the folder name is checked to see if it exists. If it does exist, the video file names of all the video files in the folder are converted into an array to form an array list, so as to complete the fast search and provide a data basis for subsequent positioning.

[0053] 2. Positioning When the user needs to view the video file at a specific time point, the system needs to quickly locate the video file at this specific time point. Use binary search to find the video file close to the user's requested time point (specific time point, positioning moment) in the array list, then read the key frame information set of the video file, find the key frame closest to the requested time point in the key frame information set, read it sequentially and discard the frame to achieve fast positioning of the video file.

[0054] In the method for processing multi-channel video recording data of this embodiment, during the retrieval and positioning process, first confirm whether the corresponding folder exists. This step effectively avoids errors or delays caused by missing folders. Subsequently, the array list is used to search for video files close to the time point requested by the user, and the required key frames are located in the key frame information set of the video file. This process significantly improves the speed of retrieval and positioning, especially when processing a large number of video files, and can quickly narrow the search range, thereby effectively solving the problems of low efficiency and lack of accuracy that users may encounter when searching and playing back video files.

[0055] See also Figure 3 As shown, it is a flow chart of a third embodiment of a method for processing multi-channel video recording data of the present invention.

[0056] Compared with other embodiments of the method for processing multi-channel video recording data, this embodiment provides detailed descriptions of the steps of retrieving folders within the retrieval period, searching for video files close to the positioning moment, and obtaining key frame information close to the positioning moment.

[0057] In this embodiment, after step S400, the method further includes: Step S500: creating a video file at every first preset time interval, and saving all video files created within a second preset time interval in the same folder.

[0058] The video file name of the video file includes the start time and end time of creating the video file, and the folder name of the folder includes the earliest time and the latest time of all video files saved in the folder.

[0059] Step S601: In response to receiving a search instruction carrying information of a search period, converting the search period into the form of the folder name, and searching for folders within the search period according to the converted form.

[0060] Specifically, the search instruction input by the user received by the system usually includes the start time and end time of the search period, and the start time and end time are converted into the form of a folder name. For example, if the search period is from 00:00 on December 29, 2021 to 00:10 on December 29, 2021, the converted form is "20211229000000-20211229000958", and the folder name corresponding to the converted form can be "20211229000000-20211230000000".

[0061] Step S602: Obtain the video file names of all video files stored in the retrieved folder, and obtain the start time and end time of the corresponding video files according to the video file names.

[0062] Specifically, for each video file name, parse out its corresponding start time and end time. For example, the video file name is "20211229000000-20211229000459.prv", which can be parsed as: the start time is 00:00:00 on December 29, 2021, and the end time is 00:04:59 on December 29, 2021.

[0063] Step S603: converting the start time and end time of each video file obtained into an array according to a preset conversion rule, and generating an array set including all arrays.

[0064] Specifically, the preset conversion rule can be to convert the start time and the end time into a timestamp or a string in a specific format for subsequent processing. For example, for the video file name "20211229000000-20211229000459.prv", it can be converted into an array: ["2021-12-29 00:00:00", "2021-12-29 00:04:59"].

[0065] Through step S601, step S602 and step S603, the system can effectively respond to the search instruction, obtain the folder name and its corresponding folder within a specific time period, and convert the time information of all video files in the folder into an array set that is easy to process.

[0066] Step S701: in response to receiving a positioning instruction carrying positioning time information, use quick sort and binary search to search for an array close to the positioning time in the array set, and obtain a video file corresponding to the found array.

[0067] Specifically, the quick sort method can be used to quickly sort the array set to ensure that the array is in order. After sorting, the system can continue to use the binary search method to find the array and its corresponding video file close to the positioning time in the sorted array set. By combining the quick sort method and the binary search method, the system can efficiently process the positioning instructions, quickly find the video files close to the positioning time, improve the positioning efficiency, and enhance the user experience.

[0068] Step S801: reading the key frame information set of the found video file, and using a binary search method to search the key frame information set for key frame information close to the positioning time.

[0069] Specifically, Quick Sort is an efficient sorting algorithm. Its basic idea is to select a benchmark element and divide the array into two parts: one part contains all elements less than the benchmark, and the other part contains all elements greater than the benchmark. By recursively sorting these two parts, Quick Sort can achieve a time complexity of O(nlogn) on average. Binary Search is an efficient algorithm for finding target elements in a sorted array. It quickly locates the target value by continuously halving the search range. The specific steps include calculating the middle element and comparing it with the target value to decide whether to continue searching in the left half or the right half, and the time complexity is O(logn). Quick Sort and Binary Search are both efficient sorting and searching methods widely used in existing algorithms, and will not be described in detail here.

[0070] Step S802: sequentially read and discard key frames corresponding to the obtained key frame information to locate the video file.

[0071] Specifically, the process of sequentially reading key frames includes: first, initializing the reading pointer according to the most recent key frame found, and preparing to start reading from the key frame. Subsequently, the key frame and its subsequent non-key frames are read frame by frame in chronological order until the positioning moment requested by the user is reached. During the reading process, the system decodes each frame and passes it to the player for display. The frame dropping process is to decide whether to skip certain frames according to the user's positioning moment during the reading process. The specific steps include: when reading each frame, checking the relationship between its timestamp and the positioning moment requested by the user. If the timestamp of the current frame is earlier than the positioning moment requested by the user, the frame can be discarded and the next frame can be read. Once a frame with a timestamp close to the positioning moment requested by the user is found, the system will stop the frame dropping process and start playing the frame and its subsequent frames. Sequential reading and frame dropping are both commonly used video data processing methods in the prior art, and will not be described in detail here.

[0072] The method for processing multi-channel video recording data of this embodiment simplifies file management by storing the video recording data of all channels in the same recording file. In addition, the processing method has the ability to quickly locate key frames, which can significantly improve the efficiency of client video playback. Through this simplified file management, efficient file retrieval and accurate time positioning, the system effectively solves the problems of low efficiency and lack of accuracy that users may encounter when searching and playing back video files, thereby significantly improving the user experience and work efficiency.

[0073] See also Figure 4 As shown, it is a flow chart of a fourth embodiment of a method for processing multi-channel video recording data of the present invention.

[0074] Compared with other embodiments of the method for processing multi-channel video recording data, this embodiment describes in detail the verification steps of the file verification information of the video file and the verification steps of the frame header verification information of the video recording data.

[0075] In this embodiment, the method for processing multi-channel video recording data includes: Step S100: In response to receiving the video recording data of each channel, a video recording file is created, and the received video recording data is stored in the created video recording file.

[0076] Step S201: obtaining file verification information of the video file, and verifying the file verification information according to a preset first verification rule.

[0077] Step S202: If the verification is passed, the file header information is written into the beginning of the video file.

[0078] The file header information includes file verification information and video file information.

[0079] Specifically, the file verification information is a verification digit generated by a specific algorithm, which is used to verify whether the format of the private video file is correct, as well as the integrity and consistency of the video file. Common verification algorithms include MD5, SHA-1, and SHA-256. These algorithms can convert the file content into a string of fixed length. The format of the video file does not match or any modification to the file content will cause the verification digit of the string to change. Only when the verification passes will the system write the file header information at the beginning of the video file. This process can effectively determine whether the format of the video file meets expectations, and ensure the validity and reliability of the video file, thereby improving the accuracy and security of data processing.

[0080] Step S301: obtaining frame header verification information of video recording data of each channel, and verifying each frame header verification information according to a preset second verification rule.

[0081] Step S302: If the verification is passed, the received video recording data of each channel is written into the middle part of the video recording file in the order of first writing the frame header information and then writing the frame data.

[0082] The frame header information includes frame header check information and frame data information.

[0083] Specifically, the frame header checksum information is stored in each frame of the video recording data, and is mainly used to verify the integrity and consistency of the frame, thereby effectively preventing the generation of dirty data. Similar to the file checksum information, the frame header checksum information can be generated by a specific checksum algorithm (such as MD5, SHA-1, etc.) to ensure that the data of each frame has not been tampered with or damaged during transmission and storage. It should be noted that the system extracts the frame header checksum information of each frame from the video recording data received from each channel, and uses the same checksum algorithm to calculate the data of the current frame to generate a new frame header checksum value. The newly generated frame header checksum value is compared with the extracted frame header checksum information. If the two are the same, it means that the frame data has not been tampered with or damaged during transmission, and the checksum passes; otherwise, the checksum fails, and the system will refuse to write the frame data. Only when the frame header checksum information is checked, the system will write the received video recording data of each channel into the recording file. This mechanism ensures the accuracy and integrity of the video recording data, significantly improves the data quality, and avoids potential problems caused by dirty data.

[0084] In some embodiments of the present application, the video file information includes at least one of a file ID, a file header length, a file header version information, media data and index information, a video media image width, and a video media image height.

[0085] Specifically, the file header information is the starting data of each private video file. The file header information contains a total of 1 file check information and 6 video file information, namely: file header check bit (4Byte), file ID (4Byte), file header length (4Byte), file header version information (1Byte), media data and index information (2Byte), video media image width (2Byte) and video media image height (2Byte). Among them, the file header check bit is fixed to 0xB6010000. The file header check bit can be used to determine whether the format of the private video file is correct. The file ID records the identity information of the video file. The file header length indicates the length of the file header, which is currently 19Byte. The file header version information records its version, which also includes the image resolution information of the video media.

[0086] In some embodiments of the present application, the frame data information includes at least one of a frame number, a frame type, media data packet information, a relative timestamp, an absolute timestamp, a channel number, a frame data length, and a reserved field.

[0087] Specifically, the frame header information (frame data header) is a header information that must be carried by each audio frame data or video frame data. The size of the header information is 29 bytes in total, which includes 1 type of frame header check information and 9 types of frame data information (used to represent the basic information of the frame data). Specifically including: 1. Frame header checksum information (frame header checksum bit: 4Byte): fixed to 0xB7010000. Each time a frame of data is read, the frame header checksum information must be checked to prevent dirty data; 2. Frame number (4 Byte): The audio and video frames of each channel maintain independent and continuous frame numbers; 3. Frame type (1 Byte): frame data type, including I frame, P frame, etc.; 4. Media data packet information (1 Byte): frame data format, including H264 / H265 / G711U, etc.; 5. Relative timestamp (4Byte): relative timestamp of frame data; 6. Absolute timestamp (seconds, 4Byte): the absolute timestamp of the frame data in seconds; 7. Absolute timestamp (microseconds, 4Byte): the number of microseconds of the absolute timestamp of the frame data; 8. Channel number (1 Byte): the source channel of the frame data; 9. Frame data length (4Byte): the length of the frame data; 10. Reserved field (2 Byte): Reserved field for subsequent supplementary information.

[0088] In some embodiments of the present application, the key frame information includes the current time of the key frame, a relative timestamp, a key frame number, and an offset address of the key frame in the video file.

[0089] Specifically, a key frame information set is recorded at the end of the private video file, and the key frame information set of each video file occupies a total size of 32KB. This 32KB of data contains a lot of key frame information with a fixed size of 16Byte. The key frame information includes: current time (2Byte), relative timestamp (2Byte), key frame number (2Byte) and offset address (2Byte). Among them, the current time and relative timestamp both record the time information of the key frame, the key frame number refers to the number of the key frame in the total video frame, and the offset address records the offset address of the key frame in the video file to facilitate quick positioning and reading.

[0090] Step S400: recording key frame information of the video recording data of each channel at the end of the video recording file to form a key frame information set.

[0091] The method for processing multi-channel video recording data of this embodiment provides a configurable storage format for multi-channel video recording data to accommodate different numbers of video channels. By uniformly storing the video recording data of all channels, the number of video recording files is reduced, thereby simplifying management. In addition, a verification mechanism and a private frame header are introduced to improve the security and accuracy of video recording data. Furthermore, key frame information is recorded at the end of the video recording file, which lays the foundation for quickly locating key frames and significantly improves the playback efficiency and accuracy of the video recording file. These measures work together to achieve rapid query and precise positioning of video files, thereby effectively improving the management and use efficiency of multi-channel video recording data.

[0092] The method for processing multi-channel video recording data of this embodiment stores the video recording data of all channels in a single recording file, making the system more convenient when processing and managing video recording data. Especially when there are a large number of channels, since the video recording data of all channels are stored in one recording file, the number of recording files is greatly reduced, making it easier and more efficient to search for recordings and perform loop recording deletion and overwriting, avoiding the management complexity caused by too many files.

[0093] The following is an embodiment of the electronic device provided by the present invention. The embodiment of the electronic device and the embodiment of the multi-channel video recording data processing method described above are of the same concept, and the details not described in detail in the embodiment of the electronic device can refer to the embodiment of the multi-channel video recording data processing method described above.

[0094] See also Figure 5 As shown, it is a schematic diagram of the structure of an electronic device in a hardware operating environment involved in an embodiment of the present invention.

[0095] In this embodiment, an electronic device includes: Memory 1005, used to store program instructions; and The processor 1001 is used to execute the program instructions to implement the steps of the method for processing multi-channel video recording data as described above.

[0096] The electronic device of the embodiment of the present invention can be a computing device such as a desktop computer, a notebook, a palm computer, and a server. Figure 5 As shown, the electronic device may include: a processor 1001 (such as a CPU), a network interface 1004, a user interface 1003, a memory 1005 and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit, such as a keyboard (Keyboard), and the user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0097] Those skilled in the art will understand that Figure 5 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0098] like Figure 5 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module and a computer program.

[0099] exist Figure 5 In the electronic device shown, the network interface 1004 is mainly used to connect to the background server and communicate data with the background server; the user interface 1003 is mainly used to connect to the client (user end) and communicate data with the client; and the processor 1001 can be used to call the computer program stored in the memory 1005. When the computer program is called and executed by the processor 1001, the steps of the above-mentioned multi-channel video recording data processing method are implemented.

[0100] The following are embodiments of the computer-readable storage medium provided by the present invention. The embodiments of the computer-readable storage medium and the embodiments of the multi-channel video recording data processing method and electronic device described above are of the same concept, and the details not described in detail in the embodiments of the computer-readable storage medium can refer to the embodiments of the multi-channel video recording data processing method and electronic device described above.

[0101] In this embodiment, a computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the steps of the method for processing multi-channel video recording data as described above are implemented.

[0102] Since the electronic device and computer-readable storage medium of the present invention can both implement the steps of the above-mentioned method for processing multi-channel video recording data, all the beneficial effects brought about by the technical solution of at least the step embodiment of the above-mentioned method for processing multi-channel video recording data are not described in detail here.

[0103] The above description is only a partial or preferred embodiment of the present invention. Neither the text nor the drawings can limit the scope of protection of the present invention. All equivalent structural changes made by using the contents of the present invention specification and drawings under the overall concept of the present invention, or direct / indirect application in other related technical fields are included in the scope of protection of the present invention.

[0104] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0105] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0106] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0107] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0108] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A method for processing multi-channel video recording data, characterized in that: include: In response to receiving the video recording data of each channel, a video recording file is created, and the received video recording data is stored in the created video recording file; wherein, Writing file header information at the beginning of the video file; wherein the file header information includes file verification information and video file information; Writing the received video recording data of each channel into the middle part of the video recording file in the order of first writing the frame header information and then writing the frame data; wherein the frame header information includes frame header check information and frame data information; The key frame information of the video recording data of each channel is recorded at the end of the video recording file to form a key frame information set.

2. The method for processing multi-channel video recording data according to claim 1, characterized in that: The video file information includes at least one of a file ID, a file header length, a file header version information, media data and index information, a video media image width, and a video media image height; The frame data information includes at least one of a frame number, a frame type, media data packet information, a relative timestamp, an absolute timestamp, a channel number, a frame data length, and a reserved field; The key frame information includes the current time of the key frame, a relative timestamp, a key frame number, and an offset address of the key frame in the video file.

3. The method for processing multi-channel video recording data according to claim 1, characterized in that: After forming the key frame information set, the method further includes: Creating a video file at every first preset time interval, and saving all video files created within a second preset time interval in the same folder; The video file name of the video file includes the start time and end time of creating the video file, and the folder name of the folder includes the earliest time and the latest time of all video files saved in the folder.

4. The method for processing multi-channel video recording data according to claim 3, characterized in that: After all the video files created within the preset second duration are saved in the same folder, the method further includes: In response to receiving a search instruction carrying information of a search period, searching for folders within the search period according to the folder names, and obtaining the video file names of all video files stored in the searched folders; In response to receiving a positioning instruction carrying information of the positioning time, searching for a video file close to the positioning time according to the obtained video file name; The key frame information set of the found video file is read to obtain the key frame information close to the positioning time, and the key frames corresponding to the obtained key frame information are sequentially read and frame discarded to realize the positioning of the video file.

5. The method for processing multi-channel video recording data according to claim 4, characterized in that: The step of searching the folders in the search period according to the folder names and obtaining the video file names of all video files stored in the searched folders includes: converting the search period into the form of the folder name, and searching for the folders within the search period according to the converted form; Obtain the video file names of all video files stored in the retrieved folder, and obtain the start time and end time of the corresponding video files according to the video file names; The start time and end time of each video file obtained are converted into an array according to a preset conversion rule, and an array set containing all arrays is generated.

6. The method for processing multi-channel video recording data according to claim 5, characterized in that: The step of searching for a video file close to the positioning time according to the obtained video file name includes: The array close to the positioning time is searched in the array set by using the quick sort method and the binary search method, and the video file corresponding to the found array is obtained.

7. The method for processing multi-channel video recording data according to claim 5, characterized in that: The obtaining of key frame information close to the positioning time includes: A binary search method is used to search the key frame information set for key frame information close to the positioning moment.

8. The method for processing multi-channel video recording data according to claim 1, characterized in that: Writing the file header information at the beginning of the video file includes: Obtaining file verification information of the video file, and verifying the file verification information according to a preset first verification rule; If the verification is passed, the file header information is written into the beginning of the video file; The step of writing the received video recording data of each channel into the middle part of the video recording file in the order of first writing the frame header information and then writing the frame data includes: Obtaining frame header verification information of the video recording data of each channel, and verifying each frame header verification information according to a preset second verification rule; If the verification is passed, the received video recording data of each channel is written into the middle part of the video recording file in the order of writing the frame header information first and then writing the frame data.

9. An electronic device, characterized in that: include: A memory for storing program instructions; as well as A processor is used to execute the program instructions to implement the steps of the method for processing multi-channel video recording data as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the steps of the method for processing multi-channel video recording data according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Method and device for processing multichannel audio and video

    CN103428462A

  • Time stream-based video rapid retrieval method

    CN106202157A

  • Storage method, storage device, located playing method and located playing device for video file

    CN107979621A

  • Method and device for storing video data and readable storage medium

    CN114003763A

  • Synchronous playing method of multi-channel video, terminal equipment and storage medium

    CN118612388A