Video screenshot generation method and device, electronic equipment and storage medium

By obtaining subtitle entries and time information in the video, selecting video clips and similarity, and generating video screenshots of target lines, the cumbersome problems of video screenshot generation in traditional methods are solved, and the user's screenshot efficiency and experience are improved.

CN119094853APending Publication Date: 2024-12-06BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411102052.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-12
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

The traditional video screenshot generation method requires users to accurately locate and manually capture the specific scenes of lines in the video. The process is cumbersome and time-consuming, affecting user experience and efficiency.

Method used

By obtaining the subtitle entries of the target line in the video, determining the start and end time of the subtitle, obtaining the video clip, and selecting the video screen as the subtitle screenshot according to the clip length and similarity, generating a video screenshot of the target line, simplifying the operation process.

Benefits of technology

Users can quickly capture video screenshots corresponding to subtitles without accurately entering the original text of the lines or a specific time, which greatly simplifies the operation process and improves screenshot efficiency and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119094853A_ABST
    Figure CN119094853A_ABST
Patent Text Reader

Abstract

The invention relates to a video screenshot generation method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining a first subtitle entry corresponding to a target line in a target video, and determining the starting time and ending time of each subtitle in the first subtitle entry in the target video; based on the starting time and the ending time, obtaining a video clip corresponding to the subtitles in a target video; selecting a target video picture from the video clip as a caption screenshot of the caption; and generating the video screenshot of the target line by using the subtitle screenshot of the subtitle, so that a user can be helped to quickly position the required subtitle, and the user can quickly capture the video screenshot corresponding to the subtitle by using the time attribute of the subtitle without accurately inputting the original text of the line or the specific occurrence time and only by simple operation, thereby improving the user experience. The user screenshot operation process is greatly simplified, the user screenshot efficiency is improved, and the effect of enhancing the user experience is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of video processing, and in particular to a method, device, electronic device and storage medium for generating video screenshots. Background Art

[0002] In today's digital age, when users are interacting on social media, discussing on a website, or conceiving copy, they often use classic lines / dialogues from movies and TV dramas, supplemented by corresponding screenshots, to enrich their expressions and enhance the effectiveness of information expression.

[0003] However, the traditional approach often requires users to go through a series of tedious steps, carefully searching and accurately locating the specific scenes where the lines appear in the huge amount of drama resources, then pausing the playback and carefully capturing the relevant scenes. The screenshot process is not only time-consuming and labor-intensive, but also tests the user's screenshot efficiency, reducing the user's experience.

[0004] Therefore, there is an urgent need to develop a video screenshot generation method, device, electronic device and storage medium to solve one or more of the above-mentioned problems. Summary of the invention

[0005] In view of this, in order to solve the above-mentioned technical problems or part of the technical problems, the embodiments of the present invention provide a video screenshot generation method, device, electronic device and storage medium.

[0006] In a first aspect, the present application provides a method for generating a video screenshot, the method comprising:

[0007] Obtaining a first subtitle entry corresponding to a target line in a target video, wherein the first subtitle entry includes all line contents of the target line;

[0008] Determine the start time and end time of each subtitle in the first subtitle entry appearing in the target video;

[0009] Based on the start time and the end time, obtain the video segment corresponding to the subtitle in the target video;

[0010] Selecting a target video screen from the video clip as a subtitle screenshot of the subtitle;

[0011] The subtitle screenshot of the subtitle is used to generate a video screenshot of the target line.

[0012] In a possible implementation manner, selecting a target video screen from the video clip as a subtitle screenshot of the subtitle includes:

[0013] When the duration of the video segment is less than a first preset duration, selecting a video screen at a start time from the video segment as a subtitle screenshot of the subtitle;

[0014] When the duration of the video clip is greater than the first preset duration, a first video frame corresponding to the first target time, or a second video frame corresponding to the first video frame and the second target time is selected from the video clip as a subtitle screenshot of the subtitle.

[0015] In a possible implementation, selecting a first video frame corresponding to a first target time, or a second video frame corresponding to the first video frame and a second target time from the video clip as a subtitle screenshot of the subtitle includes:

[0016] Acquire a first video frame corresponding to a first target time and a second video frame corresponding to a second target time in the video segment, and determine a frame similarity between the first video frame and the second video frame;

[0017] When the picture similarity is lower than a first similarity threshold, selecting the first video picture and the second video picture as subtitle screenshots of the subtitles;

[0018] When the picture similarity is higher than a first similarity threshold, the first video picture is selected as a subtitle screenshot of the subtitle.

[0019] In a possible implementation manner, obtaining a first subtitle entry corresponding to the target line in the target video includes:

[0020] Compare the target lines with the subtitles in the subtitle library to determine the start subtitle and the end subtitle corresponding to the target lines in the target video;

[0021] The subtitle entries from the start subtitle to the end subtitle in the subtitle library are used as the first subtitle entries corresponding to the target lines in the target video.

[0022] In a possible implementation manner, before determining the start time and the end time of each subtitle in the first subtitle entry appearing in the target video, the method further includes:

[0023] Acquire a second subtitle entry of a target video, where the second subtitle entry includes all subtitles of the target video;

