Video data processing method and device, equipment and medium

By performing video recording data processing in units of GOP sequences, the problems of insufficient memory resources and frame drop caused by waiting for I frames in video recording data processing are solved, and the integrity of the video recording file and real-time access efficiency are improved.

CN119232865AActive Publication Date: 2024-12-31ZHEJIANG DAHUA TECH CO LTD +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411345244.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2024-12-31
Estimated Expiration
2044-09-25

AI Technical Summary

Technical Problem

In the video recording data processing, the code stream data must be cached and waited for the next I frame before packaging, resulting in limited memory resources being lost, and the integrity and real-time access of the video recording file cannot be guaranteed.

Method used

Using the GOP sequence as the minimum storage unit, the image frame data collected in real time is written into the preset first type video file. When a complete GOP sequence is completed, it is written into the second type video file and satisfy the Package when preset conditions are set and generate a third type of video file to ensure the integrity and real-time access of the video file.

Benefits of technology

It avoids frame loss caused by insufficient memory resources, ensures the integrity of the video file and can be queried, downloaded and played back in real time, and improves the access efficiency of video data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119232865A_ABST
    Figure CN119232865A_ABST
Patent Text Reader

Abstract

The invention discloses a video data processing method and device, equipment and a medium, which are used for ensuring that a video file generated by packaging has a complete video frame. The method provided by the invention comprises the following steps: writing image frame data acquired in real time into a preset first type of video file, wherein the preset first type of video file is used for writing at least one GOP sequence; when at least one complete GOP sequence is written into the preset first type of video file, at least one complete GOP sequence in the preset first type of video file is written into a preset second type of video file, and the preset second type of video file is a video file to be packaged; and when the second type of video file satisfies a preset packaging condition, packaging the preset second type of video file, generating a third type of video file, and creating a new second type of video file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a video data processing method, device, equipment and medium. Background Art

[0002] When storing the image data collected by the encoder of the image acquisition device, since the real-time stream is continuous and uninterrupted, the bitstream data needs to be packaged into an independent video file to facilitate file download and playback. When decoding and playing the packaged video file, it is necessary to start from the I frame (i.e., the key frame). If the data part of a video file does not start from the I frame, the data frame before the I frame of the video file cannot be decoded and played. Therefore, after the video file is packaged, it is necessary to wait for the next I frame to create a new video file. Therefore, the new bitstream data must be cached in the memory and wait for the arrival of the next I frame. However, memory resources are limited. When the cache space is insufficient, the bitstream will drop frames. Summary of the invention

[0003] The embodiments of the present application provide a method, apparatus, device and medium for processing video data, which are used to avoid frame loss caused by occupying too much cache space during the process of packaging the collected video data into video files, ensure that the packaged video files have complete video frames, and enable the video files to be packaged to be accessed at any time, so that the collected video data can be queried, downloaded, played back, etc. in real time, thereby improving the work efficiency of accessing video data.

[0004] The embodiment of the present application provides a method for processing video data, including:

[0005] Writing the real-time acquired image frame data into a preset first-type video file, wherein the preset first-type video file is used to write at least one group of pictures GOP sequence;

[0006] When at least one complete GOP sequence is written into the preset first type video file, at least one complete GOP sequence in the preset first type video file is written into a preset second type video file, and the preset second type video file is the video file to be packaged;

[0007] When the second type video file meets the preset packaging condition, the preset second type video file is packaged to generate a third type video file, and a new second type video file is created.

[0008] The video data processing method provided in the embodiment of the present application writes the image frame data collected in real time into a preset first-type video file, and the preset first-type video file is used to write at least one image group GOP sequence. Since the storage space occupied by the GOP sequence is small, it can avoid the situation that new code stream data must be cached in the memory and wait for the next I frame to arrive before the data in the cache can be packaged, thereby avoiding the situation that the code stream frame is lost when the cache space is insufficient due to limited memory resources; when at least one complete GOP sequence is written into the preset first-type video file, at least one complete GOP sequence in the preset first-type video file is written into a preset second-type video file, and the preset second-type video file is the video file to be packaged; therefore, the embodiment of the present application can store and write the latest GOP sequence into the video file to be packaged with the latest GOP sequence as the smallest unit, that is, the first-type video file described in the embodiment of the present application can use the GOP sequence as the smallest storage unit, and there is no need for a huge file to store the video data. When the second type of video file meets the preset packaging condition, the preset second type of video file is packaged to generate a third type of video file, and a new second type of video file is created. The third type of video file finally generated contains complete video frames, that is, the embodiment of the present application ensures that the packaged and generated video file has complete video frames. In addition, since the operation of writing the video file is performed in units of a complete GOP sequence in the embodiment of the present application, the structure of the GOP sequence includes a key frame and multiple non-key frames, and starts with a key frame, so the GOP sequence can be used as an independent decoding unit and can be independently decoded and displayed. Therefore, the second type of video file that continuously performs the video data writing operation in the embodiment of the present application can also be accessed at any time, for example, it can be queried, downloaded, and video playback, etc., thereby improving the work efficiency of accessing video data.

