Subtitle generation method, computer device, and computer-readable storage medium

By obtaining subtitle information and time point sequence, determining animation attribute information and generating target subtitle information, it solves the problem that a single subtitle cannot realize composite animation, and realizes the display of multiple animation effects of subtitles.

CN114697573BActive Publication Date: 2024-09-17SHENZHEN TCL NEW-TECH CO LTD
View PDF 14 Cites 0 Cited by

Patent Information

Application Number
CN202011630876.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-30
Publication Date
2024-09-17
Estimated Expiration
2040-12-30

AI Technical Summary

Technical Problem

In the existing technology, a single subtitle cannot achieve composite animation effects, such as subtitle displacement and color changes at the same time.

Method used

By obtaining the subtitle information and time point sequence in the subtitle file, the animation attribute information is determined, and the target attribute information is calculated based on this information, and finally the target subtitle information is generated to achieve subtitle display with various animation effects.

Benefits of technology

The composite animation effect of a single subtitle is realized, so that the subtitle can be animated with displacement and color change at the same time, which improves the animation performance ability of the subtitle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114697573B
    Figure CN114697573B
Patent Text Reader

Abstract

The present application relates to a subtitle generation method, a computer device, and a computer-readable storage medium, the method comprising: obtaining subtitle information in a subtitle file and a subtitle time point sequence corresponding to the subtitle information; determining animation attribute information corresponding to the subtitle information; determining target attribute information corresponding to the subtitle information according to the animation attribute information and the subtitle time point sequence; and determining target subtitle information corresponding to the subtitle information according to the subtitle information and the target attribute information. Since the target attribute information is first obtained according to the animation attribute information and the subtitle time point sequence, and then the target subtitle information is obtained according to the target attribute information and the subtitle information, and the animation attribute information reflects the attributes of the animation, then by changing the animation attribute information, a variety of different animations can be obtained, so that the target subtitle information contains a variety of different animations, and a single subtitle information can be used to display a composite animation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of subtitles, and in particular to a subtitle generation method, a computer device, and a computer-readable storage medium. Background Art

[0002] With the development of multimedia technology, subtitles are constantly being improved and updated. In addition to text display and image display, subtitles also need to achieve animation effects. The animation effects of subtitles include: subtitle displacement, subtitle color change, subtitle transparency change, etc.

[0003] In the prior art, a single subtitle can only display one animation effect, that is, after a displacement animation is added to a subtitle, another animation such as subtitle color change cannot be added, resulting in a single subtitle being unable to achieve composite animation.

[0004] Therefore, the prior art needs to be improved. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide a subtitle generation method, a computer device, and a computer-readable storage medium to enable a single subtitle to form a composite animation in view of the deficiencies of the prior art.

[0006] On the one hand, an embodiment of the present invention provides a subtitle generation method, comprising:

[0007] Obtaining subtitle information in a subtitle file and a subtitle time point sequence corresponding to the subtitle information;

[0008] Determining animation attribute information corresponding to the subtitle information;

[0009] Determining target attribute information corresponding to the subtitle information according to the animation attribute information and the subtitle time point sequence;

[0010] According to the subtitle information and the target attribute information, target subtitle information corresponding to the subtitle information is determined.

[0011] In a second aspect, an embodiment of the present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0012] Obtaining subtitle information in a subtitle file and a subtitle time point sequence corresponding to the subtitle information;

[0013] Determining animation attribute information corresponding to the subtitle information;

[0014] Determining target attribute information corresponding to the subtitle information according to the animation attribute information and the subtitle time point sequence;

[0015] According to the subtitle information and the target attribute information, target subtitle information corresponding to the subtitle information is determined.

[0016] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0017] Obtaining subtitle information in a subtitle file and a subtitle time point sequence corresponding to the subtitle information;

[0018] Determining animation attribute information corresponding to the subtitle information;

[0019] Determining target attribute information corresponding to the subtitle information according to the animation attribute information and the subtitle time point sequence;

[0020] According to the subtitle information and the target attribute information, target subtitle information corresponding to the subtitle information is determined.

[0021] Compared with the prior art, the embodiments of the present invention have the following advantages: since the target attribute information is first obtained according to the animation attribute information and the subtitle time point sequence, and then the target subtitle information is obtained according to the target attribute information and the subtitle information, and the animation attribute information reflects the attributes of the animation, then by changing the animation attribute information, a variety of different animations can be obtained, so that the target subtitle information contains a variety of different animations, and a single subtitle information can be used to display a composite animation. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] 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, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0023] Figure 1 is a schematic diagram of subtitle information and layers in an embodiment of the present invention;