[0024] The time of the start frame and the end frame of the subtitle in the target video are respectively used as the start time and the end time of the subtitle appearing in the target video;

[0025] According to the sequence of the start time of each subtitle in the second subtitle entry, the subtitles in the second subtitle entry and the start time and end time of the subtitle appearing in the target video are sequentially stored in the subtitle library.

[0026] In a possible implementation, the step of generating a video screenshot of the target line using the subtitle screenshot of the subtitle includes:

[0027] Obtaining the number of subtitles included in the first subtitle entry;

[0028] In the case where the first subtitle entry includes a subtitle, taking a subtitle screenshot of the subtitle as a video screenshot corresponding to the target line;

[0029] In the case where the first subtitle entry includes multiple subtitles, the subtitle screenshots of the multiple subtitles are sequentially spliced ​​according to the order of the start time of each subtitle in the first subtitle entry to obtain a subtitle superimposed screenshot;

[0030] The subtitle overlay screenshot is used as the video screenshot corresponding to the target line.

[0031] In a possible implementation, the method further includes:

[0032] A semantic comparison is performed between the target lines and the subtitles in the subtitle library to determine candidate subtitle entries for the target lines in the target video, wherein the candidate subtitle entries include candidate subtitles corresponding to the target lines, and the candidate subtitles are used to generate candidate video screenshots corresponding to the target lines.

[0033] In a second aspect, the present application provides a video screenshot generating device, the device comprising:

[0034] A first acquisition module, configured to acquire a first subtitle entry corresponding to a target line in a target video, wherein the first subtitle entry includes all the content of the target line;

[0035] A time determination module, used to determine the start time and end time of each subtitle in the first subtitle entry appearing in the target video;

[0036] A second acquisition module, used for acquiring a video segment corresponding to the subtitle in the target video based on the start time and the end time;

[0037] A screenshot selection module, used to select a target video screen from the video clip as a subtitle screenshot of the subtitle;

[0038] A screenshot generation module is used to generate a video screenshot of the target line using the subtitle screenshot of the subtitle.

[0039] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the video screenshot generation method described in any one of the embodiments of the first aspect are implemented.

[0040] In a fourth aspect, the present application further provides a computer storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the video screenshot generation method described in any embodiment of the first aspect are implemented.

[0041] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the video screenshot generation method provided by the embodiment of the present application can not only help users quickly locate the required subtitles, but also utilize the time attribute of the subtitles, so that users do not need to accurately input the original text of the lines or the specific time of occurrence. Only simple operations are required to quickly capture the video screenshots corresponding to the subtitles, which greatly simplifies the user screenshot operation process, allowing users to easily obtain video screenshots of the target lines, providing convenience for user creation, improving the efficiency of user screenshots, and achieving the effect of enhancing user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0044] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0045] Figure 1 A schematic diagram of a process for generating a video screenshot provided in an embodiment of the present application;

[0046] Figure 2 A schematic diagram of determining subtitle time in a video screenshot generation method provided in an embodiment of the present application;

[0047] Figure 3 A schematic diagram of a subtitle library in a video screenshot generation method provided in an embodiment of the present application;

[0048] Figure 4 A schematic diagram of a process flow of another method for generating a video screenshot provided in an embodiment of the present application;

[0049] Figure 5A flowchart of a method for generating a video screenshot provided in an embodiment of the present application;

[0050] Figure 6 A schematic diagram of the structure of a video screenshot generating device provided in an embodiment of the present application;

[0051] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0053] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0054] In order to solve the problem in the prior art that users must personally search during video playback, locate the video screen where the desired specific lines appear through cumbersome steps, and then manually operate the pause button to capture the relevant screen, this process is not only time-consuming, but also quite cumbersome, seriously affecting the efficiency of user screenshots and the overall user experience of video services. The present application provides a video screenshot generation method, device, electronic device and storage medium, which can not only help users quickly locate required subtitles, but also utilize the time attribute of subtitles, so that users do not need to accurately input the original text of the lines or the specific time of occurrence, but only need simple operations to quickly capture the video screenshots corresponding to the subtitles, which greatly simplifies the user screenshot operation process, enables users to easily obtain video screenshots of target lines, provides convenience for user creation, improves the efficiency of user screenshots, and achieves the effect of enhancing user experience.

[0055] Figure 1 A schematic diagram of a process for generating a video screenshot provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method specifically includes:

[0056] S101, obtaining a first subtitle entry corresponding to a target line in a target video, wherein the first subtitle entry includes all the line contents of the target line;

[0057] When users interact and discuss film and television plots or related copywriting on social platforms, in order to express their views or feelings more deeply, they will cleverly quote some classic lines or dialogues in the drama, and combine them with accurate screenshots to enhance the strength and accuracy of their expression. This approach not only enhances the intuitiveness of the plot speech, but also allows other users to understand the meaning they want to convey more quickly.

[0058] In this embodiment, when the user is creating copy related to a film or TV series, in order to effectively achieve the target line screenshot effect, it is first necessary to obtain the subtitle entry information of the target line in the corresponding film or TV series. The subtitle entry contains the complete content of the target line, ensuring that the user can guarantee the accuracy of the line when quoting.