[0009] In some embodiments, writing the real-time acquired image frame data into a preset first type video recording file includes:

[0010] Get the current frame video data;

[0011] If the current frame video data is not key frame video data, writing the current frame video data into a preset first type video file;

[0012] If the current frame video data is key frame video data, determining whether there is a preset first type video file currently;

[0013] If yes, if the second type video file does not meet the preset packaging condition, the current frame video data is written into the preset first type video file; if the second type video file meets the preset packaging condition, the preset second type video file is packaged to generate a third type video file, and a new second type video file is created, and after at least one complete GOP sequence in the preset first type video file is written into the new second type video file, the current frame video data is written into the preset first type video file;

[0014] Otherwise, a first type video file is created, and the current frame video data is written into a preset first type video file.

[0015] In some embodiments, the method further comprises:

[0016] If there is currently a preset first type of video file, determining whether there is currently a preset second type of video file;

[0017] If yes, determining whether the second type of video file meets the preset packaging condition;

[0018] Otherwise, after creating the second type of video file, it is determined whether the second type of video file meets a preset packaging condition.

[0019] In some embodiments, writing at least one complete GOP sequence in the preset first type video file into the preset second type video file includes:

[0020] Taking GOP sequence as a unit, at least one complete GOP sequence in the first type video file is appended and written into the second type video file one by one.

[0021] In some embodiments, the preset packaging conditions include:

[0022] The sum of the duration of the video data in the second type of video file and the duration of the video data in the first type of video file is greater than a preset duration threshold; and / or,

[0023] The sum of the data volume of the video data in the second type video file and the data volume of the video data in the first type video file is greater than a preset data volume threshold.

[0024] In some embodiments, the preset second type video file is packaged to generate a third type video file, including:

[0025] Updating the file header of the second type video file;

[0026] The second type video file with the updated file header is renamed according to a preset rule to obtain a third type video file.

[0027] In some embodiments, the method further comprises:

[0028] Obtaining an access request for the second type of video file;

[0029] According to the access request for the second type of video file, the video data in the second type of video file is provided.

[0030] An embodiment of the present application provides a video data processing device, comprising:

[0031] A first unit is used to write the image frame data collected in real time into a preset first type video file, wherein the preset first type video file is used to write at least one picture group GOP sequence;

[0032] The second unit is used for writing at least one complete GOP sequence in the preset first type video file into a preset second type video file when at least one complete GOP sequence is written into the preset first type video file, wherein the preset second type video file is the video file to be packaged;

[0033] The third unit is used for packaging the preset second type video file to generate a third type video file and creating a new second type video file when the second type video file meets the preset packaging condition.

[0034] Another embodiment of the present application provides an electronic device, which includes a memory and a processor, wherein the memory is used to store program instructions, and the processor is used to call the program instructions stored in the memory and execute any of the above methods according to the obtained program.

[0035] Another embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable the computer to execute any of the above methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0037] Figure 1A schematic diagram of the overall process of a video data processing method provided in an embodiment of the present application;

[0038] Figure 2 A schematic diagram of the GOP sequence structure provided in an embodiment of the present application;

[0039] Figure 3 A schematic diagram of the video data processing principle provided in an embodiment of the present application;

[0040] Figure 4 A schematic diagram of the file format provided in the embodiment of the present application;

[0041] Figure 5 A schematic diagram of a specific process of a video data processing method provided in an embodiment of the present application;

[0042] Figure 6 A schematic diagram of the file format provided in the embodiment of the present application;