[0024] Figure 2 is a schematic diagram of each frame of an animation in an embodiment of the present invention;

[0025] Figure 3 is a flowchart of a subtitle generating method according to an embodiment of the present invention;

[0026] Figure 4 1 is a diagram showing the internal structure of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION

[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0028] The inventor has found through research that with the development of multimedia technology, subtitles have been continuously improved and updated, and subtitles have evolved from conveying simple text information to conveying complex information. For example, subtitles based on the TTML2 standard, in addition to supporting the display of text content, the display of image content, and the playback of audio, also need to achieve animation effects. The animation effects of subtitles include: subtitle displacement, subtitle color change, subtitle transparency change, etc. However, for a single subtitle, after adding an animation, it is impossible to add another animation. For example, after adding a displacement animation to a subtitle, it is impossible to add a subtitle color change. It is impossible to achieve a subtitle that changes color while moving, resulting in the problem that a single subtitle cannot achieve composite animation.

[0029] In order to solve the above problem, in an embodiment of the present invention, the subtitle information in the subtitle file and the subtitle time point sequence corresponding to the subtitle information are first obtained; the animation attribute information corresponding to the subtitle information is determined; then, according to the animation attribute information and the subtitle time point sequence, the target attribute information corresponding to the subtitle information is determined; finally, according to the subtitle information and the target attribute information, the target subtitle information corresponding to the subtitle information is determined. Since the target attribute information is first obtained according to the animation attribute information and the subtitle time point sequence, and then the target subtitle information is obtained according to the target attribute information and the subtitle information, and the animation attribute information reflects the attributes of the animation, a variety of different animations can be obtained by changing the animation attribute information, so that the target subtitle information contains a variety of different animations, and a single subtitle information can be used to display a composite animation.

[0030] The embodiment of the present invention can be applied to the following scenario: obtaining subtitle information in a subtitle file and a subtitle time point sequence corresponding to the subtitle information through a terminal device, determining the animation attribute information corresponding to the subtitle information, and determining the target attribute information corresponding to the subtitle information according to the animation attribute information and the subtitle time point sequence; and determining the target subtitle information corresponding to the subtitle information according to the subtitle information and the target attribute information. It can be understood that the terminal device includes a desktop terminal or a mobile terminal, such as a desktop computer, a tablet computer, a laptop computer, a smart phone, a television, a projector, etc.

[0031] It should be noted that the above application scenarios are only shown to facilitate understanding of the present invention, and the embodiments of the present invention are not limited in this respect. On the contrary, the embodiments of the present invention can be applied to any applicable scenarios.

[0032] Various non-limiting embodiments of the present invention are described in detail below in conjunction with the accompanying drawings.

[0033] See also Figure 3 , shows a subtitle generation method in an embodiment of the present invention. In this embodiment, the subtitle generation method may include the following steps:

[0034] S1. Obtain subtitle information in a subtitle file and a subtitle time point sequence corresponding to the subtitle information.

[0035] Specifically, the subtitle information refers to information of texts displayed in the video. The function of the subtitle information is to display the voice content in text form to help users understand the content of the video. The subtitle information can be text subtitle information or graphic subtitle information. The subtitle file refers to a file carrying subtitle information. Specifically, the subtitle information can be parsed from the subtitle file, such as Figure 1 As shown in the figure, the subtitle information includes "B102-2_020" and "Left top and right bottom へスクロール(ロールアウトなし)".

[0036] The subtitle information may be animated subtitle information or non-animated subtitle information. Animated subtitle information refers to subtitle information that is active in the video, and non-animated subtitle information refers to subtitle information that is inactive in the video. For example, the activity mode of animated subtitle information includes: font color change, font size change, background color change, coordinate change, transparency change, etc. In the prior art, the activity mode of animated subtitle information is single, that is, animated subtitle information cannot realize composite animation, so animated subtitle information can be font color change, but cannot have both font color change and font size change. The subtitle information may be closed captions subtitle information, for example, using TTML (Timed Text Markup Language) subtitles, that is, the subtitle file is a TTML subtitle file.

[0037] In an implementation of this embodiment, the subtitle information includes: first subtitle information and second subtitle information; the first subtitle information is information of subtitles to be added with animation; the second subtitle information is information of subtitles without animation.