[0059] It should be noted that the target lines are used to match the appropriate screenshots. The "target lines" refer to a sentence or a paragraph in a film or TV series that the user selects and intends to use during the creation process. The target lines can be the lines of a character in the film or TV series, or it can be a dialogue between two or more characters.

[0060] S102, determining the start time and end time of each subtitle in the first subtitle entry appearing in the target video;

[0061] Film and television videos are composed of dynamic video images and matching dialogues and subtitles. The two complement each other and together convey a complete storyline and character dialogues. With the help of artificial intelligence generated content (AIGC) technology, the text content in the video is deeply understood and analyzed. Then, the natural dialogue and time attributes of the subtitles are combined to generate a film and television subtitle library, providing users with highly convenient and efficient screenshot generation services.

[0062] like Figure 2 As shown, in this embodiment, after determining the first subtitle entry, the user inputs the subtitle content to compare and analyze the subtitles with the already generated film and television drama subtitle library, and accurately determine the specific start time and end time of each subtitle in the subtitle entry through comparison.

[0063] S103, based on the start time and the end time, obtaining a video segment corresponding to the subtitle in the target video;

[0064] Film and television videos can be divided into video slices with different subtitles based on the lines and subtitles. For example, by analyzing the video content frame by frame and comparing the display and disappearance of subtitles in the film and television video, the dynamic changes of subtitles can be accurately captured, and the start and end time of the subtitles in the film and television video can be determined. The film and television video can be divided into video slices with different subtitles based on the time information of each subtitle.

[0065] In this embodiment, after determining the exact start and end time of each subtitle in the subtitle entry, the video segments corresponding to these subtitles in the target video are extracted through time information, which are so-called video slices; the video slices contain the time range covered by the subtitles, which can ensure that the subtitles can be displayed accurately when the video is played.

[0066] S104, selecting a target video screen from the video clip as a subtitle screenshot of the subtitle;

[0067] In this embodiment, after determining the video segment corresponding to the subtitle, a video screen is selected from the video segment as a subtitle screenshot of the subtitle according to the time attribute of the video segment;

[0068] It should be noted that the number of subtitle screenshots is not fixed. It may be determined according to the demand or the duration of the video clip. It may be one or more. When the number of subtitle screenshots is multiple, multiple subtitle screenshots will be pushed to the user interface at the same time for users to choose from, thus realizing a more flexible and user-friendly subtitle service, meeting the needs of users in different scenarios, and improving the user's screenshot experience.

[0069] S105: Generate a video screenshot of the target line using the subtitle screenshot of the subtitle.

[0070] In this embodiment, different video screenshot processing is performed according to the correspondence between the target lines and the subtitles;

[0071] Specifically, when the target line only corresponds to a subtitle in the video, the screenshot containing the subtitle is directly selected as the video screenshot of the target line. Since each subtitle corresponds to a unique screenshot, the accuracy and completeness of the screenshot can be ensured. In some complex scenes, the target line may correspond to multiple subtitles. At this time, an efficient subtitle screenshot stitching method is adopted to extract all the subtitle screenshots corresponding to the target line one by one, and then use professional image processing technology, such as image fusion, edge smoothing, etc., to seamlessly stitch these subtitle screenshots to obtain a stitched image containing all corresponding subtitles as the video screenshot of the target line;

[0072] Through the above implementation, not only the correspondence between the video screenshots and the target lines is ensured, but also the special situation of multiple subtitles in complex scenes is fully considered. When the target lines and subtitles are one-to-many, the spliced ​​screenshots more completely reflect the video content.

[0073] The video screenshot generation method provided in the present embodiment obtains the subtitle entry corresponding to the target line in the target video, then obtains the subtitle screenshot corresponding to the subtitle according to the appearance time of each subtitle in the subtitle entry, and finally uses the subtitle screenshot to generate a video screenshot of the target line. This can not only help users quickly locate the required subtitles, but also utilize the time attribute of the subtitles, so that users do not need to accurately input the original text of the lines or the specific occurrence time, but only need to perform simple operations to quickly capture the video screenshot corresponding to the subtitles, which greatly simplifies the user screenshot operation process, enables users to easily obtain video screenshots of the target lines, provides convenience for user creation, and improves the efficiency of user screenshots, thereby achieving the effect of enhancing user experience.

[0074] In an optional solution of the embodiment of the present invention, selecting a target video screen from the video clip as a subtitle screenshot of the subtitle includes:

[0075] When the duration of the video segment is less than a first preset duration, selecting a video screen at a start time from the video segment as a subtitle screenshot of the subtitle;

[0076] When the duration of the video clip is greater than the first preset duration, a first video frame corresponding to the first target time, or a second video frame corresponding to the first video frame and the second target time is selected from the video clip as a subtitle screenshot of the subtitle.

[0077] Considering that subtitles may need to be displayed in a background that changes in real time, the design adopts an intelligent logic judgment method to select different background images as subtitle screenshots by judging the display time of subtitles;