[0043] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0044] Figure 8 A schematic diagram of the structure of a video data processing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0045] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0046] The embodiments of the present application provide a method, apparatus, device and medium for processing video data, which are used to avoid frame loss caused by occupying too much cache space during the process of packaging the collected video data into video files, ensure that the packaged video files have complete video frames, and enable the video files to be packaged to be accessed at any time, so that the collected video data can be queried, downloaded, played back, etc. in real time, thereby improving the work efficiency of accessing video data.

[0047] Among them, the method and the device, equipment, and medium are based on the same application concept. Since the principles of solving problems by the method and the device, equipment, and medium are similar, the implementation of the device, equipment, medium, and method can refer to each other, and the repeated parts will not be repeated.

[0048] The terms "first", "second", etc. (if any) in the specification and claims of the embodiments of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than the content illustrated or described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0049] The following examples and embodiments are to be understood as illustrative examples only. Although this specification may refer to "one", "an" or "some" examples or embodiments in several places, this does not mean that each such reference relates to the same example or embodiment, nor does it mean that the feature applies only to a single example or embodiment. Individual features of different embodiments may also be combined to provide other embodiments. In addition, terms such as "including" and "comprising" should be understood as not limiting the described embodiments to only those features that have been mentioned; such examples and embodiments may also include features, structures, units, modules, etc. that are not specifically mentioned.

[0050] In the related art, whether the video files are packaged according to the duration or the file size, the video file data must start from the I frame. Therefore, when the file reaches the required duration or the required file size, it must wait for the next I frame to create a new video file. The new code stream data must be cached in the memory. Because the memory resources are limited, when the cache space is insufficient, the code stream will lose frames. However, with the increasing requirements for code streams, the code stream definition is getting higher and higher, the code stream is getting larger and larger, and the frame data is getting larger and larger; the evolution of encoding technology, the I frame interval is getting larger and larger, such as intelligent encoding, the I frame interval is getting larger and larger; the number of access routes to storage servers is increasing, and thousands of video data are stored at the same time. Therefore, for video file packaging, if the method of caching part of the code stream is adopted, frame loss will occur during the packaging process, resulting in incomplete video file code streams. If a large code stream video is sliced, it can only be sliced ​​to form a video file when it reaches the specified size or duration. Before this, the video cannot be cut out, and the video file cannot be queried and accessed.

[0051] Therefore, the embodiment of the present application proposes to use the GOP sequence as the smallest temporary storage unit, write it into the hard disk as a temporary storage file, and after forming a complete GOP storage unit, append it to the video file being formed. This solves the problem of frame loss caused by insufficient buffer due to waiting for I frames. At the same time, the video file being written can be generated in real time and can also be queried, downloaded, and played back in real time.

[0052] The following is a detailed description of each embodiment of the present application in conjunction with the accompanying drawings. It should be noted that the display order of the embodiments of the present application only represents the order of the embodiments, and does not represent the advantages and disadvantages of the technical solutions provided by the embodiments.

[0053] Embodiment 1

[0054] See also Figure 1 , a video data processing method provided in an embodiment of the present application includes:

[0055] S101, writing the image frame data collected in real time into a preset first type video file, wherein the preset first type video file is used to write at least one group of pictures GOP sequence;

[0056] In some embodiments, the first type of video file, such as a video file with the suffix .wal, may also be referred to as a wal file or a first suffix video file in the embodiment of the present application. The first type of video file is a temporary file used to store one or more GOP (Group of picture) sequences.

[0057] See also Figure 2 The GOP sequence consists of an I frame and a series of other types of frames (i.e. non-key frames, such as P frames, B frames and other non-I frames). The GOP sequence is an independent decoding unit and can be decoded and displayed independently.

[0058] S102, when at least one complete GOP sequence is written into the preset first type video file, writing at least one complete GOP sequence in the preset first type video file into a preset second type video file, where the preset second type video file is the video file to be packaged;

[0059] In some embodiments, the second type of video file, such as a video file with a suffix of .dav_, may also be referred to as a dav_ file or a second suffix video file in the embodiments of the present application. It is a video file being written to the hard disk and can be continuously appended with video data. When the GOP sequence in the first type of video file is complete, it will be appended to the dav_ file. The dav_ file is the video file to be packaged.

[0060] In some embodiments, after writing the GOP sequence in the first type of video file into the second type of video file, the original GOP sequence in the first type of video file can be deleted to prepare for writing the new GOP sequence; or, the subsequent new GOP sequence can be written over the first type of video file.

