Video template generation method, apparatus, and electronic device
By acquiring the video to be analyzed, performing transition detection and material recognition, and generating video templates, the problem of not being able to create the same type of video in the same application in the existing technology is solved, and the function of creating the same type of video directly in the same application is realized.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING ZITIAO NETWORK TECH CO LTD
- Filing Date
- 2023-01-20
- Publication Date
- 2026-07-03
AI Technical Summary
Existing short video apps do not directly support creating the same video for any other video; users need to switch to other dedicated editing apps.
By acquiring the video to be parsed, performing transition detection and material information recognition, and generating video templates, it is possible to create the same type of video within the same application.
It enables users to create video templates similar to any video directly within the same application, satisfying their needs for creating similar videos.
Smart Images

Figure CN116208808B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, specifically to a video template generation method, apparatus, and electronic device. Background Technology
[0002] When internet users see videos that interest them on mobile applications, they often have the desire to create similar videos. Most existing short video applications provide templates that support similar creation, but these templates require users to switch to other dedicated editing applications to produce them, and cannot directly support the creation of similar videos based on any given video. Summary of the Invention
[0003] This disclosure is provided to briefly introduce the concepts, which will be described in detail in the subsequent Detailed Description section. This disclosure is not intended to identify key or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0004] In a first aspect, embodiments of this disclosure provide a video template generation method, comprising: acquiring a video to be parsed; performing transition detection on the video to be parsed to obtain target transition information; determining material information based on the video to be parsed; and generating a video template corresponding to the video to be parsed based on the target transition information and the material information.
[0005] Secondly, this disclosure provides a video template generation apparatus, comprising: an acquisition unit for acquiring a video to be parsed; a detection unit for performing transition detection based on the video to be parsed to obtain target transition information; an identification unit for determining material information based on the video to be parsed; and a generation unit for generating a video template corresponding to the video to be parsed based on the target transition information and the material information.
[0006] Thirdly, embodiments of this disclosure provide an electronic device, including: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the video template generation method as described in the first aspect.
[0007] Fourthly, embodiments of this disclosure provide a computer-readable medium having a computer program stored thereon that, when executed by a processor, implements the steps of the video template generation method as described in the first aspect.
[0008] The video template generation method, apparatus, and electronic device provided in this disclosure involve: acquiring a video to be parsed; then, performing transition detection on the video to be parsed to obtain target transition information; subsequently, determining material information based on the video to be parsed; and finally, generating a video template corresponding to the video to be parsed based on the target transition information and the material information. This approach allows for the creation of identical videos for any given video. Attached Figure Description
[0009] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0010] Figure 1 This is a flowchart of an embodiment of the video template generation method according to the present disclosure;
[0011] Figure 2 This is a flowchart of yet another embodiment of the video template generation method according to the present disclosure;
[0012] Figure 3 This is a schematic diagram of an application scenario of the video template generation method disclosed herein;
[0013] Figure 4 This is a flowchart of another embodiment of the video template generation method according to the present disclosure;
[0014] Figure 5 This is a flowchart of an embodiment of detecting cut-scene video frames in the video template generation method according to the present disclosure;
[0015] Figure 6 This is a flowchart of an embodiment of identifying transition categories in the video template generation method according to the present disclosure;
[0016] Figure 7 This is a schematic diagram of an application scenario for identifying transition categories in the video template generation method disclosed herein;
[0017] Figure 8 This is a schematic diagram of an application scenario for detecting transition information in the video template generation method disclosed herein;
[0018] Figure 9 This is a schematic diagram of a structure of an embodiment of the video template generation apparatus according to the present disclosure;
[0019] Figure 10 These are exemplary system architecture diagrams to which the various embodiments of this disclosure can be applied;
[0020] Figure 11 This is a schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present disclosure. Detailed Implementation
[0021] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0022] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0023] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0024] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0025] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0026] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0027] Please refer to Figure 1 The diagram illustrates a flow 100 of an embodiment of a video template generation method according to the present disclosure. The video template generation method includes the following steps:
[0028] Step 101: Obtain the video to be parsed.
[0029] In this embodiment, the execution entity of the video template generation method can obtain the video to be parsed. Here, the execution entity can be a server, which can obtain videos that meet preset conditions (e.g., videos with more clicks than a preset click threshold, videos of a preset video type, etc.) as the videos to be parsed.
[0030] Step 102: Perform transition detection based on the video to be parsed to obtain target transition information.
[0031] In this embodiment, the aforementioned execution entity can obtain target transition information by performing transition detection based on the video to be parsed. A transition typically refers to the transition or transformation between scenes in a video. Transition information may include transition types, which may include, but are not limited to, at least one of the following: fade-in / fade-out, exit-from-picture / in-picture, wipe, flip, freeze frame, dissolve, multi-screen splitting, and using establishing shots. Transition information may also include the timestamp interval corresponding to the transition animation.
[0032] Here, the aforementioned execution entity can input the video to be parsed into a pre-trained transition recognition model to obtain the transition information in the video as the target line transition information. This transition recognition model can be used to characterize the correspondence between videos and the transition information within them.
[0033] It should be noted that if the video to be analyzed has multiple transitions, then the transition information for each transition can be obtained.
[0034] Step 103: Determine the material information based on the video to be parsed.
[0035] In this embodiment, the execution entity can determine the material information based on the video to be parsed. The video to be parsed is typically composed of various materials, such as emojis and filters. The execution entity can identify the emojis used in the video to be parsed and obtain an emoji identifier; it can also identify the filters used in the video to be parsed and obtain a filter identifier.
[0036] Step 104: Based on the target transition information and material information, generate a video template corresponding to the video to be parsed.
[0037] In this embodiment, the execution entity can generate a video template corresponding to the video to be parsed based on the target transition information and the material information. The execution entity can also use the target transition information and the material information to output a video template based on a preset template protocol and package it into a template resource package. The template protocol can utilize relevant video information, such as material information and transition information, to generate a video template corresponding to the video.
[0038] Here, the aforementioned template protocol typically specifies the materials (e.g., filters, emojis, etc.) that need to be added to the video template, as well as the types of transitions that need to be used.
[0039] The method provided in the above embodiments of this disclosure involves: acquiring a video to be parsed; then, performing transition detection on the video to be parsed to obtain target transition information; subsequently, determining material information based on the video to be parsed; and finally, generating a video template corresponding to the video to be parsed based on the target transition information and the material information. This approach allows for the creation of identical videos for any given video.
[0040] In some alternative implementations, the aforementioned material information may include at least one of the following: text information, audio information, special effects information, and sticker information.
[0041] The aforementioned text information may include text content. As an example, the aforementioned execution entity can use OCR (Optical Character Recognition) to recognize text information from the aforementioned video to be parsed. OCR text recognition typically refers to the process by which electronic devices examine characters printed on paper, determine their shape by detecting dark and light patterns, and then translate the shape into computer text using character recognition methods.
[0042] The audio information mentioned above is typically an audio file, which usually contains background music. If the video to be parsed contains human voices, then the audio file can also be a file containing both background music and human voices. As an example, the execution entity can call the open-source video processing tool FFmpeg (Fast Forward MPEG (Moving Picture Experts Group)) to extract the audio file from the video to be parsed. FFmpeg is an open-source computer program that can be used to record, convert, and stream digital audio and video.
[0043] The aforementioned special effects information may include the type of special effects and the corresponding timestamp range. Special effects generally refer to special effects created by computer software that do not typically occur in reality. The aforementioned execution entity can obtain the corresponding special effects information by inputting the video to be analyzed into a pre-trained special effects recognition model. The aforementioned special effects recognition model can be used to characterize the correspondence between the video and the special effects information appearing in the video.
[0044] The sticker information mentioned above can include the sticker category and the corresponding timestamp range. Stickers typically refer to decorative stickers added to a video. The execution entity can obtain the corresponding sticker information by inputting the video to be parsed into a pre-trained sticker recognition model. This sticker recognition model can be used to characterize the correspondence between the video and the sticker information of the stickers appearing in the video.
[0045] By identifying the text, audio, effects, stickers, and other material information in the video to be analyzed, the generated video using the video template can more closely resemble the presentation of the video to be analyzed.
[0046] In some optional implementations, the aforementioned text information may include at least one of the following: the timestamp interval corresponding to the text, the position coordinates corresponding to the text, the font, and the font size. That is, the executing entity can identify the timestamp interval, position coordinates, font, and font size corresponding to the text from the video to be parsed. Here, the timestamp interval typically refers to the timestamp interval when the text appears in the video, and the position coordinates can refer to the position coordinates of the text's bounding box. This method allows for the identification of richer text information, making the text information in the generated video template more closely match the text information in the video to be parsed.
[0047] Continue to refer to Figure 2 This illustrates a flow 200 of another embodiment of the video template generation method. Flow 200 of this video template generation method includes the following steps:
[0048] Step 201: In response to receiving a template generation request for the currently viewed video, the currently viewed video is identified as the video to be parsed.
[0049] In this embodiment, a user can browse videos (e.g., short videos on short video social media apps). If a user is interested in the currently viewed video and wants to generate a similar video, they can send a template generation request. As an example, a template generation icon can be displayed on the interface of the currently viewed video. The user can send a template generation request by triggering the icon.
[0050] If the execution entity of the video template generation method receives a template generation request for the currently viewed video, the execution entity can identify the currently viewed video as the video to be parsed.
[0051] Step 202: Obtain the video to be parsed.
[0052] Step 203: Perform transition detection based on the video to be parsed to obtain target transition information.
[0053] Step 204: Determine the material information based on the video to be parsed.
[0054] Step 205: Based on the target transition information and material information, generate a video template corresponding to the video to be parsed.
[0055] In this embodiment, steps 202-205 can be performed in a similar manner to steps 101-104, and will not be described again here.
[0056] Step 206: Generate a video using a video template.
[0057] In this embodiment, the executing entity can use the video template generated in step 205 to generate a video identical to the currently viewed video. As an example, after generating the video template, the user can choose to upload locally stored photos or videos, or they can take photos or videos in real time and upload them, thereby generating a similar video.
[0058] from Figure 2 It can be seen from this that, with Figure 1 Compared to the corresponding embodiments, the video template generation method in this embodiment, in process 200, embodies the steps of generating a video template for the video currently being viewed by the user and generating a similar video. Therefore, the solution described in this embodiment can satisfy a user's need for a replica of any video they are browsing.
[0059] See further Figure 3 , Figure 3 This is a schematic diagram illustrating an application scenario of the video template generation method according to this embodiment. Figure 3In this application scenario, when a user browses video 301 in a short video application, a "Generate Draft Template" icon 302 appears on the browsing interface. Clicking the "Generate Draft Template" icon 302 allows the currently viewed video 301 to be parsed. The parsing operation can include eight steps: audio track separation, video cuts, transition detection, video OCR, font recognition, font size recognition, special effects detection, and sticker detection. Audio segments can be extracted from video 301 through audio track separation; slot duration can be identified from video 301 through video cuts; after video cuts, transition animations can be identified from scene transition segments through transition detection; text content and text position can be identified from video 301 through video OCR; font recognition can identify the font of the text area; font size recognition can identify the font size of the text area; special effects detection can identify the special effects ID and the time interval when the special effects are displayed from video 301; sticker detection can identify the sticker ID and spatiotemporal position from video 301, that is, the position where the sticker is displayed and the time interval when it is displayed; finally, an editing template corresponding to video 301 can be generated using audio segments, slot durations, transition animations, text content and position, text fonts, text font sizes, special effects IDs and time intervals, and sticker IDs and spatiotemporal positions. If the user clicks the "Create a similar video" icon 303, a similar video can be generated using the generated video template.
[0060] Please refer to Figure 4 This illustrates a flow 400 of another embodiment of the video template generation method. Flow 400 of this video template generation method includes the following steps:
[0061] Step 401: Obtain the video to be parsed.
[0062] In this embodiment, step 401 can be performed in a similar manner to step 101, and will not be described again here.
[0063] Step 402: Perform cut-scene detection on the video to be analyzed to obtain cut-scene video frames.
[0064] In this embodiment, the execution entity of the video template generation method can perform clipping detection on the video to be parsed to obtain clipped video frames. Here, the execution entity can use the clipper clipping detection method to perform clipping detection on the video to be parsed. The detection steps of the clipper clipping detection method typically include: extracting image features from the video frames of the video to be parsed; for each video frame, determining the similarity between the video frame and adjacent video frames within the time window to obtain a correlation matrix; flattening the correlation matrix into a vector, inputting the vector into a pre-trained binary classification model (e.g., MLP (Multilayer Perceptron)) to obtain a classification result, which is used to indicate whether it is a clipped video frame. As an example, a classification result of "1" or "T" can be used to indicate that the video frame is a clipped video frame, and a classification result of "0" or "F" can be used to indicate that the video frame is not a clipped video frame.
[0065] Step 403: Based on the video frames of the cut scene, determine whether to use transition animation.
[0066] In this embodiment, the execution entity can determine whether to use transition animation based on the cut video frames detected in step 402. To make the transition between two scenes more natural, transition animation is usually used between the two scenes. However, there are also cases where transition animation is not used and the scene is switched directly from one scene to another. This scene switch can be called a hard cut.
[0067] Specifically, the aforementioned executing entity can determine the matching degree between the cut video frame and its adjacent frames. Here, the matching degree between the cut video frame and its adjacent frames can be the matching degree between the cut video frame and its preceding adjacent frame, the matching degree between the cut video frame and its following adjacent frame, or the average of the matching degrees between the cut video frame and its two preceding and following adjacent frames.
[0068] If the matching degree is greater than or equal to the preset matching degree threshold, it means that the difference between the two frames is relatively small. In this case, it can be determined that a transition animation is used, and step 404 is executed. If the matching degree is less than the above matching degree threshold, it means that the difference between the two frames is relatively large. In this case, it can be determined that a transition animation is not used.
[0069] Step 404: If transition animation is used, extract scene switching segments from the video to be parsed.
[0070] In this embodiment, if it is determined in step 403 that a transition animation is to be used, the execution entity can extract scene switching segments from the video to be parsed. The execution entity can extract a preset number of video frames before and after the cut video frame from the video to be parsed, and combine the preset number of video frames before and after the cut video frame with the cut video frame to form a scene switching segment.
[0071] As an example, the first five frames and the last five frames adjacent to the aforementioned cut-scene video frame can be extracted from the video to be analyzed, and the first five frames, the aforementioned cut-scene video frame, and the last five frames can be combined to form a scene switching segment.
[0072] It should be noted that the number of video frames extracted can be set according to the actual situation.
[0073] Step 405: Identify the transition category of the transition animation from the scene switching clips.
[0074] In this embodiment, the execution entity can identify the transition category of the transition animation from the scene switching segment. Specifically, the execution entity can input the scene switching segment into a pre-trained transition type recognition model to obtain the transition category of the transition animation. The transition type recognition model can be used to characterize the correspondence between the scene transition video and the transition type to which the scene transition video belongs.
[0075] Step 406: Determine the material information based on the video to be parsed.
[0076] Step 407: Based on the target transition information and material information, generate a video template corresponding to the video to be parsed.
[0077] In this embodiment, steps 406 and 407 can be performed in a similar manner to steps 103 and 104, and will not be described again here.
[0078] from Figure 4 It can be seen from this that, with Figure 1 Compared to the corresponding embodiments, the video template generation method in this embodiment, in its process 400, involves detecting video frames of cut scenes, determining whether transition animations are used, and, if so, capturing scene transition segments and identifying the transition type. Therefore, the solution described in this embodiment provides a method for transition category identification, improving the accuracy of transition category identification.
[0079] In some optional implementations, the execution entity can determine whether to use a transition animation based on the aforementioned cut-scene video frame in the following way: the execution entity can perform a difference operation on the cut-scene probability value corresponding to the aforementioned cut-scene video frame and the cut-scene probability value corresponding to the adjacent frame of the aforementioned cut-scene video frame. This difference operation is usually a first-order difference, which refers to the difference between two consecutive adjacent terms in a discrete function. When the independent variable changes from x to x+1, the change in the function y = y(x) Δyx = y(x+1) - y(x), (x = 0, 1, 2, ...) is called the first-order difference of the function y(x) at point x.
[0080] As an example, the aforementioned executing entity may determine the difference between the cut probability value corresponding to the cut video frame and the cut probability value corresponding to the previous adjacent frame of the cut video frame as the difference result; it may also determine the difference between the cut probability value corresponding to the cut video frame and the cut probability value corresponding to the next adjacent frame of the cut video frame as the difference result; or it may determine the average of the differences between the cut probability value corresponding to the cut video frame and the cut probability values corresponding to the two adjacent frames of the cut video frame as the difference result.
[0081] Next, based on the difference results, it can be determined whether to use a transition animation. Here, it can be determined whether the difference results are less than a preset difference threshold. If the difference results are less than the threshold, then it can be determined whether to use a transition animation. Because the cut probability value corresponding to the cut video frame during a hard cut differs significantly from the cut probability values corresponding to the preceding and following frames, the first-order difference result of the cut video frame is large during a hard cut transition, but small during a transition transition. This method allows for a more accurate determination of when to use a transition animation.
[0082] In some optional implementations, the execution entity can perform a difference operation on the cut probability value corresponding to the cut video frame and the cut probability value corresponding to the adjacent frame of the cut video frame in the following way, and determine whether to use the transition animation based on the difference result: The execution entity can determine the difference between the cut probability value corresponding to the cut video frame and the cut probability value corresponding to the previous video frame of the cut video frame as the first difference value, and determine the ratio of the first difference value to the cut probability value corresponding to the previous video frame as the first ratio value, that is, the first ratio value = (cut probability value corresponding to the cut video frame - cut probability value corresponding to the previous video frame) / cut probability value corresponding to the previous video frame. Next, the difference between the cut probability value corresponding to the aforementioned cut video frame and the cut probability value corresponding to the next video frame can be determined as the second difference. The ratio of the second difference to the cut probability value corresponding to the next video frame is then determined as the second ratio, i.e., the second ratio = (cut probability value corresponding to the cut video frame - cut probability value corresponding to the next video frame) / cut probability value corresponding to the next video frame. Then, the average of the first ratio and the second ratio can be determined as the difference result. Finally, the difference result can be compared with a preset difference threshold. If the difference result is less than the difference threshold, it can be determined that a transition animation is used. This method further improves the accuracy of determining when to use a transition animation.
[0083] In some optional implementations, after identifying the transition category of the transition animation from the aforementioned scene switching segments, the executing entity can obtain the overlap identifier corresponding to the transition type. The executing entity typically stores a mapping table between transition types and overlap identifiers, and can look up the overlap identifier corresponding to the transition type in this table. The overlap identifier is usually used to indicate whether the transition animation overlaps with the slot content. For example, an overlap identifier "1" or "T" indicates that the transition animation overlaps with the slot content; an overlap identifier "0" or "F" indicates that there is no overlap. The "dissolve" transition type gradually fades the preceding scene and gradually strengthens the following scene; therefore, the overlap identifier for the "dissolve" transition type is usually "1". The aforementioned video template can consist of multiple slots, and users can upload materials (e.g., images, videos, etc.) to fill the slots in the video template to generate a video. If the aforementioned overlap indicator indicates that the transition animation and the slot content overlap, the aforementioned execution entity can compensate for the duration of the aforementioned slot content.
[0084] As an example, if the duration of the content in the preceding slot is 2 seconds, the duration of the content in the following slot is 2 seconds, and there is a 0.5-second transition animation between the two slots, the actual rendered duration is 3.5 seconds (the 0.5-second transition animation duration is removed). To maintain the original video template duration of 4 seconds, if the transition animation overlaps with the content in the preceding slot, the preceding slot content needs to be compensated with 0.5 seconds of duration. This method maintains the original video template duration even with overlapping transitions.
[0085] Continue to refer to Figure 5 This illustrates a flowchart 500 of an embodiment of a video template generation method for detecting cut-scene video frames. The flowchart 500 for detecting cut-scene video frames includes the following steps:
[0086] Step 501: Determine the cut probability value corresponding to each video frame in the video to be parsed, and obtain the cut probability value sequence.
[0087] In this embodiment, the execution body of the video template generation method can determine the cut probability value corresponding to each video frame in the video to be parsed, and obtain a cut probability value sequence.
[0088] Specifically, for each video frame in the video to be parsed, the execution entity can determine the visual difference between that video frame and its adjacent video frames, obtaining a difference value. Then, it can obtain the cut probability value corresponding to the difference value. The execution entity can store a correspondence table containing the relationships between difference values and cut probability values, and can query the cut probability value corresponding to the difference value from the table. Subsequently, a sequence of cut probability values corresponding to the video frame sequence can be generated, where the video frame sequence is arranged in the order of the video frames in the video to be parsed from beginning to end.
[0089] Step 502: Smooth the sequence of cutting probability values.
[0090] In this embodiment, the execution entity can smooth the sequence of camera cut probability values. As an example, a moving window average smoothing algorithm can be used to smooth the sequence of camera cut probability values. The moving window average smoothing algorithm moves a smoothing window across the data and averages the results, thereby denoising the data.
[0091] Step 503: Based on the smoothed cut probability value sequence, determine the cut video frames from the video to be parsed.
[0092] In this embodiment, the execution entity can determine the cut video frame from the video to be parsed based on the smoothed cut probability value sequence.
[0093] Here, the aforementioned execution entity can compare the cut probability values in the cut probability value sequence with a preset probability value threshold, and extract at least one cut interval from the video frame sequence. Each cut interval consists of a series of consecutive video frames whose cut probability values are greater than the aforementioned probability value threshold. Subsequently, for each of the aforementioned at least one cut interval, the video frame corresponding to the largest cut probability value in that cut interval can also be determined as the cut video frame.
[0094] The method provided in the above embodiments of this disclosure obtains a sequence of cut-scene probability values by determining the cut-scene probability values corresponding to each video frame in the video to be parsed; then, the cut-scene probability value sequence is smoothed; and finally, the cut-scene video frames are determined from the video to be parsed based on the smoothed cut-scene probability value sequence. The smoothing operation reduces noise in the cut-scene probability values, thereby reducing the occurrence of missed or over-detection of cut-scene video frames.
[0095] In some optional implementations, the execution entity can determine the cut probability value corresponding to each video frame in the video to be parsed, obtaining a cut probability value sequence, by inputting the video frame sequence of the video to be parsed into a pre-trained shot segmentation detection model. The shot segmentation detection model can be used to characterize the correspondence between video frames and their corresponding cut probability values. Here, the shot segmentation detection model can be a TransNetV2 model. The input to the TransNetV2 model is a video. The TransNetV2 model compresses each frame of the video to a uniform small size, taking every 100 frames as a segment (but only taking the middle 50 frames, with the first and last 25 frames similar to overlap), and inputs this segment into the TransNetV2 model to obtain the probability of each frame being a boundary frame. After calculating the probability for the entire video segment, frames with a probability greater than a threshold (default is 0.5) are determined to be shot boundary frames. This method improves the accuracy of shot cut detection by using a shot segmentation detection model to detect cut video frames.
[0096] In some optional implementations, the execution entity can determine the cut-scene video frame from the video to be parsed based on the smoothed cut-scene probability value sequence as follows: The execution entity can obtain a target threshold and the window width of the sliding window used to smooth the cut-scene probability value sequence. The target threshold is typically the original threshold used by the shot segmentation detection model when determining whether a video frame is a cut-scene video frame. Then, the ratio of the target threshold to the window width can be determined as the updated threshold. For example, if the target threshold is 0.5 and the window width is 5, the updated threshold is 0.1. Then, the smoothed cut-scene probability value sequence can be compared with the updated threshold to determine the cut-scene video frame from the video to be parsed. Specifically, at least one video interval can be formed by selecting video frames from the video to be parsed whose smoothed cut-scene probability value is greater than the updated threshold. The video frame corresponding to the maximum smoothed cut-scene probability value can be selected from each video interval as the cut-scene video frame. In this way, the threshold for detecting cut-scene video frames can be adaptively adjusted after smoothing, thereby more accurately identifying the cut-scene video frames.
[0097] Please refer to Figure 6 This illustrates a process 600 for identifying transition categories in a video template generation method. The process 600 for identifying transition categories includes the following steps:
[0098] Step 601: Divide the scene transition segment into a preset first number of intervals.
[0099] In this embodiment, the execution body of the video template generation method can divide the scene switching segment into a preset first number of intervals. Here, the scene switching segment can be equally divided into the aforementioned first number of intervals, for example, into 10 intervals.
[0100] Step 602: For each interval obtained, select the target video frame from the interval, obtain the second set number of consecutive video frames after the target video frame, and perform a difference operation on the target video frame and the consecutive video frames to obtain a difference image.
[0101] In this embodiment, for each divided interval, the execution entity can select a target video frame from that interval. As an example, any video frame can be arbitrarily selected from that interval as the target video frame.
[0102] Next, a predetermined second number (e.g., 4) of consecutive video frames following the target video frame can be acquired. A difference operation can be performed between the target video frame and these consecutive video frames to obtain a difference image. The difference image is the image formed by subtracting images of the target scene at consecutive time points. In a broader sense, the difference image is defined as the difference between the images of the target scene at time points tk and tk+L. The difference image is obtained by subtracting images of the target scene at adjacent time points, thus revealing the transformation of the target scene over time.
[0103] Step 603: Input the difference images corresponding to the first number of intervals into the pre-trained transition type recognition model to obtain the transition category to which the transition animation belongs.
[0104] In this embodiment, the execution entity can input the difference images corresponding to the first number of intervals into a pre-trained transition type recognition model to obtain the transition category to which the transition animation belongs. The transition type recognition model can be used to characterize the correspondence between the difference images corresponding to video intervals and the transition types to which the video intervals belong.
[0105] Specifically, the aforementioned execution entity can concatenate the difference images corresponding to the first number of intervals along the channel dimension and input them into the aforementioned transition type recognition model. The aforementioned transition type recognition model can be a TSM (Temporal Shift Module), which moves channels forward and backward along the time dimension. After the movement, the information of adjacent frames is mixed with the information of the current frame. The convolution operation consists of shifting and multiplication accumulation. It shifts by ±1 in the time dimension and accumulates the multiplication from the time dimension to the channel dimension. This is equivalent to a temporal convolution with a kernel size of 3. In implementation, only the address pointer needs to be moved, not the data, thus ensuring efficiency.
[0106] The method provided in the above embodiments of this disclosure divides scene transition segments into multiple intervals. Then, for each interval, a target video frame is selected, and multiple consecutive video frames following the target video frame are obtained. A difference operation is performed between the target video frame and the consecutive video frames to obtain a difference image. Finally, the difference images corresponding to the first number of intervals are input into a pre-trained transition type recognition model (e.g., a TSM model) to obtain the transition category to which the transition animation belongs. This method identifies transition categories through temporal difference and the TSM model, ensuring both accuracy and efficiency in transition category recognition.
[0107] See also Figure 7 , Figure 7 This is a schematic diagram illustrating an application scenario of identifying transition categories in the video template generation method according to this embodiment. Figure 7In the application scenario, the scene transition segment indicated by icon 701 is divided into N equally divided intervals, resulting in S1, S2…SN. For each of the N intervals, the target video frame and the following four consecutive video frames are extracted from that interval, resulting in five consecutive video frames, as shown in icon 702. The five consecutive video frames corresponding to each interval are input into the two-dimensional convolutional neural network (2D Conv) shown in icon 703 to obtain the difference image corresponding to each interval. The difference images corresponding to each interval are concatenated along the channel dimension and then input into the time-shifting module (TSM) indicated by icon 704 to obtain the transition category to which the scene transition animation belongs.
[0108] See further Figure 8 , Figure 8 This is a schematic diagram illustrating an application scenario of detecting transition information in the video template generation method according to this embodiment. Figure 8 In this application scenario, video frames are extracted from the video to be parsed. Cut detection is then performed on these extracted frames. The cut detection steps include: predicting the cut probability value of a single video frame, smoothing the cut probability value, and determining the position of the cut video frame. Next, transition intervals are calculated, mainly including: distinguishing between hard cuts and transitions; if a transition animation is determined, a low threshold is used to define the transition interval. Finally, transition classification is performed, predicting the transition category using temporal difference and TSM models.
[0109] Further reference Figure 9 As an implementation of the methods shown in the above figures, this application provides an embodiment of a video template generation apparatus, which is similar to... Figure 1 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.
[0110] like Figure 9 As shown, the video template generation device 900 of this embodiment includes: an acquisition unit 901, a detection unit 902, a determination unit 903, and a generation unit 904. The acquisition unit 901 is used to acquire the video to be parsed; the detection unit 902 is used to perform transition detection based on the video to be parsed to obtain target transition information; the determination unit 903 is used to determine material information based on the video to be parsed; and the generation unit 904 is used to generate a video template corresponding to the video to be parsed based on the target transition information and the material information.
[0111] In this embodiment, the specific processing of the acquisition unit 901, detection unit 902, determination unit 903, and generation unit 904 of the video template generation device 900 can be referred to Figure 1 The corresponding steps are 101, 102, 103 and 104 in the embodiment.
[0112] In some optional implementations, the apparatus further includes a video determination unit (not shown in the figure) and a video generation unit (not shown in the figure). The video determination unit is used to determine the currently viewed video as the video to be parsed in response to receiving a template generation request for the currently viewed video. The video generation unit is used to generate a video using the video template.
[0113] In some optional implementations, the detection unit 902 is further configured to obtain target transition information by performing transition detection on the video to be parsed in the following manner: performing cut-scene detection on the video to be parsed to obtain cut-scene video frames; determining whether a transition animation is used based on the cut-scene video frames; if so, extracting scene switching segments from the video to be parsed; and identifying the transition category to which the transition animation belongs from the scene switching segments.
[0114] In some optional implementations, the detection unit 902 is further configured to perform cut-scene detection on the video to be parsed to obtain cut-scene video frames by: determining the cut-scene probability value corresponding to each video frame in the video to be parsed, and obtaining a cut-scene probability value sequence; smoothing the cut-scene probability value sequence; and determining the cut-scene video frames from the video to be parsed based on the smoothed cut-scene probability value sequence.
[0115] In some optional implementations, the detection unit 902 is further used to determine the cut probability value corresponding to each video frame in the video to be parsed in the following way, to obtain the cut probability value sequence: input the video frame sequence of the video to be parsed into a pre-trained shot segmentation detection model to obtain the cut probability value sequence corresponding to the video frame sequence.
[0116] In some optional implementations, the detection unit 902 is further configured to determine the cut-scene video frame from the video to be parsed based on the smoothed cut-scene probability value sequence in the following manner: obtaining a target threshold and the window width of the sliding window when smoothing the cut-scene probability value sequence, wherein the target threshold is the original threshold used to detect the cut-scene video frame; determining the ratio of the target threshold to the window width as the updated threshold; and comparing the smoothed cut-scene probability value sequence with the updated threshold to determine the cut-scene video frame from the video to be parsed.
[0117] In some optional implementations, the detection unit 902 is further configured to determine whether to use a transition animation based on the aforementioned cut-scene video frame by performing a difference operation on the cut-scene probability value corresponding to the aforementioned cut-scene video frame and the cut-scene probability value corresponding to the adjacent frame of the aforementioned cut-scene video frame, and determining whether to use a transition animation based on the difference result.
[0118] In some optional implementations, the detection unit 902 is further configured to perform a difference operation on the cut probability value corresponding to the cut video frame and the cut probability value corresponding to the adjacent frame of the cut video frame in the following manner, and determine whether to use a transition animation based on the difference result: determine the difference between the cut probability value corresponding to the cut video frame and the cut probability value corresponding to the previous video frame of the cut video frame as a first difference value, and determine the ratio of the first difference value to the cut probability value corresponding to the previous video frame as a first ratio value; determine the difference between the cut probability value corresponding to the cut video frame and the cut probability value corresponding to the next video frame of the cut video frame as a second difference value, and determine the ratio of the second difference value to the cut probability value corresponding to the next video frame as a second ratio value; determine the average of the first ratio value and the second ratio value as a difference result; if the difference result is less than a preset difference threshold, determine that a transition animation should be used.
[0119] In some optional implementations, the detection unit 902 is further configured to identify the transition category of the transition animation from the scene switching segment in the following manner: dividing the scene switching segment into a preset first number of intervals; for each interval, selecting a target video frame from the interval, obtaining a preset second number of consecutive video frames after the target video frame, performing a difference operation on the target video frame and the consecutive video frames to obtain a difference image; inputting the difference images corresponding to the first number of intervals into a pre-trained transition type recognition model to obtain the transition category of the transition animation.
[0120] In some optional implementations, the device further includes an overlap identifier acquisition unit (not shown in the figure) and a compensation unit (not shown in the figure). The overlap identifier acquisition unit is used to acquire the overlap identifier corresponding to the transition type, wherein the overlap identifier is used to indicate whether the transition animation overlaps with the slot content; the compensation unit is used to compensate for the duration of the slot content if the overlap identifier indicates that the transition animation overlaps with the slot content.
[0121] In some optional implementations, the aforementioned material information includes at least one of the following: text information, audio information, special effects information, and sticker information.
[0122] In some optional implementations, the above text information may also include at least one of the following: the timestamp interval corresponding to the text, the location coordinates corresponding to the text, the text font, and the text size.
[0123] Please refer to Figure 10 An exemplary system architecture 1000 is shown, to which embodiments of the video template generation method disclosed herein can be applied.
[0124] like Figure 10 As shown, system architecture 1000 may include terminal devices 10011, 10012, and 10013, network 1002, and server 1003. Network 1002 is used as a medium to provide communication links between terminal devices 10011, 10012, and 10013 and server 1003. Network 1002 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.
[0125] Users can use terminal devices 10011, 10012, and 10013 to interact with server 1003 via network 1002 to send or receive messages, etc. For example, server 1003 can send video editing templates to user terminal devices 10011, 10012, and 10013. Various communication client applications, such as short video applications, video editing applications, and instant messaging software, can be installed on terminal devices 10011, 10012, and 10013.
[0126] Users can browse short videos in short video applications using terminal devices 10011, 10012, and 10013. If a user sends a template generation request for the currently viewed video, terminal devices 10011, 10012, and 10013 can obtain the currently viewed video as the video to be parsed. Then, they can perform transition detection based on the video to be parsed to obtain target transition information. Next, they can determine the source material information based on the video to be parsed. Finally, based on the target transition information and the source material information, they can generate a video template corresponding to the video to be parsed. Users can then use the generated video template to create similar videos.
[0127] Terminal devices 10011, 10012, and 10013 can be either hardware or software. When terminal devices 10011, 10012, and 10013 are hardware, they can be various electronic devices with displays and supporting information interaction, including but not limited to smartphones, tablets, and laptops. When terminal devices 10011, 10012, and 10013 are software, they can be installed in the aforementioned electronic devices. They can be implemented as multiple software programs or software modules (e.g., multiple software programs or software modules used to provide distributed services) or as a single software program or software module. No specific limitations are imposed here.
[0128] Server 1003 can be a server providing various services. For example, it can be a backend server that parses the video to be parsed. Server 1003 can obtain the video to be parsed; then, it can perform transition detection based on the video to be parsed to obtain target transition information; subsequently, it can determine the material information based on the video to be parsed; finally, it can generate a video template corresponding to the video to be parsed based on the target transition information and the material information. When the video viewed by the user is a parsed video, the video template can be presented so that the user can create a similar video.
[0129] It should be noted that server 1003 can be either hardware or software. When server 1003 is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When server 1003 is software, it can be implemented as multiple software programs or software modules (e.g., used to provide distributed services), or as a single software program or software module. No specific limitations are made here.
[0130] It should also be noted that the video template generation method provided in this embodiment can be executed by terminal devices 10011, 10012, and 10013. In this case, the video template generation device can be set in terminal devices 10011, 10012, and 10013. The video template generation method can also be executed by server 1003. In this case, the video template generation device can be set in server 1003.
[0131] It should be understood that Figure 10 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0132] The following is for reference. Figure 11 It illustrates an electronic device suitable for implementing embodiments of the present disclosure (e.g., Figure 10 The diagram below shows the structure of the server or terminal device 1100. The terminal device in the embodiments of this disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 11 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of this disclosure.
[0133] like Figure 11As shown, electronic device 1100 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1101, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 1102 or a program loaded from storage device 1108 into random access memory (RAM) 1103. The RAM 1103 also stores various programs and data required for the operation of electronic device 1100. The processing device 1101, ROM 1102, and RAM 1103 are interconnected via bus 1104. Input / output (I / O) interface 1105 is also connected to bus 1104.
[0134] Typically, the following devices can be connected to I / O interface 1105: input devices 1106 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 1107 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1108 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1109. Communication device 1109 allows electronic device 1100 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 11 An electronic device 1100 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively. Figure 11 Each box shown can represent a device or multiple devices as needed.
[0135] Specifically, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 1109, or installed from storage device 1108, or installed from ROM 1102. When the computer program is executed by processing device 1101, it performs the functions defined in the methods of embodiments of this disclosure. It should be noted that the computer-readable medium described in embodiments of this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. The computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In embodiments of this disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In embodiments of this disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0136] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device. The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to: acquire the video to be parsed; perform transition detection based on the video to be parsed to obtain target transition information; determine material information based on the video to be parsed; and generate a video template corresponding to the video to be parsed based on the target transition information and the material information.
[0137] Computer program code for performing the operations of embodiments of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0138] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0139] The units described in the embodiments of this disclosure can be implemented in software or hardware. The described units can also be housed in a processor; for example, a processor may be described as including an acquisition unit, a detection unit, a determination unit, and a generation unit. The names of these units do not necessarily limit the specific unit; for example, an acquisition unit may also be described as a "unit that acquires the video to be parsed."
[0140] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in the embodiments of this disclosure.
Claims
1. A method of video template generation, characterized by, include: Get the video to be parsed; Target transition information is obtained by performing transition detection based on the video to be parsed; Determine the material information based on the video to be analyzed; Based on the target transition information and the material information, a video template corresponding to the video to be parsed is generated; as well as The step of obtaining target transition information based on the transition detection of the video to be parsed includes: The video to be analyzed is subjected to cut-scene detection to obtain cut-scene video frames; Based on the cut video frames, determine whether to use transition animation; If so, then extract the scene transition segment from the video to be parsed; Identify the transition category of the transition animation from the scene switching segments; and The step of detecting cut-scene frames in the video to be parsed includes: Determine the cut probability value corresponding to each video frame in the video to be parsed to obtain a cut probability value sequence; The sequence of cut-off probability values is smoothed. Based on the smoothed cut probability value sequence, the cut video frames are determined from the video to be analyzed; The step of identifying the transition category of the transition animation from the scene switching segment includes: The scene switching segment is divided into a preset first number of intervals; For each interval obtained, a target video frame is selected from the interval, and a preset second number of consecutive video frames are obtained after the target video frame. A difference operation is performed on the target video frame and the consecutive video frames to obtain a difference image. The difference images corresponding to the first number of intervals are input into a pre-trained transition type recognition model to obtain the transition category to which the transition animation belongs.
2. The method according to claim 1, characterized in that, Before obtaining the video to be parsed, the method further includes: In response to receiving a template generation request for the currently viewed video, the currently viewed video is identified as the video to be parsed; and After generating the video template corresponding to the video to be parsed based on the target transition information and the material information, the method further includes: Use the video template to generate a video.
3. The method according to claim 1, characterized in that, The step of determining the cut probability value corresponding to each video frame in the video to be parsed, and obtaining the cut probability value sequence, includes: The video frame sequence of the video to be parsed is input into a pre-trained shot segmentation and detection model to obtain the shot cut probability value sequence corresponding to the video frame sequence.
4. The method according to claim 1, characterized in that, The method of determining the cut-scene video frames from the video to be parsed based on the smoothed cut-scene probability value sequence includes: Obtain the target threshold and the window width of the sliding window when smoothing the cut probability value sequence, wherein the target threshold is the original threshold used to detect cut video frames; The ratio of the target threshold to the window width is determined as the updated threshold; The smoothed sequence of cut-scene probability values is compared with the updated threshold to determine the cut-scene video frames from the video to be parsed.
5. The method according to claim 1, characterized in that, The step of determining whether to use a transition animation based on the cut video frame includes: A difference operation is performed on the cut probability value corresponding to the cut video frame and the cut probability value corresponding to the adjacent frame of the cut video frame. Based on the difference result, it is determined whether to use the transition animation.
6. The method according to claim 5, characterized in that, The step of performing a difference operation on the cut probability value corresponding to the cut video frame and the cut probability value corresponding to the adjacent frame of the cut video frame, and determining whether to use a transition animation based on the difference result, includes: The difference between the cut probability value corresponding to the cut video frame and the cut probability value corresponding to the previous video frame is determined as the first difference value, and the ratio of the first difference value to the cut probability value corresponding to the previous video frame is determined as the first ratio value. The difference between the cut probability value corresponding to the cut video frame and the cut probability value corresponding to the next video frame is determined as the second difference value, and the ratio of the second difference value to the cut probability value corresponding to the next video frame is determined as the second ratio value. The average of the first ratio and the second ratio is determined as the difference result; If the difference result is less than a preset difference threshold, a transition animation is determined to be used.
7. The method according to claim 1, characterized in that, After identifying the transition category of the transition animation from the scene switching segment, the method further includes: Obtain the overlap identifier corresponding to the transition type, wherein the overlap identifier is used to indicate whether the transition animation overlaps with the slot content; If the overlap indicator indicates that the transition animation and the slot content overlap, the duration of the slot content will be compensated.
8. The method according to claim 1, characterized in that, The material information includes at least one of the following: text information, audio information, special effects information, and sticker information.
9. The method according to claim 8, characterized in that, The text information also includes at least one of the following: the timestamp interval corresponding to the text, the location coordinates corresponding to the text, the font of the text, and the font size of the text.
10. A video template generation device, characterized in that, include: The acquisition unit is used to acquire the video to be parsed; The detection unit is used to perform transition detection based on the video to be parsed to obtain target transition information; The determining unit is used to determine material information based on the video to be parsed; The generation unit is used to generate a video template corresponding to the video to be parsed based on the target transition information and the material information; as well as The detection unit is further configured to obtain target transition information based on the video to be parsed by performing transition detection in the following manner: The video to be analyzed is subjected to cut-scene detection to obtain cut-scene video frames; Based on the cut video frames, determine whether to use transition animation; If so, then extract the scene transition segment from the video to be parsed; Identify the transition category of the transition animation from the scene switching segments; and The detection unit is further configured to perform cut-scene detection on the video to be parsed to obtain cut-scene video frames in the following manner: Determine the cut probability value corresponding to each video frame in the video to be parsed to obtain a cut probability value sequence; The sequence of cut-off probability values is smoothed. Based on the smoothed cut probability value sequence, the cut video frames are determined from the video to be analyzed; The detection unit is further configured to identify the transition category of the transition animation from the aforementioned scene switching segments in the following manner: The scene switching segment is divided into a preset first number of intervals; For each interval obtained, a target video frame is selected from the interval, and a preset second number of consecutive video frames are obtained after the target video frame. A difference operation is performed on the target video frame and the consecutive video frames to obtain a difference image. The difference images corresponding to the first number of intervals are input into a pre-trained transition type recognition model to obtain the transition category to which the transition animation belongs.
11. An electronic device, characterized in that, include: One or more processors; Storage device, on which one or more programs are stored, When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-9.
12. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-9.