[0078] In this embodiment, the duration of the video segment where the subtitles appear is set to be lower than a preset duration in advance according to the user's screenshot diversity requirements or the video screen change frequency. When the video segment duration is less than the first preset duration, the video screen at the start time is selected from the video segment as the subtitle screenshot of the subtitles; when the video segment duration is greater than the first preset duration, the first video screen corresponding to the first target time, or the second video screen corresponding to the first video screen and the second target time, is selected from the video segment as the subtitle screenshot of the subtitles.

[0079] For example, the first preset duration is 1 second. When the duration of subtitle display does not exceed 1 second, the initial background image of the subtitle display is used as the subtitle screenshot of the subtitle. For example, when the subtitle is displayed from 00:29:51.066 to 00:29:51.238, the background image displayed at 00:29:51.066 is saved as img1.jpg, and img1.jpg is used as the subtitle screenshot of the subtitle.

[0080] For another example, when the subtitle is displayed for more than one second, for example, from 00:29:51.066 to 00:29:52.238, the system can automatically capture the background images of the first 1 / 5 (i.e., 00:29:51.300) and the last 1 / 5 (i.e., 00:29:52.003) of the time period, and save them as img2.jpg and img3.jpg, and use img2.jpg and img3.jpg as candidate subtitle screenshots of the subtitle;

[0081] It should be noted that, in order to ensure that the subtitle screenshot can accurately reflect the changes in the video screen, the time difference from the start time to the first target time is equal to the time difference from the second target time to the end time. In actual operation, the first target time and the second target time can be specifically set according to the switching frequency of the video background, that is, the target time can be set at different time points in the video as needed; in addition, the number of target times is not fixed, and can be set according to the required display duration. The number of target times can be more than two, but can be set to multiple according to actual needs.

[0082] The video screenshot generation method provided in this embodiment compares the display duration of the video clip with the preset duration, selects one or more video frames as subtitle screenshots, ensures that the subtitle screenshots can accurately reflect the changes in the video frames, and provides users with screenshot options of different transition frames, thereby achieving diverse selectivity of subtitle screenshots.

[0083] In an optional solution of the embodiment of the present invention, selecting a first video frame corresponding to a first target time, or a second video frame corresponding to the first video frame and a second target time from the video clip as a subtitle screenshot of the subtitle includes:

[0084] Acquire a first video frame corresponding to a first target time and a second video frame corresponding to a second target time in the video segment, and determine a frame similarity between the first video frame and the second video frame;

[0085] When the picture similarity is lower than a first similarity threshold, selecting the first video picture and the second video picture as subtitle screenshots of the subtitles;

[0086] When the picture similarity is higher than a first similarity threshold, the first video picture is selected as a subtitle screenshot of the subtitle.

[0087] In this embodiment, the screen similarity between the first video screen and the second video screen is obtained, and subtitle screenshots of the subtitles are selected from the first video screen and the second video screen according to the screen similarity.

[0088] It should be noted that the similarity threshold in this embodiment can be dynamically adjusted according to the subtitle length. For example, the subtitle length threshold is 1 second, and the similarity threshold is set to 90% as an estimated setting. The preset similarity threshold is not fixed, but can be dynamically configured and adjusted according to actual needs, so that the similarity judgment can be more flexibly adapted to different application scenarios.

[0089] In the process of calculating the similarity of the pictures, the DINOv2 similarity algorithm can be used, or the image similarity comparison scheme provided by openCV (cross-platform computer vision library) can be used. The similarity of the two pictures can be evaluated by calculating the structural similarity index weighted histogram (SSIM-WH), that is, comparing the brightness, contrast and structural information of the two pictures and the histogram similarity. Alternatively, the DINOv2 and OpenCV algorithms can be combined to make a judgment.

[0090] The video screenshot generation method proposed in this embodiment compares the similarity of multiple candidate images to select one or more video images as subtitle screenshots, ensuring that the generated subtitle screenshots can accurately reflect the changes in the video images, including character expressions, actions, and scene details, etc.; it provides users with a rich variety of transition screenshot options, allowing users to better capture key images when watching videos, thereby improving the user's viewing experience. In addition, the method also fully considers the personalized needs of users, allowing users to select different video clips as subtitle screenshots according to their preferences and needs, so that users can have more choices when sharing videos or making video clips, and can also meet the personalized needs of users.

[0091] In an optional solution of the embodiment of the present invention, the step of obtaining a first subtitle entry corresponding to the target line in the target video includes:

[0092] Compare the target lines with the subtitles in the subtitle library to determine the start subtitle and the end subtitle corresponding to the target lines in the target video;

[0093] In this embodiment, the target lines to be analyzed are first compared one by one with the subtitle sequences stored in the subtitle library to locate the time interval in which the target lines appear in the video file. Through the above comparison, it is possible to accurately identify which subtitles match the target lines during video playback, and the matching process not only includes accurate alignment of the line content, but also ensures semantic coherence; after the matching is completed, the starting subtitles and ending subtitles of the target lines in the video can be confirmed.

[0094] The subtitle entries from the start subtitle to the end subtitle in the subtitle library are used as the first subtitle entries corresponding to the target lines in the target video.