[0061] S103: When the second type video file meets the preset packaging condition, the preset second type video file is packaged to generate a third type video file, and a new second type video file is created.

[0062] In some embodiments, the third type of video file, such as a video file with a suffix of .dav, may also be referred to as a dav file or a video file with a third suffix in the embodiment of the present application. The third type of video file is a complete video file that has been packaged.

[0063] Visible, see Figure 3 In the embodiment of the present application, the GOP sequence can be used as the minimum temporary storage unit, that is, the minimum storage unit is temporarily generated and written into the hard disk to form the minimum storage unit, which is appended to the video file being written into the hard disk. When the video file meets the packaging conditions, the latest GOP sequence is written into the new file. The first step in the whole process is the construction and writing of the temporary minimum storage unit file of the GOP sequence. The subsequent dav files and dav_ files can be queried, played back, and downloaded normally. The wal file is a temporary write file, that is, the file where the frame data is written. It is not visible to the outside, that is, it cannot be accessed by the user.

[0064] In some embodiments, writing the real-time acquired image frame data into a preset first type video recording file includes:

[0065] Get the current frame video data;

[0066] If the current frame video data is not key frame video data, writing the current frame video data into a preset first type video file;

[0067] If the current frame video data is key frame video data, determining whether there is a preset first type video file currently;

[0068] If yes, if the second type video file does not meet the preset packaging condition, the current frame video data is written into the preset first type video file; if the second type video file meets the preset packaging condition, the preset second type video file is packaged to generate a third type video file, and a new second type video file is created, and after at least one complete GOP sequence in the preset first type video file is written into the new second type video file, the current frame video data is written into the preset first type video file;

[0069] Otherwise, a first type video file is created, and the current frame video data is written into a preset first type video file.

[0070] In some embodiments, the method further comprises:

[0071] If there is currently a preset first type of video file, determining whether there is currently a preset second type of video file;

[0072] If yes, determining whether the second type of video file meets the preset packaging condition;

[0073] Otherwise, after creating the second type of video file, it is determined whether the second type of video file meets a preset packaging condition.

[0074] In some embodiments, writing at least one complete GOP sequence in the preset first type video file into the preset second type video file includes:

[0075] Taking GOP sequence as a unit, at least one complete GOP sequence in the first type video file is appended and written into the second type video file one by one.

[0076] In some embodiments, the preset packaging conditions include:

[0077] The sum of the duration of the video data in the second type of video file and the duration of the video data in the first type of video file is greater than a preset duration threshold; and / or,

[0078] The sum of the data volume of the video data in the second type video file and the data volume of the video data in the first type video file is greater than a preset data volume threshold.

[0079] In some embodiments, the preset second type video file is packaged to generate a third type video file, including:

[0080] Updating the file header of the second type video file;

[0081] The second type video file with the updated file header is renamed according to a preset rule to obtain a third type video file.

[0082] In some embodiments, the method further comprises:

[0083] Obtaining an access request (such as a query, download, playback, etc. request) for the second type of video file;

[0084] According to the access request for the second type of video file, the video data in the second type of video file is provided.

[0085] See also Figure 4 , the image data collected by the encoder is stored. Since the real-time stream is continuous and uninterrupted, the code stream data needs to be packaged into an independent video file to facilitate file download and playback. Because decoding and playback require an independently playable video file to start from an I frame (key frame), the video file subpackaging must wait for an I frame to start. If the data part of a video file does not start from an I frame, the initial non-key frame in the video file cannot be decoded and played, because the decoding must start from an I frame. In the embodiment of the present application, since the operation of writing the video file is performed in units of a complete GOP sequence, the structure of the GOP sequence includes a key frame and multiple non-key frames, and it starts with a key frame, so the GOP sequence can be used as an independent decoding unit and can be independently decoded and displayed. Therefore, in the embodiment of the present application, not only the integrity of the video frames of the third type of video files generated by packaging is guaranteed, but also, in the second type of video files that continuously perform the video data writing operation, since they are all complete GOP sequences, the second type of video files can also be accessed at any time, for example, they can be queried, downloaded, and video playback, thereby improving the work efficiency of accessing video data.

[0086] Embodiment 2

[0087] See also Figure 5 , a video data processing method provided in an embodiment of the present application includes:

[0088] S501, current frame data input;

