ES-based video storage and playback method and system
Through the ES-based video storage and playback method, video code streams are obtained and indexed in real time, and the problems of low video storage efficiency and slow retrieval speed in traditional monitoring systems are solved, efficient storage and rapid retrieval are achieved, and user experience and resource utilization are improved. Rate.
Patent Information
- Application Number
- CN202411367779.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-14
AI Technical Summary
In traditional monitoring systems, video storage relies on a single storage method, resulting in low storage efficiency, slow retrieval speed and waste of resources, which cannot meet the needs of large-scale data storage and multi-user access.
Using ES-based video storage and playback methods, the video code stream is obtained in real time, frame image information is extracted, index information is generated and stored in the ES database, the target data is retrieved according to the playback request and pushed to the client, supporting multiple storage types and flexible playback condition.
It improves the storage efficiency and retrieval speed of video data, reduces video playback delay, saves system resources, avoids unnecessary waste of network bandwidth and storage space, and improves user experience.
Smart Images

Figure CN119316655A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of video technology, and in particular relates to a video storage and playback method and system based on ES. Background Art
[0002] With the widespread application and rapid popularization of surveillance systems in various fields, the rich and diverse video information generated by them has brought significant convenience to many aspects of social life. Whether in ensuring public safety, regulating traffic order, or improving business operation efficiency, promoting education and teaching, surveillance systems play an indispensable role.
[0003] That is, in traditional surveillance systems, no matter whether video storage is built on IP network-based IP-SAN storage, NAS storage mode, or cloud storage, each uses its own unique video index for business management, resulting in video storage relying on only one of these storage methods. This single storage method has obvious limitations. Therefore, how to better implement video storage has become an urgent problem to be solved. Summary of the invention
[0004] In view of the above deficiencies in the prior art, the purpose of the invention is to provide a video storage and playback method and system based on ES, which improves the storage efficiency and retrieval speed of video data, and the user can flexibly set the playback conditions according to needs, so as to quickly obtain the target playback data.
[0005] In a first aspect of the present invention, a video storage and playback method based on ES is proposed, comprising: S1, obtaining a video stream in real time, and extracting image information of each frame in the video stream; S2, generating index information of each frame according to the video clips and the image information of each frame in the video stream, and storing the image of each frame and the index information in an ES database; S3, upon receiving a playback request, obtaining playback information, and retrieving target index information and target playback data corresponding to the playback information from the ES database based on the playback information, wherein the target playback data includes a target video clip and a target frame image; S4, downloading the target playback data and pushing the target playback data after downloading to a client.
[0006] Furthermore, the video code stream is obtained in real time, and the image information of each frame in the video code stream is extracted, including: obtaining an RTP data packet in real time, the RTP data packet including the video code stream; based on the RTP protocol, unpacking and depacketizing the RTP data packet, and decoding the video code stream based on the load type of the RTP data packet to obtain the image information of each frame in the video code stream.
[0007] Furthermore, the index information of each frame image is generated according to the video clips and the information of each frame image in the video code stream, including: slicing the video code stream into the video clips of a preset size; marking the video clips, and determining the offset position of each frame image in the video clips; and generating the index information of each frame image according to the offset position of each frame image in the video clips and the attribute information of each frame image.
[0008] Furthermore, the index information includes task information, identification and storage type of the video clip, and the offset position of each frame image, wherein the method further includes: storing the video clip based on a preset storage type.
[0009] Further, the playback information includes a playback type and playback parameters, and the playback parameters include one or more of time information, identification information and content information, wherein the target index information and target playback data corresponding to the playback information are retrieved from the ES database based on the playback information, including: when the playback type is a video clip, retrieving the target index information corresponding to the time information from the ES database, and determining the target video clip based on the target index information; and / or retrieving the target index information corresponding to the identification information from the ES database, and determining the target video clip based on the target index information; and / or retrieving the target index information corresponding to the content information from the ES database, and determining the target video clip based on the target index information.
[0010] Furthermore, it also includes: when the playback type is a frame image, retrieving the target index information corresponding to the playback parameter from the ES database, and determining the target frame image based on the target index information.
[0011] Furthermore, the target frame image is pushed to the client in a streaming manner.
[0012] In a second aspect of the present invention, a video storage and playback system based on ES is proposed, comprising: an acquisition module for acquiring a video stream in real time and extracting information of each frame of image in the video stream; a generation module for generating index information of each frame of image based on the video clips and the information of each frame of image in the video stream, and storing the each frame of image and the index information in an ES database; a retrieval module for acquiring playback information upon receiving a playback request, and retrieving target index information and target playback data corresponding to the playback information from the ES database based on the playback information, wherein the target playback data includes a target video clip and a target frame of image; and a push module for downloading the target playback data and pushing the target playback data after downloading to a client.
[0013] According to a third aspect of the present invention, an electronic device is proposed, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any of the methods described in the first aspect of the present invention.
[0014] According to a fourth aspect of the present invention, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute any one of the methods according to the first aspect of the present invention.
[0015] The beneficial effects of the present invention are as follows:
[0016] The ES-based video storage and playback method and system of the present invention obtains video code streams in real time and extracts the image information of each frame in the video code stream; generates index information of each frame according to the video clips and each frame image information in the video code stream, and stores each frame image and index information in the ES database; obtains playback information when a playback request is received, retrieves target index information and target playback data corresponding to the playback information from the ES database based on the playback information, and the target playback data includes target video clips and target frame images; downloads the target playback data and pushes the downloaded target playback data to the client. The method improves the storage efficiency and retrieval speed of video data, and the user can flexibly set the playback conditions as needed, so as to quickly obtain the target playback data, and significantly reduce the delay in the video playback process, improve the user experience, and avoid loading the entire video file into the memory at one time by slicing and indexing the video code stream, thereby saving system resources. At the same time, on-demand retrieval and transmission of target playback data also avoids unnecessary waste of network bandwidth and storage space. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings are only used to illustrate specific embodiments and are not considered to limit the present invention. In the entire drawings, the same reference symbols represent the same components. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings.
[0018] Figure 1 is a flowchart of a video storage and playback method based on ES according to an embodiment of the present invention;
[0019] Figure 2 is a flowchart of a video storage and playback method based on ES according to a specific embodiment of the present invention;
[0020] Figure 3 is a schematic diagram of generating index information according to an embodiment of the present invention;
[0021] Figure 4 is a structural block diagram of a video storage and playback system based on ES according to an embodiment of the present invention;
[0022] Figure 5 It is a structural block diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without making creative work should fall within the scope of protection of the present invention.
[0024] Furthermore, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concepts disclosed in the present invention.
[0025] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the orientation or position relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inside", "outside", etc. is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present invention. In addition, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. The terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be a connection between the two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0026] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of methods and systems consistent with some aspects of the present invention as detailed in the appended claims.
[0027] In traditional surveillance systems, no matter whether video storage is built on IP-SAN storage based on IP network, or adopts NAS storage mode, or uses cloud storage, each uses its own unique video index for business management, resulting in video storage relying on only one of the storage methods. This single storage method has obvious limitations. For example, if it relies solely on IP-SAN storage, it may be limited by network stability and bandwidth, resulting in unsmooth data transmission and incomplete storage; if it relies entirely on NAS storage, it has deficiencies in data scalability and sharing, and cannot meet the needs of large-scale data storage and multi-user simultaneous access; and if it relies solely on cloud storage, it may face problems such as data privacy and access delays.
[0028] To this end, the present invention proposes a video storage and playback method, system and related equipment based on ES. Specifically, the video storage and playback method, system and related equipment based on ES according to an embodiment of the present invention are described below with reference to the accompanying drawings.
[0029] Figure 1It is a flow chart of a video storage and playback method based on ES according to an embodiment of the present invention. It should be noted that the video storage and playback method based on ES in the embodiment of the present invention can be applied to the video storage and playback system based on ES in the embodiment of the present invention. The video storage and playback system based on ES can be configured on an electronic device or in a server. This embodiment of the application does not limit this.
[0030] like Figure 1 As shown, the video storage and playback method based on ES includes:
[0031] S110, acquiring a video code stream in real time, and extracting image information of each frame in the video code stream.
[0032] In an embodiment of the present invention, an RTP data packet is acquired in real time, the RTP data packet includes a video stream; based on the RTP protocol, the RTP data packet is unpacked and depacketized, and the video stream is decoded based on the load type of the RTP data packet to obtain image information of each frame in the video stream.
[0033] That is, the server can send a video request instruction to the client, and the client can send a video code stream to the server in real time when receiving the video request instruction, so that the server can obtain the video code stream in real time and then extract the image information of each frame in the video code stream. If the client does not receive the video request instruction within a preset time or the server does not obtain the video code stream within a preset time, the server can send a video request instruction to the client again.
[0034] Among them, the RTP data packet may be divided into multiple smaller data packets (slices) during transmission to adapt to the limitations of network bandwidth or MTU (maximum transmission unit). The server needs to reassemble these slices into a complete RTP data packet, that is, to realize the unpacking of the RTP data packet.
[0035] The server needs to parse the header information of the RTP data packet, including the sequence number, timestamp, load type, etc., to unpack the RTP data packet.
[0036] Among them, the Payload Type field of the RTP data packet is used to indicate the encoding format of the payload data in the data packet. For example, for video data, common payload types include 96, 97, etc. for H.264 encoding. According to the payload type, the server selects a suitable decoder to decode the video data. For example, for video data encoded by H.264, the decoding process may include separating the NAL unit (Network Abstraction Layer Unit) from the RTP payload and then decoding it according to the encoding specification. The decoded video data is usually processed in frames. The server needs to extract the complete video frame based on the decoding results, and may further process these frames, such as timestamp synchronization, frame reorganization, etc., thereby realizing the extraction of image information of each frame in the video stream.
[0037] S120, generating index information of each frame of image according to the video clips and each frame of image information in the video code stream, and storing each frame of image and the index information in the ES database.
[0038] In an embodiment of the present invention, the video code stream can be sliced into video clips of a preset size, and then the index information of each frame of image information can be generated according to the video clips and each frame of image information, and each frame of image and index information can be stored in the ES database. The specific implementation method can refer to the subsequent embodiments.
[0039] S130, when a playback request is received, playback information is obtained, and target index information and target playback data corresponding to the playback information are retrieved from an ES database based on the playback information, where the target playback data includes a target video clip and a target frame image.
[0040] The playback information includes playback type and playback parameters, and the playback parameters include one or more of time information, identification information and content information.
[0041] In the embodiment of the present invention, when a playback request is received, the playback type can be determined, and then based on the playback type and playback parameters, the target index information and target playback data corresponding to the playback information can be retrieved from the ES database. For specific implementation methods, please refer to the subsequent embodiments.
[0042] S140, downloading target playback data and pushing the downloaded target playback data to the client.
[0043] In the embodiment of the present invention, when the target playback data is retrieved, the target playback data can be downloaded, and then the downloaded target playback data is pushed to the client, so that the client can realize the video playback.
[0044] According to the ES-based video storage and playback method of the embodiment of the present invention, the video code stream is obtained in real time, and the image information of each frame in the video code stream is extracted; the index information of each frame image is generated according to the video clip and each frame image information in the video code stream, and each frame image and index information are stored in the ES database; when a playback request is received, the playback information is obtained, and the target index information and target playback data corresponding to the playback information are retrieved from the ES database based on the playback information, and the target playback data includes the target video clip and the target frame image; the target playback data is downloaded and the target playback data after downloading is pushed to the client. The method improves the storage efficiency and retrieval speed of video data, and the user can flexibly set the playback conditions as needed, so as to quickly obtain the target playback data, and significantly reduce the delay in the video playback process, improve the user's experience, and by slicing and indexing the video code stream, it is avoided to load the entire video file into the memory at one time, thereby saving system resources. At the same time, on-demand retrieval and transmission of target playback data also avoids unnecessary waste of network bandwidth and storage space.
[0045] In order to make it easier for those skilled in the art to understand the present invention, Figure 2 A video storage and playback method based on ES according to a specific embodiment of the present invention is as follows. Figure 2 As shown, the ES-based video storage and playback method includes:
[0046] S210, acquiring a video code stream in real time, and extracting image information of each frame in the video code stream.
[0047] In the embodiment of the present invention, the implementation of step S210 may refer to the implementation of step S110 described above, and the present invention will not elaborate on this any more.
[0048] S220, slicing the video code stream into video clips of a preset size.
[0049] In an embodiment of the present invention, Figure 3 As shown, based on a preset size, the video code stream is sliced into n video clips.
[0050] S230, marking the video clip, and determining the offset position of each frame image in the video clip.
[0051] In the embodiment of the present invention, when the video code stream is sliced into video clips of a preset size, each video clip can be identified, that is, each video clip corresponds to a unique identifier.
[0052] S240: Generate index information of each frame of image according to the offset position of each frame of image in the video clip and the attribute information of each frame of image.
[0053] The index information includes the task information, identification and storage type of the video clip, and the offset position of each frame image. The task information includes but is not limited to the national standard code of the device, the size of the video clip, the recording cycle, the creation time of the video task, etc.
[0054] That is to say, Figure 3 As shown, the video code stream is sliced into n video segments, wherein each video segment includes n frames of images, and each frame of image corresponds to index information.
[0055] In one embodiment of the present invention, the video clips may be stored based on a preset storage type, wherein the preset storage type includes but is not limited to NAS storage, IP-SAN storage, and cloud storage.
[0056] The video clips may also be stored based on the priority of the preset storage type. For example, the application scenario corresponding to the ES-based video storage and playback method may be determined, and then the video clips may be stored based on the priority of the preset storage type based on the application scenario. For example, in the case of application scenario A, the video clips are stored based on the nas storage type, and in the case of application scenario B, the video clips are stored based on the ip-san storage type.
[0057] S250, storing each frame image and index information in the ES database.
[0058] In the embodiment of the present invention, when the index information of each frame image is generated, each frame image and the index information corresponding to each frame image may be stored in the ES database.
[0059] S260: When a playback request is received, playback information is obtained, and target index information and target playback data corresponding to the playback information are retrieved from the ES database based on the playback information.
[0060] In an embodiment of the present invention, the playback information includes a playback type and playback parameters, and the playback parameters include one or more of time information, identification information, and content information.
[0061] In one embodiment of the present invention, when the playback type is a video clip, the target index information corresponding to the time information is retrieved from the ES database, and the target video clip is determined based on the target index information; and / or the target index information corresponding to the identification information is retrieved from the ES database, and the target video clip is determined based on the target index information; and / or the target index information corresponding to the content information is retrieved from the ES database, and the target video clip is determined based on the target index information.
[0062] In one embodiment of the present invention, when the playback type is a frame image, target index information corresponding to the playback parameter is retrieved from the ES database, and the target frame image is determined based on the target index information.
[0063] S270, downloading the target playback data and pushing the downloaded target playback data to the client.
[0064] In an embodiment of the present invention, the target frame image is pushed to the client in a streaming manner.
[0065] According to the ES-based video storage and playback method of the embodiment of the present invention, by slicing the video code stream into video clips of preset size and generating index information of each frame image, structured storage of a large amount of video data is realized. This storage method enables the target data to be quickly located through index information when a specific video clip or frame needs to be retrieved, greatly improving the retrieval efficiency; it supports multiple preset storage types (such as NAS storage, IP-SAN storage, and cloud storage), and the appropriate storage type can be selected according to the priority of the application scenario. This flexible storage strategy not only meets the storage requirements in different scenarios, but also improves the utilization rate of storage resources; it supports accurate retrieval of target playback data according to playback type (video clip or frame image) and playback parameters (time information, identification information, content information, etc.). Users can flexibly select the content and method of playback according to their needs, which improves the user experience; by acquiring the video code stream in real time and extracting the frame image information, real-time processing of video data is realized. At the same time, based on the distributed characteristics of ES, the method has good scalability and can support the storage and retrieval of large-scale video data; through slicing and indexing technology, the scanning range during data retrieval is reduced, and the consumption of system resources is reduced. At the same time, the target playback data is downloaded on demand, avoiding unnecessary data transmission and further optimizing resource usage. Since this method is based on ES, an open source and widely used search and analysis engine, it is easy to integrate with other systems or applications. At the same time, ES itself has rich plug-ins and expansion capabilities, which can be customized and optimized according to actual needs.
[0066] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0067] According to one aspect of an embodiment of the present invention, a video storage and playback system based on ES is also proposed. Figure 4 is a structural block diagram of a video storage and playback system based on ES according to an embodiment of the present invention; Figure 4 As shown, including:
[0068] The acquisition module 410 is used to acquire the video code stream in real time and extract the image information of each frame in the video code stream;
[0069] A generating module 420, configured to generate index information of each frame of image according to the video clips in the video code stream and the information of each frame of image, and store the each frame of image and the index information in an ES database;
[0070] A retrieval module 430 is used to obtain playback information when a playback request is received, and retrieve target index information and target playback data corresponding to the playback information from the ES database based on the playback information, wherein the target playback data includes a target video clip and a target frame image;
[0071] The push module 440 is used to download the target playback data and push the downloaded target playback data to the client.
[0072] According to the ES-based video storage and playback system of the embodiment of the present invention, the video code stream is obtained in real time, and the image information of each frame in the video code stream is extracted; the index information of each frame image is generated according to the video clip and each frame image information in the video code stream, and each frame image and index information are stored in the ES database; when a playback request is received, the playback information is obtained, and the target index information and target playback data corresponding to the playback information are retrieved from the ES database based on the playback information, and the target playback data includes the target video clip and the target frame image; the target playback data is downloaded and the target playback data after downloading is pushed to the client. Thereby, the storage efficiency and retrieval speed of the video data are improved, and the user can flexibly set the playback conditions as needed, so as to quickly obtain the target playback data, and significantly reduce the delay in the video playback process, improve the user's experience, and by slicing and indexing the video code stream, it is avoided to load the entire video file into the memory at one time, thereby saving system resources. At the same time, on-demand retrieval and transmission of target playback data also avoids unnecessary waste of network bandwidth and storage space.
[0073] Optionally, the acquisition module 410 is specifically used to acquire RTP data packets in real time, wherein the RTP data packets include the video stream; based on the RTP protocol, the RTP data packets are unpacked and depacketized, and the video stream is decoded based on the load type of the RTP data packets to obtain image information of each frame in the video stream.
[0074] Optionally, the generation module 420 is specifically used to slice the video code stream into video segments of a preset size; mark the video segments, and determine the offset position of each frame image in the video segments; and generate the index information of each frame image based on the offset position of each frame image in the video segments and the attribute information of each frame image.
[0075] Optionally, the index information includes task information, identification and storage type of the video clip, and the offset position of each frame image, wherein the device also includes a storage module for storing the video clip based on a preset storage type.
[0076] Optionally, the playback information includes a playback type and playback parameters, and the playback parameters include one or more of time information, identification information and content information, wherein the retrieval module 430 is specifically used to retrieve the target index information corresponding to the time information from the ES database when the playback type is a video clip, and determine the target video clip based on the target index information; and / or retrieve the target index information corresponding to the identification information from the ES database, and determine the target video clip based on the target index information; and / or retrieve the target index information corresponding to the content information from the ES database, and determine the target video clip based on the target index information.
[0077] Optionally, the retrieval module 430 is specifically configured to retrieve the target index information corresponding to the playback parameter from the ES database when the playback type is a frame image, and determine the target frame image based on the target index information.
[0078] Optionally, the push module 440 is specifically configured to push the target frame image to the client in a streaming manner.
[0079] According to one aspect of an embodiment of the present invention, an electronic device is provided.
[0080] Figure 5 Schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Figure 5 As shown, the electronic device may include one or more ( Figure 5Only one is shown in the figure) processor 102 (processor 102 may include but is not limited to a microprocessor (Microprocessor Unit, referred to as MPU) or a programmable logic device (Programmable logic device, referred to as PLD)) and a memory 104 for storing data. In an exemplary embodiment, the electronic device may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 5 The structure shown is for illustration only and does not limit the structure of the above terminal device. Figure 5 More or fewer components as shown, or with Figure 5 Equivalent functions or comparisons shown Figure 5 A different configuration with more features is shown.
[0081] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the ES-based video storage and playback method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0082] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the switching device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0083] The present invention provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute an ES-based video storage and playback method.
[0084] The applicant of the present invention has made a detailed explanation and description of the implementation examples of the present invention in conjunction with the drawings in the specification. However, those skilled in the art should understand that the above implementation examples are only preferred implementation schemes of the present invention, and the detailed description is only to help readers better understand the spirit of the present invention, but not to limit the scope of protection of the present invention. On the contrary, any improvements or modifications based on the inventive spirit of the present invention should fall within the scope of protection of the present invention.
[0085] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0086] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present invention. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.
[0087] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, rather than to limit them. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the above embodiments, or replace some of the technical features therein by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. Any changes or replacements that can be easily thought of by those skilled in the art within the technical scope disclosed in the present invention should be covered within the protection scope of the present invention.
Claims
1. A video storage and playback method based on ES, characterized in that: include: S1, acquiring a video code stream in real time, and extracting image information of each frame in the video code stream; S2, generating index information of each frame of image according to the video clips in the video code stream and the information of each frame of image, and storing the each frame of image and the index information in an ES database; S3, when receiving a playback request, obtaining playback information, and retrieving target index information and target playback data corresponding to the playback information from the ES database based on the playback information, wherein the target playback data includes a target video clip and a target frame image; S4, downloading the target playback data and pushing the downloaded target playback data to the client.
2. The ES-based video storage and playback method according to claim 1, characterized in that: Acquire the video code stream in real time and extract the image information of each frame in the video code stream, including: Acquire an RTP data packet in real time, wherein the RTP data packet includes the video code stream; Based on the RTP protocol, the RTP data packet is unpacked and depacketized, and the video code stream is decoded based on the load type of the RTP data packet to obtain image information of each frame in the video code stream.
3. The ES-based video storage and playback method according to claim 1, characterized in that: Generating index information of each frame of image according to the video clips in the video code stream and the information of each frame of image, including: Slicing the video code stream into video clips of a preset size; Marking the video clip, and determining the offset position of each frame of image in the video clip; The index information of each frame image is generated according to the offset position of each frame image in the video clip and the attribute information of each frame image.
4. The ES-based video storage and playback method according to claim 3, characterized in that: The index information includes task information, identification and storage type of the video clip, and the offset position of each frame image, wherein the method further includes: storing the video clip based on a preset storage type.
5. The ES-based video storage and playback method according to claim 1, characterized in that: The playback information includes playback type and playback parameters, and the playback parameters include one or more of time information, identification information and content information, wherein: Retrieving target index information and target playback data corresponding to the playback information from the ES database based on the playback information includes: In the case where the playback type is a video clip, retrieving the target index information corresponding to the time information from the ES database, and determining the target video clip based on the target index information; and / or Retrieving the target index information corresponding to the identification information from the ES database, and determining the target video segment based on the target index information; and / or The target index information corresponding to the content information is retrieved from the ES database, and the target video segment is determined based on the target index information.
6. The ES-based video storage and playback method according to claim 5, characterized in that: Also includes: In the case where the playback type is a frame image, the target index information corresponding to the playback parameter is retrieved from the ES database, and the target frame image is determined based on the target index information.
7. The ES-based video storage and playback method according to claim 6, characterized in that: Push the target frame image to the client in a streaming manner.
8. A video storage and playback system based on ES, characterized in that: include: An acquisition module is used to acquire video code stream in real time and extract image information of each frame in the video code stream; A generating module, used for generating index information of each frame of image according to the video clips in the video code stream and the information of each frame of image, and storing the each frame of image and the index information in an ES database; A retrieval module, configured to obtain playback information upon receiving a playback request, and retrieve target index information and target playback data corresponding to the playback information from the ES database based on the playback information, wherein the target playback data includes a target video clip and a target frame image; The push module is used to download the target playback data and push the target playback data after downloading to the client.
9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 7.