Subtitle rendering method, system and device based on AI technology and storage medium
By using AI technology to analyze and render subtitles in short videos, the problem of synchronization matching and visual adaptation in the context of traditional subtitle rendering systems has been solved, thus improving the display effect of subtitles and the user experience.
Patent Information
- Application Number
- CN202511590414.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-03
- Publication Date
- 2026-01-23
AI Technical Summary
Traditional subtitle rendering systems cannot accurately match the audio stream in short video environments, resulting in comprehension delays or information gaps. Their visual styles are monotonous and fail to highlight key information, and they are difficult to adapt to vertical screen displays, affecting user experience.
AI technology is used for speech analysis to extract the core components and keywords of sentences in the text information, generate structured subtitle metadata, and combine layout parameters and timestamps for word-by-word rendering, dynamically adjusting the display style to adapt to portrait screen display.
It achieves synchronization between subtitles and audio rhythm, dynamically highlights key information, improves information reception efficiency and user experience, and adapts to the needs of vertical screen display.
Smart Images

Figure CN121397168A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of artificial intelligence technology, in particular to a subtitle rendering method, system, device and storage medium based on AI technology. BACKGROUND
[0002] In the current mobile digital media era where short video content is the mainstream information type, traditional subtitle rendering systems, similar to classic film and television work subtitles, have many significant defects, as follows: Firstly, in terms of display rhythm and human language expression adaptability, the traditional system adopts a "sentence-by-sentence display" mode, i.e. the entire sentence appears on the screen at the same time and disappears synchronously. This mode is seriously out of sync with the natural word-by-word expression and sequential rhythm of human language, and the display granularity is extremely coarse. When users watch short videos, they often need to quickly capture voice and subtitle information in a short time, and the sentence-by-sentence display method makes it impossible to accurately match the subtitle information with the voice stream, which can easily lead to understanding delays or information gaps in the information receiving process, especially when dealing with short videos with fast speech or complex content, this problem is more prominent.
[0003] Secondly, in terms of the functionality and guidance of visual style, the visual presentation of existing subtitles (including color, font, size, background, etc.) is usually static and unchanged during the entire display period of a single sentence. This single, fixed visual style has obvious limitations: on the one hand, it cannot effectively highlight the core words and key information in the sentence, making it difficult for users to quickly grasp the content highlights and increasing the cost of information screening and understanding; on the other hand, it cannot guide the user's gaze to move synchronously with the voice rhythm through dynamic changes in visual elements, which weakens the association between the subtitles and the voice, and the coherence and expressiveness of the overall information transmission are insufficient.
[0004] In addition, in terms of adapting to the vertical display characteristics of mobile media, traditional subtitle systems face significant spatial adaptation problems. The current mainstream form of mobile media display is vertical, compared with the horizontal mode of traditional film and television works, the width of the vertical screen is obviously limited, and it is difficult to accommodate the complete content of long sentences. Although some systems adapt to the vertical width by simply truncating the length, this processing method will divide the complete sentence into incoherent fragments, not only destroying the integrity of the content, but also significantly reducing the smoothness of information display, and making the context relationship between the front and back of the sentence not smooth, further affecting the user's overall understanding and receiving experience of the content.
[0005] In conclusion, in the mobile digital media environment dominated by short videos, the shortcomings of traditional subtitle rendering systems in terms of rhythm adaptation, visual guidance, and vertical screen compatibility have become increasingly apparent, failing to meet users' demands for efficient, accurate, and smooth information reception. Therefore, how to improve subtitle rendering effects to meet user needs is a problem that those skilled in the art need to solve. Summary of the Invention
[0006] This invention provides a subtitle rendering method, system, computer device, and storage medium based on AI technology, aiming to improve the subtitle rendering effect and meet user needs, which is a problem that needs to be solved by those skilled in the art.
[0007] In a first aspect, embodiments of the present invention provide a subtitle rendering method based on AI technology, including: Obtain the target file to be rendered, and use AI technology to perform speech analysis processing on the target file to obtain the corresponding text information; The core components and keywords of the sentences in the text information are obtained to generate structured subtitle metadata; The structured subtitle metadata is paginated using preset layout parameters to obtain the corresponding page data; Based on the page data, the structured subtitle metadata in the page data is rendered word by word in combination with the timestamp; According to the set display mode, the page data is rendered in pages and then output for display.
[0008] Secondly, embodiments of the present invention provide a subtitle rendering system based on AI technology, comprising: The AI processing unit is used to acquire the target file to be rendered, and to use AI technology to perform voice analysis processing on the target file to obtain the corresponding text information. The data generation unit is used to obtain the core components and keywords of the sentences in the text information, and thereby generate structured subtitle metadata; The pagination layout unit is used to perform pagination layout processing on the structured subtitle metadata using preset layout parameters to obtain the corresponding page data. The word-by-word rendering unit is used to render the structured subtitle metadata in the page data word by word based on the page data and combined with the timestamp; The pagination rendering unit is used to perform pagination rendering of the page data and output the display according to the set display mode.
[0009] In a third aspect, an embodiment of the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the AI technology-based subtitle rendering method according to the first aspect when executing the computer program.
[0010] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executable on a processor to implement the AI technology-based subtitle rendering method according to the first aspect.
[0011] The embodiment of the present application provides an AI technology-based subtitle rendering method and system, a computer device, and a storage medium. The method comprises the following steps: obtaining a target file to be rendered, performing voice analysis processing on the target file by using AI technology to obtain corresponding text information; obtaining a sentence core component and a keyword in the text information to generate structured subtitle metadata; performing pagination layout processing on the structured subtitle metadata by using a preset layout parameter to obtain corresponding page data; performing word-by-word rendering on the structured subtitle metadata in the page data based on the page data and in combination with a timestamp; and performing pagination rendering on the page data and outputting display according to a set display mode. The embodiment of the present application performs AI voice analysis processing on a target file, extracts a core component and a keyword to generate structured subtitle metadata, and performs word-by-word rendering in combination with a layout parameter and a timestamp. Finally, pagination rendering output is completed in a set display mode, so that the subtitle rendering effect can be significantly improved, and user demand can be met. BRIEF DESCRIPTION OF DRAWINGS
[0012] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0013] Figure 1 A flowchart of an AI technology-based subtitle rendering method provided by an embodiment of the present application is shown in the figure. Figure 2 A schematic block diagram of an AI technology-based subtitle rendering system provided by an embodiment of the present application is shown in the figure. Figure 3 A first pagination example diagram in an AI technology-based subtitle rendering method provided by an embodiment of the present application is shown in the figure. Figure 4 A second pagination example diagram in an AI technology-based subtitle rendering method provided by an embodiment of the present application is shown in the figure. Figure 5A third paging example diagram in a subtitle rendering method based on an AI technology provided by an embodiment of the present application; Figure 6 A fourth paging example diagram in a subtitle rendering method based on an AI technology provided by an embodiment of the present application; Figure 7 A fifth paging example diagram in a subtitle rendering method based on an AI technology provided by an embodiment of the present application; Figure 8 A first rendering example diagram in a subtitle rendering method based on an AI technology provided by an embodiment of the present application; Figure 9 A second rendering example diagram in a subtitle rendering method based on an AI technology provided by an embodiment of the present application; Figure 10 A third rendering example diagram in a subtitle rendering method based on an AI technology provided by an embodiment of the present application; Figure 11 A fourth rendering example diagram in a subtitle rendering method based on an AI technology provided by an embodiment of the present application. DETAILED DESCRIPTION
[0014] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all the other embodiments obtained by those skilled in the art without creative work are within the protection scope of the present application.
[0015] It should be understood that the terms “comprise” and “include” as used in the specification and the appended claims indicate the presence of the described features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0016] It should also be understood that the terms used in the present application specification are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the present application specification and the appended claims, unless otherwise clearly indicated by the context, the singular forms “a”, “an” and “the” are intended to include the plural forms as well.
[0017] It should be further understood that the term “and / or” as used in the present application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.
[0018] Please see the following Figure 1The embodiment of the present application provides a subtitle rendering method based on AI technology, and specifically comprises the following steps: S101-S105.
[0019] In step S101, a target file to be rendered is acquired, and AI technology is used for voice analysis and processing of the target file to obtain corresponding text information. In step S102, the sentence core components and keywords in the text information are acquired to generate structured subtitle metadata. In step S103, the structured subtitle metadata is subjected to page layout processing by using preset layout parameters to obtain corresponding page data. In step S104, the structured subtitle metadata in the page data is subjected to word-by-word rendering based on the page data and in combination with a time stamp. In step S105, the page data is subjected to page rendering and output display according to a set display mode.
[0020] In the embodiment, first, a target file to be rendered is acquired by an AI processing unit, and is converted into text information. The target file can be a short video, an audio file or the like containing voice information. Then, the acquired text information is parsed to extract the sentence core components such as subject, predicate, object and the like from the text information, and to identify keywords having important meanings. Based on the core components and the keywords, structured subtitle metadata is generated. The metadata organizes information in a standardized format, facilitating subsequent page layout and rendering processing. Subsequently, the structured subtitle metadata is subjected to page layout processing according to preset layout parameters. Then, the page data obtained based on the page layout is subjected to word-by-word rendering in combination with a time stamp. Finally, the page data is subjected to page rendering and output display according to a set display mode.
[0021] In the embodiment, the target file is subjected to AI voice analysis and processing, the core components and the keywords are extracted to generate structured subtitle metadata, and the word-by-word rendering is performed in combination with layout parameters and a time stamp. Finally, the page rendering and output are completed in a set display mode, so that the subtitle rendering effect can be significantly improved, and the user demand can be met.
[0022] In an embodiment, the step S101 comprises: The target file is subjected to voice recognition by using a voice recognition technology to obtain corresponding voice signals. The voice signals are converted into the text information.
[0023] The embodiment converts the voice signal into text information through voice recognition technology, providing a basis for subsequent text processing and analysis. During voice recognition, deep learning algorithms can be used for feature extraction and pattern matching of voice signals to accurately identify each word and sentence in the voice as much as possible. At the same time, post-processing of the recognition results can be performed, such as error correction, punctuation addition, etc., to improve the accuracy and readability of the text information. Specifically, during voice recognition, the target file, such as a video file (including MP4, AVI, etc.) or an audio file (including WAV, MP3, etc.), is preprocessed first, including noise reduction, enhancement, etc., to improve the accuracy of voice recognition. Subsequently, a pre-trained voice recognition model is used to convert the processed voice signal into a corresponding phoneme or word sequence frame by frame. During this process, the voice recognition model will use the acoustic features and language models learned from a large amount of voice data to predict the most likely text output. After obtaining the preliminary text information, further natural language processing techniques are applied to perform semantic analysis, context understanding, and necessary corrections on the text, such as identifying and correcting homonym errors that may occur during voice recognition, or adding punctuation marks reasonably according to the context to ensure that the final generated text information is accurate and conforms to language habits.
[0024] In an embodiment, the step S102 comprises: performing part-of-speech tagging and semantic analysis on the text information through a natural grammar model; extracting the core components of the text information according to the results of part-of-speech tagging and semantic analysis; setting an identifier for the keywords in the text information based on a preset keyword strategy.
[0025] In this embodiment, when obtaining the core components of the text information, a natural grammar model is first used to deeply analyze the text information to identify the part-of-speech of each word in the text information, such as nouns, verbs, adjectives, etc., and further analyze the semantic relationship between the words to construct the semantic structure of the text. Here, through part-of-speech tagging and semantic analysis, the subject, predicate, object, etc. of the text can be accurately located, which form the basic framework of the sentence and are crucial for understanding the meaning of the sentence. In addition, when obtaining the keywords, the keywords in the text can be intelligently identified according to the preset keyword strategy. The keyword strategy can be based on the importance, frequency of occurrence, emotional color, etc. of the keywords to ensure that the identified keywords accurately reflect the theme and key points of the text.
[0026] In actual application scenarios, when identifying keywords, the TF-IDF algorithm, text frequency statistics, or sentiment analysis method can be used to intelligently identify the keywords in the text information according to the preset keyword strategy.
[0027] In an embodiment, the step S102 further comprises: performing word recognition on the text information by using an audio analysis technique, and obtaining a voice waveform corresponding to the text information; obtaining time sequence information of each word based on the voice waveform; wherein the time sequence information comprises a start time and an end time; obtaining a specified template resource and interface display parameters, and generating structured subtitle metadata containing multi-level information in combination with the sentence core component, the keywords and the time sequence information.
[0028] In the generation of structured subtitle metadata, the embodiment first performs in-depth processing on the text information by using an audio analysis technique, recognizes the accurate pronunciation of each word, and obtains the corresponding voice waveform data. These voice waveform data not only record the audio features of the words, but also contain the time distribution information thereof. Based on these voice waveforms, the start time and the end time of each word can be accurately calculated, thereby constructing a detailed time sequence information library. At the same time, the specified template resource and interface display parameters of the user are also obtained. For example, the template resource can include preset subtitle styles, layout rules and animation effects, and the interface display parameters can include the visual attributes such as the font, color and size of the subtitles. By combining the extracted sentence core component, keywords and time sequence information, these multi-level information can be organically integrated, and finally the structured subtitle metadata is generated. The structured subtitle metadata is a lightweight, machine-readable data structure (such as JSON), which contains rendering rules and rendering content, organizes information in a standardized format, is not only convenient for subsequent pagination and rendering processing, but also can be flexibly adjusted and optimized according to the user's needs. For example, the user can select different display modes (such as word-by-word mode, line-by-line mode or page-by-page mode) and define the animation effect of the current reading word according to different application scenarios and rhythm requirements, thereby realizing personalized subtitle rendering effect.
[0029] In an embodiment, the step S103 comprises: obtaining the maximum number of words per line and the maximum number of lines per page set in the layout parameters; performing line and page processing on the structured subtitle metadata according to the maximum number of words per line and the maximum number of lines per page; obtaining the keywords in the structured subtitle metadata, and performing independent page display processing on the keywords.
[0030] In the embodiment, when performing the layout, first, the maximum number of words per line and the maximum number of lines per page are extracted from the obtained layout parameters. The maximum number of words per line determines the number of words that can be contained in a single line, and the maximum number of lines per page limits the range of lines displayed in a single page. According to the maximum number of words per line (for example, 3 words), the words in the structured subtitle metadata are divided line by line. In the division process, the words are arranged in sequence according to the parameter, and when the maximum number of words per line is reached, the operation of inserting a line break is performed to automatically wrap to the next line and continue arranging. After completing the line division, the maximum number of lines per page (for example, 2 lines) is used to perform the page division on the divided subtitle metadata. The subtitle metadata of a certain number of lines is integrated into a page, and when the number of lines reaches the maximum number of lines per page, a new page is started to arrange the subsequent content.
[0031] Here, for the keywords in the structured subtitle metadata, the embodiment adopts the independent page display mode for processing. The embodiment considers the importance and particularity of the keywords in the text and displays the keywords separately to highlight the position of the keywords and make it easier for users to capture the core points of the text. For example, in some important speech video subtitle rendering, the independent page display of keywords can make the audience more clearly grasp the key content of the speech. Through such line and page division, the user can focus on the context of the current relevant words instead of the whole sentence through page division, and the current local information in the sentence can be more reasonably displayed in the scene with limited vertical video width. By setting the independent page display of the keywords and accompanying unique text color, the effect of emphasis can be achieved.
[0032] In combination with Figures 3 to 7 , for example, the example sentence content is "this task only takes three days to finish", the maximum number of words per line is 3 words, and the maximum number of lines per page is 2 lines. The layout is performed, and the first page content is "this task only takes three days", the first line of the first page is "this task only", and the second line of the first page is "takes three days", as shown in Figure 3 . The second page content is "to finish", as shown in Figure 4 . However, because "takes" is a keyword, the logic of additional independent page display of the keyword needs to be truncated from the position of the keyword and displayed separately, and therefore the final page division is "this task only", "takes", and "three days to finish", which are Figure 5 , Figure 6 , and Figure 7As shown, the first action of "three days to finish" is "three days to", and the second action is "finish".
[0033] In an embodiment, the step S104 comprises: acquiring a timestamp of each frame in the target file; based on the timestamp and timing information, acquiring the currently displayed page data, and determining whether the words in the currently displayed page data are the current reading vocabulary; if it is determined that the current reading vocabulary, the corresponding words are rendered in a first style; if it is determined that the non-current reading vocabulary, the corresponding words are rendered in a second style different from the first style; When the current reading vocabulary or non-current reading vocabulary is a keyword, the corresponding words are rendered in a third style different from the first style and the second style.
[0034] In this embodiment, when rendering word by word, first, the timestamp information of each frame in the target file is acquired, which accurately records the time of each frame in the video or audio. Then, combined with the timing information extracted before, that is, the start time and end time of each word, it can be accurately determined which words should be displayed at the current time point, that is, the currently displayed page data. After determining the currently displayed page data, further determine which of these words are currently being read. For the current reading vocabulary, a first style can be used for rendering, such as using a pre-set "active text style" to render it. The active text style can be white, bold, large font size, etc. so that the user can quickly capture the current reading content. For non-current reading vocabulary, a second style different from the first style can be used for rendering, such as using a pre-set "basic text style" to render it. The basic text style can be a regular color, a smaller font size, etc. which is relatively low-key, so as not to interfere with the user's attention to the current reading content. In particular, when the current reading vocabulary or non-current reading vocabulary is identified as a keyword, a third style different from the first style and the second style is used for rendering. This third style is usually more eye-catching. As long as it is located within the currently displayed page, it will continue to maintain its "keyword style", such as always displaying golden yellow with a glowing effect, etc. to ensure its visual priority and emphasize the importance of the keyword, helping the user better understand and remember the text content. Through such word-by-word rendering, the display style of different words can be dynamically adjusted according to their state and attributes, so as to achieve more intelligent and personalized subtitle rendering effect.
[0035] It is to be noted that the third style of keyword has a higher priority than the first and second styles, that is, when a certain word meets the conditions of keyword and non-current reading vocabulary or current reading vocabulary at the same time, the third style is preferred for rendering to ensure that the keyword stands out visually. This priority setting helps users quickly capture key information in the text when browsing subtitles, improving information acquisition efficiency. For example, in an educational video, the teacher is explaining an important concept, which is identified as a keyword. During the subtitle rendering process, even if the keyword is not currently being read, due to its keyword attribute, it will still be displayed in the third style (such as a golden yellow glowing effect), forming a clear contrast with other ordinary words in terms of vision, attracting the user's attention. Combined with Figures 8-10 which shows the rendering state at the start of different pages in playback, where black is the base style, green is the active style, which is activated when a word is under the current frame in different pages, and red is the keyword font color, which will not be covered by the active style. The maximum number of words per line is 3, and the maximum number of lines per page is 2.
[0036] In an embodiment, the step S105 comprises: rendering the currently displayed page data and adding animation transformation effects to the rendered content; compositing the rendered page data with the video frame of the target file current frame to obtain corresponding composite data and output.
[0037] In this embodiment, when performing pagination rendering and finally outputting, the current page data to be displayed is first rendered. In the "word-by-word mode", only the text in the current page is drawn, and the elements are displayed in turn according to one of "word-by-word", "line-by-line" and "page-by-page". The words that do not reach the timing are set to be completely hidden. During the rendering process, not only the clarity and color matching of the text are paid attention to, but also rich and varied animation transformation effects are added to the rendered content according to the preset rules. For example, glyph textures can be generated by a text rendering library for drawing. These animation transformation effects can be text fade-in and fade-out, scaling and rotation, color flickering, etc. Through these effects, the visual appeal of the subtitles can be enhanced, and the user's viewing experience can be improved. After rendering, the rendered page data is composited with the video frame of the target file current frame. During the composition process, the fusion degree of the subtitles and the video frame is fully considered to ensure that the subtitles do not block important content in the video, while clearly displaying in the appropriate position. Through image processing technology, the subtitles and the video frame are seamlessly combined, for example, in the frame buffer for composition, to ensure strict synchronization of visual presentation and speech rhythm, to obtain corresponding composite data. Finally, the composite data is output in the specified format for subsequent playback or further processing, such asFigure 11 In this way, the accuracy and readability of the subtitles are ensured, and vivid visual effects are provided, so as to meet the needs of users in different scenes for subtitle rendering.
[0038] In general, compared with the prior art, the embodiment solves the following problems: (1) The problem of single display granularity is solved, rhythm synchronization is achieved, and by introducing a paging mechanism and vocabulary-level timing rendering, the display unit of the subtitles is refined from "sentence level" to "vocabulary level", which makes the display rhythm of the text more consistent with the reading rhythm, and provides users with a better experience of reading subtitles.
[0039] (2) The problem of single style is solved, and dynamic visual updating is achieved, by a dynamic switching mechanism of basic style and active style, a moving visual focus is created for the currently read vocabulary. In this way, the user's attention can be attracted, so that the user's line of sight always follows the voice progress, the guiding nature of the subtitles is significantly enhanced, and the problem that static subtitles cannot highlight the key points is solved.
[0040] (3) The problem that single-line text is too long when long sentences in vertical videos are segmented, and forced multiple unnatural line breaks are solved, by the paging function, a text block that is visually comfortable and easy to understand instantly is formed, the over-invasion of the subtitles into the video picture is avoided, and the display of information is more reasonable.
[0041] Figure 2 A schematic block diagram of a subtitle rendering system 200 based on AI technology provided by the embodiment of the present application is provided, and the device 200 comprises: An AI processing unit 201 is configured to acquire a target file to be rendered, perform voice analysis processing on the target file by using AI technology, and obtain corresponding text information; A data generation unit 202 is configured to acquire sentence core components and keywords in the text information, and generate structured subtitle metadata therefrom; A paging layout unit 203 is configured to perform paging layout processing on the structured subtitle metadata by using preset layout parameters, and obtain corresponding page data; A word-by-word rendering unit 204 is configured to perform word-by-word rendering on the structured subtitle metadata in the page data based on the page data and in combination with a timestamp; A paging rendering unit 205 is configured to perform paging rendering on the page data according to a set display mode and output the page data for display.
[0042] In an embodiment, the AI processing unit 201 comprises: A voice recognition unit is configured to perform voice recognition on the target file by using a voice recognition technology, and obtain corresponding voice signals; a signal conversion unit, configured to convert the voice signal into the text information.
[0043] In an embodiment, the data generation unit 202 comprises: a part-of-speech tagging and semantic analysis unit, configured to perform part-of-speech tagging and semantic analysis on the text information by using a natural language model; a core component extraction unit, configured to extract a core component of a sentence in the text information according to the results of the part-of-speech tagging and semantic analysis; a keyword identification unit, configured to set an identification for a keyword in the text information based on a preset keyword strategy.
[0044] In an embodiment, the data generation unit 202 further comprises: a waveform acquisition unit, configured to perform word recognition on the text information by using an audio analysis technology, and acquire a voice waveform corresponding to the text information; a time sequence acquisition unit, configured to acquire time sequence information of each word based on the voice waveform; wherein the time sequence information comprises a start time and an end time; a resource acquisition unit, configured to acquire a specified template resource and interface display parameter, and generate structured subtitle metadata containing multi-level information in combination with the core component of the sentence, the keyword, and the time sequence information.
[0045] In an embodiment, the page layout unit 203 comprises: a parameter acquisition unit, configured to acquire a maximum number of words per line and a maximum number of lines per page set in the layout parameter; a line and page division unit, configured to perform line and page division processing on the structured subtitle metadata according to the maximum number of words per line and the maximum number of lines per page; an independent display unit, configured to acquire a keyword in the structured subtitle metadata, and perform independent page display processing on the keyword.
[0046] In an embodiment, the word-by-word rendering unit 204 comprises: a timestamp acquisition unit, configured to acquire a timestamp of each frame in the target file; a word judgment unit, configured to acquire page data currently displayed based on the timestamp and the time sequence information, and judge whether a word in the page data currently displayed is a current reading word; a first rendering unit, configured to, if the word is determined to be the current reading word, render the corresponding word in a first style; a second rendering unit, configured to, if the word is determined to be a non-current reading word, render the corresponding word in a second style different from the first style; The third rendering unit is configured to render the corresponding word in a third style different from the first style and the second style when the current reading vocabulary or the non-current reading vocabulary is a keyword.
[0047] In an embodiment, the page rendering unit 205 includes: The page rendering unit is configured to render the currently displayed page data and add an animation transformation effect to the rendered content. The synthesis output unit is configured to synthesize the rendered page data with a video frame of the target file to obtain corresponding synthesis data and output the synthesis data.
[0048] Since the embodiments of the device part correspond to the embodiments of the method part, the embodiments of the device part are described in the description of the embodiments of the method part, and are not described here.
[0049] The embodiments of the present application also provide a computer readable storage medium, which has a computer program stored thereon, and the computer program can implement the steps provided by the above embodiments when executed. The storage medium can include a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various storage medium capable of storing program codes.
[0050] The embodiments of the present application also provide a computer device, which can include a memory and a processor, the memory has a computer program stored therein, and the processor can implement the steps provided by the above embodiments when calling the computer program in the memory. Of course, the computer device can also include various network interfaces, power supplies and other components.
[0051] The embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts of each embodiment can be referred to each other. For the system disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the related parts can be referred to the method part. It should be pointed out that for ordinary skilled in the art, without departing from the principles of the present application, the present application can be improved and modified, and these improvements and modifications also fall within the protection scope of the claims of the present application.
[0052] It is further noted that the terminology "first", "second" and the like used in the specification are merely used for distinguishing between similar objects and does not imply or imply any actual relationship or order between the objects. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element preceded by "comprises a" does not exclude the existence of additional identical elements in the process, method, article, or apparatus including the element.
Claims
1. A method for rendering subtitles based on AI technology, characterized in that, The method comprises the following steps: obtaining a target file to be rendered, performing voice analysis processing on the target file by using an AI technology to obtain corresponding text information; obtaining a sentence core component and a keyword in the text information to generate structured subtitle metadata; performing page layout processing on the structured subtitle metadata by using a preset layout parameter to obtain corresponding page data; based on the page data, rendering the structured subtitle metadata in the page data word by word in combination with a time stamp; performing page rendering on the page data according to a set display mode and outputting the page data. 2.The AI technology-based subtitle rendering method of claim 1, wherein, The method of obtaining a target file to be rendered and performing voice analysis processing on the target file by using an AI technology to obtain corresponding text information comprises the following steps: performing voice recognition on the target file by using a voice recognition technology to obtain corresponding voice signals; converting the voice signals into the text information. 3.The AI technology-based subtitle rendering method of claim 1, wherein, The method of obtaining a sentence core component and a keyword in the text information to generate structured subtitle metadata comprises the following steps: performing part-of-speech tagging and semantic analysis on the text information by using a natural language grammar model; extracting the sentence core component in the text information according to the results of part-of-speech tagging and semantic analysis; setting an identifier for the keyword in the text information based on a preset keyword strategy. 4.The AI technology-based subtitle rendering method of claim 1, wherein, The method of obtaining a sentence core component and a keyword in the text information to generate structured subtitle metadata further comprises the following steps: performing word recognition on the text information by using an audio analysis technology and obtaining voice waveforms corresponding to the text information; based on the voice waveforms, obtaining time sequence information of each word, wherein the time sequence information comprises a start time and an end time; obtaining specified template resources and interface display parameters, and generating structured subtitle metadata containing multi-level information in combination with the sentence core component, the keyword and the time sequence information. 5.The AI technology-based subtitle rendering method of claim 1, wherein, The method of performing page layout processing on the structured subtitle metadata by using a preset layout parameter to obtain corresponding page data comprises the following steps: obtaining a maximum number of words per line and a maximum number of lines per page set in the layout parameter; performing line and page processing on the structured subtitle metadata according to the maximum number of words per line and the maximum number of lines per page; obtaining the keyword in the structured subtitle metadata and performing independent page display processing on the keyword. 6.The AI technology-based subtitle rendering method of claim 4, wherein, The method of rendering the structured subtitle metadata in the page data word by word in combination with a time stamp based on the page data comprises the following steps: obtaining a time stamp of each frame in the target file; based on the time stamp and the time sequence information, obtaining the page data currently displayed and determining whether the word in the page data currently displayed is a current reading word; if it is determined that the word is a current reading word, rendering the word in a first style; if it is determined that the word is not a current reading word, rendering the word in a second style different from the first style; if the current reading word or the word that is not a current reading word is a keyword, rendering the word in a third style different from the first style and the second style. 7.The AI technology-based subtitle rendering method of claim 1, wherein, The page data is rendered and output according to the set display mode, including: rendering the currently displayed page data and adding animation transformation effects to the rendered content; compositing the rendered page data with the video picture of the current frame of the target file to obtain corresponding composite data and output. 8.A subtitle rendering system based on AI technology, characterized in that, It includes: an AI processing unit configured to obtain a target file to be rendered, perform voice analysis on the target file by using an AI technology, and obtain corresponding text information; a data generation unit configured to obtain sentence core components and keywords in the text information to generate structured subtitle metadata; a page layout unit configured to perform page layout processing on the structured subtitle metadata by using preset layout parameters to obtain corresponding page data; a word-by-word rendering unit configured to perform word-by-word rendering on the structured subtitle metadata in the page data based on the page data and a timestamp; a page rendering unit configured to perform page rendering on the page data according to a set display mode and output the page data.
9. A computer device, comprising: The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the subtitle rendering method based on the AI technology.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the subtitle rendering method based on the AI technology.