[0095] In this embodiment, after determining the start subtitle and the end subtitle, all subtitle entries from the start subtitle to the end subtitle corresponding to the target line in the subtitle library are selected to form the first subtitle entry corresponding to the target line in the target video.

[0096] By determining the starting subtitle and the ending subtitle to form the first subtitle entry, it is ensured that the subsequent subtitle screenshot and generation process can accurately and comprehensively cover the display period of the target line in the video. This not only improves the matching degree between the subtitle screenshot and the video content, but also enhances the coherence of the screenshot subtitle.

[0097] In an optional solution of the embodiment of the present invention, before determining the start time and the end time of each subtitle in the first subtitle entry appearing in the target video, the method further includes:

[0098] Acquire a second subtitle entry of a target video, where the second subtitle entry includes all subtitles of the target video;

[0099] The time of the start frame and the end frame of the subtitle in the target video are respectively used as the start time and the end time of the subtitle appearing in the target video;

[0100] In this embodiment, all subtitles in the target video are obtained to generate a second subtitle entry, and the time of the frame in which each subtitle starts to appear and the time of the frame in which it ends to appear are recorded as the start time and the end time of the subtitle in the video, respectively. Through the above processing, no matter whether the subtitles appear synchronously or sequentially, the subtitle information in the video can be accurately obtained, and no matter how many subtitles there are in the video, the appearance and disappearance of each subtitle can be completely captured, thereby providing accurate time information for post-processing of the video, such as editing or extracting subtitles.

[0101] According to the sequence of the start time of each subtitle in the second subtitle entry, the subtitles in the second subtitle entry and the start time and end time of the subtitle appearing in the target video are sequentially stored in the subtitle library.

[0102] In this embodiment, the start time of each subtitle in the second subtitle entry is used as the basis for sorting, and the subtitle content contained in the second subtitle entry and their corresponding start and end times in the target video are saved one by one in the subtitle library in order, ensuring that the subtitle information can be accurately recorded and stored in the order of appearance, which is convenient for subsequent subtitle retrieval.

[0103] like Figure 3 As shown in the figure, the subtitle content format in the subtitle library is: serial number + subtitle appearance timeline + subtitle content. In the subtitle library environment, users only need to enter the required lines (and support specified TV series), and the service will start the AIGC algorithm to conduct in-depth analysis of the input text. By comparing the information in the subtitle library, the time node where the user's input lines appear in the TV series is accurately located. Then, the system automatically captures the TV series screen at that time point and generates high-definition screenshots for users to download and use.

[0104] Figure 4 A schematic diagram of a process flow of another method for generating a video screenshot provided in an embodiment of the present application, such as Figure 4 As shown, the method specifically includes:

[0105] S401, obtaining the number of subtitles included in the first subtitle entry;

[0106] In this embodiment, the number of subtitles corresponding to the target line may be one or more, and the number of subtitles corresponding to the target line is obtained by acquiring the number of subtitles of the first subtitle entry corresponding to the target line.

[0107] S402: When the first subtitle entry includes a subtitle, taking a subtitle screenshot of the subtitle as a video screenshot corresponding to the target line;

[0108] In this embodiment, when the first subtitle entry includes only one subtitle, it means that the target line corresponds to a certain subtitle, and at this time, a subtitle screenshot of the subtitle is obtained as the video screenshot of the target line.

[0109] S403: when the first subtitle entry includes multiple subtitles, sequentially splicing the subtitle screenshots of the multiple subtitles according to the order of the start time of each subtitle in the first subtitle entry to obtain a subtitle superimposed screenshot;

[0110] In this embodiment, when the first subtitle entry contains multiple subtitles, the screenshots of these subtitles are sequentially spliced ​​and combined in order according to the start time sequence of each subtitle in the first subtitle entry, so as to produce a screenshot with subtitles superimposed. In the process of splicing and combining, the screenshots of each subtitle need to be arranged in chronological order to ensure that the superimposed screenshots can be presented in the original playback order, so that the subtitle superimposed screenshots can achieve the effect of video restoration.

[0111] S404: Using the subtitle overlay screenshot as the video screenshot corresponding to the target line.

[0112] It should be noted that the number of subtitle screenshots corresponding to each subtitle is determined based on the duration information of the video clip where the subtitle is located and the changes in the video screen. This is not a fixed value, but a variable value. Correspondingly, in the implementation process, all possible subtitle screenshots must be retained, and the subtitle screenshots of each subtitle must be arranged and combined to generate multiple different subtitle overlay screenshots containing all subtitle screenshots, ensuring that all possible situations can be covered when generating subtitle overlay screenshots, so that the final overlay screenshot can meet the screenshot requirements to the greatest extent.

[0113] Furthermore, after obtaining the subtitle overlay screenshot, in order to improve the visual effect and user experience of the subtitle overlay screenshot, the subtitle overlay screenshot is optimized, and the optimization is not limited to adjusting the brightness and contrast of the screenshot, removing possible noise or blur, and optimizing the display effect of the subtitles to ensure that the subtitles are clear and readable without affecting the overall beauty of the video screen. At the same time, watermarks, borders or other decorative elements can be added to the subtitle overlay screenshot according to user preferences or specific needs.