[0089] S502, determining whether the current frame is an I frame, if yes, executing step S503; otherwise, executing step S510;

[0090] S503, determine whether the wal file exists, if yes, execute step S505; otherwise, execute step S504;

[0091] S504, create a wal file, and then execute step S507;

[0092] S505, determine whether the dav_ file exists, if yes, execute step S507; otherwise, execute step S506;

[0093] S506, create a dav_ file, and then execute step S507;

[0094] S507, determine whether to package, if yes, execute step S508; otherwise, execute step S510;

[0095] That is, determine whether the dav_ file meets the preset packaging conditions, for example:

[0096] Packing is performed by duration. If the dav_ file duration + the wal file duration is greater than the preset packing duration, the packing condition is met and step S508 is executed.

[0097] Pack according to the length of the video file. If the dav_ file length + the wal file length is greater than the preset packing length, the packing condition is met and step S508 is executed.

[0098] S508, update the file header information of the dav_ file, then rename the dav file to dav file, and create a new dav_ file.

[0099] In some embodiments, the file header information includes: frame index information, check information, file description information, etc.

[0100] In some embodiments, see Figure 6 As shown, the file header description information includes:

[0101] name Length (bytes) content File magic number 4 PRIVATEAV File Type 1 R Version Number 1 2 encryption 1 0 File header length 4 128 Data part length 4 1280000 Verification Information 4 12875 Reserved Fields 16 0

[0102] The packaged generated dav file is a complete video file, and the _dav file is a new second type video file.

[0103] S509. The content of the GOP storage unit in the wal file is written into the dav_ file.

[0104] That is to say, the contents of the wal file are appended to the dav_ file GOP by GOP.

[0105] S510, write the current frame data into the wal file.

[0106] In summary, it can be seen that compared with the related art that first writes the video stream into a large file and then cuts it into several small files, the embodiment of the present application only needs a wal file of the smallest GOP sequence storage unit, and does not need a continuous and huge large file storage. In addition, the large file needs to wait until the packaging conditions are met before it can be cut. Before that, the large file lacks the necessary information for playback such as the file I frame index information, resulting in the inability to access the large file before cutting the large file. The dav_ file in the embodiment of the present application contains all the information for normal playback and playback, and can be requested for access at any time.

[0107] In addition, compared with the related art, the real-time stream is cached in the memory. Due to the I frame interval, it is necessary to wait for the next I frame to create a new packaged file. However, the memory resources are limited, and the cache space will be full, resulting in storage frame loss. The embodiment of the present application writes to the disk with the minimum GOP storage unit. Compared with the limited memory resources, the disk resources can meet the needs of various scenarios such as large code streams, long I frame intervals, and simultaneous storage of a large number of concurrent channels, ensuring that the storage does not lose frames. Moreover, the related technology still needs to write the previous file before waiting for the data in front of the next I frame to be packaged, which cannot meet the strict requirements of the packaging time and file size restrictions. In the embodiment of the present application, before the GOP minimum storage unit in the wal file is appended to the dav_ file, it is determined whether the dav_ file meets the packaging conditions, and the packaging pre-condition requirements are strictly met.

[0108] The following is an introduction to the equipment or device provided in the embodiments of the present application, in which the explanations or examples of technical features that are the same or corresponding to those described in the above method will not be repeated later.

[0109] Embodiment 3

[0110] An electronic device provided in an embodiment of the present application, for example, may be any type of terminal, network device, etc. Figure 7 , the electronic device includes, for example:

[0111] The processor 600 is used to read the program in the memory 620 and execute the following process:

[0112] Writing the real-time acquired image frame data into a preset first-type video file, wherein the preset first-type video file is used to write at least one group of pictures GOP sequence;

[0113] When at least one complete GOP sequence is written into the preset first type video file, at least one complete GOP sequence in the preset first type video file is written into a preset second type video file, and the preset second type video file is the video file to be packaged;

[0114] When the second type video file meets the preset packaging condition, the preset second type video file is packaged to generate a third type video file, and a new second type video file is created.

[0115] In some embodiments, writing the real-time acquired image frame data into a preset first type video recording file includes:

[0116] Get the current frame video data;

[0117] If the current frame video data is not key frame video data, writing the current frame video data into a preset first type video file;

[0118] If the current frame video data is key frame video data, determining whether there is a preset first type video file currently;