[0038] Specifically, the subtitle information is divided into two categories: one is the subtitle information that needs to be added with animation, namely, the first subtitle information; the other is the subtitle information that does not need to be added with animation, namely, the second subtitle information. Therefore, in the subsequent steps, it is only necessary to add animation to the first subtitle information, and it is not necessary to add animation to the second subtitle information. The first subtitle information and the second subtitle information are displayed using different layers. For example, a first layer and a second layer are created, the first subtitle information is displayed on the first layer, and the second subtitle information is displayed on the second layer. Therefore, when updating or adjusting the first subtitle information during a dynamic change process, only the first subtitle information displayed on the first layer is updated, and there is no need to update the second subtitle information displayed on the second layer, thereby simplifying the update process.

[0039] For example, the first subtitle information may be named P200-2, and the second subtitle information may be named P200-1, so as to distinguish the first subtitle information from the second subtitle information.

[0040] In an implementation of this embodiment, the subtitle time point sequence refers to a sequence of time points at which subtitle information is displayed, the subtitle information is displayed together with a video frame in a video, and the time points at which the subtitle information is displayed correspond to the time points at which the video frame is displayed in the video. The subtitle time point sequence includes: a plurality of subtitle time points that increase in sequence, the subtitle time points being the time points at which the subtitle information is displayed. A plurality of subtitle time points are sequentially arranged to form a subtitle time point sequence.

[0041] S2. Determine animation attribute information corresponding to the subtitle information.

[0042] Specifically, the animation attribute information refers to information about the activity properties of the animation. In one implementation of the present embodiment, as shown in Table 1, the animation attribute information includes: one or more of font color animation attribute information, font size animation attribute information, background color animation attribute information, coordinate animation attribute information, and transparency animation attribute information. Of course, in addition to font color change, font size change, background color change, coordinate change, and transparency change, the animation attribute can also be other animation attributes, such as rotation change, tilt change, etc. Therefore, when adding animation to the subtitle information, it is necessary to first determine the animation attribute information corresponding to the subtitle information. One animation or multiple animations can be added to the subtitle information. It is determined which animations are added to the subtitle information according to needs, so that the animation attribute information corresponding to the subtitle information can be determined.

[0043] Table 1 Animation attribute information table

[0044] Property name Property Value Animation Properties font-color #FF0000FF Font color change animation font-size 20px Font size change animation background-color #FFFF00FF Background color changing animation origin (0,0) Coordinate change animation opacity 50% Transparency change animation

[0045] For example, the subtitle information may be added with an animation of font size change, the subtitle information may be added with an animation of font color change, or the subtitle information may be added with animations of both font color change and font size change.

[0046] When adding animation to the subtitle information, linear animation or non-linear animation can be added. Linear animation refers to an animation with uniform change speed. For example, in the dynamic change process of transparency change animation, the transparency of the subtitle information changes uniformly over time. For example, as time changes, the transparency of the subtitle information gradually changes, specifically as follows: 10%, 20%, 30%, 40%, 50%, 60%. Of course, the time intervals between the transparency of each of the above subtitle information are the same. Non-linear animation refers to an animation with uneven change speed. For example, as time changes, the transparency of the subtitle information gradually changes, specifically as follows: 10%, 20%, 30%, 40%, 50%, 60%. Of course, the time intervals between the transparency of each of the above subtitle information are different.

[0047] Usually non-linear animation includes: frame-by-frame animation, which refers to animation that is played continuously frame by frame. The display time point of frame-by-frame animation can be adjusted as needed, and it does not need to be limited to the display time point like linear animation. Usually, the video is in the form of frame-by-frame animation, and the video frames are played continuously frame by frame to form a video.

[0048] In an implementation of this embodiment, S2, determining the animation attribute information corresponding to the subtitle information, includes:

[0049] S21. Determine animation attribute information corresponding to the first subtitle information.

[0050] Specifically, the first subtitle information and the second subtitle information are displayed using different layers.

[0051] Specifically, since the subtitle information is divided into the first subtitle information and the second subtitle information, and the first subtitle information requires additional animation, while the second subtitle information does not require additional animation, when determining the animation attribute information corresponding to the subtitle information, it is only necessary to determine the animation attribute information corresponding to the first subtitle information.

[0052] S3. Determine target attribute information corresponding to the subtitle information according to the animation attribute information and the subtitle time point sequence.