[0114] The video screenshot generation method provided in this embodiment determines the number of subtitles included in the target line, and performs different processing logic when the number of subtitles is one or more, so as to realize accurate and flexible video screenshot generation, and obtain a subtitle screenshot of a single subtitle or a subtitle splicing screenshot of multiple subtitles as a video screenshot of the target line. On the basis of realizing the video screenshot of the target line, the integrity and coherence of the screenshot are ensured, so that the screenshot finally generated can fully display the entire content of the target line in the video.

[0115] In an optional solution of this embodiment, the method further includes:

[0116] A semantic comparison is performed between the target lines and the subtitles in the subtitle library to determine candidate subtitle entries for the target lines in the target video, wherein the candidate subtitle entries include candidate subtitles corresponding to the target lines, and the candidate subtitles are used to generate candidate video screenshots corresponding to the target lines.

[0117] In this embodiment, when comparing the target lines with the subtitles in the subtitle library, semantic comparison can also be used. By performing semantic comparison between the target lines and the subtitles in the subtitle library, subtitle entries that are similar or related in meaning to the target lines can be more flexibly identified, rather than just a literal exact match. This is suitable for processing lines that have synonyms, near-synonyms, or are semantically similar but expressed differently. Through semantic comparison, the matching range can be significantly expanded, and the recognition accuracy can be improved, thereby generating more accurate and rich candidate video screenshots.

[0118] Specifically, when performing semantic comparison, natural language processing (NLP) technology can be introduced, such as word vector models (such as Word2Vec, BERT, etc.) to capture the semantic relationship between words. The above model can convert words into points in a high-dimensional vector space, so that words with similar semantics are closer in the vector space. By calculating the semantic similarity (such as cosine similarity) between the target lines and each subtitle in the subtitle library, the candidate subtitle entries that are semantically closest to the target lines can be screened out. After obtaining the candidate subtitle entries, the corresponding video clips are further extracted from the target video according to the start time and end time of these candidate subtitles, and the corresponding candidate video screenshots are generated; the screenshots will be used as multiple possible forms of expression of the target lines in the video for users to choose or further process.

[0119] It should be noted that in the process of comparing the target lines with the subtitle library, if the user does not specify a specific TV series, this embodiment is not limited to the subtitle library of a certain TV series, and can generate candidate video screenshots with similar subtitles of multiple TV series.

[0120] In the process of comparing the target lines with the subtitle library in this embodiment, if the user does not explicitly specify the specific name of the film or TV series, the matching will not be limited to the subtitle library of a specific film or TV series, but relevant subtitle information will be extracted from the subtitle libraries of multiple film and TV series to generate a series of candidate video screenshots similar to the target lines, so that the user can find the most suitable video screenshot among the screenshots of multiple film and TV series, providing the user with multiple choices.

[0121] In addition, in order to improve the user experience, this embodiment can also provide an intelligent recommendation function. According to the user's historical selections, preferences and current context information (such as the type and style of the target video), the candidate video screenshots that best meet the user's needs are intelligently recommended. By continuously optimizing the recommendation algorithm, it is ensured that the user can quickly and accurately find the best way to present the target lines in the video.

[0122] Figure 5 A process step diagram of a video screenshot generation device provided in an embodiment of the present application, such as Figure 5As shown, in the process of generating video screenshots, the user first needs to input the lines that the user needs to correspond to the video screenshots. After entering the lines, LLM (Large Language Model) analysis is performed, and the corresponding film and television subtitles are output based on the lines entered by the user to ensure that the generated video screenshots can closely match the user's needs. Then, the timeline corresponding to these film and television subtitles is obtained. The timeline indicates the exact time when each subtitle appears. The timeline can be used to accurately locate each key frame in the video, providing a basis for generating video screenshots. Further, professional video processing tools will be used to capture images in the video frame by frame in chronological order according to the obtained subtitle timeline, ensuring that each screenshot can accurately reflect the important moments in the film and television works, and finally these generated video screenshots are fed back to the user. The user can select and apply these screenshots.

[0123] Figure 6 A schematic diagram of the structure of another video screenshot generating device provided in an embodiment of the present application, such as Figure 6 As shown, the device specifically includes:

[0124] A first acquisition module 601 is used to acquire a first subtitle entry corresponding to a target speech in a target video, wherein the first subtitle entry includes all speech contents of the target speech;

[0125] A time determination module 602, configured to determine the start time and the end time of each subtitle in the first subtitle entry appearing in the target video;

[0126] A second acquisition module 603 is used to acquire the video segment corresponding to the subtitle in the target video based on the start time and the end time;

[0127] A screenshot selection module 604 is used to select a target video screen from the video clip as a subtitle screenshot of the subtitle;

[0128] The screenshot generation module 605 is used to generate a video screenshot of the target line using the subtitle screenshot of the subtitle.

[0129] In a possible implementation, the screenshot selection module 604 is also used to select a video frame at a start time from the video segment as a subtitle screenshot of the subtitles when the duration of the video segment is less than a first preset duration; and to select a first video frame corresponding to a first target time, or a second video frame corresponding to the first target time, from the video segment as a subtitle screenshot of the subtitles when the duration of the video segment is greater than the first preset duration.