[0119] If yes, if the second type video file does not meet the preset packaging condition, the current frame video data is written into the preset first type video file; if the second type video file meets the preset packaging condition, the preset second type video file is packaged to generate a third type video file, and a new second type video file is created, and after at least one complete GOP sequence in the preset first type video file is written into the new second type video file, the current frame video data is written into the preset first type video file;

[0120] Otherwise, a first type video file is created, and the current frame video data is written into a preset first type video file.

[0121] In some embodiments, the processor 600 is further configured to read a program in the memory 620 and execute the following process:

[0122] If there is currently a preset first type of video file, determining whether there is currently a preset second type of video file;

[0123] If yes, determining whether the second type of video file meets the preset packaging condition;

[0124] Otherwise, after creating the second type of video file, it is determined whether the second type of video file meets a preset packaging condition.

[0125] In some embodiments, writing at least one complete GOP sequence in the preset first type video file into the preset second type video file includes:

[0126] Taking GOP sequence as a unit, at least one complete GOP sequence in the first type video file is appended and written into the second type video file one by one.

[0127] In some embodiments, the preset packaging conditions include:

[0128] The sum of the duration of the video data in the second type of video file and the duration of the video data in the first type of video file is greater than a preset duration threshold; and / or,

[0129] The sum of the data volume of the video data in the second type video file and the data volume of the video data in the first type video file is greater than a preset data volume threshold.

[0130] In some embodiments, the preset second type video file is packaged to generate a third type video file, including:

[0131] Updating the file header of the second type video file;

[0132] The second type video file with the updated file header is renamed according to a preset rule to obtain a third type video file.

[0133] In some embodiments, the processor 600 is further configured to read a program in the memory 620 and execute the following process:

[0134] Obtaining an access request for the second type of video file;

[0135] According to the access request for the second type of video file, the video data in the second type of video file is provided.

[0136] The transceiver 610 is configured to receive and send data under the control of the processor 600 .

[0137] Among them, Figure 7In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically one or more processors represented by processor 600 and various circuits of memory represented by memory 620 are linked together. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface. The transceiver 610 may be a plurality of components, namely, a transmitter and a receiver, providing a unit for communicating with various other devices on a transmission medium, including wireless channels, wired channels, optical cables, and other transmission media. For different user devices, the user interface 630 may also be an interface capable of externally and internally connecting required devices, and the connected devices include but are not limited to a keypad, a display, a speaker, a microphone, a joystick, and the like.

[0138] The processor 600 is responsible for managing the bus architecture and general processing, and the memory 620 can store data used by the processor 600 when performing operations.

[0139] In some embodiments, the processor 600 may be a CPU (central processing unit), an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array) or a CPLD (Complex Programmable Logic Device), and the processor may also adopt a multi-core architecture.

[0140] The processor calls the computer program stored in the memory to execute any of the methods provided in the embodiments of the present application according to the obtained executable instructions. The processor and the memory can also be arranged physically separately.

[0141] It should be noted here that the above-mentioned device provided in the embodiment of the present application can implement all the method steps implemented in the above-mentioned method embodiment, and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as those in the method embodiment will not be described in detail here.

[0142] Embodiment 4:

[0143] See also Figure 8 The embodiment of the present application provides a video data processing device, which may be any type of terminal, network device, etc., and the device includes:

[0144] The first unit 11 is used to write the image frame data collected in real time into a preset first type video file, wherein the preset first type video file is used to write at least one picture group GOP sequence;

[0145] The second unit 12 is used for writing at least one complete GOP sequence in the preset first type video file into a preset second type video file when at least one complete GOP sequence is written into the preset first type video file, wherein the preset second type video file is the video file to be packaged;

[0146] The third unit 13 is used for packaging the preset second type video file to generate a third type video file and creating a new second type video file when the second type video file meets the preset packaging condition.

[0147] In some embodiments, writing the real-time acquired image frame data into a preset first type video recording file includes:

[0148] Get the current frame video data;

[0149] If the current frame video data is not key frame video data, writing the current frame video data into a preset first type video file;

[0150] If the current frame video data is key frame video data, determining whether there is a preset first type video file currently;

[0151] If yes, if the second type video file does not meet the preset packaging condition, the current frame video data is written into the preset first type video file; if the second type video file meets the preset packaging condition, the preset second type video file is packaged to generate a third type video file, and a new second type video file is created, and after at least one complete GOP sequence in the preset first type video file is written into the new second type video file, the current frame video data is written into the preset first type video file;