[0053] Specifically, the target attribute information refers to the information of the activity nature of the target animation. Since the animation added to the subtitle information is not directly added, but the added animation needs to be adjusted to form the target animation, the target animation refers to the animation adjusted according to the animation to be added. Specifically, after the animation attribute information corresponding to the subtitle information is determined, it is necessary to determine the target attribute information corresponding to the subtitle information according to the animation attribute information and the subtitle time point sequence. When the animation is added to the subtitle information, the time point of the change of the added animation is not consistent with the time point of the display of the subtitle information. For example, the added animation has 50 time points in 1 second, that is, 50 frames of images are displayed in 1 second to form the animation (then the frame rate of the animation is 50 frames / second), and the subtitle information has 24 time points in 1 second, that is, 24 frames of images are displayed in 1 second to form the subtitle information (then the frame rate of the subtitle information is 24 frames / second). Of course, the frame rate of the subtitle information can be determined according to the frame rate of the video frame in the video. For example, the frame rate of the subtitle information is equal to the frame rate of the video frame in the video. Obviously, the frame rate of the additional animation is higher, and the frame rate of the subtitle information is lower. When the animation is added to the subtitle information, the additional animation does not need to have such a high display frame rate, as long as the frame rate of the subtitle information is satisfied. On the contrary, if the frame rate of the additional animation is lower, and the frame rate of the subtitle information is higher, that is, the display frame rate of the additional animation is too low, and the display frame rate of the additional animation needs to be increased so that the display frame rate of the additional animation is the same as the display frame rate of the subtitle information.

[0054] When adding animation to the subtitle information, the animation attribute information needs to be adjusted. Therefore, the target attribute information corresponding to the subtitle information is determined according to the animation attribute information and the subtitle time point sequence.

[0055] It should be noted that when multiple animations are added to the subtitle information, the time points of the changes in the multiple animations are not completely consistent, that is, the frame rates of different animations are also different. Therefore, each animation and the subtitle information also need to use a unified frame rate. Therefore, when determining the target attribute information corresponding to the subtitle information based on the animation attribute information and the subtitle time point sequence, the frame rates of the animations can also be unified.

[0056] In order to simplify the process of adding animation to subtitle information, linear animation is degraded into frame animation. Then the animation added to the subtitle information is in the form of frame animation. Unifying the animation added to the subtitle information into frame animation makes it easier to update and simplifies the animation adjustment process. Linear animation includes three elements: starting time point, ending time point, and animation interval. In the linear animation degradation process, the linear animation can be anchored on the timeline according to the starting time point, ending time point, and animation interval, so as to split the linear animation into multiple frames, thus forming a frame animation.

[0057] It should be noted that, since the animation intervals and key frame positions of different linear animations are different, the frame animations obtained by degenerating different linear animations are not completely the same.

[0058] In an implementation of this embodiment, the animation attribute information includes: an animation attribute value sequence and an animation time point sequence corresponding to the animation attribute value sequence; the target attribute information includes: a target attribute value sequence and a target time point sequence corresponding to the target attribute value sequence.

[0059] Specifically, the animation attribute value sequence refers to a sequence formed by the arrangement of animation attribute values ​​corresponding to each state in the dynamic change process of the animation, and the animation time point sequence refers to a sequence formed by the arrangement of animation time points corresponding to each state in the dynamic change process of the animation. Each state in the dynamic change process of the animation corresponds to a frame, and each frame has an animation attribute value and an animation time point. The target attribute value sequence refers to a sequence formed by the arrangement of target attribute values ​​corresponding to each state in the dynamic change process of the target animation. The target time point sequence refers to a sequence formed by the arrangement of target time points corresponding to each state in the dynamic change process of the target animation.

[0060] It can be understood that the animation attribute value sequence includes: a number of animation attribute values; the animation time point sequence includes: a number of animation time points; each animation attribute value corresponds to each animation time point. The target attribute value sequence includes: a number of target attribute values; the target time point sequence includes: a number of target time points; each target attribute value corresponds to each target time point.

[0061] For example, Figure 2As shown in the figure, there are n frames between the start frame Anim 1start of the first animation and the end frame Anim1 end of the first animation, and Anim1 slice n represents the nth frame of the first animation. There are n frames between the start frame Animm start of the mth animation and the end frame Anim m end of the mth animation, and Anim m slice n represents the nth frame of the mth animation. There are n frames between the start frame Anim'start of the target animation and the end frame Anim'end of the target animation, and Anim'slice n represents the nth frame of the target animation.

