A subtitle display method and related apparatus
By splitting and recycling subtitle content on the client side, the problem of subtitles becoming longer or shorter in streaming subtitle display is solved, achieving efficient and smooth subtitle display and improving user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-27
- Publication Date
- 2026-03-24
AI Technical Summary
Existing technologies for streaming caption display suffer from problems such as captions becoming increasingly longer, impacting server efficiency, client display performance, and user experience, especially when the broadcaster is continuously outputting audio, causing the captions to suddenly shorten or jump.
By determining whether the new subtitle contains a sentence break marker on the client side, the new subtitle is split into historical subtitles and the current subtitle. When the number of lines in the subtitle display area meets the condition, the recycling logic is executed to retain the subtitle content in the actual screen as the new subtitle ending history, thus avoiding simply discarding the old subtitles.
It achieves accurate overlay and intelligent recycling of new subtitles in streaming subtitle display, improving server sending efficiency, client display performance and user experience, and avoiding abrupt subtitle transitions.
Smart Images

Figure CN121217880B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of subtitle display, in particular to a subtitle display method and related device. BACKGROUND
[0002] The streaming subtitle refers to the subtitle content sent by the server after voice recognition, which is a trapezoidal subtitle. The client receives the trapezoidal subtitle, and the subtitle content displayed on the client is continuously superimposed like a typing effect.
[0003] When displaying the streaming subtitle, not only the continuous superposition of the subtitle text needs to be considered, but also the recycling of the subtitle text. Therefore, how to accurately display the streaming subtitle is a technical problem to be solved by the person skilled in the art. SUMMARY
[0004] In view of the above problems, the present application provides a subtitle display method and related device to achieve the purpose of accurately displaying the streaming subtitle. The specific scheme is as follows:
[0005] The first aspect of the present application provides a subtitle display method, comprising:
[0006] In the case of receiving a new subtitle sent by the server, it is judged whether the new subtitle includes a punctuation mark or not;
[0007] In the case of not including the punctuation mark, the new subtitle is combined with the subtitle end history record to obtain the complete subtitle content to be displayed currently;
[0008] In the case of including the punctuation mark, the new subtitle is split into a history subtitle and a current subtitle based on the position of the punctuation mark in the new subtitle, and the history subtitle is combined with the subtitle end history record to obtain a new subtitle end history record;
[0009] The number of lines of the current subtitle display area is obtained;
[0010] In the case that the number of lines of the subtitle display area meets the subtitle recycling logic, the specified subtitle content in the new subtitle end history record is taken as an updated subtitle end history record;
[0011] The updated subtitle end history record and the current subtitle are combined to obtain the complete subtitle content to be displayed currently;
[0012] The complete subtitle content is displayed.
[0013] In a possible implementation, the new subtitle is combined with the subtitle end history record to obtain the complete subtitle content to be displayed currently, comprising:
[0014] Splice the new subtitle to the end of the subtitle end history record to obtain complete subtitle content to be displayed currently.
[0015] In a possible implementation, splitting the new subtitle into the history subtitle and the current subtitle based on the position of the punctuation mark in the new subtitle comprises:
[0016] Taking the position of the punctuation mark in the new subtitle as a split point, the new subtitle before the punctuation mark is taken as the history subtitle, and the new subtitle after the punctuation mark is taken as the current subtitle.
[0017] In a possible implementation, combining the subtitle end history record and the history subtitle to obtain a new subtitle end history record comprises:
[0018] In a case where the content of the subtitle end history record is empty, taking the history subtitle as the new subtitle end history record;
[0019] In a case where the content of the subtitle end history record is not empty, splicing the history subtitle to the end of the subtitle end history record to obtain the new subtitle end history record.
[0020] In a possible implementation, in a case where the number of lines of the subtitle display area meets the subtitle recycling logic, taking specified subtitle content in the new subtitle end history record as an updated subtitle end history record comprises:
[0021] In a case where the number of lines of the subtitle display area is greater than a preset line threshold, taking the latest specified number of lines of subtitle content in the new subtitle end history record as the updated subtitle end history record.
[0022] In a possible implementation, displaying the complete subtitle content comprises:
[0023] Obtaining a display position of a subtitle before the new subtitle;
[0024] Displaying the complete subtitle content after the display position.
[0025] The second aspect of the present application provides a subtitle display device, comprising:
[0026] A judging module is configured to judge whether a punctuation mark is included in a new subtitle in a case where the new subtitle is received from a server;
[0027] A first combining module is configured to combine the new subtitle and a subtitle end history record to obtain complete subtitle content to be displayed currently in a case where the punctuation mark is not included.
[0028] The second combination module is configured to split the new subtitle into a history subtitle and a current subtitle based on a position of the punctuation mark in the new subtitle, combine a subtitle end history record with the history subtitle, and obtain a new subtitle end history record in a case where the punctuation mark is included.
[0029] The acquisition module is configured to acquire a current number of lines of a subtitle display area.
[0030] The record updating module is configured to, in a case where the number of lines of the subtitle display area meets a subtitle recycling logic, combine specified subtitle content in the new subtitle end history record as an updated subtitle end history record.
[0031] The third combination module is configured to combine the updated subtitle end history record and the current subtitle to obtain complete subtitle content to be displayed.
[0032] The display module is configured to display the complete subtitle content.
[0033] The third aspect of the present application provides a client, comprising at least one processor and a memory connected to the processor, wherein:
[0034] The memory is configured to store a computer program.
[0035] The processor is configured to execute the computer program, so that the client can implement the subtitle display method.
[0036] The fourth aspect of the present application provides a subtitle display system, comprising a server and the client described above.
[0037] The server is configured to convert received speech into subtitles and send new subtitles in the converted subtitles to the client.
[0038] In a possible implementation, when the server is configured to convert received speech into subtitles, the server is specifically configured to:
[0039] perform speech recognition on the received speech to obtain corresponding subtitles; and in a case where a pause part is recognized in the speech, configure a punctuation mark corresponding to the pause part in the subtitles.
[0040] By means of the technical scheme, the application provides a subtitle display method and related device. In the application, when a new subtitle sent by a server is received, the complete subtitle content to be displayed is determined according to a judgment result of whether a punctuation mark is included in the new subtitle, and a corresponding display operation is performed, so that the new part in the new subtitle is continuously displayed like a typing effect on the basis of the original subtitle, and the purpose of accurately displaying a streaming subtitle is achieved. In addition, when the new subtitle includes the punctuation mark, the number of lines of a current subtitle display area is obtained, and when the number of lines of the subtitle display area meets a subtitle recycling logic, the subtitle recycling logic is executed, the specified subtitle content in the new subtitle end history record is taken as an updated subtitle end history record, and the problem of too much subtitle content displayed by the client is avoided. BRIEF DESCRIPTION OF DRAWINGS
[0041] The above and other features, advantages, and aspects of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals are used to refer to the same or similar elements. It should be understood that the drawings are schematic and elements and features are not necessarily to scale.
[0042] Figure 1 A flowchart of a subtitle display method provided by the application;
[0043] Figure 2 A scene schematic diagram of a subtitle display method provided by the application;
[0044] Figure 3 A subtitle display schematic diagram provided by the application;
[0045] Figure 4 Another subtitle display schematic diagram provided by the application;
[0046] Figure 5 A structural schematic diagram of a subtitle display device provided by the application;
[0047] Figure 6 A structural schematic diagram of a client provided by the application. DETAILED DESCRIPTION
[0048] The embodiments of the application are described below in conjunction with the accompanying drawings. The terms used in the embodiment part of the application are only used to explain the specific embodiments of the application, and are not intended to limit the application.
[0049] The embodiments of the application are described below in conjunction with the accompanying drawings. Those skilled in the art can know that, as technology develops and new scenarios appear, the technical solutions provided by the embodiments of the application are also applicable to similar technical problems.
[0050] The terms "first", "second", and the like in the description and in the claims of the present application and above drawings are used for distinguishing between similar objects and not necessarily for describing a specific sequential or chronological order. It is to be understood that the terms so used are interchangeable under appropriate circumstances and that the embodiments of the present application are capable of functioning in other sequences than described or otherwise illustrated herein. Moreover, the terms "comprise", "have" and any variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises, has or includes a list of elements is not necessarily limited to those elements, but can include other elements not expressly listed or inherent to such process, method, article, or apparatus.
[0051] The streaming subtitle refers to that the subtitle content sent by the server after voice recognition is a ladder-shaped subtitle, and the client receives the ladder-shaped subtitle, and the subtitle content displayed on the client is continuously displayed like a typing effect.
[0052] In the live real-time subtitle, the streaming subtitle function can be added, that is, the subtitle is not displayed one sentence at a time, but the display effect of the subtitle looks like a typing effect, and the words are displayed one by one and added to the back. The streaming subtitle needs to consider how to continuously add the subtitle text to the back, and set the subtitle recycling logic when the subtitle text is continuously lengthened. Therefore, when the streaming subtitle is displayed, how to splice the recognized subtitle from the server like a typing effect, and how to recycle the useless subtitle text, are technical problems that need to be considered.
[0053] Currently, when the streaming subtitle is displayed, the server and the client need to cooperate with each other, and the server sends the recognized subtitle content to the client in the format of the ladder-shaped subtitle. In the ladder-shaped subtitle, the content of the next sentence contains the content of the previous sentence. After the client receives the ladder-shaped subtitle, the content of the next sentence directly replaces the content of the previous sentence, thereby realizing the streaming subtitle effect.
[0054] This way of directly replacing the content of the previous sentence with the content of the next sentence has the following two problems:
[0055] The first problem is that if the host continuously outputs voice, the subtitle content will continuously lengthen, and if it lengthens to a certain extent, it will affect the efficiency of the server subtitle sending and the performance of the client display.
[0056] The second problem is that if the server-sent subtitle reaches a certain length and automatically restarts, there will be a process of suddenly shortening the subtitle, which is not good for user experience.
[0057] The third problem is that if the subtitle recycling logic is not designed, the client display performance problem will also exist. If the recycling logic is that the old subtitle is abandoned and the display of the new subtitle is restarted when the subtitle exceeds a certain length, the display effect will have a sudden jump and shortening of the subtitle content, and there is no continuous superposition effect.
[0058] To solve the above problems, in the embodiments of the present application, on the one hand, the subtitles are divided into old subtitles and new subtitles, so that the subtitles sent by the server can not be continuously superimposed, but are divided into different periods, and the server only needs to send new subtitles of new periods, which does not affect the server subtitle sending efficiency and the client display performance. At the same time, the client is prompted that the subtitle period has changed. Thus, the new subtitles can be divided into historical subtitles and current subtitles. On the other hand, the subtitle recycling logic is no longer simply discarded when it exceeds a certain length, but the displayed subtitle content on the actual screen is retained, the historical record beyond the screen is discarded, and the subtitle in the screen is retained as the historical record at the end of the new subtitle. This recycling method not only achieves the recycling effect, but also is imperceptible to the user, and there is no abrupt effect of jumping subtitles on the screen, and the experience is better.
[0059] On the basis of the above, an embodiment of the present application provides a subtitle display method, and the execution subject can be a client. Referring to Figure 1 , the subtitle display method comprises the following steps.
[0060] S11, receiving a new subtitle sent by a server.
[0061] The application scenario in the embodiment can be a live broadcast scene, and the server can perform a speech recognition operation on the speech output by the host in the live broadcast to obtain corresponding subtitles, and send the recognized subtitle content to the client in the form of a trapezoidal subtitle. The client can be a display terminal such as a mobile phone, a tablet computer, or a computer. In the trapezoidal subtitle, in one sentence breaking period (i.e. trapezoidal subtitle period), the next sentence subtitle contains the content of the previous sentence subtitle and adds some new content. Whenever the “ ” character is included in the incoming subtitle, it indicates that the sentence breaking starts from here, the front is a trapezoidal subtitle period, and the back is a new trapezoidal subtitle period. In an example, an example of the trapezoidal subtitle can be as follows.
[0062] The first sending is “That class”.
[0063] The second sending is “That class, mainly is”.
[0064] The third sending is “That class, mainly is want”.
[0065] The fourth sending: "want to let everyone".
[0066] The fifth sending: "want to let everyone understand".
[0067] The sixth sending: "want to let everyone understand Say the class".
[0068] The seventh sending: "say the class it".
[0069] The eighth sending: "say the class it's real".
[0070] ...
[0071] When the server identifies the voice, it can also identify whether the voice has a pause. In the actual scene, the host may have a pause in the middle of two sentences. For example, the host says "that is, this class mainly" and "want to let everyone understand" in the middle of the two sentences. At this time, the server can identify that the voice of the host has a pause part, so that the pause part corresponding to the punctuation mark can be configured in the generated subtitle. The punctuation mark can be the above-mentioned " character, in addition, other characters can also be used as punctuation marks, and specific characters can be configured according to actual conditions.
[0072] S12, judge whether the new subtitle includes the punctuation mark; if not, execute step S13; if yes, execute step S14.
[0073] The punctuation mark can be the above-mentioned " character. If there is no punctuation mark, it means that there is no punctuation at this time, there is no trapezoidal subtitle period change, and it is still in the original trapezoidal subtitle period. If there is a " character, it means that punctuation is involved at this time, and a new trapezoidal subtitle period is involved.
[0074] S13, combine the new subtitle and the subtitle end history record to obtain the complete subtitle content to be displayed at present.
[0075] The role of the subtitle end history record mLastSubEnd is to ensure the continuity of the subtitle streaming printing. The subtitle content of the previous trapezoidal subtitle period cannot be directly abandoned, otherwise the subtitle display will jump, but it should be continuously added to the back, so as to have the effect of streaming.
[0076] In particular, if there is no break mark, in the same trapezoidal subtitle period, the received new subtitle subtitle is added to the subtitle end history record mLastSubEnd to obtain the complete subtitle content displayText to be displayed at present. In an implementation, the new subtitle subtitle can be spliced after the subtitle end history record mLastSubEnd to obtain the complete subtitle content displayText to be displayed at present. The specific implementation is as shown in Figure 2
[0077] Still taking the trapezoidal subtitle sent by the server as described above, the first time:
[0078] The first time: "That class".
[0079] The second time: "That class is mainly".
[0080] The third time: "That class is mainly Want".
[0081] The fourth time: "Want everyone".
[0082] The fifth time: "Want everyone to understand".
[0083] The sixth time: "Want everyone to understand Say class".
[0084] The seventh time: "Say class it".
[0085] The eighth time: "Say class it is really".
[0086] ...
[0087] Take the above as an example for illustration.
[0088] At this time, when the first time the server sends the subtitle:
[0089] New subtitle subtitle: "That class".
[0090] Subtitle end history record mLastSubEnd: "none".
[0091] Final subtitle displayText: "That class".
[0092] When the second time the server sends the subtitle:
[0093] New subtitle subtitle: "That class is mainly".
[0094] Subtitle end history record mLastSubEnd: "none".
[0095] Final caption: "So this lecture is mainly about".
[0096] S14, based on the position of the punctuation mark in the new caption, split the new caption into historical caption and current caption, combine the historical caption with the caption end history record to obtain a new caption end history record.
[0097] Specifically, if there is a " character, it means that this time involves punctuation, and involves a new trapezoidal caption period. At this time, the new caption needs to be split into historical caption and current caption.
[0098] In an implementation manner, the position of the punctuation mark in the new caption can be taken as a split point, the caption before the punctuation mark in the new caption is taken as the historical caption, and the caption after the punctuation mark in the new caption is taken as the current caption.
[0099] In specific implementation, firstly, the " character is split before and after, the caption content before the " character is the historical caption beforeText, and the beforeText belongs to the last trapezoidal caption period, and the caption content after the " character is the current caption afterText, and the afterText belongs to the new trapezoidal caption period. Then, the existing caption end history record mLastSubEnd is combined with the historical caption beforeText to obtain a new caption end history record mLastSubEnd. In an implementation manner, in a case where the content of the caption end history record mLastSubEnd is empty, it is indicated that there is no caption end history record mLastSubEnd before, and the historical caption beforeText can be directly taken as the new caption end history record mLastSubEnd. In a case where the content of the caption end history record mLastSubEnd is not empty, the historical caption beforeText is spliced after the caption end history record mLastSubEnd to obtain the new caption end history record mLastSubEnd. The specific implementation is shown in
[0100] Figure 2
[0101] S15, obtain the current caption display area row number.
[0102] In the embodiment, in a case where the punctuation mark exists, a caption recycling strategy is introduced to uniformly perform caption recycling in the logic of the punctuation case in which the caption end history record needs to be updated.
[0103] In the determination of whether the caption recycling strategy is met, the current caption display area row number is obtained.
[0104] In a specific implementation, each time the subtitle display is performed, if the subtitles are always added backward (i.e., as the anchor voice is continuously output, the number of characters in the subtitles is continuously increasing), the history of the subtitles will be continuously increasing, the content will be longer and longer, which will affect the sending efficiency of the server and the display performance of the client. Therefore, the history of the subtitles needs to be recycled. Specifically, after the client performs the subtitle streaming printing each time, the current number of lines in the subtitle display area is recorded. The number of lines in the subtitle display area refers to the number of lines of the latest subtitles obtained before the newly received subtitles are added to the subtitles. The number of lines in the subtitle display area can be 5 lines, 10 lines, etc.
[0105] S16, in a case where the number of lines in the subtitle display area meets the subtitle recycling logic, the specified subtitle content in the new subtitle end history record is taken as an updated subtitle end history record.
[0106] The number of lines in the subtitle display area meeting the subtitle recycling logic refers to that the number of lines in the subtitle display area is large, such as greater than a preset line threshold (such as 10 lines, which is configured according to an actual scene).
[0107] In a case where the number of lines in the subtitle display area is greater than 10 lines, it indicates that the history of the subtitles is long, but the history has been read by the user, and the user's experience is not greatly affected by the full display of the history to the user again. Therefore, the subtitle recycling operation can be started, and only the latest history is displayed to the user, such as taking the specified number of lines of the subtitle content in the new subtitle end history record as an updated subtitle end history record.
[0108] In an implementation manner, the specified number of lines of the subtitle content in the new subtitle end history record can be taken as the updated subtitle end history record.
[0109] In a specific implementation, the subtitle content after the start position of the second last line is first obtained to obtain the latest 2 lines of the subtitle content in the subtitle display area, and the subtitle content is directly assigned to the subtitle end history record mLastSubEnd.
[0110] In order for those skilled in the art to more clearly understand the subtitle recycling logic in the embodiments of the present application, an example is given.
[0111] Suppose that the received subtitles at this time meet the recycling condition (i.e., the number of lines of the currently displayed subtitles is greater than 10 lines);
[0112] Suppose that the fields at this time are as follows:
[0113] The newly received subtitles subtitle: "say the true meaning of it".
[0114] Subtitle ending history mLastSubEnd: "There are many, many historical records. There are many, many historical records. There are many, many historical records. There are many, many historical records. There are many, many historical records. There are many, many historical records. There are many, many historical records. There are many, many, many historical records. There are many, many historical records. There are many, many historical records. There are many, many historical records. Then this class mainly aims to make everyone understand".
[0115] The subtitle displayed in the subtitle display area is: "There are many, many historical records. There are many, many historical records. There are many, many historical records. There are many, many historical records. There are many, many historical records. There are many, many historical records. There are many, many historical records. There are many, many, many historical records. There are many, many historical records. There are many, many historical records. There are many, many historical records. Then this class mainly aims to make everyone understand the true meaning of说课".
[0116] It should be noted that since the display interface of the client is small, when the above subtitle is displayed on the client, it has exceeded 10 lines. Therefore, it is necessary to trigger the subtitle recycling strategy, such as Figure 3 As shown, only the latest two lines in the new subtitle ending history are used as the updated subtitle ending history mLastSubEnd, and the previous several lines are recycled. The user cannot see the content of these previous lines. In this way, it is equivalent to recycling all the subtitle content before the last 2 lines. According to the above logic, each time the subtitle ending history is updated, it will not keep stacking, but recycle the corresponding subtitle content.
[0117] In one embodiment, the subtitle recycling strategy of the related technology is compared with the subtitle recycling strategy in the embodiment of the present application to better understand the subtitle recycling strategy in the embodiment of the present application.
[0118] In the related technology, the subtitle recycling strategy may be to recycle a certain number of characters. For example, 110 characters are recycled, and the remaining characters are: "To make everyone understand the true meaning of说课". With this recycling strategy, when the user sees the text in this box, the character "想" jumps directly from the middle to the front, and the subtitle suddenly becomes shorter, and the user will feel a sense of jerk.
[0119] In the embodiment of the present application, instead of recycling by the number of characters, it accurately identifies the position of the first character "那" in the last two lines of the subtitle display area, and then recycles (i.e., removes) the subtitle before the character "那". The remaining characters are: "那这节课呢主要是想让大家明白说课它的真正".
[0120] After such subtitle recycling, the updated subtitle ending history mLastSubEnd is "那这节课呢主要是想让大家明白说课它的真正".
[0121] At this time, the history record of the subtitle is recycled, and the displayed subtitle content is simplified to avoid affecting the display performance of the client.
[0122] Since the word "that" is still in the first place, it is not perceptible to the user, and there is no jumping.
[0123] S17, combine the updated subtitle end history record and the current subtitle to obtain the complete subtitle content to be displayed.
[0124] In this embodiment, the updated subtitle end history record mLastSubEnd and the current subtitle afterText are combined to obtain the complete subtitle content to be displayed displayText. The specific implementation is as shown in Figure 2 .
[0125] In one example, the newly received subtitle subtitle is "to understand the true meaning of teaching".
[0126] The updated subtitle end history record mLastSubEnd is "to understand the true meaning of teaching".
[0127] The final displayed subtitle (i.e., the complete subtitle content to be displayed) is "to understand the true meaning of teaching". The specific implementation is as shown in Figure 4 .
[0128] In one example, still take
[0129] "First send: "That this class".
[0130] Second send: "That this class mainly is".
[0131] Third send: "That this class mainly is want to".
[0132] Fourth send: "Want to let everyone".
[0133] Fifth send: "Want to let everyone understand".
[0134] Sixth send: "Want to let everyone understand teaching".
[0135] Seventh send: "Teaching it".
[0136] Eighth send: "Teaching its true meaning".
[0137] ...
[0138] For example, the case of the existence of the character " " is introduced to illustrate how to get the complete subtitle content displayText.
[0139] Received the third time sending:
[0140] New subtitle subtitle: "That this lesson is mainly to want to let", there is " ".
[0141] Subtitle end history record mLastSubEnd: "That this lesson is mainly to let", at this time, "That this lesson is mainly to let" before the character " " is taken as the new subtitle end history record, at this time, no subtitle recycling is performed.
[0142] Final subtitle displayText: "That this lesson is mainly to want to let". That is, the new subtitle end history record is superimposed with "want to let" after the character " ".
[0143] Received the fourth time sending:
[0144] New subtitle subtitle: "Want to let everyone", there is no " ".
[0145] Subtitle end history record mLastSubEnd: "That this lesson is mainly to let", the same as the third time of the subtitle end history record.
[0146] Final subtitle: "That this lesson is mainly to want to let everyone", the subtitle end history record is combined with the new subtitle.
[0147] Received the fifth time sending:
[0148] New subtitle subtitle: "Want to let everyone understand".
[0149] Subtitle end history record mLastSubEnd: "That this lesson is mainly to let".
[0150] Final subtitle: "That this lesson is mainly to want to let everyone understand".
[0151] Received the sixth time sending:
[0152] New received subtitle subtitle: "Want to let everyone understand say lesson", there is " ".
[0153] The end of the subtitle history record mLastSubEnd: "That is, this class mainly want to let everyone understand".
[0154] The final subtitle: "That is, this class mainly want to let everyone understand say class".
[0155] The seventh time to receive the sending:
[0156] New subtitle: "Say class it".
[0157] The end of the subtitle history record mLastSubEnd: "That is, this class mainly want to let everyone understand".
[0158] The final subtitle: "That is, this class mainly want to let everyone understand say class it".
[0159] The eighth time to receive the sending:
[0160] New subtitle: "Say class it is really".
[0161] The end of the subtitle history record mLastSubEnd: "That is, this class mainly want to let everyone understand".
[0162] The final subtitle: "That is, this class mainly want to let everyone understand say class it is really".
[0163] S18, display the complete subtitle content.
[0164] Specifically, after obtaining the complete subtitle content displayText, the complete subtitle content can be displayed in the subtitle display area. In an implementation manner, the display position of the subtitle located before the new subtitle is obtained, and the complete subtitle content is displayed after the display position. That is, after the last existing subtitle, the subtitles are displayed word by word, and the specific display effect can be referred to as shown in 4.
[0165] In an example, the specific implementation of the subtitle display in the embodiment of the present application is illustrated.
[0166] In the live broadcast process, the host starts broadcasting and continuously speaks. The audience end continuously receives the ladder-shaped subtitles sent by the server. Although the host continuously speaks to continuously generate subtitles, the ladder-shaped subtitles sent by the server will not become longer and longer. The audience end uses the subtitle splicing logic of the embodiment (specifically refer to Figure 2 ), which can display the continuously stacked streaming subtitle effect on the screen. At the same time, using the subtitle recycling logic of the embodiment, the recycling of the subtitles is carried out without feeling during the continuous speaking, and the audience does not know it, only sees the continuous typing output of the subtitles, and there is no jumping situation of the subtitles starting again, but continuously stacks and outputs.
[0167] In the embodiment, in the case that the new subtitle sent by the server is received, the complete subtitle content to be displayed is determined according to the judgment result of whether the punctuation mark is included in the new subtitle, and the corresponding display operation is performed, so that the new part in the new subtitle is continuously displayed like a typing effect on the basis of the original subtitle, and the purpose of accurately displaying the streaming subtitle is achieved. In addition, in the case that the punctuation mark is included in the new subtitle, the number of lines of the current subtitle display area is obtained, and in the case that the number of lines of the subtitle display area meets the subtitle recycling logic, the subtitle recycling logic is executed, the specified subtitle content in the new subtitle end history record is taken as the updated subtitle end history record, and the problem of too much subtitle content displayed by the client is avoided.
[0168] In addition, in the embodiment, the history subtitle is used to update the subtitle end history record, and the complete subtitle content can be directly updated as soon as the new subtitle is received, so that the effects of correction and streaming printing are achieved. When the trapezoidal subtitle sent by the server has two trapezoidal subtitle periods, the special identifier “ ” is used to distinguish different periods. The history subtitle is before the special identifier, and the current subtitle is after the special identifier. Through such a logic, whenever a periodical subtitle comes, the previous subtitle content is fixed as a history subtitle, and the new one is replaced and superimposed, so that continuous streaming output is achieved, and the subtitle sent by the server can not be continuously superimposed.
[0169] In addition, by increasing the subtitle recycling logic, the recycling logic is not simply to discard the old one when exceeding a certain length, but to keep the subtitle content displayed on the actual screen, discard the history record outside the screen, and take the subtitle in the screen as the new subtitle end history record. In this way, recycling not only achieves the recycling effect, but also is imperceptible to users on the screen, without the abrupt effect of jumping, with better experience, and avoids the performance and display problems caused by continuous superposition of subtitle text content.
[0170] For the above reasons, the embodiment of the application can achieve the effect of streaming subtitle, and can achieve the effects of clever splicing and intelligent and imperceptible recycling, so as to achieve the effect of streaming subtitle with good performance, high efficiency and good experience.
[0171] On the basis of the above-mentioned embodiment of the subtitle display method, another embodiment of the application provides a subtitle display device, which refers to Figure 5 may include:
[0172] The judgment module 101 is configured to judge whether the punctuation mark is included in the new subtitle in the case that the new subtitle sent by the server is received.
[0173] The first combination module 102 is configured to combine the new subtitle and the subtitle end history record to obtain complete subtitle content to be displayed currently without including a punctuation mark.
[0174] The second combination module 103 is configured to split the new subtitle into a history subtitle and a current subtitle based on a position of the punctuation mark in the new subtitle, and combine the history subtitle and the subtitle end history record to obtain a new subtitle end history record in a case where the punctuation mark is included.
[0175] The acquisition module 104 is configured to acquire a current number of lines of a subtitle display area.
[0176] The record updating module 105 is configured to take specified subtitle content in the new subtitle end history record as an updated subtitle end history record in a case where the number of lines of the subtitle display area meets a subtitle recycling logic.
[0177] The third combination module 106 is configured to combine the updated subtitle end history record and the current subtitle to obtain the complete subtitle content to be displayed currently.
[0178] The display module 107 is configured to display the complete subtitle content.
[0179] In an implementation manner, the first combination module 102 is specifically configured to:
[0180] splicing the new subtitle after the subtitle end history record to obtain the complete subtitle content to be displayed currently.
[0181] In an implementation manner, the second combination module 103 is specifically configured to, when splitting the new subtitle into the history subtitle and the current subtitle based on the position of the punctuation mark in the new subtitle:
[0182] taking the new subtitle before the punctuation mark as the history subtitle and taking the new subtitle after the punctuation mark as the current subtitle as a split point.
[0183] In an implementation manner, the second combination module 103 is specifically configured to, when combining the subtitle end history record and the history subtitle to obtain the new subtitle end history record:
[0184] taking the history subtitle as the new subtitle end history record in a case where content of the subtitle end history record is empty, or splicing the history subtitle after the subtitle end history record to obtain the new subtitle end history record in a case where the content of the subtitle end history record is not empty.
[0185] In an implementation manner, the record updating module 105 is specifically configured to:
[0186] In a case where the number of lines of the subtitle display area is greater than the preset line number threshold, the latest specified number of lines of subtitle content in the new subtitle end history record is taken as the updated subtitle end history record.
[0187] In an implementation manner, the display module 107 is specifically configured to:
[0188] obtain a display position of the subtitle located before the new subtitle; and display the complete subtitle content after the display position.
[0189] In the embodiment, in a case where the new subtitle is received, the complete subtitle content to be displayed is determined according to a judgment result of whether the new subtitle includes the sentence breaking identifier, and a corresponding display operation is performed, so that the newly added part in the new subtitle is continuously displayed like a typing effect on the basis of the original subtitle, and the purpose of accurately displaying the streaming subtitle is achieved. In addition, in a case where the new subtitle includes the sentence breaking identifier, the number of lines of the current subtitle display area is obtained, and in a case where the number of lines of the subtitle display area meets the subtitle recycling logic, the subtitle recycling logic is executed, the specified subtitle content in the new subtitle end history record is taken as the updated subtitle end history record, and the problem of too much subtitle content displayed by the client is avoided.
[0190] It should be noted that the working processes of the modules and sub-modules in the embodiment are described above, and will not be described herein.
[0191] In the embodiment, a client is further provided, which includes at least one processor and a memory connected with the processor, and the memory is configured to store a computer program.
[0192] The memory is configured to store a computer program.
[0193] The processor is configured to execute the computer program, so that the client can implement the above-described subtitle display method.
[0194] Reference Figure 6 As shown in FIG. 1, a structure schematic diagram of a client suitable for implementing the client in the embodiment of the present application is shown. The client in the embodiment of the present application can include but is not limited to a fixed terminal such as a mobile phone, a notebook computer, a PDA (Personal Digital Assistant), a PAD (Tablet Personal Computer), a desktop computer, and the like. Figure 6 The client shown in FIG. 1 is only an example, and should not bring any limitation to the functions and use range of the embodiment of the present application.
[0195] As Figure 6As shown, the client can include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601 that can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 602 or loaded from a storage device 608 into a random access memory (RAM) 603. In a state in which the client is powered on, various programs and data required for the operation of the client are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0196] Generally, the following devices can be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a memory card, a hard disk, etc.; and a communication device 609. The communication device 609 can allow the client to communicate wirelessly or wired with other devices to exchange data. Although Figure 6 The client with various devices is shown, but it should be understood that it is not required to implement or have all of the shown devices. More or less devices can alternatively be implemented or included.
[0197] The application also provides a subtitle display system, comprising a server and the client described above.
[0198] The server is configured to convert the received voice into subtitles and send new subtitles in the converted subtitles to the client.
[0199] The server is configured to convert the received voice into subtitles, and specifically configured to:
[0200] perform a voice recognition operation on the received voice to obtain corresponding subtitles; wherein, in the case that a pause part is recognized in the voice, a punctuation mark corresponding to the pause part is configured in the subtitles.
[0201] The specific implementation of this step is referred to the above corresponding description.
[0202] The application also provides a computer program product comprising computer readable instructions, which, when executed on an electronic device, cause the electronic device to implement any of the subtitle display methods provided by the application.
[0203] The application also provides a computer readable storage medium, which carries one or more computer programs, which, when executed on an electronic device, can cause the electronic device to implement any of the subtitle display methods provided by the application.
[0204] It should be noted that the apparatus embodiments described above are only illustrative, and the units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, i.e., can be located in one place or distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the embodiment according to actual needs. In addition, the connection relationship between the modules in the apparatus embodiment provided in the present application indicates that there is a communication connection between them, which can be implemented as one or more communication buses or signal lines.
[0205] Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be realized by means of software and the necessary general hardware, and of course can also be realized by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. Generally, functions completed by computer programs can be easily realized by corresponding hardware, and the specific hardware structure for realizing the same function can also be various, such as analog circuit, digital circuit or special circuit, etc. However, for the present application, software program implementation is a better embodiment. Based on this understanding, the technical solutions of the present application can be embodied in the form of software products, which are stored in readable storage media, such as computer floppy disks, U disks, mobile hard disks, ROM, RAM, magnetic or optical disks, etc., including a plurality of instructions for making a computer device (which can be a personal computer, a training device, or a network device, etc.) execute the methods described in various embodiments of the present application.
[0206] In the above embodiments, all or part can be realized by software, hardware, firmware or any combination thereof. When realized by software, it can be realized in the form of a computer program product in whole or in part.
[0207] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from one website, computer, training device or data center to another website, computer, training device or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be stored by the computer or a data storage device such as a training device, a data center, etc. integrated with one or more available media sets. The available media can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)), etc.
Claims
1. A method for displaying subtitles, characterized in that, include: Upon receiving a new subtitle from the server, determine whether the new subtitle includes a sentence break marker; Without including sentence break markers, the new subtitle is combined with the subtitle ending history to obtain the complete subtitle content to be displayed. In the case of including sentence break markers, based on the position of the sentence break markers in the new subtitle, the new subtitle is split into historical subtitles and current subtitles, and the subtitle ending history is combined with the historical subtitles to obtain a new subtitle ending history. Get the current number of lines in the subtitle display area; If the number of lines in the subtitle display area meets the subtitle recycling logic, the specified subtitle content in the new subtitle ending history will be used as the updated subtitle ending history. By combining the updated caption ending history and the current caption, the complete caption content to be displayed is obtained. The complete subtitle content is displayed.
2. The subtitle display method according to claim 1, characterized in that, The new subtitle is combined with the subtitle ending history to obtain the complete subtitle content to be displayed, including: The new subtitle is then appended to the end of the subtitle history to obtain the complete subtitle content to be displayed.
3. The subtitle display method according to claim 1, characterized in that, Based on the position of the sentence segmentation markers within the new subtitle, the new subtitle is split into historical subtitles and current subtitles, including: Using the position of the punctuation mark in the new subtitle as the dividing point, subtitles in the new subtitle that are before the punctuation mark are regarded as historical subtitles, and subtitles that are after the punctuation mark are regarded as current subtitles.
4. The subtitle display method according to claim 1, characterized in that, The new caption ending history is obtained by combining the caption ending history with the historical captions, including: If the content of the caption ending history is empty, the historical caption will be used as the new caption ending history. If the content of the subtitle ending history is not empty, the historical subtitle is appended to the subtitle ending history to obtain a new subtitle ending history.
5. The subtitle display method according to claim 1, characterized in that, If the number of lines in the subtitle display area satisfies the subtitle recycling logic, the specified subtitle content in the new subtitle ending history will be used as the updated subtitle ending history, including: If the number of lines in the subtitle display area exceeds a preset line count threshold, the latest subtitle content in the new subtitle ending history will be used as the updated subtitle ending history.
6. The subtitle display method according to claim 1, characterized in that, The complete subtitle content is displayed, including: Obtain the display position of the subtitle preceding the new subtitle; The full caption content will be displayed after the specified display position.
7. A subtitle display device, characterized in that, include: The judgment module is used to determine whether the new subtitles sent by the server include sentence break markers when the new subtitles are received. The first combination module is used to combine the new subtitle with the subtitle ending history without including sentence break markers to obtain the complete subtitle content to be displayed. The second combination module is used to split the new subtitle into a historical subtitle and a current subtitle based on the position of the historical subtitle and the position of the historical subtitle, when including the punctuation mark, and combine the subtitle ending history with the historical subtitle to obtain a new subtitle ending history. The acquisition module is used to obtain the current number of lines in the subtitle display area; The record update module is used to use the specified subtitle content in the new subtitle end history as the updated subtitle end history when the number of lines in the subtitle display area meets the subtitle recycling logic. The third combination module is used to combine the updated subtitle ending history and the current subtitle to obtain the complete subtitle content to be displayed. The display module is used to display the complete subtitle content.
8. A client application, characterized in that, It includes at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the client can implement the subtitle display method as described in any one of claims 1 to 6.
9. A subtitle display system, characterized in that, Includes the server and the client as described in claim 8; The server is used to convert the received audio into subtitles and send the new subtitles from the converted subtitles to the client.
10. The subtitle display system according to claim 9, characterized in that, When the server converts the received audio into subtitles, it is specifically used for: The received speech is subjected to speech recognition to obtain corresponding subtitles; wherein, when a pause is detected in the speech, a sentence segmentation marker corresponding to the pause is configured in the subtitle.
Citation Information
Patent Citations
Video subtitle adding method and device, electronic equipment and readable storage medium
CN116156246A
Subtitle control method, electronic equipment and computer readable storage medium
CN116205216A