Video playing method and device, terminal equipment and storage medium
By identifying and extracting the original video file, generating the target video file and playing it, the problem of inefficient searching for specific objects or events in the prior art is solved, and the user experience is significantly improved.
Patent Information
- Application Number
- CN202411986527.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-18
AI Technical Summary
The prior art has low search efficiency and poor user experience when viewing a specific object or event.
By obtaining the original video file, targeting it, and identifying all key objects. When a video generation instruction is received for the target object, the video frame corresponding to the target object is extracted from the original video file, forming the target video file, and playing it.
It greatly reduces the time for users to manually search for key information, improves search efficiency, and improves user experience.
Smart Images

Figure CN119854571A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and in particular, relates to a video playback method, apparatus, terminal device and storage medium. Background Art
[0002] With the rapid development of information technology, video surveillance and data recording technologies have been widely used in various fields, such as security monitoring, traffic management, medical image analysis, etc. In these application scenarios, a large amount of video data is continuously generated and stored, and how to efficiently browse, retrieve and analyze these video data has become an urgent problem to be solved.
[0003] Traditional video browsing methods mainly rely on users to manually drag the progress bar or perform keyword searches to find key information. However, this method is not only inefficient, but also easy to miss important content, especially when the video data volume is large and the key information is scattered. In addition, for users who need to frequently view specific objects or events, traditional video browsing methods are cumbersome and inconvenient. Summary of the invention
[0004] The embodiments of the present application provide a video playback method, apparatus, terminal device, and storage medium, which can solve the problems of low search efficiency and poor user experience when viewing specific objects or events in related technologies.
[0005] In a first aspect, an embodiment of the present application provides a method for playing a video, the method comprising:
[0006] Get the original video file;
[0007] Perform target recognition on the original video file and identify all key objects in the original video file;
[0008] When a video generation instruction for a target object is received, a video frame corresponding to the target object is extracted from the original video file to form a target video file, wherein the key object includes the target object;
[0009] Play the target video file.
[0010] In a second aspect, an embodiment of the present application provides a video playback device, including:
[0011] An acquisition module is used to acquire the original video file;
[0012] The recognition module is used to perform target recognition on the original video file and identify all key objects in the original video file;
[0013] An extraction module, for extracting video frames corresponding to the target object from the original video file to form a target video file when receiving a video generation instruction for the target object, wherein the key object includes the target object;
[0014] The playback module is used to play the target video file.
[0015] In a third aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned video playback method when executing the computer program.
[0016] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the above-mentioned video playback method are implemented.
[0017] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute the above-mentioned video playback method.
[0018] The beneficial effects of the embodiments of the present application compared with the prior art are as follows: the embodiments of the present application obtain the original video file, perform target recognition on the original video file, identify all key objects in the original video file, and when receiving a video generation instruction for the target object, extract the video frames corresponding to the target object from the original video file, compose the target video file, and play the target video file. The implementation method of the present application automatically recognizes and extracts the video frames where the target object is located from the original video file, and composes the target video file with all the video frames containing the target object. By playing the target video file, the user can see all video images about the target object, which greatly reduces the time for the user to manually search for key information, greatly improves the search efficiency, and thus improves the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art 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 labor.
[0020] Figure 1 It is a schematic diagram of the implementation flow of a video playback method provided in an embodiment of the present application;
[0021] Figure 2 It is a structural schematic diagram of a video playback device provided in an embodiment of the present application;
[0022] Figure 3 It is a schematic diagram of the structure of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work are protected by the present application.
[0024] It should be noted that the terms "include", "comprises" and "have" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, terminal, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices. In the claims, specification and drawings of the present application, relational terms such as "first" and "second" are merely used to distinguish one entity / operation / object from another entity / operation / object, and do not necessarily require or imply any such real-time relationship or order between these entities / operations / objects.
[0025] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0026] With the rapid development of information technology, video surveillance and data recording technologies have been widely used in various fields, such as security monitoring, traffic management, medical image analysis, etc. In these application scenarios, a large amount of video data is continuously generated and stored, and how to efficiently browse, retrieve and analyze these video data has become an urgent problem to be solved.
[0027] Traditional video browsing methods mainly rely on users to manually drag the progress bar or perform keyword searches to find key information. However, this method is not only inefficient, but also easy to miss important content, especially when the video data volume is large and the key information is scattered. In addition, for users who need to frequently view specific objects or events, traditional video browsing methods are cumbersome and inconvenient.
[0028] In view of this, the implementation mode of the present application automatically identifies and extracts the video frames where the target object is located from the original video file, and composes a target video file with all the video frames containing the target object. By playing the target video file, the user can see all video images about the target object, which greatly reduces the time the user spends manually searching for key information, greatly improves the search efficiency, and thus enhances the user experience.
[0029] In order to illustrate the technical solution of the present application, a specific embodiment is provided below for illustration.
[0030] Figure 1 A schematic diagram of the implementation process of a video playback method provided in an embodiment of the present application is shown. The method can be applied to a terminal device, specifically a smart phone, a tablet computer, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, etc.
[0031] Specifically, the video playback method may include the following steps S101 to S104.
[0032] Step S101, obtaining an original video file.
[0033] The original video file may be video data directly generated by a camera or other video recording device without any processing or editing.
[0034] In an implementation manner of the present application, the terminal device can load the original video file stored on a hard disk, cloud storage or other storage device through a file reading interface (such as Python's open function or a dedicated video processing library).
[0035] Step S102: performing target recognition on the original video file to identify all key objects in the original video file.
[0036] Among them, key objects can be objects that are identified as important or have specific meanings in the video, and these objects may vary depending on the application scenario, such as faces and vehicles in security monitoring, abnormal structures in medical images, etc. It is understandable that there can be multiple key objects in the original video file.
[0037] In an embodiment of the present application, the terminal device can use a pre-trained deep learning model (such as YOLO, Faster R-CNN, etc.) to analyze the video frame by frame, identify all key objects, and record data such as their position and timestamp in the video, thereby establishing an index of the video content, providing a basis for subsequent extraction of video frames corresponding to the target objects.
[0038] Step S103, when a video generation instruction for a target object is received, video frames corresponding to the target object are extracted from the original video file to form a target video file.
[0039] The target object may be a specific object that the user specifies to focus on or extract, and the key object may include the target object, that is, the user may select one or more of the key objects as the target object.
[0040] In the implementation mode of the present application, the user can input the characteristics of the target object (such as category, color, shape, etc.) through the interactive interface or API, or can generate a video generation instruction for the target object by clicking a related button. The terminal device can filter out the target object from the identified key objects according to the characteristics of the target object. And based on the data such as the position and timestamp of the target object in the video, the video frame containing the target object is extracted from the original video file, and reassembled into a new video file in chronological order, thereby generating a video containing only the target object that the user is concerned about, which can greatly simplify the user's browsing and analysis process.
[0041] Step S104, playing the target video file.
[0042] In an implementation manner of the present application, the terminal device may use a video player (such as VLC, FFmpeg, etc.) or a web player to display the target video file so that the user can view and analyze the behavior or characteristics of the target object.
[0043] The implementation methods of this application can be applied to the following usage scenarios:
[0044] Security monitoring: Police or security personnel can quickly locate and view the movement trajectory of specific people or vehicles.
[0045] Traffic management: Traffic departments can analyze the behavior of key vehicles in traffic accidents and optimize traffic signal control.
[0046] Medical image analysis: Doctors can quickly browse images of patients’ specific organs or lesion areas to assist in diagnosis.
[0047] Wildlife Conservation: Researchers can track and observe the activity patterns of specific animals to protect the ecological environment.
[0048] The beneficial effects of the embodiments of the present application compared with the prior art are as follows: the embodiments of the present application obtain the original video file, perform target recognition on the original video file, identify all key objects in the original video file, and when receiving a video generation instruction for the target object, extract the video frames corresponding to the target object from the original video file, compose the target video file, and play the target video file. The implementation method of the present application automatically recognizes and extracts the video frames where the target object is located from the original video file, and composes the target video file with all the video frames containing the target object. By playing the target video file, the user can see all video images about the target object, which greatly reduces the time for the user to manually search for key information, greatly improves the search efficiency, and thus improves the user experience.
[0049] In some specific implementations of the present application, the above-mentioned target recognition is performed on the original video file to identify all key objects in the original video file, which may specifically include step S401 and step S402.
[0050] Step S401 , performing target recognition on all video frames in the original video file, and identifying key objects in each video frame.
[0051] In an embodiment of the present application, the terminal device can use a deep learning model (such as YOLO, Faster R-CNN, etc.) to analyze each frame in the original video file frame by frame. Specifically, the deep learning model can output information such as the category, position (such as bounding box coordinates), confidence, etc. of the object detected in each frame, and filter out objects with higher confidence as key objects according to preset thresholds or rules. It is understandable that these deep learning models have been trained to identify specific objects in video frames.
[0052] Step S402: Record the structured data of all key objects in the original video file.
[0053] Compared with unstructured data (such as text, images, etc.), structured data has a clear format and type, which is convenient for storage, query and analysis. In the implementation of the present application, structured data may include information such as the category, location, size, and timestamp of an object.
[0054] In the implementation of the present application, the terminal device can store the category, location, timestamp and other information of the identified key objects in a structured data structure, such as a database table or a JSON file, for subsequent query, analysis and processing, for example, the occurrence of an object in a specific time period can be quickly located.
[0055] The implementation method of the present application can more accurately identify key objects in the video through frame-by-frame analysis. And record the corresponding structured data, so that subsequent video browsing, retrieval and analysis become more efficient and convenient. In addition, the implementation method of the present application can adapt to different application scenarios and object recognition needs, which can be achieved by simply adjusting the deep learning model and preset rules.
[0056] In some specific embodiments of the present application, when a video generation instruction for a target object is received, video frames corresponding to the target object are extracted from the original video file to form a target video file, which may specifically include steps S501 to S503.
[0057] Step S501 , when a video generation instruction for a target object is received, the video generation instruction is parsed to determine the target object corresponding to the video generation instruction.
[0058] In an embodiment of the present application, when a video generation instruction for a target object is received, the terminal device can parse the video generation instruction and extract the target object information therein, such as category name, identifier, etc., so as to clarify the specific target object that the user wants to extract.
[0059] Step S502: Acquire target structured data corresponding to the target object.
[0060] In an embodiment of the present application, the terminal device can retrieve data related to the target object from previously recorded structured data based on the parsed target object information, thereby obtaining the specific position and timestamp of the target object in the original video file for subsequent extraction of video frames.
[0061] Step S503: extracting video frames corresponding to the target object from the original video file according to the target structured data to form a target video file.
[0062] In an implementation manner of the present application, the terminal device can extract video frames containing the target object from the original video file based on the position and timestamp information in the target structured data, and reassemble them into a new video file in chronological order, thereby generating a video that only contains the target object that the user is concerned about, simplifying the user's browsing and analysis process.
[0063] It is understandable that the user can generate the video in a variety of ways, such as inputting text or natural language such as voice to input the corresponding video generation instruction. Based on this, in some specific embodiments of the present application, when the video generation instruction for the target object is received, parsing the video generation instruction and determining the target object corresponding to the video generation instruction may specifically include the following steps:
[0064] Natural language recognition is performed on the video generation instruction to determine the target object corresponding to the video generation instruction.
[0065] In the implementation manner of the present application, the user can input the video generation instruction through the user interface of the system (such as a voice input interface, a text input box, etc.). The terminal device can monitor or detect the video generation instruction. Once the instruction is received, the terminal device can pre-process the received video generation instruction, such as removing noise, standardizing the text format (if it is text input), etc.
[0066] For text input, the terminal device can use natural language processing tools to segment the instructions and mark the part of speech for each word (such as noun, verb, etc.). For voice input, the terminal device can first convert it into text, and then perform word segmentation and part of speech tagging.
[0067] Then, the terminal device can use pre-trained semantic models (such as BERT, GPT, etc.) to understand the instructions after word segmentation and identify the user's intention and the target object mentioned. Based on the semantic understanding, the terminal device can further identify the entity (i.e., the target object) in the instruction and extract its related information (such as name, category, etc.). In this way, the video generation instruction input by the user in the form of natural language is converted into information that can be understood and processed by the computer, especially identifying the target object that the user wants to extract.
[0068] Finally, based on the results of natural language recognition, the terminal device can determine the target object mentioned in the instruction and extract its relevant information (such as name, category, location or timestamp in the original video, etc.).
[0069] In the implementation mode of the present application, users can input video generation instructions through natural language without understanding the internal logic or technical details of the system, which reduces the threshold for use. In addition, the implementation mode of the present application can understand and process various forms of video generation instructions (such as instructions in different languages and different expressions), which improves the flexibility and adaptability of the system.
[0070] In some specific implementations of the present application, the above-mentioned process of extracting video frames corresponding to the target object from the original video file according to the target structured data to form the target video file may specifically include step S601 and step S602.
[0071] Step S601: create a virtual file object for the target object according to the target structured data.
[0072] In an implementation manner of the present application, the terminal device may first parse the target structured data, extract detailed information about the target object, such as name, type, location, etc., and then create a virtual file object in memory or on a specific storage medium based on the parsed information. This virtual file object has the basic properties and operation interface of a file (such as open, close, read, write, etc.), but does not actually occupy disk space or generate a physical file. The terminal device may set initial properties for the virtual file object, such as the file name (which may be generated based on the name of the target object), the file type (such as a video file), and other necessary metadata. This provides a temporary, dynamic file container for subsequent video frame extraction and storage, avoids direct operation of physical files on the disk, and improves the flexibility and efficiency of data processing.
[0073] Step S602: Add the video frame corresponding to the target video to the virtual file object to obtain a dynamic virtual file.
[0074] The target video file includes a dynamic virtual file. It should be understood that a dynamic virtual file is a file object temporarily created in memory or on a specific storage medium for organizing and storing data (such as video frames). It does not directly correspond to a physical file on the disk, but serves as an intermediate link in the data processing process. Dynamic virtual files can dynamically add, delete or modify content as needed.
[0075] In the implementation manner of the present application, the terminal device can extract the video frame corresponding to the target object from the original video file according to the position information (such as timestamp, coordinates, etc.) in the target structured data. In addition, the terminal device can encode the extracted video frame (such as converting it into a specific video encoding format). Then the encoded video frame is added to the virtual file object in a specific order (such as time sequence). In this process, the terminal device can store and manage these video frames by maintaining an internal data structure (such as a linked list, array, etc.). With the addition of video frames, the virtual file object gradually builds up a complete video data structure. Although it is still a virtual object at this time, it already contains all the necessary video frames and metadata and can be regarded as a dynamic virtual file. By organizing the extracted target object video frame into a complete video data structure, it is convenient for subsequent playback, transmission or further processing.
[0076] The implementation method of the present application avoids frequent reading and writing of physical files on the disk by creating dynamic virtual files, reduces the overhead of I / O operations, and improves the efficiency of data processing. Since dynamic virtual files allow temporary storage and organization of data in memory or on a specific storage medium, more flexibility is provided for further processing of data. In addition, since dynamic virtual files do not directly occupy disk space, system resources can be used more efficiently, especially when processing large amounts of video data.
[0077] In some specific implementations of the present application, the above-mentioned target recognition is performed on all video frames in the original video file to identify the key object in each video frame, which may specifically include steps S701 to S703.
[0078] Step S701, extracting features from video frames to obtain video features.
[0079] In the implementation mode of the present application, the terminal device may first pre-process the video frame, such as denoising, graying, resizing, etc., to improve the accuracy and efficiency of feature extraction. Then, a specific feature extraction algorithm (such as SIFT, SURF, HOG, etc.) is used to extract features from the pre-processed video frame. These algorithms can identify and extract key feature points or feature areas in the video frame. And the extracted feature points or feature areas are converted into feature vectors or feature descriptors for subsequent object detection or classification.
[0080] Step S702: perform object detection based on video features to detect corresponding key objects.
[0081] In the implementation mode of the present application, the terminal device can use a pre-trained object detection model (such as Faster R-CNN, YOLO, SSD, etc.) to perform object detection on the extracted video features. It is understandable that these object detection models have been trained on large-scale data sets and can identify and locate a variety of different objects. In addition, based on the pre-trained model, specific detection algorithms (such as sliding windows, region proposal networks, etc.) can also be used to traverse and match video features to find the location and range of key objects, so as to identify and locate key objects from video frames, and provide a basis for subsequent object association or tracking.
[0082] Step S703: Associating the same key object in different video frames.
[0083] In an embodiment of the present application, for adjacent or similar video frames, the terminal device can use a feature matching algorithm (such as BF Matcher, FLANN Matcher, etc.) to match the extracted video features to find the same key object in different video frames. Then, based on the result of the feature matching, a trajectory tracking algorithm (such as Kalman filtering, optical flow method, etc.) is used to estimate and track the motion trajectory of the key object. And based on the results of the trajectory tracking, it is determined whether the key objects in different video frames belong to the same object. Specifically, this can be achieved by analyzing the continuity and consistency of the object's motion trajectory, shape, color and other features. By associating the same key object in different video frames, subsequent tasks such as object tracking, behavior analysis or event detection can be performed.
[0084] The implementation method of the present application can more accurately identify key objects and reduce misidentification or missed identification by performing feature extraction and object detection on video frames. It can also process video scenes containing multiple key objects and complex backgrounds, and has broad application prospects.
[0085] It is understandable that, in addition to inputting the video generation instruction through natural language, the user can also input the video generation instruction by clicking the button corresponding to the target object in the interactive interface. Based on this, in some embodiments of the present application, after performing target recognition on the original video file and identifying all key objects in the original video file, the above method may include step S801 and step S802.
[0086] Step S801: Generate a corresponding object button on the display interface according to the name of the key object.
[0087] In an embodiment of the present application, after identifying all key objects in the original video file, the terminal device can parse the target recognition result, obtain the names of all key objects, and generate button elements according to the names of the key objects. Specifically, it can be to generate object button elements at a specified location of the display interface using a graphical interface development tool (such as HTML, CSS, JavaScript, etc.), and use the name of the key object as the label or prompt information of the button. By generating an object button, an intuitive and interactive interface element is provided to the user, allowing the user to trigger operations related to the key object by clicking the button.
[0088] Step S802: Establish a mapping relationship between the object button and the corresponding video generation instruction.
[0089] In the implementation manner of the present application, the terminal device can define a series of video generation instructions according to the requirements of the application scenario, such as "generate a close-up video of a key object", "generate a motion trajectory video of a key object", etc.
[0090] Specifically, the terminal device can create a mapping table or data structure to associate the object button with the corresponding video generation instruction. The mapping table can be a simple key-value pair set, where the key is the identifier of the object button (such as the button ID) and the value is the corresponding video generation instruction. Then add a click event listener to the object button. When the user clicks the button, the event listener is triggered, and the corresponding video generation instruction is found according to the mapping table and executed. By establishing a mapping relationship between the object button and the video generation instruction, the function of users generating or processing videos by clicking buttons is realized, which improves the interactivity and ease of use of the system.
[0091] The implementation of the present application can provide users with an intuitive and easy-to-use interactive interface by generating object buttons and establishing a mapping relationship with video generation instructions, allowing users to easily trigger operations related to key objects, thereby improving user experience. It is also possible to define a variety of video generation instructions according to different application scenarios and requirements, and associate them with different object buttons through mapping relationships, thereby achieving flexible video generation and processing functions.
[0092] Figure 2 The schematic diagram of the structure of a video playback device provided in an embodiment of the present application is shown. The video playback device 2 can be configured on a terminal device. Specifically, the video playback device 2 can include:
[0093] An acquisition module 201 is used to acquire an original video file;
[0094] The recognition module 202 is used to perform target recognition on the original video file and identify all key objects in the original video file;
[0095] The extraction module 203 is used to extract the video frame corresponding to the target object from the original video file to form a target video file when receiving a video generation instruction for the target object, wherein the key object includes the target object;
[0096] The playing module 204 is used to play the target video file.
[0097] The beneficial effects of the embodiments of the present application compared with the prior art are as follows: the embodiments of the present application obtain the original video file, perform target recognition on the original video file, identify all key objects in the original video file, and when receiving a video generation instruction for the target object, extract the video frames corresponding to the target object from the original video file, compose the target video file, and play the target video file. The implementation method of the present application automatically recognizes and extracts the video frames where the target object is located from the original video file, and composes the target video file with all the video frames containing the target object. By playing the target video file, the user can see all video images about the target object, which greatly reduces the time for the user to manually search for key information, greatly improves the search efficiency, and thus improves the user experience.
[0098] In some implementations of the present application, the identification module 202 is further used to:
[0099] Performing target recognition on all video frames in the original video file to identify key objects in each video frame;
[0100] The structured data of all the key objects in the original video file are recorded.
[0101] In some embodiments of the present application, the extraction module 203 is further used to:
[0102] When receiving a video generation instruction for a target object, parsing the video generation instruction to determine the target object corresponding to the video generation instruction;
[0103] Acquire target structured data corresponding to the target object;
[0104] According to the target structured data, video frames corresponding to the target object are extracted from the original video file to form the target video file.
[0105] In some embodiments of the present application, the extraction module 203 is further used to:
[0106] Natural language recognition is performed on the video generation instruction to determine the target object corresponding to the video generation instruction.
[0107] In some implementations of the present application, the target video file includes a dynamic virtual file, and the extraction module 203 is further used to:
[0108] Creating a virtual file object for the target object according to the target structured data;
[0109] The video frame corresponding to the target video is added to the virtual file object to obtain the dynamic virtual file.
[0110] In some implementations of the present application, the identification module 202 is further used to:
[0111] Extracting features from the video frame to obtain video features;
[0112] Perform object detection according to the video features to detect the corresponding key objects;
[0113] The same key object in different video frames is associated.
[0114] In some implementations of the present application, the video playback device 2 further includes a generation module for:
[0115] Generating a corresponding object button on the display interface according to the name of the key object;
[0116] A mapping relationship is established between the object button and the corresponding video generation instruction.
[0117] like Figure 3 , which is a schematic diagram of a terminal device provided in an embodiment of the present application. The terminal device 3 may include: a processor 301, a memory 302, and a computer program 303 stored in the memory 302 and executable on the processor 301, such as a video playback program. When the processor 301 executes the computer program 303, the steps in the above-mentioned video playback method embodiments are implemented.
[0118] The computer program may be divided into one or more modules / units, one or more modules / units are stored in the memory 302 and executed by the processor 301 to complete the present application. One or more modules / units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the terminal device.
[0119] The terminal device may include, but is not limited to, a processor 301 and a memory 302. Those skilled in the art will appreciate that Figure 3 It is only an example of a terminal device and does not constitute a limitation of the terminal device. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device may also include input and output devices, network access devices, buses, etc.
[0120] The processor 301 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0121] The memory 302 may be an internal storage unit of the terminal device, such as a hard disk or memory of the terminal device. The memory 302 may also be an external storage device of the terminal device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device. Further, the memory 302 may also include both an internal storage unit of the terminal device and an external storage device. The memory 302 is used to store computer programs and other programs and data required by the terminal device. The memory 302 may also be used to temporarily store data that has been output or is to be output.
[0122] It should be noted that, for the convenience and brevity of description, the structure of the above-mentioned terminal device can also refer to the specific description of the structure in the method embodiment, which will not be repeated here.
[0123] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0124] The embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned video playback method can be implemented.
[0125] An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned video playback method when executing the computer program product.
[0126] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0127] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0128] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0129] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0130] In addition, each functional unit in each embodiment of the present application may be integrated into one 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.
[0131] If the integrated module / 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 present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0132] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A video playback method, characterized in that: The method comprises: Get the original video file; Performing target recognition on the original video file to identify all key objects in the original video file; When receiving a video generation instruction for a target object, extracting a video frame corresponding to the target object from the original video file to form a target video file, wherein the key object includes the target object; The target video file is played.
2. The video playback method according to claim 1, characterized in that: The performing target recognition on the original video file to identify all key objects in the original video file includes: Performing target recognition on all video frames in the original video file to identify key objects in each video frame; The structured data of all the key objects in the original video file are recorded.
3. The video playback method according to claim 2, characterized in that: When receiving a video generation instruction for a target object, extracting a video frame corresponding to the target object from the original video file to form a target video file includes: When receiving a video generation instruction for a target object, parsing the video generation instruction to determine the target object corresponding to the video generation instruction; Acquire target structured data corresponding to the target object; According to the target structured data, video frames corresponding to the target object are extracted from the original video file to form the target video file.
4. The video playback method according to claim 3, characterized in that: When receiving a video generation instruction for a target object, parsing the video generation instruction and determining the target object corresponding to the video generation instruction includes: Natural language recognition is performed on the video generation instruction to determine the target object corresponding to the video generation instruction.
5. The video playback method according to claim 3, characterized in that: The target video file includes a dynamic virtual file, and the video frame corresponding to the target object is extracted from the original video file according to the target structured data to form the target video file, including: Creating a virtual file object for the target object according to the target structured data; The video frame corresponding to the target video is added to the virtual file object to obtain the dynamic virtual file.
6. The video playback method according to claim 2, characterized in that: The performing target recognition on all video frames in the original video file to identify key objects in each video frame includes: Extracting features from the video frame to obtain video features; Perform object detection according to the video features to detect the corresponding key objects; The same key object in different video frames is associated.
7. The video playback method according to claim 1, characterized in that: After performing target recognition on the original video file and identifying all key objects in the original video file, the method further includes: Generating a corresponding object button on the display interface according to the name of the key object; A mapping relationship is established between the object button and the corresponding video generation instruction.
8. A video playback device, characterized in that: include: An acquisition module, used to acquire original video files; A recognition module, used to perform target recognition on the original video file, and identify all key objects in the original video file; an extraction module, for extracting a video frame corresponding to the target object from the original video file to form a target video file when receiving a video generation instruction for the target object, wherein the key object includes the target object; The playing module is used to play the target video file.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the video playback method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the video playback method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Video playing device and method
CN105100892A
Performance fragment marking method, video playing method, video playing device, and video playing system
CN108337532A
Video selection playing method, device and equipment and readable storage medium
CN110225369A
Video editing method and system and storage medium
CN110401878A
Video analysis method and apparatus, computer device and storage medium
WO2020248386A1