[0062] The frame of the first animation has an animation time point and an animation property value, so the first animation can form an animation time point sequence and an animation property value sequence. The frame of the second animation also has an animation time point and an animation property value, so the second animation can form an animation time point sequence and an animation property value sequence. The frame of the target animation also has an animation time point and an animation property value, so the target animation can also form a target time point sequence and a target property value sequence.

[0063] For example, the frame of the first animation has an animation time point and an animation attribute value. For example, the first animation is a coordinate change animation. The animation time point and animation attribute value of the starting frame of the first animation are respectively 00:00, (0, 0), the animation time point and animation attribute value of the first frame of the first animation are respectively 00:10, (10, 0), and the animation time point and animation attribute value of the second frame of the first animation are respectively 00:20, (20, 0). That is to say, after 10 unit time from the starting frame, the subtitle information moves 10 units in the x direction, and after another 10 unit time, the subtitle information moves another 10 units in the x direction.

[0064] The frame of the second animation also has an animation time point and animation attribute value. For example, the second animation is a transparency change animation. The animation time point and animation attribute value of the starting frame of the second animation are 00:02, 0% respectively. The animation time point and animation attribute value of the first frame of the second animation are 00:12, 10% respectively. The animation time point and animation attribute value of the second frame of the second animation are 00:22, 20% respectively. That is to say, after 10 unit times from the starting frame, the transparency of the subtitle information becomes 10%. After another 10 unit times, the transparency of the subtitle information becomes 20%.

[0065] In an implementation of this embodiment, step S3, determining target attribute information corresponding to the subtitle information according to the animation attribute information and the subtitle time point sequence, includes:

[0066] S31. Determine a target time point sequence corresponding to the subtitle information according to the animation time point sequence and the subtitle time point sequence.

[0067] S32: Determine a target attribute value sequence corresponding to the subtitle information according to the target time point sequence, the animation attribute value sequence and the animation time point sequence.

[0068] S33. Determine target attribute information corresponding to the subtitle information according to the target attribute value sequence and the target time point sequence.

[0069] Specifically, since the animation time point sequence of an animation is different from the subtitle time point sequence, and the animation time point sequences of different animations are not exactly the same, it is necessary to first determine the target time point sequence corresponding to the subtitle information based on the animation time point sequence and the subtitle time point sequence, thereby forming a target time point sequence based on the animation time point sequence of the animation and the subtitle time point sequence of the subtitle information.

[0070] It should be noted that the target attribute value sequence can be determined only after the target time point sequence is determined. Therefore, the target time point sequence corresponding to the subtitle information is first determined based on the animation time point sequence and the subtitle time point sequence.

[0071] In an implementation of this embodiment, step S31, determining a target time point sequence corresponding to the subtitle information according to the animation time point sequence and the subtitle time point sequence, includes:

[0072] S311 . For each animation time point in the animation time point sequence, determine a target time point corresponding to the animation time point according to the animation time point and the subtitle time point sequence.

[0073] S312: Determine the target time point sequence corresponding to the subtitle information according to all the target time points.

[0074] Specifically, there are several animation time points in the animation time point sequence, and for each animation time point in the animation time point sequence, the target time point corresponding to the animation time point is determined according to the animation time point and the subtitle time point sequence. Specifically, the target time point is determined according to the time interval between the animation time point and the subtitle time point in the subtitle time point sequence.

[0075] When the time interval between the animation time point and the subtitle time point in the subtitle time point sequence is less than a first preset interval and the time interval between the animation time point and the subtitle time point in the subtitle time point sequence is greater than or equal to a second preset interval, the subtitle time point is used as the target time point. The first preset interval is greater than the second preset interval.

[0076] When the time interval between the animation time point and the subtitle time point in the subtitle time point sequence is less than the second preset interval, the animation time point is used as the target time point.

[0077] Specifically, the preset interval refers to a preset time interval, the first preset interval is greater than the second preset interval, and the first preset interval can be determined based on the minimum time interval between two adjacent subtitle time points in the subtitle time point sequence, for example, the second preset interval is 1 / 10 of the minimum time interval, and of course it can also be set to other values, for example, the second preset interval is 1 / 15 of the minimum time interval. The first preset interval can be determined based on the minimum time interval between two adjacent subtitle time points in the subtitle time point sequence, for example, the first preset interval is 1 / 2 of the minimum time interval, and of course it can also be set to other values, for example, the first preset interval is the minimum time interval.