[0152] Otherwise, a first type video file is created, and the current frame video data is written into a preset first type video file.

[0153] In some embodiments, the first unit 11 is further configured to:

[0154] If there is currently a preset first type of video file, determining whether there is currently a preset second type of video file;

[0155] If yes, determining whether the second type of video file meets the preset packaging condition;

[0156] Otherwise, after creating the second type of video file, it is determined whether the second type of video file meets a preset packaging condition.

[0157] In some embodiments, writing at least one complete GOP sequence in the preset first type video file into the preset second type video file includes:

[0158] Taking GOP sequence as a unit, at least one complete GOP sequence in the first type video file is appended and written into the second type video file one by one.

[0159] In some embodiments, the preset packaging conditions include:

[0160] The sum of the duration of the video data in the second type of video file and the duration of the video data in the first type of video file is greater than a preset duration threshold; and / or,

[0161] The sum of the data volume of the video data in the second type video file and the data volume of the video data in the first type video file is greater than a preset data volume threshold.

[0162] In some embodiments, the preset second type video file is packaged to generate a third type video file, including:

[0163] Updating the file header of the second type video file;

[0164] The second type video file with the updated file header is renamed according to a preset rule to obtain a third type video file.

[0165] In some embodiments, the second unit 12 is further configured to:

[0166] Obtaining an access request for the second type of video file;

[0167] According to the access request for the second type of video file, the video data in the second type of video file is provided.

[0168] It should be noted that the division of units in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional unit in each embodiment of the present application may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0169] If the integrated unit 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 this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (RandomAccess Memory, RAM), disk or optical disk and other media that can store program code.

[0170] Any of the devices or apparatuses provided in the embodiments of the present application may specifically be a desktop computer, a portable computer, a smart phone, a tablet computer, a personal digital assistant (PDA), etc. It may include a central processing unit (CPU), a memory, an input / output device, etc. The input device may include a keyboard, a mouse, a touch screen, etc. The output device may include a display device, such as a liquid crystal display (LCD), a cathode ray tube (CRT), etc.

[0171] The memory may include a read-only memory (ROM) and a random access memory (RAM), and provides the processor with program instructions and data stored in the memory. In an embodiment of the present application, the memory may be used to store the program of any of the methods provided in the embodiments of the present application.

[0172] The processor calls the program instructions stored in the memory, and the processor is used to execute any of the methods provided in the embodiments of the present application according to the obtained program instructions.

[0173] The present application embodiment also provides a computer program product or computer program, which includes a computer instruction, which is stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction so that the computer device executes any of the methods described in the above embodiments. The program product can use any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0174] The embodiment of the present application provides a computer-readable storage medium for storing computer program instructions used by the apparatus provided in the embodiment of the present application, which includes a program for executing any of the methods provided in the embodiment of the present application. The computer-readable storage medium may be a non-transitory computer-readable medium.

[0175] The computer-readable storage medium can be any available medium or data storage device that can be accessed by a computer, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD)), etc.

[0176] It should be understood that:

[0177] The access technology through which entities in the communication network transmit traffic can be any suitable current or future technology, such as WLAN (Wireless Local Access Network), WiMAX (Worldwide Interoperability for Microwave Access), LTE, LTE-A, 5G, Bluetooth, infrared, etc.; in addition, the embodiments can also apply wired technology, for example, IP-based access technology, such as a wired network or a fixed line.

[0178] Embodiments suitable for being implemented as software code or a portion thereof and running using a processor or processing functionality are independent of the software code and may be specified using any known or future developed programming language, such as a high-level programming language such as objective-C, C, C++, C#, Java, Python, Javascript, other scripting languages, etc., or a low-level programming language such as machine language or assembler.

[0179] The implementation of the embodiments is hardware independent and may be implemented using any known or future developed hardware technology or any mixture thereof, such as a microprocessor or CPU (central processing unit), MOS (metal oxide semiconductor), CMOS (complementary MOS), BiMOS (bipolar MOS), BiCMOS (bipolar CMOS), ECL (emitter coupled logic) and / or TTL (transistor-transistor logic).

[0180] Embodiments may be implemented as separate devices, apparatuses, units, components, or functions, or in a distributed manner, for example, one or more processors or processing functions may be used or shared in a process, or one or more processing segments or processing portions may be used and shared in a process, wherein one physical processor or more than one physical processor may be used to implement one or more processing portions dedicated to a specific process as described.

