A video frame query method
By configuring a unique frame identifier for each video frame, the accurate positioning of any video frame in multimedia information is achieved, which solves the problem of being unable to query any video frame in the existing technology and improves query efficiency and accuracy.
Patent Information
- Application Number
- CN201911222475.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-03
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2039-12-03
AI Technical Summary
The existing technology cannot accurately locate and query any video frame in multimedia information. The positioning function is limited to fuzzy time and key frames, which cannot meet the needs of querying any frame.
Configure a unique frame identifier for each video frame, and query and locate any video frame through the frame identifier to achieve accurate positioning.
Any video frame can be accurately located through frame identification, which solves the problem of being unable to query any video frame and improves the efficiency and accuracy of video frame query.
Smart Images

Figure CN112911378B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of multimedia information technology, and in particular to a method for querying video frames. Background Art
[0002] In the field of multimedia information processing technology, related technologies are still stuck in accurately locating a key video frame (Intra-coded picture, referred to as I frame) according to a specified time for fast positioning and playback. The positioning function is limited to vague time and can only locate key frames near the desired time, rather than arbitrary frames. This cannot meet the needs of querying arbitrary frames. Summary of the invention
[0003] The embodiment of the present invention provides a method for querying a video frame, so as to at least solve the problem in the related art that any frame cannot be queried.
[0004] According to an embodiment of the present invention, a method for querying a video frame is provided, comprising:
[0005] Obtain each video frame in the multimedia information;
[0006] Configuring a frame identifier for each of the video frames, wherein the frame identifier is used to uniquely identify the video frame;
[0007] In case of receiving a request for querying any video frame in the multimedia information, querying the any video frame according to a frame identifier corresponding to the any video frame.
[0008] According to another embodiment of the present invention, a method for querying a video frame is provided, comprising:
[0009] Identify a target object in the multimedia information to obtain a recognition result, wherein the recognition result indicates recognition information of the target object, and the recognition information is used to identify the target object;
[0010] According to the correspondence between the identification information and the frame identifier, a specified frame identifier corresponding to the identification information of the target object is obtained; wherein the frame identifier is pre-configured for each video frame of the multimedia information, and the frame identifier is used to uniquely identify the video frame in the multimedia information;
[0011] A designated video frame corresponding to the designated frame identifier is searched according to the designated frame identifier.
[0012] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.
[0013] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0014] Through the embodiments of the present invention, since a unique frame identifier is configured for each video frame, any video frame can be located according to the unique frame identifier. Therefore, the problem that any video frame cannot be queried in the related art can be solved, and the effect of accurately locating any video frame can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0016] Figure 1 is a flowchart of a method for querying a video frame according to an embodiment of the present invention;
[0017] Figure 2 is a flowchart of a method for querying a video frame according to another embodiment of the present invention;
[0018] Figure 3 is a flowchart of multi-target tracking according to an optional embodiment of the present invention;
[0019] Figure 4 is a flowchart of video target labeling according to an optional embodiment of the present invention;
[0020] Figure 5 is a flow chart of video text translation according to an optional embodiment of the present invention. DETAILED DESCRIPTION
[0021] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0022] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0023] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a computing device as an example, the computing device may include one or more processors (the processor may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory for storing data. In one embodiment, the computing device may also include a transmission device and an input / output device for a communication function. It can be understood by a person of ordinary skill in the art that the above structure is only for illustration and does not limit the structure of the above computing device. For example, the computing device may also include more or fewer components than those described above, or have a configuration different from that described above.
[0024] The memory can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the query method of the video frame in the embodiment of the present invention. The processor executes various functional applications and data processing by running the computer program stored in the memory, that is, implementing the above method. The memory 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 may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the computing 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 combinations thereof.
[0025] The transmission device 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 computing device. In one example, the transmission device 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 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0026] In this embodiment, a video frame query method is provided, which can be run on a computing device. Figure 1 is a flowchart of a method for querying a video frame according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0027] Step S101, obtaining each video frame in the multimedia information;
[0028] Step S103, configuring a frame identifier for each video frame, wherein the frame identifier is used to uniquely identify the video frame;
[0029] Step S105 , when a request for searching any video frame in the multimedia information is received, searching any video frame according to a frame identifier corresponding to any video frame.
[0030] Through the above steps, since a unique frame identifier is configured for each video frame, any video frame can be located according to the unique frame identifier. Therefore, the problem that any video frame cannot be queried in the related art can be solved, and the effect of accurately locating any video frame can be achieved.
[0031] In one embodiment, configuring a frame identifier for each video frame includes: acquiring summary information of each video frame, and using the summary information as a frame identifier corresponding to each video frame.
[0032] According to another embodiment of the present invention, a method for querying a video frame is provided. Figure 2 FIG. 1 is a flowchart of a method for querying a video frame according to another embodiment of the present invention. Figure 2 As shown, including:
[0033] Step S202, identifying a target object in the multimedia information to obtain a recognition result, wherein the recognition result indicates recognition information of the target object, and the recognition information is used to identify the target object;
[0034] Step S204, obtaining a designated frame identifier corresponding to the identification information of the target object according to the correspondence between the identification information and the frame identifier; wherein the frame identifier is pre-configured for each video frame of the multimedia information, and the frame identifier is used to uniquely identify the video frame in the multimedia information;
[0035] Step S206: query the designated video frame corresponding to the designated frame identifier according to the designated frame identifier.
[0036] Through the above steps, since a unique frame identifier is configured for each video frame, any video frame can be located according to the unique frame identifier. Therefore, the problem that any video frame cannot be queried in the related technology can be solved. Any frame in which the target object appears can be queried, thereby achieving the effect of accurately locating any video frame.
[0037] In one embodiment, after searching for a designated video frame corresponding to the designated frame identifier according to the designated frame identifier, the method further includes: outputting the designated video frame; or encoding the designated video frame and identification information of the target object into a video stream and outputting the video stream.
[0038] In one embodiment, after querying the specified video frame corresponding to the specified frame identifier according to the specified frame identifier, the method also includes: replacing the target object in the specified video frame with the first object, and outputting the replaced specified video frame; or, replacing the target object in the specified video frame with the first object, encoding the replaced specified video frame into a video stream and outputting the video stream.
[0039] In one embodiment, the frame identifier is pre-configured for each video frame of the multimedia information, including: obtaining summary information of each video frame, and using the summary information as the frame identifier corresponding to each video frame.
[0040] 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 can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, 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, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0041] Alternative Implementation
[0042] The solution of the embodiment of the present invention is convenient, fast, and easy to implement, and can be applied to the fields of security tracking systems, video editing and storage, image search, etc. The embodiment of the present invention can solve the problem of how to query or obtain any video frame in these fields, for example, it can solve the problem of single target tracking and poor traceability in the security field, especially in the intelligent tracking system, to achieve cost savings and support massive target tracking.
[0043] The embodiments of the present invention can make video content become like a database, so that video frames can be easily obtained and used, which greatly improves the efficiency of video editing and searching; reduces system operating costs, improves user experience, and improves efficiency and maintainability; and greatly reduces the storage requirements for intermediate images, reducing equipment investment costs; it can also facilitate users to manage video content and easily eliminate redundant images or similar images in the field of video editing.
[0044] In an optional implementation, a hash value may be established for each frame of video as a frame ID, and the frame ID may be implemented by appending private data to each video frame.
[0045] The embodiments of the present invention can be applied to any video service-related device, such as smart phones, tablet computers, PCs, servers, and cameras. In video encoding, frame IDs are established to meet the image search function; or, in a security tracking system, frame IDs are established during video recognition, and target video information is established to meet the target tracking function; or, in a video editing and search system, frame information is accurately acquired and edited, and image search functions are supported in video content.
[0046] The embodiments of the present invention bring about improvements: video frame query can be realized, so that media content can truly become something like a database; the storage of fragment content will be greatly reduced, saving hardware investment costs; and the system design can be simplified, effectively improving system operation efficiency and user experience.
[0047] The following is an implementation example of the present invention:
[0048] The following takes the tracking system as an example to further illustrate the embodiment of the present invention:
[0049] The tracking system can mainly include three subsystems: video generation module, target recognition module, and target tracking module; among them, the video generation module is mainly responsible for collecting surveillance videos, video recording and storage, video forwarding, and video editing, and is mainly composed of cameras and media servers; the target recognition module is mainly responsible for real-time detection and recognition of multiple live streams, and recording each detection information, including detection time, frame ID, and detection results; the target tracking module is mainly responsible for triggering the media server to retrieve video frames according to the detection results, annotating and editing each video stream, and then encoding it into a video stream and forwarding it to the front end for playback. Figure 3 is a flowchart of multi-target tracking according to an optional embodiment of the present invention. Figure 3 As shown, the main steps to achieve the tracking goal are as follows:
[0050] Step S01, video acquisition; that is, using a video generation module to perform video acquisition;
[0051] Step S02, recording and storing: the video generation module records and stores the collected content;
[0052] Step S03, video forwarding; that is, the video generation module forwards the recorded and stored video to the target recognition module;
[0053] Step S04, the target recognition module starts the recognition program;
[0054] Step S05, target detection; that is, after receiving the video, the target recognition module performs target detection on the video;
[0055] Step S06, creating a frame ID; for example, the target recognition module extracts a frame summary of each video frame in the video as a frame identifier (frame ID);
[0056] Step S07, associating the detection with the frame ID; for example, associating the detected target with the frame ID of the video frame where the target is located;
[0057] Step S08, start tracking; that is, the target tracking module starts the tracking program;
[0058] Step S09, target tracking; for example, the time period or position where the target in the video appears in the video may be detected;
[0059] Step S10, the target tracking module queries the video frame according to the historical detection time and the frame ID; for example, the target tracking module may query the video frame according to the frame ID of the video frame in which the tracked target appears;
[0060] Step S11, sending target information, that is, the target tracking module sends the target information to the video generation module;
[0061] Step S12, video positioning; for example, the video generation module positions the video containing the target according to the frame ID of the queried video frame;
[0062] Step S13, retrieving frames; that is, the video generation module retrieves the video frame where the target appears according to the frame ID;
[0063] Step S14, target labeling; that is, the video generation module labels the target in the retrieved video frame according to the received target information;
[0064] Step S15, video forwarding; that is, after the video generation module synthesizes the retrieved video frames into a video, the video is forwarded to the target tracking module;
[0065] Step S16, tracking and playing the video, that is, the video tracking module plays the video.
[0066] Through the above steps, the video frames where the target appears can be accurately found, and these video frames can be used to generate videos; moreover, the targets can be marked in these found video frames, so that the generated video also contains the target information, which is convenient for tracking the target when playing the video.
[0067] The following takes the video content intelligent editing system as an example to further illustrate the embodiment of the present invention:
[0068] The video content intelligent editing system of the embodiment of the present invention mainly includes: a target recognition module and a target labeling module. The embodiment of the present invention can realize the labeling of multiple targets in the video. Among them, the target recognition module is mainly responsible for identifying multiple types of targets in the video stream and recording the detection information of each target, including the detection time, frame ID and detection result; the target labeling module is mainly responsible for retrieving the video frame according to the detection result, and labeling the specific target into the video frame according to the requirement, and then encoding it into a video stream. Figure 4 is a flow chart of video target labeling according to an optional embodiment of the present invention. Figure 4 As shown, the main steps are as follows:
[0069] Step 01, start the recognition program to identify various targets in the video;
[0070] Step 02, extracting a summary from each video frame in the video, and using the summary as a unique identifier for each video frame;
[0071] Step 03, record the identified target information;
[0072] Step 04, obtaining a video frame according to a frame identifier; for example, obtaining a video frame according to a frame identifier of a video frame corresponding to the target;
[0073] Step 05, retrieving the video frame; for example, retrieving the video frame according to the frame ID corresponding to the target;
[0074] Step 06, marking the specified target in each retrieved video frame;
[0075] Step 07, generating a video stream from each annotated video frame.
[0076] It should be noted that the embodiment of the present invention does not limit the actual execution order of step 01 and step 02, and the process of performing target recognition on the video and generating a frame identifier for each frame in the video can be independent of each other.
[0077] The following takes a video content editing system as an example to further illustrate an embodiment of the present invention:
[0078] The video content editing system in the embodiment of the present invention mainly includes a target recognition module (exemplarily marked as a text recognition module in the figure) and a target replacement module. The system can realize translation and editing of text in the video. Among them, the target recognition module: This module is mainly responsible for detecting or identifying text or targets in the video stream, and recording each detection result, including the detection time, frame ID and detection result; the target replacement module is mainly responsible for retrieving video frames according to the detection results, marking or editing each video frame (for example, replacing content), and then encoding it into a video stream. Figure 5 is a flowchart of video text translation according to an optional embodiment of the present invention. Figure 5 As shown, the main steps are as follows:
[0079] Step 01, start the recognition program to recognize the text in the video;
[0080] Step 02, extracting a summary from each video frame in the video, and using the summary as a unique identifier for each video frame;
[0081] Step 03, record the identified target information;
[0082] Step 04, obtaining a video frame according to a frame identifier; for example, obtaining a video frame according to a frame identifier of a video frame corresponding to the target;
[0083] Step 05, retrieving the video frame; for example, retrieving the video frame according to the frame ID corresponding to the target;
[0084] Step 06, replacing the text content in each retrieved video frame with other content, such as translated text content;
[0085] Step 07, replacing each video frame after editing to generate a video stream.
[0086] It should be noted that the embodiment of the present invention does not limit the actual execution order of step 01 and step 02, and the process of performing target recognition on the video and generating a frame identifier for each frame in the video can be independent of each other.
[0087] It should be noted that the invention will be widely used in the field of artificial intelligence, especially the intelligent tracking system. The invention can effectively reduce the intermediate images generated in the media editing process, improve system efficiency and reduce hardware costs, and at the same time provide a foundation for automated batch personalized video editing.
[0088] The embodiment of the present invention supports the function of obtaining the ID of some video frames, and can use the real-time generated frame summary as the frame ID. This solution is the simplest and most effective to implement. Furthermore, since it is necessary to traverse all frames including B frames and P frames between two I frames, fast traversal is one of the difficulties. The embodiment of the present invention can use GPU concurrent fast decoding to implement the solution, and it is expected that the time will be controlled within 10ms to complete the retrieval.
[0089] According to another embodiment of the present invention, a video frame query device is provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0090] The video frame query device of this embodiment includes:
[0091] An acquisition module 31, used to acquire each video frame in the multimedia information;
[0092] A configuration module 33, configured to configure a frame identifier for each video frame, wherein the frame identifier is used to uniquely identify the video frame;
[0093] The query module 35 is used to query any video frame according to a frame identifier corresponding to any video frame when receiving a request for querying any video frame in the multimedia information.
[0094] Through the above module, since a unique frame identifier is configured for each video frame, any video frame can be located according to the unique frame identifier. Therefore, the problem that any video frame cannot be queried in the related art can be solved, and the effect of accurately locating any video frame can be achieved.
[0095] In one embodiment, the configuration module includes: a first configuration submodule, configured to obtain summary information of each video frame, and use the summary information as a frame identifier corresponding to each video frame.
[0096] According to yet another embodiment of the present invention, a video frame query device is provided, comprising:
[0097] The recognition module 42 is used to recognize the target object in the multimedia information and obtain a recognition result, wherein the recognition result indicates recognition information of the target object, and the recognition information is used to identify the target object;
[0098] The acquisition module 44 is used to acquire the designated frame identifier corresponding to the identification information of the target object according to the correspondence between the identification information and the frame identifier; wherein the frame identifier is pre-configured for each video frame of the multimedia information, and the frame identifier is used to uniquely identify the video frame in the multimedia information;
[0099] The query module 46 is used to query the specified video frame corresponding to the specified frame identifier according to the specified frame identifier.
[0100] Through the above module, since a unique frame identifier is configured for each video frame, any video frame can be located according to the unique frame identifier. Therefore, the problem that any video frame cannot be queried in the related technology can be solved. Any video frame in which the target object appears can be queried, thereby achieving the effect of accurately locating any video frame.
[0101] In one embodiment, it further includes: a first output module for outputting a specified video frame; or a second output module for encoding the specified video frame and identification information of the target object into a video stream and outputting the video stream.
[0102] In one embodiment, it also includes: a first replacement module, used to replace the target object in the specified video frame with the first target object; a first output module, used to output the replaced specified video frame; or, a second replacement module, used to replace the target object in the specified video frame with the first target object; a second output module, used to encode the replaced specified video frame into a video stream and output the video stream.
[0103] In one embodiment, the method further includes: a configuration module configured to obtain summary information of each video frame and use the summary information as a frame identifier corresponding to each video frame.
[0104] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0105] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0106] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0107] Step S1, obtaining each video frame in the multimedia information;
[0108] Step S2, configuring a frame identifier for each of the video frames, wherein the frame identifier is used to uniquely identify the video frame;
[0109] Step S3: when a request for querying any video frame in the multimedia information is received, querying the any video frame according to a frame identifier corresponding to the any video frame.
[0110] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0111] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0112] S1, identifying a target object in multimedia information to obtain a recognition result, wherein the recognition result indicates recognition information of the target object, and the recognition information is used to identify the target object;
[0113] S2, obtaining a designated frame identifier corresponding to the identification information of the target object according to the correspondence between the identification information and the frame identifier; wherein the frame identifier is pre-configured for each video frame of the multimedia information, and the frame identifier is used to uniquely identify the video frame in the multimedia information;
[0114] S3: query a designated video frame corresponding to the designated frame identifier according to the designated frame identifier.
[0115] Optionally, the storage medium is also configured to store a computer program for executing any of the above steps, which will not be described in detail here.
[0116] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
[0117] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0118] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0119] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0120] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0121] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A video frame query method, characterized in that: Tracking systems used in security fields include: Identify a target object in the multimedia information to obtain a recognition result, wherein the recognition result indicates recognition information of the target object, and the recognition information is used to identify the target object; According to the correspondence between the identification information and the frame identifier, a designated frame identifier corresponding to the identification information of the target object is obtained; wherein the frame identifier is pre-configured for each video frame of the multimedia information, and the frame identifier is used to uniquely identify the video frame in the multimedia information, wherein a hash value is established for each frame of video as the frame identifier, and the frame identifier is realized by appending private data to each video frame; A specified video frame corresponding to the specified frame identifier is queried according to the specified frame identifier, wherein the specified frame identifier is: the frame identifier of the video frame where the target object tracked by the tracking system is located, wherein the tracking system performs video acquisition; performs target detection on the acquired video; and associates the detected target object with the frame identifier of the video frame where the target object is located.
2. The method according to claim 1, characterized in that After searching for a designated video frame corresponding to the designated frame identifier according to the designated frame identifier, the method further includes: output the specified video frame; or, The designated video frame and the identification information of the target object are encoded into a video stream and the video stream is output.
3. The method according to claim 1, characterized in that After searching for a designated video frame corresponding to the designated frame identifier according to the designated frame identifier, the method further includes: replacing the target object in the designated video frame with the first object, and outputting the designated video frame after replacement; or, The target object in the designated video frame is replaced with a first object, and the designated video frame after replacement is encoded into a video stream and the video stream is output.
4. The method according to claim 1, characterized in that: The frame identifier is pre-configured for each video frame of the multimedia information, and includes: The summary information of each video frame is obtained, and the summary information is used as a frame identifier corresponding to each video frame.
5. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 4 when executed.
6. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 4.