[0078] From the above, it can be seen that when the time interval between the animation time point and the subtitle time point in the subtitle time point sequence is small (that is, the time interval is less than the second preset interval), the animation time point can be used as the target time point. Then the animation attribute value corresponding to the animation time point is not much different from the animation attribute value corresponding to the subtitle time point. Therefore, the animation attribute value corresponding to the animation time point can be directly used as the target attribute value corresponding to the target time point.

[0079] When the time interval between the animation time point and the subtitle time point in the subtitle time point sequence is large (that is, the first preset interval is greater than the time interval, and the time interval is greater than or equal to the second preset interval), the subtitle time point is used as the target time point. Then, the animation attribute value corresponding to the animation time point is greatly different from the animation attribute value corresponding to the subtitle time point. Therefore, it is necessary to calculate the animation attribute value corresponding to the subtitle time point, and the animation attribute value corresponding to the subtitle time point can be used as the target attribute value corresponding to the target time point.

[0080] In general, the target time point may be one of several subtitle time points, or may be an animation time point.

[0081] It should be noted that when the time interval between an animation time point and any subtitle time point in the subtitle time point sequence is greater than a first preset interval, the time point of the linear animation can be removed, and there is no need to determine the target time point corresponding to the animation time point. When there are a large number of animation time points in the animation time point sequence, there are multiple animation time points between two subtitle time points, and the animation time points in the middle of the multiple animation time points can be removed.

[0082] For example, Figure 2As shown, the animation time point of the start frame of the second animation is: 00:02, the animation time point of the first frame of the second animation is: 00:12, and the animation time point of the second frame of the second animation is: 00:22. The letter time points in the subtitle time point sequence are: 00:00, 00:10, 00:21, 00:32. The minimum time interval between two adjacent subtitle time points in the subtitle time point sequence is 10, the first preset interval is 10, and the second preset interval is 2. The time interval between the animation time point 00:02 of the start frame of the second animation and the subtitle time point 00:00 is 2, that is, the time interval is equal to the second preset interval, so the subtitle time point 00:00 can be used as the target time point. The animation time point of the first frame of the second animation is: The time interval between the animation time point 00:12 and the subtitle time point 00:10 is 2, that is, the time interval is equal to the second preset interval, so the subtitle time point 00:10 can be used as the target time point. The animation time point of the second frame of the second animation is 00:22, and the time interval between the subtitle time point 00:21 is 1<the second preset interval, so the animation time point 00:22 of the second frame of the second animation can be used as the target time point.

[0083] In an implementation of this embodiment, step S32, determining a target attribute value sequence corresponding to the subtitle information according to the target time point sequence, the animation attribute value sequence and the animation time point sequence, includes:

[0084] S321. Determine a starting animation attribute value of the animation attribute value sequence and a starting time point of the animation time point sequence.

[0085] S322. For each animation attribute value in the animation attribute value sequence, determine a target attribute value corresponding to the animation attribute value according to the animation attribute value, the animation time point corresponding to the animation attribute value, the target time point corresponding to the animation attribute value, the starting time point, and the starting animation attribute value.

[0086] S323. Determine the target attribute value sequence according to all the target attribute values.

[0087] Specifically, the starting animation attribute value refers to the first animation attribute value in the animation attribute value sequence, and the starting time point refers to the first time point in the animation time point sequence. First, determine the starting animation attribute value of the animation attribute value sequence and the starting time point of the animation time point sequence. Figure 2 As shown, the first animation is a coordinate change animation, and the animation time point and animation attribute value of the first animation's starting frame are: 00:00, (0, 0). The second animation is a transparency change animation, and the animation time point and animation attribute value of the second animation's starting frame are: 00:02, 0%.

[0088] Then, for each animation attribute value in the animation attribute value sequence, a target attribute value corresponding to the animation attribute value is determined according to the animation attribute value, the animation time point corresponding to the animation attribute value, the target time point corresponding to the animation attribute value, the starting time point and the starting animation attribute value.

[0089] The second animation is a transparency change animation. The animation attribute value of the first frame in the animation attribute value sequence of the second animation is 10%. The animation time point corresponding to this animation attribute value is: 00:12. If the target time point corresponding to this animation attribute value is 00:10, the starting time point is 00:02, and the starting animation attribute value is 0%, since (target time point-starting time point) / (animation time point-target time point)=(target attribute value-starting attribute value) / (animation attribute value-target attribute value), that is, 8 / 2=(target attribute value-0%) / (10%-target attribute value), the target attribute value is 8%.