[0181] The device may be implemented by a semiconductor chip, a chipset, or a (hardware) module including such a chip or chipset.

[0182] The embodiments may also be implemented as any combination of hardware and software, such as ASIC (Application Specific IC (Integrated Circuit)) components, FPGA (Field Programmable Gate Array) or CPLD (Complex Programmable Logic Device) components or DSP (Digital Signal Processor) components.

[0183] The embodiments may also be implemented as a computer program product including a computer usable medium having computer readable program code embodied therein, the computer readable program code being adapted to perform the processes as described in the embodiments, wherein the computer usable medium may be a non-transitory medium.

[0184] 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 adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) that contain computer-usable program code.

[0185] 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 the 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 generate 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.

[0186] 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.

[0187] 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 in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0188] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A video data processing method, characterized in that: The method comprises: Writing the real-time acquired image frame data into a preset first-type video file, wherein the preset first-type video file is used to write at least one group of pictures GOP sequence; When at least one complete GOP sequence is written into the preset first type video file, at least one complete GOP sequence in the preset first type video file is written into a preset second type video file, and the preset second type video file is the video file to be packaged; When the second type video file meets the preset packaging condition, the preset second type video file is packaged to generate a third type video file, and a new second type video file is created.

2. The method according to claim 1, characterized in that The step of writing the real-time acquired image frame data into a preset first type video recording file includes: Get the current frame video data; If the current frame video data is not key frame video data, writing the current frame video data into a preset first type video file; If the current frame video data is key frame video data, determining whether there is a preset first type video file currently; If yes, if the second type video file does not meet the preset packaging condition, the current frame video data is written into the preset first type video file; if the second type video file meets the preset packaging condition, the preset second type video file is packaged to generate a third type video file, and a new second type video file is created, and after at least one complete GOP sequence in the preset first type video file is written into the new second type video file, the current frame video data is written into the preset first type video file; Otherwise, a first type video file is created, and the current frame video data is written into a preset first type video file.

3. The method according to claim 2, characterized in that The method further comprises: If there is currently a preset first type of video file, determining whether there is currently a preset second type of video file; If yes, determining whether the second type of video file meets the preset packaging condition; Otherwise, after creating the second type of video file, it is determined whether the second type of video file meets a preset packaging condition.

4. The method according to claim 1, characterized in that The step of writing at least one complete GOP sequence in the preset first type video file into the preset second type video file comprises: Taking GOP sequence as a unit, at least one complete GOP sequence in the first type video file is appended and written into the second type video file one by one.

5. The method according to claim 1, characterized in that The preset packaging conditions include: The sum of the duration of the video data in the second type of video file and the duration of the video data in the first type of video file is greater than a preset duration threshold; and / or, The sum of the data volume of the video data in the second type video file and the data volume of the video data in the first type video file is greater than a preset data volume threshold.

6. The method according to claim 1, characterized in that Packaging the preset second type video file to generate a third type video file includes: Updating the file header of the second type video file; The second type video file with the updated file header is renamed according to a preset rule to obtain a third type video file.

7. The method according to claim 1, characterized in that The method further comprises: Obtaining an access request for the second type of video file; According to the access request for the second type of video file, the video data in the second type of video file is provided.

8. A video data processing device, characterized in that: The device comprises: A first unit is used to write the image frame data collected in real time into a preset first type video file, wherein the preset first type video file is used to write at least one picture group GOP sequence; The second unit is used for writing at least one complete GOP sequence in the preset first type video file into a preset second type video file when at least one complete GOP sequence is written into the preset first type video file, wherein the preset second type video file is the video file to be packaged; The third unit is used for packaging the preset second type video file to generate a third type video file and creating a new second type video file when the second type video file meets the preset packaging condition.

9. An electronic device, characterized in that: include: A memory for storing program instructions; A processor, configured to call the program instructions stored in the memory, and execute the method according to any one of claims 1 to 7 according to the obtained program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable the computer to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Storage method of index data and storage control device

    CN101644996A

  • Streaming media playback method

    CN106303671A

  • Live streaming recording method, device, computer equipment and storage medium

    CN108833970A

  • Storage system, data management method and storage medium

    CN110764706A

  • Video processing method and device and computer storage medium

    CN116600065A