[0130] In a possible implementation, the screenshot selection module 604 is also used to obtain a first video screen corresponding to a first target time in the video clip, and a second video screen corresponding to a second target time, and determine the screen similarity between the first video screen and the second video screen; when the screen similarity is lower than a first similarity threshold, the first video screen and the second video screen are selected as subtitle screenshots of the subtitles; when the screen similarity is higher than the first similarity threshold, the first video screen is selected as the subtitle screenshot of the subtitles.

[0131] In a possible implementation, the first acquisition module 601 is further used to compare the target lines with the subtitles in the subtitle library to determine the starting subtitles and ending subtitles corresponding to the target lines in the target video; and use the subtitle entries from the starting subtitles to the ending subtitles in the subtitle library as the first subtitle entries corresponding to the target lines in the target video.

[0132] In a possible implementation, the device further includes a subtitle storage module 606, which is used to obtain a second subtitle entry for the target video, wherein the second subtitle entry includes all subtitles for the target video; using the time of the start frame and the end frame of the subtitle in the target video as the start time and the end time of the subtitle appearing in the target video, respectively; and storing the subtitles in the second subtitle entry and the start time and the end time of the subtitle appearing in the target video in the subtitle library in sequence according to the sequence of the start time of each subtitle in the second subtitle entry.

[0133] In a possible implementation, the screenshot generation module 605 is further used to obtain the number of subtitles included in the first subtitle entry; when the first subtitle entry includes one subtitle, a subtitle screenshot of the subtitle is used as the video screenshot corresponding to the target line; when the first subtitle entry includes multiple subtitles, the subtitle screenshots of the multiple subtitles are sequentially spliced ​​in the order of the start time of each subtitle in the first subtitle entry to obtain a subtitle overlay screenshot; and the subtitle overlay screenshot is used as the video screenshot corresponding to the target line.

[0134] In one possible implementation, the device further includes a candidate module 607, which is used to perform a semantic comparison between the target lines and the subtitles in the subtitle library, and determine a candidate subtitle entry for the target lines in the target video, wherein the candidate subtitle entry includes a candidate subtitle corresponding to the target lines, and the candidate subtitles are used to generate a candidate video screenshot corresponding to the target lines.

[0135] The video screenshot generation device provided in this embodiment can be as follows Figure 6 The video screenshot generating device shown in , can execute as follows Figure 1-5 All the steps of video screenshot generation are implemented Figure 1-5 The technical effects generated by the video screenshots shown are shown in the figure. Figure 1-5 For the sake of brevity, the relevant description is not repeated here.

[0136] The device embodiments described above are merely illustrative, wherein 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 modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0137] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Figure 7 As shown, an embodiment of the present application provides an electronic device, including a processor 701, a communication interface 702, a memory 703 and a communication bus 704, wherein the processor 701, the communication interface 702, and the memory 703 communicate with each other through the communication bus 704; the memory 703 is used to store computer programs; the processor 701 is used to execute the program stored in the memory 703, and implement the steps of the video screenshot generation method provided by any of the above method embodiments:

[0138] Obtain a first subtitle entry corresponding to a target line in a target video, wherein the first subtitle entry includes all the line content of the target line; determine a start time and an end time of each subtitle in the first subtitle entry appearing in the target video; based on the start time and the end time, obtain a video clip corresponding to the subtitle in the target video; select a target video screen from the video clip as a subtitle screenshot of the subtitle; and generate a video screenshot of the target line using the subtitle screenshot of the subtitle.

[0139] In one possible implementation, when the duration of the video segment is less than a first preset duration, a video frame at the start time is selected from the video segment as a subtitle screenshot of the subtitles; when the duration of the video segment is greater than the first preset duration, a first video frame corresponding to a first target time, or a second video frame corresponding to the first video frame and a second target time is selected from the video segment as a subtitle screenshot of the subtitles.

[0140] In one possible implementation, a first video screen corresponding to a first target time and a second video screen corresponding to a second target time in the video clip are obtained, and the screen similarity between the first video screen and the second video screen is determined; when the screen similarity is lower than a first similarity threshold, the first video screen and the second video screen are selected as subtitle screenshots of the subtitles; when the screen similarity is higher than the first similarity threshold, the first video screen is selected as the subtitle screenshot of the subtitles.

[0141] In one possible implementation, the target lines are compared with the subtitles in a subtitle library to determine the starting subtitles and ending subtitles corresponding to the target lines in the target video; and the subtitle entries from the starting subtitles to the ending subtitles in the subtitle library are used as the first subtitle entries corresponding to the target lines in the target video.

[0142] In a possible implementation, a second subtitle entry of a target video is obtained, wherein the second subtitle entry includes all subtitles of the target video; the time of the start frame and the end frame of the subtitle in the target video are used as the start time and the end time of the subtitle appearing in the target video, respectively; and the subtitles in the second subtitle entry and the start time and the end time of the subtitle appearing in the target video are stored in a subtitle library in sequence according to the sequence of the start times of the subtitles in the second subtitle entry.