[0090] For another example, the animation attribute value of the second frame in the animation attribute value sequence of the second animation is 20%, and the animation time point corresponding to the animation attribute value is: 00:22. If the target time point corresponding to the animation attribute value is 00:20, the starting time point is 00:02, and the starting animation attribute value is 0%, since (target time point-starting time point) / (animation time point-target time point)=(target attribute value-starting attribute value) / (animation attribute value-target attribute value), that is, 18 / 2=(target attribute value-0%) / (20%-target attribute value), the target attribute value is 18%.

[0091] The first animation is a coordinate change animation. The animation time point and animation attribute value of the starting frame of the first animation are 00:00, (0, 0), and the animation time point and animation attribute value of the first frame of the first animation are 00:10, (10, 0). Taking this animation time point as the target time point, the target time point is 00:10 and the target attribute value is (10, 0).

[0092] The animation time point and animation attribute value of the second frame of the first animation are respectively: 00:20, (20, 0). Taking this animation time point as the target time point, the target time point is 00:20, and the target attribute value is (20, 0).

[0093] In summary, the target animation is an animation of coordinate changes and transparency changes. The animation time point and animation attribute value of the starting frame of the target animation are: 00:00, 0%; the animation time point and animation attribute value of the first frame of the target animation are: 00:10, {(10, 0), 8%}; the animation time point and animation attribute value of the second frame of the target animation are: 00:20, {(20, 0), 18%}. That is to say, after 10 unit times from the starting frame, the transparency of the subtitle information becomes 8%, and after another 10 unit times, the transparency of the subtitle information becomes 18%, thereby achieving the addition of two animations (the coordinate change animation and the transparency change animation) to the subtitle information.

[0094] After all the target attribute values ​​are obtained, the target attribute value sequence may be determined according to all the target attribute values.

[0095] S4. Determine target subtitle information corresponding to the subtitle information according to the subtitle information and the target attribute information.

[0096] Specifically, after obtaining the subtitle information and the target attribute information, the target subtitle information corresponding to the subtitle information can be determined according to the subtitle information and the target attribute information. The obtained target subtitle information can be directly rendered by a subtitle control module and displayed on the screen.

[0097] It should be noted that in the prior art, when adding animation to subtitle information, the subtitle information is usually rendered first, then placed in an animation thread, and the display coordinates of the rendered subtitle information are modified by the animation thread at regular intervals, and redisplayed on the screen, thereby achieving a coordinate change animation effect. In the present application, target subtitle information is obtained based on the subtitle information and the target attribute information, and the obtained target subtitle information can be directly rendered by the subtitle control module and displayed on the screen, that is, the subtitle information is redrawn, so the subtitle information can be adjusted according to demand to obtain different target subtitle information, which is more flexible.

[0098] Step S4, determining the target subtitle information corresponding to the subtitle information according to the subtitle information and the target attribute information, including:

[0099] S41, for each target time point in the target time point sequence, determine the target subtitle corresponding to the target time point according to the target time point, the target attribute value corresponding to the target time point and the subtitle information.

[0100] S42: Obtain target subtitle information corresponding to the subtitle information according to all the target subtitles.

[0101] Specifically, for each target time point, the target subtitle corresponding to the target time point is determined according to the target time point, the target attribute value corresponding to the target time point and the subtitle information. Then, according to all the target subtitles, the target subtitle information corresponding to the subtitle information is obtained. The target subtitle includes: the target time point, the target attribute value and the subtitle information, and the target subtitle can be displayed as a frame of the target animation.

[0102] In one embodiment, the present invention provides a computer device, which may be a terminal, and the internal structure is as follows: Figure 4 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a subtitle generation method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0103] Those skilled in the art will understand that Figure 4 What is shown is only a block diagram of a portion of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0104] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0105] Obtaining subtitle information in a subtitle file and a subtitle time point sequence corresponding to the subtitle information;

[0106] Determining animation attribute information corresponding to the subtitle information;

[0107] Determining target attribute information corresponding to the subtitle information according to the animation attribute information and the subtitle time point sequence;

[0108] According to the subtitle information and the target attribute information, target subtitle information corresponding to the subtitle information is determined.

[0109] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0110] Obtaining subtitle information in a subtitle file and a subtitle time point sequence corresponding to the subtitle information;

[0111] Determining animation attribute information corresponding to the subtitle information;

[0112] Determining target attribute information corresponding to the subtitle information according to the animation attribute information and the subtitle time point sequence;

[0113] According to the subtitle information and the target attribute information, target subtitle information corresponding to the subtitle information is determined.

[0114] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

Claims

1. A subtitle generation method, It is characterized in that The method comprises: Acquire subtitle information in a subtitle file and a subtitle time point sequence corresponding to the subtitle information; the subtitle information is attached with multiple animations; Determining animation attribute information corresponding to the subtitle information; Determining target attribute information corresponding to the subtitle information according to the animation attribute information and the subtitle time point sequence; Determining target subtitle information corresponding to the subtitle information according to the subtitle information and the target attribute information; The animation attribute information includes: an animation attribute value sequence and an animation time point sequence corresponding to the animation attribute value sequence; the target attribute information includes: a target attribute value sequence and a target time point sequence corresponding to the target attribute value sequence; The step of determining target attribute information corresponding to the subtitle information according to the animation attribute information and the subtitle time point sequence includes: Determining a target time point sequence corresponding to the subtitle information according to the animation time point sequence and the subtitle time point sequence; Determining a target attribute value sequence corresponding to the subtitle information according to the target time point sequence, the animation attribute value sequence and the animation time point sequence; Determining target attribute information corresponding to the subtitle information according to the target attribute value sequence and the target time point sequence; The subtitle time point sequence includes: a plurality of subtitle time points that increase in sequence, and the subtitle time points are time points at which the subtitle information is displayed; and determining the target time point sequence corresponding to the subtitle information according to the time point sequence and the subtitle time point sequence includes: For each animation time point in the animation time point sequence, determine the target time point corresponding to the animation time point according to the animation time point and the subtitle time point sequence; the target time point is a subtitle time point or an animation time point; when the time interval between the animation time point and the subtitle time point in the subtitle time point sequence is less than a first preset interval and the time interval between the animation time point and the subtitle time point in the subtitle time point sequence is greater than or equal to a second preset interval, take the subtitle time point as the target time point; wherein the first preset interval is greater than the second preset interval; when the time interval between the animation time point and the subtitle time point in the subtitle time point sequence is less than the second preset interval, take the animation time point as the target time point; The target time point sequence corresponding to the subtitle information is determined according to all the target time points.

2. The subtitle generation method according to claim 1, It is characterized in that The determining, according to the target time point sequence, the animation attribute value sequence and the animation time point sequence, a target attribute value sequence corresponding to the subtitle information comprises: Determine the starting animation attribute value of the animation attribute value sequence and the starting time point of the animation time point sequence; For each animation attribute value in the animation attribute value sequence, determining a target attribute value corresponding to the animation attribute value according to the animation attribute value, the animation time point corresponding to the animation attribute value, the target time point corresponding to the animation attribute value, the starting time point and the starting animation attribute value; The target attribute value sequence is determined according to all the target attribute values.

3. The subtitle generation method according to claim 2, It is characterized in that The determining, according to the subtitle information and the target attribute information, target subtitle information corresponding to the subtitle information includes: For each target time point in the target time point sequence, determining a target subtitle corresponding to the target time point according to the target time point, a target attribute value corresponding to the target time point, and the subtitle information; According to all the target subtitles, the target subtitle information corresponding to the subtitle information is obtained.

4. The subtitle generation method according to claim 1, It is characterized in that The subtitle information includes: first subtitle information and second subtitle information; the first subtitle information is information of subtitles to be added with animation; the second subtitle information is information of subtitles without animation; The determining of the animation attribute information corresponding to the subtitle information includes: Determine animation attribute information corresponding to the first subtitle information.

5. The subtitle generation method according to claim 4, It is characterized in that The first subtitle information and the second subtitle information are displayed using different layers.

6. The subtitle generation method according to any one of claims 1 to 5, It is characterized in that The animation attribute information includes: multiple of font color animation attribute information, font size animation attribute information, background color animation attribute information, coordinate animation attribute information and transparency animation attribute information.

7. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the subtitle generation method according to any one of claims 1 to 6 are implemented.

8. A computer-readable 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 subtitle generation method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Method and device for generating caption moving pictures with curve extension dynamic effect

    CN102118584A

  • Solving scheme for image-text flash relevance broadcast

    CN102737687A

  • Animation display device

    CN103098098A

  • Animation subtitle drawing method with changeable effect

    CN106657821A

  • Video caption generation method and device

    CN109788335A