[0143] In one possible implementation, the number of subtitles included in the first subtitle entry is obtained; when the first subtitle entry includes one subtitle, a subtitle screenshot of the subtitle is used as the video screenshot corresponding to the target line; when the first subtitle entry includes multiple subtitles, the subtitle screenshots of the multiple subtitles are sequentially spliced ​​in the order of the start time of each subtitle in the first subtitle entry to obtain a subtitle overlay screenshot; and the subtitle overlay screenshot is used as the video screenshot corresponding to the target line.

[0144] In one possible implementation, a semantic comparison is performed between the target lines and the subtitles in the subtitle library to determine candidate subtitle entries for the target lines in the target video, wherein the candidate subtitle entries include candidate subtitles corresponding to the target lines, and the candidate subtitles are used to generate candidate video screenshots corresponding to the target lines.

[0145] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0146] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0147] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for generating video screenshots, It is characterized in that include: Obtaining a first subtitle entry corresponding to a target line in a target video, wherein the first subtitle entry includes all line contents of the target line; Determine the start time and end time of each subtitle in the first subtitle entry appearing in the target video; Based on the start time and the end time, obtain the video segment corresponding to the subtitle in the target video; Selecting a target video screen from the video clip as a subtitle screenshot of the subtitle; The subtitle screenshot of the subtitle is used to generate a video screenshot of the target line.

2. The method according to claim 1, It is characterized in that The step of selecting a target video screen from the video clip as a subtitle screenshot of the subtitle includes: When the duration of the video segment is less than a first preset duration, selecting a video screen at a start time from the video segment as a subtitle screenshot of the subtitle; When the duration of the video clip is greater than the first preset duration, a first video frame corresponding to the first target time, or a second video frame corresponding to the first video frame and the second target time is selected from the video clip as a subtitle screenshot of the subtitle.

3. The method according to claim 2, It is characterized in that The selecting, from the video clip, a first video frame corresponding to a first target time, or a second video frame corresponding to the first video frame and a second target time, as a subtitle screenshot of the subtitle, includes: Acquire a first video frame corresponding to a first target time and a second video frame corresponding to a second target time in the video segment, and determine a frame similarity between the first video frame and the second video frame; When the picture similarity is lower than a first similarity threshold, selecting the first video picture and the second video picture as subtitle screenshots of the subtitles; When the picture similarity is higher than a first similarity threshold, the first video picture is selected as a subtitle screenshot of the subtitle.

4. The method according to claim 1, It is characterized in that The step of obtaining a first subtitle entry corresponding to a target line in a target video includes: Compare the target lines with the subtitles in the subtitle library to determine the start subtitle and the end subtitle corresponding to the target lines in the target video; The subtitle entries from the start subtitle to the end subtitle in the subtitle library are used as the first subtitle entries corresponding to the target lines in the target video.

5. The method according to claim 1, It is characterized in that Before determining the start time and end time of each subtitle in the first subtitle entry appearing in the target video, the method further includes: Acquire a second subtitle entry of a target video, where the second subtitle entry includes all subtitles of the target video; The time of the start frame and the end frame of the subtitle in the target video are respectively used as the start time and the end time of the subtitle appearing in the target video; According to the sequence of the start time of each subtitle in the second subtitle entry, the subtitles in the second subtitle entry and the start time and end time of the subtitle appearing in the target video are sequentially stored in the subtitle library.

6. The method according to claim 1, It is characterized in that The step of generating the video screenshot of the target line by using the subtitle screenshot of the subtitle includes: Obtaining the number of subtitles included in the first subtitle entry; In the case where the first subtitle entry includes a subtitle, taking a subtitle screenshot of the subtitle as a video screenshot corresponding to the target line; In the case where the first subtitle entry includes multiple subtitles, the subtitle screenshots of the multiple subtitles are sequentially spliced ​​according to the order of the start time of each subtitle in the first subtitle entry to obtain a subtitle superimposed screenshot; The subtitle overlay screenshot is used as the video screenshot corresponding to the target line.

7. The method according to claim 1, It is characterized in that The method further comprises: A semantic comparison is performed between the target lines and the subtitles in the subtitle library to determine candidate subtitle entries for the target lines in the target video, wherein the candidate subtitle entries include candidate subtitles corresponding to the target lines, and the candidate subtitles are used to generate candidate video screenshots corresponding to the target lines.

8. A video screenshot generating device, It is characterized in that include: A first acquisition module, configured to acquire a first subtitle entry corresponding to a target line in a target video, wherein the first subtitle entry includes all the content of the target line; A time determination module, used to determine the start time and end time of each subtitle in the first subtitle entry appearing in the target video; A second acquisition module, used for acquiring a video segment corresponding to the subtitle in the target video based on the start time and the end time; A screenshot selection module, used to select a target video screen from the video clip as a subtitle screenshot of the subtitle; A screenshot generation module is used to generate a video screenshot of the target line using the subtitle screenshot of the subtitle.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the steps of the video screenshot generation method according to any one of claims 1 to 7 are implemented.

10. A storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the video screenshot generation method according to any one of claims 1 to 7 are implemented.