Subtitle processing method, device, equipment and storage medium

JP7639169B2Active Publication Date: 2025-03-04シェンツェン·ティシーエル·ニュー·テクノロジー·カンパニー·リミテッド
View PDF 11 Cites 0 Cited by

Patent Information

Application Number
JP2023560195
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2021-04-26
Filing Date
2022-03-25
Publication Date
2025-03-04
Estimated Expiration
2042-03-25

AI Technical Summary

Benefits of technology

【0024】 上記説明は本願の技術案の概要に過ぎず、本願の技術的手段をより明確に理解するために、明細書の内容に従って実施することができ、また、本願の上記及び他の目的、特徴及び利点をより明確に理解するために、以下、好ましい実施例を添付の図面と併せて詳細に説明する。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007639169000004
    Figure 0007639169000004
  • Figure 0007639169000005
    Figure 0007639169000005
  • Figure 0007639169000006
    Figure 0007639169000006
Patent Text Reader

Abstract

The present application provides a subtitle processing method, device, equipment and storage medium, which obtains layout information of a target subtitle, the layout information including an initial format of the target subtitle and a first attribute value of a target style attribute, and when the initial format is different from the predetermined format, according to the corresponding relationship between the initial format and the predetermined format, modifying the first attribute value to a second attribute value, and rendering the target subtitle in a canvas corresponding to the predetermined format according to the second attribute value, which can avoid the reconstruction of the canvas in the format switching process, and is favorable to improving system performance.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] This application claims priority to a Chinese patent application, application number 202110455647.3, filed with the China Patent Office on April 26, 2021, for the invention titled "Subtitle processing method, device, equipment and storage medium," the entire contents of which are incorporated herein by reference.

[0002] The present application relates to the field of multimedia technology, and in particular to a method, apparatus, device and storage medium for processing subtitles. [Background technology]

[0003] With the popularization of 4K technology and the increasing emphasis on the TTML2 (Timed Text Markup Language 2, Timed Text Markup Language V2.0) subtitle standard, the requirements for subtitles are also increasing. In Japan's ISDB-S3 standard (third generation integrated service digital broadcasting standard), TTML subtitles can be generally classified into various formats, such as 2K format, 4K format, and 8K format. Simply put, the difference between 2K and 4K formats includes that both are on different canvases. For example, if the range of the subtitle area is displayed at 960*540px, in the 2K canvas (1920*1080px), the rendering image should occupy 1 / 4 of the display, and in the 4K canvas (3840*2160px), the rendering image should occupy 1 / 16 of the display. Conversely, to form a subtitle that occupies 1 / 4 of the display area of ​​the screen, 2K requires an image of 960*540px, and 4K requires an image of 1920*1080px.

[0004] For ordinary viewers, only the reference objects are different between different formats, and there is a scaling relationship between them. However, in order to realize subtitles, different formats of subtitles have a large difference in memory usage, and when different formats are switched, the canvas needs to be reconstructed frequently, which affects the system performance. Summary of the Invention [Problem to be solved by the invention]

[0005] An object of the present invention is to provide a new subtitle processing method, device, equipment, and storage medium. [Means for solving the problem]

[0006] The objective of the present application is realized by the following technical solution: A subtitle processing method provided by the present application includes: obtaining layout information of a target subtitle, the layout information including an initial format of the target subtitle and a first attribute value of a target style attribute; when the initial format is different from a predetermined format, modifying the first attribute value to a second attribute value according to a corresponding relationship between the initial format and the predetermined format; and rendering the target subtitle on a canvas corresponding to the predetermined format according to the second attribute value.

[0007] The object of the present application can be further achieved by the following technical solutions.

[0008] In the subtitle processing method, the predetermined format includes a predetermined resolution standard, the initial format includes an initial resolution standard of the target subtitle, and the correspondence relationship includes a numerical relationship corresponding to the predetermined resolution standard and the initial resolution standard, and modifying the first attribute value to a second attribute value based on the correspondence relationship between the initial format and the predetermined format includes: determining the numerical relationship based on the predetermined resolution standard and the initial resolution standard; and modifying the first attribute value based on the numerical relationship to obtain the modified second attribute value.

[0009] The subtitle processing method further includes creating a canvas corresponding to the predetermined format before rendering the target subtitle on the canvas corresponding to the predetermined format based on the second attribute value.

[0010] In the subtitle processing method, the target style attribute includes a style attribute related to a display position or a size of the target subtitle.

[0011] In the subtitle processing method, obtaining the location information of the target subtitle includes: analyzing an initial codestream and the initial format of the target subtitle from a media stream; and performing content analysis on the initial codestream to obtain the first attribute value.

[0012] The subtitle processing method further includes rendering the target subtitle on a canvas corresponding to the predetermined format based on the second attribute value, and then displaying a subtitle image suitable for the predetermined format obtained by rendering the target subtitle on the canvas corresponding to the predetermined format based on the second attribute value.

[0013] In the subtitle processing method, the target subtitles are Closed Captions subtitles using the TTML2 standard in the ISDB-S3 standard.

[0014] The objective of the present application is also achieved by the following technical solution: The subtitle processing device provided by the present disclosure includes: an acquisition module for acquiring layout information of a target subtitle, the layout information including an initial format of the target subtitle and a first attribute value of a target style attribute, a modification module for modifying the first attribute value to a second attribute value according to a corresponding relationship between the initial format and the predetermined format when the initial format acquired by the acquisition module is different from a predetermined format, and a rendering module for rendering the target subtitle on a canvas corresponding to the predetermined format according to the second attribute value acquired by the modification module.

[0015] In addition, the object of the present application is further achieved by the following technical solutions.

[0016] In the subtitle processing device, the predetermined formula includes a predetermined resolution standard, the initial formula includes an initial resolution standard of the target subtitle, and the correspondence relationship includes a numerical relationship corresponding to the predetermined resolution standard and the initial resolution standard, and the correction module is specifically used for determining the numerical relationship based on the predetermined resolution standard and the initial resolution standard acquired by the acquisition module, and modifying the first attribute value based on the numerical relationship to obtain a modified second attribute value.

[0017] The subtitle processing device further includes a creation module, which is used for creating a canvas corresponding to the predetermined format before the rendering module renders the target subtitle on a canvas corresponding to the predetermined format based on the second attribute value.

[0018] In the subtitle processing device, the target style attribute includes a style attribute related to a display position or a size of the target subtitle.

[0019] In the subtitle processing device, the acquisition module is specifically used for analyzing an initial code stream and the initial format of the target subtitle from a media stream, and performing content analysis on the initial code stream to obtain the first attribute value.

[0020] The subtitle processing device further includes a display module, which is used for displaying a subtitle image adapted to the predetermined format obtained by the rendering module rendering the target subtitle on a canvas corresponding to the predetermined format based on the second attribute value.

[0021] The objectives of the present application are also achieved by the following technical solution: The present disclosure provides a subtitle processing device, which includes a memory adapted to store non-transitory computer-readable instructions, and a processor adapted to execute the computer-readable instructions, thereby realizing any of the above subtitle processing methods when executed by the processor.

[0022] The objectives of the present application are also achieved by the following technical solutions: The present disclosure provides a computer-readable storage medium for storing non-transitory computer-readable instructions, which, when executed by a computer, can be used to cause the computer to perform any of the above-mentioned subtitle processing methods.

[0023] The present application has obvious advantages and advantageous effects compared with the prior art. According to the above technical solution, the subtitle processing method, device, equipment and storage medium provided by the present application use a canvas with a unified predetermined format, and when the initial format of the target subtitle to be processed is different from the predetermined format, the initial attribute value of the target style attribute of the target subtitle is modified according to the corresponding relationship between the initial format of the target subtitle and the predetermined format to obtain a modified attribute value that is suitable for the predetermined format, and then rendered on the canvas with the predetermined format according to the modified attribute value, thereby preventing the reconstruction of the canvas when the subtitle standard changes, improving the system performance, and being favorable to the subtitle processing such as the creation of the subtitle canvas, the generation, storage and transmission of the subtitle image.

[0024] The above description is only an outline of the technical solution of the present application, which can be implemented according to the contents of the specification in order to more clearly understand the technical means of the present application. In order to more clearly understand the above and other objectives, features and advantages of the present application, the preferred embodiments are described in detail below in conjunction with the accompanying drawings. [Brief description of the drawings]

[0025] [Figure 1] FIG. 2 is a flow diagram illustrating a subtitle processing method according to an embodiment of the present application. [Diagram 2] FIG. 11 is a flow diagram illustrating a subtitle processing method according to another embodiment of the present application. [Diagram 3] FIG. 11 is a flow diagram illustrating a subtitle processing method according to another embodiment of the present application. [Figure 4] FIG. 2 is a flow diagram illustrating two subtitle rendering procedures according to an embodiment of the present application. [Diagram 5]FIG. 2 is a schematic diagram illustrating glyph scaling according to an embodiment of the present application. [Figure 6] FIG. 11 is a flow diagram illustrating a subtitle processing method according to another embodiment of the present application. [Figure 7] 1 is a schematic diagram illustrating a caption processing device according to an embodiment of the present application; [Figure 8] FIG. 13 is a schematic diagram showing a caption processing device according to another embodiment of the present application. [Figure 9] FIG. 1 is a schematic diagram showing a subtitle processing device according to an embodiment of the present application.

[0026] The realization of the object, the functional features and advantages of the present application will be further explained with reference to the drawings in conjunction with the embodiments. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0027] In order to further explain the technical means and effects used by the present application to achieve the object of the application, the specific embodiments, structures, features and effects of the subtitle processing method, device, equipment and storage medium provided by the present application will be described in detail below with reference to the drawings and preferred embodiments.

[0028] It should be understood that, in this specification, relational terms such as "first," "second," and the like are used only to distinguish one object or operation from another, and do not necessarily require or imply that such an actual relationship or sequence exists between these objects or operations. Also, the terms "comprise," "comprises," or any variation thereof are intended to include a non-exclusive inclusion, such that a process, method, article, or device that includes a set of elements includes not only those elements, but also other elements not expressly listed, or includes elements inherent to such process, method, article, or device. Unless further limited, an element qualified by the term "comprise" does not exclude the presence of additional identical elements in the process, method, article, or device that includes the element.

[0029] 1 is a flow diagram illustrating a subtitle processing method according to an embodiment of the present application. Referring to FIG. 1, in some embodiments of the present application, the exemplary subtitle processing method of the present application mainly includes steps S11 to S13.

[0030] In step S11, the terminal device obtains layout information of a target subtitle, where the layout information includes an initial format of the target subtitle and a first attribute value of a target style attribute.

[0031] In the embodiments of the present application, the terminal device includes, but is not limited to, fixed terminal devices such as televisions and desktop computers, smartphones, notebook computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), PMPs (Portable Multimedia Players), navigation devices, in-vehicle terminal devices, in-vehicle display terminals, and portable terminal devices such as in-vehicle electronic rearview mirrors.

[0032] In some variations of the present application, the processed subtitles include subtitles in a broadcast television signal, subtitles in media data stored in a computer storage medium, etc. In one specific example, the target subtitles are Closed Captions (abbreviated as CC, Closed Captions, using the TTML2 standard) subtitles in the ISDB-S3 standard.

[0033] In the embodiment of the present application, the subtitle standard may include a subtitle resolution standard. Here, the subtitle resolution may be the size of pixel representation, the canvas resolution, the canvas dimension, or the pixel dot number of the canvas, etc. It should be noted that the canvas standard referred to in the present application may be a current normal standard or standard standard, or may not be a normal standard or standard standard. Taking the canvas resolution as an example, the current subtitle resolution standard may be any dimension such as 1280×720, 1920×1080, 3840×2160, 2048×1080, 4096×2160, etc., but is not limited thereto. Taking the subtitle based on the TTML2 standard in the ISDB-S3 standard as an example, the subtitle standard of the TTML2 standard in the ISDB-S3 standard generally includes 2K, 4K and 8K standards.

[0034] In the embodiment of the present application, the subtitle style attribute refers to an attribute related to the subtitle style. In the embodiment of the present application, the subtitle style attribute can include a series of attributes related to subtitle display, such as the font color, font size, background color, display coordinate value, transparency, width and height of the subtitle display area, line height, border width, font line width, character width, line spacing, character spacing, special effect position, offset position, etc. In some variants of the present application, the target style attribute includes one or more style attributes related to the display and / or dimensions of the subtitle, for example, the target style attribute includes some or all of the attributes related to the display or dimensions of the subtitle, such as the font size or display coordinate value.

[0035] It should be noted that the target style attributes may include other types of style attributes in addition to style attributes related to the display and dimensions of the subtitles, and the embodiments of the present application are not limited thereto.

[0036] Preferably, the layout information in the x-axis direction (width direction of the display) and the y-axis direction (height direction of the display) are obtained, for example, the canvas width standard and the canvas height standard of the target subtitle are obtained for the initial format, and the width of the subtitle display area, the width of the font, the height of the subtitle display area, and the height of the font are obtained for the target style attribute. In practice, only the layout information in one of the width direction and the height direction of the subtitle is obtained, and the layout information in the other direction is not obtained, and thus the subtitle style attribute value in that direction does not need to be adjusted in the subsequent steps.

[0037] In an embodiment of the present application, the terminal device first obtains layout information of the target subtitle, and the layout information includes an initial format of the target subtitle and a first attribute value of a target style attribute, where the initial format of the target subtitle refers to an initially configured standard of the target subtitle, such as an initially configured resolution standard, and the first attribute value of the target style attribute is an initially configured attribute value of the target style attribute of the target subtitle.

[0038] Preferably, in the embodiment of the present application, the terminal device analyzes the initial format of the target subtitle initially arranged from the media stream and the initial code stream of the target subtitle. For example, the initial format of the target subtitle obtained from the media stream is 4K. The terminal device analyzes the content of the initial code stream to obtain a first attribute value of the target style attribute. For example, the target style attribute includes the font size, display coordinate value, and width and height of the display area of ​​the target subtitle, and the first attribute value (i.e., the initially arranged attribute value) of the target style attribute obtained by analyzing the content of the initial code stream is respectively: font size 20px, display coordinate value (200,200), width and height of the display area (1000,240). Note that the media stream usually has a field used to identify the subtitle standard, which may be in the subtitle control stream, and the initial format of the target subtitle is directly obtained by acquiring and analyzing the field. In addition, in a media stream, audio, video, and subtitle streams are usually multiplexed (muxed), so parsing the subtitles from the media stream to obtain the initial code stream involves demultiplexing (demuxing) the media stream to obtain each data.

[0039] It should be noted that in the embodiment of the present application, the layout information of the target subtitle may include other types of information related to the target subtitle in addition to the initial format of the target subtitle and the first attribute value of the target style attribute, and the embodiment of the present application is not limited thereto.

[0040] In step S12, if the initial format of the target subtitle is different from the predetermined format, the terminal device corrects the first attribute value of the target subtitle to the second attribute value based on the correspondence between the predetermined format and the initial format of the target subtitle.

[0041] In the embodiment of the present application, the predetermined format is a preset subtitle format. In the embodiment of the present application, the predetermined format is independent of the target subtitle, that is, it does not change according to the change of the target subtitle.

[0042] Preferably, the preset predetermined format may be a normal subtitle format in the subtitle standard used, a subtitle format adapted to the specifications of a display device such as a screen on which the target subtitles are displayed, a subtitle format with a small or minimum memory occupancy, a subtitle format with a small or minimum memory occupancy among common subtitle formats, a subtitle format with a large or maximum high definition or maximum resolution, etc. Preferably, the specifications of the display device such as a screen include a screen aspect ratio, for example, 16:9, 16:10, etc.

[0043] For example, the subtitles used are subtitles based on the TTML2 standard in the ISDB-S3 standard. Subtitles conforming to the TTML2 standard in the ISDB-S3 standard generally include 2K, 4K, and 8K formats, and regardless of the format of the target subtitles to be processed, the preset predetermined format in the embodiment of the present application is 2K, and the embodiment of the present application uniformly creates a 2K canvas of a predetermined format, such as a 16:9 2K canvas with a dimension of 1920*1080.

[0044] Preferably, a predetermined format corresponding to each of the x-axis direction (width direction of the display) and the y-axis direction (height direction of the display) is determined, and for example, the predetermined value of the subtitle canvas width may be set to 1920, and the predetermined value of the subtitle canvas height may be set to 1080. In practice, it is also possible to set a predetermined format for only one of the width direction and the height direction, without setting a predetermined format for the other direction, and without adjusting the subtitle style attribute for the corresponding direction.

[0045] In an embodiment of the present application, after the terminal device obtains the initial format of the target subtitle and the first attribute value of the target style attribute, if the initial format of the target subtitle is different from the predetermined format, the terminal device modifies the first attribute value of the target subtitle to a second attribute value according to the corresponding relationship between the predetermined format and the initial format of the target subtitle. For example, if the initial format of the target subtitle initially arranged is 4K and the predetermined format is 2K, the terminal device modifies the first attribute value of the target style attribute of the target subtitle to a second attribute value corresponding to the predetermined format 2K according to the corresponding relationship between 4K and 2K.

[0046] Preferably, in the embodiment of the present application, the correspondence relationship between the predetermined format and the initial format may be specifically a numerical correspondence relationship between the initial resolution standard of the target subtitle and the predetermined resolution standard.

[0047] For example, if the initial format of the target subtitle is 4K and the predetermined format is 2K, it can be determined that the corresponding numerical relationship between the initial resolution standard and the predetermined resolution standard is a scaling factor of 1 / 2. The terminal device modifies a first attribute value from the target style attribute according to the scaling factor to a second attribute value according to the scaling factor. Then, the obtained second attribute value is an attribute value of the target style attribute corresponding to the predetermined format 2K. Table 1 is a modified example showing the target style attribute provided by the embodiment of the present application.

[0048] [Table 1]

[0049] Here, the target style attributes in the embodiment of the present application include the font size, display coordinate value, width and height of the display area, and line height of the target subtitle, and its first attribute value (i.e., initially arranged attribute value) is respectively 20px for font size, (200,200) for display coordinate value, (1000,240) for width and height of the display area, and 240 for line height. According to the scaling coefficient 1 / 2 between the initial format 4K and the predetermined format 2K of the target subtitle, the first attribute value 20px of font size is modified to a second attribute value 10px, the first attribute value (200,200) of display coordinate value is modified to a second attribute value (100,100), the first attribute value (1000,240) of the width and height of the display area is modified to a second attribute value (500,120), and the first attribute value 240 of line height is modified to a second attribute value 120.

[0050] It should be understood that Table 1 shows modified examples of the target style attributes and does not limit the present application. Any corresponding target style attributes can be modified to obtain a subtitle image adapted to a predetermined format. For example, to generate a subtitle image adapted to a predetermined canvas resolution of the target subtitle, the adjustable subtitle style attributes may further include a border width size (Border-length), a font line size (Outline-length), a blur radius size (Blur-radius), padding (Padding), a letter spacing (Letter-spacing), a shadow offset coordinate setting (Shadow-offset), etc.

[0051] In addition, the correspondence relationship between the predetermined formula and the initial formula may include other correspondence relationships, and the above is merely an example of the correspondence relationship between the predetermined formula and the initial formula, and does not limit the present application.

[0052] In step S13, the terminal device renders the target subtitle on a canvas corresponding to a predetermined style according to the second attribute value of the target style attribute.

[0053] In an embodiment of the present application, the terminal device modifies the first attribute value of the target subtitle to a second attribute value based on the correspondence between the predetermined format and the initial format of the target subtitle, and then renders the target subtitle on a canvas corresponding to the predetermined format based on the modified second attribute value, thereby obtaining a subtitle image (also called a subtitle layer) of the target subtitle that is adapted to the predetermined format.

[0054] In an embodiment of the present application, the canvas corresponding to the predetermined format is created in advance at any time before the terminal device performs the above-mentioned "rendering the target subtitle on the canvas corresponding to the predetermined format based on the second attribute value of the target style attribute."

[0055] The canvas is an abstract space on which subtitles are rendered, and subtitles are rendered as a single image on the canvas, so the size of the canvas may be set to 1920*1080. Image and screen standards are logical concepts at the time of display, and a 1920*1080 image needs to be scaled to the size of the display window when displayed.

[0056] In the embodiment of the present application, what is obtained by rendering the subtitle data is not a subtitle image based on the initial format of the target subtitle, but a subtitle image based on a predetermined format.

[0057] Here, rendering in the present embodiment refers to the process of drawing image content from the initial text representation of the subtitle to the canvas. Preferably, the result of rendering in the canvas is RGBA (representing a color space including red, green, blue, and alpha channels) data stored in one memory block, and the data is saved in the memory.

[0058] In general, after rendering and obtaining image data of the target subtitle, the terminal device temporarily stores the image data and later performs processing such as display.

[0059] In the subtitle processing method provided by the embodiments of the present application, a unified canvas of a predetermined format is used. When the initial format of a target subtitle to be processed is different from the predetermined format, a first (initial) attribute value of a target style attribute of the target subtitle is modified based on the corresponding relationship between the initial format of the target subtitle and the predetermined format to obtain a second attribute value suitable for the predetermined format, and finally rendering is performed on the canvas of the predetermined format based on the modified second attribute value, thereby avoiding the reconstruction of the canvas in the format switching process, which is beneficial to improving system performance.

[0060] It should be noted that subtitle format switching can occur in many situations, and in the process of switching various signal sources, the canvas format on which the subtitles are based can change, and is not limited thereto. For example, when a television program with a 2K signal source is switched to a television program with a 4K signal source, or when a 4K television program is switched to 2K, the subtitle format of the television program also generally changes according to the television program format. In addition, for example, when a message, news, or advertisement is interrupted during a movie, television program, or live online broadcast, the resolution of the message, news, or advertisement may differ from the currently broadcast media format, so that the subtitle format may change. In addition, when a movie is played, if the subtitle formats of multiple subtitles (e.g., multilingual subtitles) stored in advance are different, the subtitle format may be switched when switching subtitles. In the subtitle processing method provided by the embodiment of the present application, when performing subtitle processing, if the canvas format on which the subtitles are based changes, a canvas corresponding to a pre-created predetermined format is used to render the switched subtitles instead of creating a new canvas, thereby reducing the reconstruction of the canvas in the format switching process.

[0061] FIG. 2 is a schematic diagram showing a subtitle processing method according to another embodiment of the present invention.

[0062] Another embodiment of the subtitle processing method provided by the embodiment of the present application shown in FIG. 2 includes steps S21 to S26.

[0063] In step S21, a canvas corresponding to a predetermined format is created, where the predetermined format is a low format occupying a preset small memory space. In an embodiment of the present application, the terminal device reads the predetermined subtitle format occupying a preset small memory space, and creates a canvas corresponding to the predetermined subtitle format, which is used to render a subtitle image in a subsequent step.

[0064] In the embodiment of the present application, a canvas corresponding to a predetermined format is created in advance by a terminal device, and the terminal device can create a canvas corresponding to a predetermined format only once, and within a subsequent preset time period, the terminal device can perform subtitle rendering based on this canvas for subtitles in any received media stream.

[0065] In particular, the predetermined format in this embodiment is, for example, a low format with a low memory occupancy that is preset, such as a low format with a small memory occupancy or the smallest memory occupancy among normal caption formats. Taking captions based on the TTML2 standard in the ISDB-S3 standard as an example, subtitles conforming to the TTML2 standard in the ISDB-S3 standard usually include the 2K, 4K, and 8K formats prescribed by the standard, and when subtitle processing is performed using the method shown in the embodiment of the present application, a 2K canvas, specifically, a 16:9 2K canvas with dimensions of 1920*1080, is uniformly created.

[0066] In step S22, the location information of the target subtitle is obtained. In the embodiment of the present application, the terminal device obtains a media stream, analyzes an initial format and an initial code stream of the target subtitle from the media stream, and performs content analysis on the initial code stream to obtain a first attribute value (initial attribute value) of the target style attribute of the target subtitle.

[0067] Taking TTML subtitles as an example for a specific embodiment, the process of obtaining the initial format of the target subtitle specifically includes analyzing the subtitle standard used by the current TTML subtitle from the pcap code stream, for example, determining whether the target subtitle is in 2K, 4K, or 8K format, for example, the initial format is 4K. The process of obtaining the first attribute value of the target style attribute of the target subtitle specifically includes analyzing the initial code stream of the current TTML subtitle from the pcap code stream, performing content analysis on the TTML subtitle, and obtaining the initial attribute value of the target style setting of the subtitle, i.e., the first attribute value. For example, the target style attribute includes the font size, display coordinate value, and width and height of the display area of ​​the target subtitle, and by analyzing the content of the initial code stream, the first attribute value of the target style attribute (i.e., the initially arranged attribute value) is respectively 20px for font size, (200,200) for display coordinate value, and (1000,240) for width and height of the display area. Here, the pcap code stream is a data packet commonly used in network packet capture and network packets. It should be understood that this application does not limit the media stream used and that in addition to the pcap codestream described above, other types and formats of data may be used, such as RTP codestream packets.

[0068] A detailed description of step S22 in the embodiment of the present application can be understood with reference to step S11 in FIG. 1, and will not be described further here.

[0069] In step S23, it is determined whether the initial format of the target subtitle is the same as the predetermined format.

[0070] In the embodiment of the present application, after performing step S22 to obtain the initial format of the target subtitle, the terminal device determines whether the initial format of the target subtitle is the same as the predetermined format based on the initial format and the predetermined format previously set in step S21.

[0071] In step S24, if the judgment result in step S23 is that the initial format of the target subtitle is different from the predetermined format, the terminal device modifies the first attribute value of the target subtitle to a second attribute value based on the corresponding relationship between the predetermined format and the initial format of the target subtitle, where the predetermined format is a low format that occupies a small memory space.

[0072] A detailed description of step S24 in the embodiment of the present application can be understood with reference to step S12 of FIG. 1, and will not be described further here.

[0073] In step S25, to obtain a subtitle image suitable for a low format with a small preset memory space of the target subtitle, the target subtitle is rendered on a canvas corresponding to a predetermined format based on the second attribute value of the target style attribute of the target subtitle.

[0074] A detailed description of step S25 in the embodiment of the present application can be understood with reference to step S13 in FIG. 1, and will not be described further here.

[0075] In step S26, the subtitle image is displayed.

[0076] In the embodiment of the present application, after obtaining a subtitle image conforming to a predetermined format of the target subtitle, the terminal device can display the subtitle image, and generally send the rendered subtitle image to a display module (e.g., a television or a graphics processor GPU of a computer) of the terminal device, so that the display module displays the subtitle on the screen. It should be understood that the display module can be adjusted and scaled to display full screen according to any size of image, any resolution of video, or to adjust to any other display area.

[0077] In the embodiment of the present application, the method for processing subtitles provided by the embodiment of the present application uses a canvas with a unified predetermined format, and when the initial format of the target subtitle to be processed is different from the predetermined format, the first (initial) attribute value of the target style attribute of the target subtitle is modified based on the correspondence between the initial format of the target subtitle and the predetermined format to obtain a second attribute value that is suitable for the predetermined format, and rendering is performed on the canvas with the predetermined format based on the last modified second attribute value, thereby avoiding the reconstruction of the canvas in the format switching process, which is favorable to improving the system performance. In addition, the predetermined format used is a low format with a small memory occupancy space that is preset, which can reduce the memory space required for the subtitle processing process such as the creation of the canvas, the generation, storage, transmission and screen display of the subtitle image, and can reduce the memory cost in the rendering process, and can avoid the inability to display the subtitle due to the lack of a large memory capacity. Taking ISDB-S3 CC subtitles as an example, the subtitle processing method disclosed in this application can reduce the memory usage of ISDB-S3 CC subtitles, avoiding other processes in devices such as televisions from being killed due to memory shortage caused by too high memory occupation, and at the same time improving rendering efficiency.

[0078] FIG. 3 is a schematic diagram showing a subtitle processing method according to another embodiment of the present application.

[0079] FIG. 3 shows another embodiment of the subtitle processing method provided by the embodiment of the present application shown in FIG. 2, which includes steps S31 to S36.

[0080] In step S31, a canvas corresponding to a predetermined format is created, where the predetermined format is a preset high-definition format. In an embodiment of the present application, the terminal device reads the preset high-definition predetermined caption format, and creates a canvas corresponding to the predetermined caption format, which is used to render a caption image in a subsequent step.

[0081] In the embodiment of the present application, a canvas corresponding to a predetermined format is created in advance by a terminal device, and the terminal device can create a canvas corresponding to a predetermined format only once, and within a subsequent preset time period, the terminal device can perform subtitle rendering based on this canvas for subtitles in any received media stream.

[0082] In particular, the predetermined format in this embodiment is, for example, a preset high-definition format among normal caption formats. Taking captions based on the TTML2 standard in the ISDB-S3 standard as an example, subtitles conforming to the TTML2 standard in the ISDB-S3 standard usually include the 2K, 4K and 8K formats prescribed by the standard, and when the method shown in the embodiment of the present application is used for caption processing, an 8K canvas with the highest resolution is uniformly created.

[0083] In step S32, the location information of the target subtitle is obtained. In the embodiment of the present application, the terminal device obtains a media stream, analyzes an initial format and an initial code stream of the target subtitle from the media stream, and performs content analysis on the initial code stream to obtain a first attribute value (initial attribute value) of the target style attribute of the target subtitle.

[0084] Taking TTML subtitles as an example for a specific embodiment, the process of obtaining the initial format of the target subtitle specifically includes analyzing the subtitle standard used by the current TTML subtitle from the pcap code stream, for example, determining whether the target subtitle is in 2K, 4K, or 8K format, for example, the initial format is 4K. The process of obtaining the first attribute value of the target style attribute of the target subtitle specifically includes analyzing the initial code stream of the current TTML subtitle from the pcap code stream, performing content analysis on the TTML subtitle, and obtaining the initial attribute value of the target style setting of the subtitle, i.e., the first attribute value. For example, the target style attribute includes the font size, display coordinate value, and width and height of the display area of ​​the target subtitle, and by analyzing the content of the initial code stream, the first attribute value of the target style attribute (i.e., the initially arranged attribute value) is, respectively, 20px for the font size, (200,200) for the display coordinate value, and (1000,240) for the width and height of the display area. Here, the pcap code stream is a datagram that is often used in network packet capture and network packet analysis. It should be understood that this application does not limit the media stream used and that in addition to the pcap codestream described above, other types and formats of data may be used, such as RTP codestream packets.

[0085] A detailed description of step S32 in the embodiment of the present application can be understood with reference to step S11 in FIG. 1, and will not be described further here.

[0086] In step S33, it is determined whether the initial format of the target subtitle is the same as the predetermined format.

[0087] In the embodiment of the present application, after performing step S32 to obtain the initial format of the target subtitle, the terminal device determines whether the initial format of the target subtitle is the same as the predetermined format based on the initial format and the predetermined format previously set in step S31.

[0088] In step S34, if the judgment result in step S33 is that the initial format of the target subtitle is different from the predetermined format, the terminal device modifies the first attribute value of the target subtitle to a second attribute value according to the corresponding relationship between the predetermined format and the initial format of the target subtitle, where the predetermined format is a preset high-definition format.

[0089] A detailed description of step S34 in the embodiment of the present application can be understood with reference to step S12 of FIG. 1, and will not be described further here.

[0090] In step S35, the target subtitle is rendered on a canvas corresponding to the predetermined format according to the second attribute value of the target style attribute of the target subtitle, so as to obtain a subtitle image suitable for the preset high-definition format of the target subtitle.

[0091] In step S36, the subtitle image is displayed.

[0092] In the embodiment of the present application, after obtaining a subtitle image conforming to a predetermined format of the target subtitle, the terminal device may display the subtitle image, and typically sends the rendered subtitle image to a display module of the terminal device (e.g., a television or a graphics processor GPU of a computer) so that the display module displays the subtitle on the screen. It should be understood that the display module can adjust and scale itself to display any size image, any resolution video, full screen display, or to fit any other display area.

[0093] In the embodiment of the present application, the method for processing subtitles provided by the embodiment of the present application uses a canvas with a unified predetermined format, and when the initial format of the target subtitle to be processed is different from the predetermined format, the first (initial) attribute value of the target style attribute of the target subtitle is modified according to the correspondence between the initial format and the predetermined format to obtain a second attribute value that is suitable for the predetermined format, and finally rendered on the canvas with the predetermined format according to the modified second attribute value, thereby avoiding the reconstruction of the canvas in the format switching process, which is favorable to improving the system performance. In addition, the predetermined format used is a preset high-definition format, which can improve the definition of the subtitles, and can avoid the problem of the display module enlarging and blurring the subtitles in the subsequent processing of the subtitles.

[0094] In a further embodiment of the subtitle processing method provided in this application, the preset subtitle format is a canvas format that matches the screen standard or a normal standard canvas format. By rendering subtitles based on the preset canvas format that matches the screen standard or the normal standard canvas format, subtitles of different formats can be adjusted to subtitles that match the screen standard or subtitles of normal standard formats, which is convenient for performing subtitle processing processes such as canvas creation, subtitle image generation, storage, transmission and presentation.

[0095] It should be noted that the method of obtaining a subtitle image conforming to the predetermined format can be performed in various ways. In the above embodiment of the present application, a source side scaling method is used, that is, scaling is performed at the first position of the business process, also called a style attribute value correction method. First, a first attribute value of the target style attribute is adjusted to obtain a second attribute value, and then rendering is performed based on the second attribute value to obtain a subtitle image conforming to the predetermined format. Therefore, when using the above embodiment, the style attribute value at the source side point is directly adjusted proportionally to the value of the target point. In other embodiments, a terminal scaling method may be used, that is, scaling is performed at the last position of the business process, also called a correction method when rendering. First, a subtitle image based on the initial format of the target subtitle is rendered based on the initial setting value (i.e., the first attribute value) of the target style attribute of the subtitle, and then, based on the correspondence between the predetermined format and the initial format of the target subtitle, the subtitle image of the initial format is adjusted to adjust the subtitle image to the canvas conforming to the predetermined format.

[0096] It should be understood that the above two variants have a large difference in memory and time costs. FIG. 4 is a flow diagram showing two subtitle rendering methods according to an embodiment of the present application. Referring to FIG. 4, the initial format of the target subtitle is 4K canvas resolution, and the predetermined format is 2K canvas resolution. The upper half of FIG. 4 shows a case where the end scaling method (i.e., the modification method when rendering) is used. The content of the 4K subtitle is first rendered into a 4K format subtitle with a width and height of 400×100, then scaled into a subtitle layer with a width and height of 200×50 and placed on the 2K canvas, and finally the subtitle layer is sent to the display module, and the hardware of the display module scales and displays the content of the 4K subtitle on a 4K screen. The lower half of FIG. 4 shows a case where the above source side scaling method (i.e., the style attribute value modification method) is used. First, the initial attribute value of the 4K subtitle is adjusted to match the 4K format to obtain the attribute value to match the 2K format, then the content of the 4K subtitle is directly rendered on the 2K canvas based on the adjusted attribute value to obtain a subtitle layer with a width and height of 200×50, and finally the subtitle layer is sent to the display module, and the hardware of the display module scales the content of the 4K subtitle to a 4K screen for display. Thus, rendering the subtitle in the initial 4K format and scaling it to 2K requires one more memory (the size of the memory is the initial size of the 4K subtitle, 400×100×4B) and one more scaling time than directly rendering in the 2K format. Therefore, the source-side scaling method disclosed in the above embodiment of the present application has a great advantage in terms of memory and time costs.

[0097] Note that the adjustment of the subtitle image by the display module is a process by the display module (usually related to the GPU), and generally only relates to the set display window size, and does not relate to the style attribute modification and rendering modification disclosed in this application. For example, in order to display an image of 1920*768px, whether the display module displays the image in full screen or 1 / 4 size of the screen (coordinates are arbitrary), the display module first decodes the image into a single image of 1920*768px (of course, it is allowed to decode a part of the image area, otherwise an image with millions of pixels will run out of memory), and then scales it to the area size specified by the display window setting.

[0098] In some embodiments of the present application, the target subtitles use vector-based fonts, which have the property that vector data can be arbitrarily scaled without affecting the definition of the text when rendering it, unlike subtitles that are PNG resources or the like.

[0099] Furthermore, the rendering process of step S13 includes obtaining a subtitle image that matches the second attribute value of the target subtitle by scaling, shifting, rotating, and / or tilting the initial vector glyph corresponding to the text of the target subtitle. Specifically, a matrix is ​​used to perform scaling, shifting, rotating, and / or tilting on the vector glyph to obtain a subtitle image that matches a predetermined format.

[0100] As a concrete example, the formula for scaling subtitles using a matrix is:

[0101]

number

[0102] where the matrix

[0103]

number

[0104] is a matrix used for scaling, enlarging all coordinate values ​​by a factor of 2. Similarly, you can adjust the subtitle style using shift matrices, rotation matrices, skew matrices, etc.

[0105] It should be understood that the scaling required to change the canvas formula is a basic decode scaling for the image. In text rendering, the most important issue is whether the font size can be scaled directly. In some embodiments of the present application, the style attribute is scaled first when modifying the subtitle formula, and the theoretical basis for scaling the style is a proportional relationship. Also, in some embodiments of the present application, the rendering of glyphs is based on a unified "canvas" so that the font size can have a simple multiple relationship.

[0106] The process of forming characters with different font sizes is actually a scaling for the initial glyph. Generally, TTF (full name is TrueType) and SVG (full name is Scalable Vector Graphics) glyphs both use vector representation, and the vector representation is based on a mathematical representation of a specified space. When normalizing, it can be understood as a percentage of the coordinates of each key point in the specified space. For example, as shown in FIG. 5, for a vector glyph set to a glyph with Advance of 2048, the initial vector representation of the glyph is a space based on 2048*2048, and the font is set to 144px*72px, that is, the vector image based on the space representation of 2048*2048 is scaled to 144px*72px. It should be understood that the font is set to 144px*72px, which means that the horizontal dimension is 144px and the vertical dimension is 72px, and the dimensions include margins. It should be understood that the horizontal and vertical directions can be arranged separately. Therefore, when the canvas is scaled by a certain factor, the font size is scaled by the same factor. For example, when 4K is scaled to 2K and the canvas has a 2x scaling relationship both horizontally and vertically, the font should also have a 2x scaling relationship, which is equivalent to scaling 2048*2048 to 72px*36px, and the font size of 144px set at 4K is equal to the font size of 72px set at 2K, that is, the font size is scaled by the same factor. Finally, after the screen is scaled (display module scaling), the user feels the same size characters on the screen.

[0107] In addition, if the initial format of the target subtitle is consistent with the predetermined format, there is no need to adjust the subtitle image, and the initial code stream can be directly used for playback. Specifically, in some embodiments of the present application, before the above step S12, the subtitle processing method provided by the present application further includes judging whether the initial format of the target subtitle is consistent with the predetermined format, and if the judgment result is not consistent, the process of the above steps S12 and S13 is performed to adjust the initial code stream of the subtitle into a subtitle image suitable for the initial format, and then send it to the display module for display; if the judgment result is consistent, it can be directly rendered according to the initial code stream of the subtitle, and sent to the display module for display.

[0108] In some embodiments of the present application, subtitles are decoded by software, and the subtitle stream obtained by demultiplexing the media stream is processed separately and then displayed on a separate layer. For example, both subtitles and video are independent, and the subtitle image is formed as one display layer, and the video is another display layer, and the subtitle layer and the video layer are processed separately and sent to the display module respectively. Note that the processing of subtitles and video is generally independent and unrelated. The association between subtitles and video is such that both are operated on the same time axis, and the timing of both is synchronized so that the subtitles and video are displayed in sync, and both are executed in the same way when performing operations such as pause, play, fast forward, etc.

[0109] In some embodiments, the present application provides a method for processing subtitles, further comprising mixing a subtitle image with video content.

[0110] In some embodiments of the present application, the display module and the device for executing the subtitle processing method may be two independent devices, for example, the subtitle processing device may be a CPU in a terminal device such as a television, computer, smartphone, etc., and the display module may be a GPU therein. In other embodiments of the present application, the device for executing the subtitle processing method of the present application includes a module for executing subtitle processing and a display module, i.e., the operation of the subtitle processing method of the present application and the operation of the display module are performed using the same device.

[0111] In some embodiments of the present application, the step of displaying the subtitles based on the subtitle image adapted to the predetermined format of the target subtitles by the display module provided in the above embodiments may specifically include displaying the subtitle image adapted to the predetermined format of the target subtitles by the display module adjusting the subtitle image adapted to the predetermined format of the target subtitles to an image adapted to the size and position of the display area. Note that the final display situation of the subtitle image is not limited to the size and display position set by the initial format of the subtitles. In practice, the size and position of the display area on the screen of the subtitles may be arbitrary, and the playback interface of the subtitles may be arbitrary, for example, may be displayed in a manner such as non-full screen display, split screen display, picture-in-picture mode, etc. Preferably, the display module adjusts the subtitle image by displaying the image with the size of the display window set by the application as the display range, so that the subtitle image can be made larger or smaller, and the display position may be changed to match the size and position of the display area. For example, if the display area of ​​the image is shifted from the center of the screen, the display position of the subtitles may be adjusted, and this display area becomes the final display range.

[0112] As a specific example, the initial format of the target subtitle may be a resolution standard of 3840*2160 (abbreviated as 4K), and if the default setting predetermined format is a resolution standard of 1920*1080 (abbreviated as 2K), the above method can be used to render and obtain a subtitle image based on the 2K canvas. If the screen resolution is 4K and the display range set by the application is full screen, the display module restores and displays the subtitle image based on the 2K canvas to the 4K canvas. On the other hand, if the display range set by the application is in a non-full screen state, for example, the display range is 1 / 4 screen, the display module adjusts and displays the subtitle image based on the 2K canvas to a size suitable for 1 / 4 screen.

[0113] In some subtitle standards, some style attributes of subtitles may be expressed by a correspondence with the canvas rather than a specific value. For example, in the TTML2 standard, styles such as coordinates and font size can be expressed using a percentage of the canvas size. Such proportional style attributes may be converted to a specific value format and processed by the subtitle processing method shown in Figure 1 above, or such proportional style attributes may be directly used for subtitle processing.

[0114] 6 is a flow diagram illustrating a subtitle processing method according to another embodiment of the present application. Referring to FIG. 6, the embodiment of the present application further provides another subtitle processing method, which mainly includes steps S41 to S43.

[0115] In step S41, the layout information of the target subtitle is obtained, where the layout information includes a correspondence between the target style attribute of the target subtitle and the canvas. Taking the style attribute related to the display position and size as an example, the correspondence may be a proportional value between the attribute value of the target style attribute and the attribute value of the canvas.

[0116] In step S42, a specific value of the style attribute adapted to the predetermined format of the target subtitle is determined based on the correspondence between the target style attribute of the target subtitle and the canvas and the attribute of the canvas corresponding to the predetermined format.

[0117] In step S43, values ​​are identified based on style attributes that apply to a predetermined format of the target subtitle, and the target subtitle is rendered on a canvas corresponding to the predetermined format.

[0118] Note that, if the initial format of the target subtitle is different from the predetermined format, in the above step S42, the specific value of the style attribute of the target subtitle determined based on the attribute of the canvas corresponding to the predetermined format is not the initially specified value of the style attribute of the target subtitle, but a modified style attribute adapted to the predetermined format, which corresponds to the second attribute value in the embodiment corresponding to the above FIG. 1.

[0119] As a specific example, the target style attribute of the target subtitle includes attributes related to the display position and dimensions. The attributes of the canvas corresponding to the predetermined formula include the position and dimensions of the canvas. The correspondence relationship between the target style attribute and the canvas includes the proportional relationship between the target style attribute and the canvas attribute. Therefore, when adjusting a style attribute such as coordinate, position, pitch, etc., if the percentage relationship of the style attribute with the canvas in the x-axis and y-axis directions is specified, when the canvas is enlarged and adjusted by δ times, the percentage relationship between the style attribute and the canvas remains unchanged, and the attribute value of the style attribute is equally enlarged by δ times.

[0120] Preferably, the predetermined format may be a low format that occupies a small amount of preset memory space, a high-definition format, or a format that conforms to the standard of a display device.

[0121] The main difference between the subtitle processing method illustrated in FIG. 6 and the subtitle processing method illustrated in FIG. 1 is the manner in which the placement information of the target subtitle is initially obtained. The subsequent rendering props are basically the same. Therefore, the above specific details corresponding to FIG. 1 also apply to the subtitle processing method illustrated in FIG. 6. For detailed descriptions and technical effects thereof, please refer to the corresponding descriptions in each of the above embodiments, and the description will be omitted here.

[0122] 7 is a schematic block diagram of a subtitle processing device according to an embodiment of the present application. Referring to FIG. 7, the embodiment of the present application further provides a subtitle processing device 100, which mainly includes an acquisition module 101, a correction module 102 and a rendering module 103.

[0123] Here, the obtaining module 101 obtains the layout information of the target subtitle, where the layout information includes the initial format of the target subtitle and the first attribute value of the target style attribute.

[0124] In some variants of the present application, the acquisition module 101 is specifically used for analyzing an initial code stream and an initial format of the target subtitle from the media stream, and performing content analysis on the initial code stream to obtain a first attribute value.

[0125] The modifying module 102 is used to modify the first attribute value to the second attribute value according to the corresponding relationship between the initial formula and the predetermined formula when the initial formula acquired by the acquiring module 101 is different from the predetermined formula.

[0126] The rendering module 103 is used to render the target subtitle in a canvas corresponding to a predetermined style according to the second attribute value obtained by the modification module 102. In some variations of the present application, the target style attribute includes a style attribute related to a display position or a size of the target subtitle.

[0127] In some variants of the present application, the predetermined format includes a predetermined resolution standard, the initial format includes an initial resolution standard of the target subtitle, and the correspondence relationship between the initial format of the target subtitle and the predetermined format includes a numerical relationship corresponding to the predetermined resolution standard and the initial resolution standard. The modifying module 102 is specifically used for determining a numerical relationship between the predetermined resolution standard and the initial resolution standard acquired by the acquiring module 101, and modifying the first attribute value according to the numerical relationship, so as to obtain a modified second attribute value.

[0128] In some variants of the present application, the subtitle processing device 100 further includes a creation module (not shown) used to create a canvas corresponding to a predetermined format before the rendering module 103 renders the target subtitle on the canvas corresponding to the predetermined format based on the second attribute value.

[0129] In some variants of the present application, the subtitle processing device 100 further includes a display module (not shown) used to display a subtitle image adapted to a predetermined format obtained by the rendering module 103 rendering the target subtitle on a canvas corresponding to the predetermined format based on the second attribute value.

[0130] In addition, each subtitle processing device 100 illustrated in the embodiments of the present application includes modules and units corresponding to executing the methods of each of the above embodiments, and for detailed descriptions and technical effects thereof, please refer to the descriptions of each of the above embodiments, and no further description will be given here.

[0131] 8 is a schematic block diagram of a subtitle processing device according to another embodiment of the present application. Referring to FIG. 8, the embodiment of the present application further provides a subtitle processing device 100', which mainly includes an acquisition module 101', a determination module 112 and a rendering module 103'.

[0132] Here, the acquiring module 101' acquires the layout information of the target subtitle, where the layout information is used for including the corresponding relationship between the target style attribute of the subtitle and the canvas.

[0133] The determination module 112 is used for determining a specific value of the style attribute adapted to the predetermined format of the target subtitle based on the corresponding relationship between the target style attribute of the target subtitle and the canvas and the attribute of the canvas corresponding to the predetermined format.

[0134] The rendering module 103' is used to determine values ​​according to style attributes that are adapted to a predetermined format of the target subtitle, and render the target subtitle on a canvas corresponding to the predetermined format.

[0135] In addition, each subtitle processing device 100' illustrated in the embodiments of the present application includes modules and units corresponding to executing the methods of each of the above embodiments, and for detailed descriptions and technical effects thereof, please refer to the corresponding descriptions of each of the above embodiments, and no further description will be given here.

[0136] 9 is a schematic block diagram of a subtitle processing device according to an embodiment of the present application. As shown in FIG. 9, a subtitle processing device 200 provided in the embodiment of the present application includes a memory 201 and a processor 202.

[0137] The memory 201 is used to store non-transitory computer readable instructions. Specifically, the memory 201 may include one or more computer program products. The computer program products may include various forms of computer readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include read only memory (ROM), a hard disk, a flash memory, etc.

[0138] The processor 202 may be a central processing unit (CPU) or other type of processing unit having data processing and / or instruction execution capabilities, and can control other components in the subtitling processing device 200 to perform desired functions. In one example of the present application, the processor 202 is used to execute computer-readable instructions stored in the memory 201, so as to cause the subtitling processing device 200 to perform all or part of the steps of the subtitling processing method provided by the above embodiment of the present invention.

[0139] Those skilled in the art will recognize that in order to solve the technical problems to obtain a good user experience, this embodiment may include well-known configurations such as communication buses and interfaces, and these well-known structures should also be included in the scope of protection of the present application.

[0140] For detailed description and technical effects of this embodiment, please refer to the description of each embodiment above, and no further description will be given here.

[0141] An embodiment of the present application further provides a computer storage medium having stored therein computer instructions, which, when executed by an apparatus, causes the apparatus to perform the relevant method steps, thereby realizing the subtitle processing method in the embodiment.

[0142] The embodiment of the present application further provides a computer program product, which, when executed on a computer, causes the computer to perform the relevant method steps, thereby realizing the subtitle processing method in the embodiment.

[0143] Moreover, the embodiments of the present application further provide an apparatus, which may be specifically a chip, an assembly, or a module, and which may include a processor and a memory connected thereto, where the memory is used to store computer-executable instructions, and the processor can execute the computer-executable instructions stored in the memory when the apparatus is executed, so as to cause the chip to perform the subtitle processing method in each of the above method embodiments.

[0144] Herein, the apparatus, computer storage medium, computer program product, or chip provided in the present application can be used to implement the related methods disclosed above, and therefore, the achievable effects thereof can refer to the effects of the corresponding methods disclosed above, and will not be further described herein.

[0145] The above is merely a preferred embodiment of the present application, and does not limit the present application. The present application discloses the above preferred embodiment, but does not limit the present application. If a person skilled in the art can easily change or modify the above disclosed technical content without departing from the technical scope of the present application, it is an equivalent embodiment of an equivalent modification. If it does not deviate from the content of the technical solution of the present application, any simple change, equivalent modification and modification made to the above disclosed embodiment based on the technical idea of ​​the present application all belong to the scope of the technical solution of the present application. [Explanation of symbols]

[0146] 100 Subtitle processing device 100' Subtitle processing device 101 Acquisition Module 101' Acquisition Module 102 Correction Module 103 Rendering Module 103' Rendering Module 112 Decision Module 200 Subtitling equipment 201 Memory 202 Processor S11 Step S12 Step S13 Step S21 Step S22 Step S23 Step S24 Step S25 Step S26 Step S31 Step S32 Step S33 Step S34 Step S35 Step S36 Step S41 Step S42 Step S43 Step

Claims

1. Creating a canvas corresponding to a predetermined format; Obtaining layout information of a target subtitle, the layout information including an initial style of the target subtitle and a first attribute value of a target style attribute; When the initial formula and the predetermined formula are different, modifying the first attribute value to a second attribute value based on a correspondence relationship between the initial formula and the predetermined formula; rendering the target subtitle on a canvas corresponding to the predetermined format based on the second attribute value to obtain a subtitle image of the target subtitle adapted to the predetermined format.

2. The predetermined format includes a predetermined resolution standard, the initial format includes an initial resolution standard of the target subtitle, and the correspondence relationship includes a numerical relationship corresponding to the predetermined resolution standard and the initial resolution standard; modifying the first attribute value to a second attribute value based on a correspondence relationship between the initial formula and the predetermined formula, determining the numerical relationship based on the predetermined resolution standard and the initial resolution standard; and modifying the first attribute value based on the numerical relationship to obtain a modified second attribute value.

3. The subtitle processing method according to claim 1 or 2, wherein the target style attribute includes a style attribute related to a display position or a size of the target subtitle.

4. The obtaining of the target subtitle placement information includes: Parsing an initial code stream and an initial format of the target subtitle from a media stream; 3. A method according to claim 1 or 2, further comprising: performing a content analysis on said initial codestream to obtain said first attribute value.

5. After rendering the target subtitle on a canvas corresponding to the predetermined format based on the second attribute value, 3. The method of claim 1, further comprising: displaying a subtitle image adapted to the predetermined format obtained by rendering the target subtitle on a canvas corresponding to the predetermined format based on the second attribute value.

6. Displaying a subtitle image adapted to the predetermined format obtained by rendering the target subtitle on a canvas corresponding to the predetermined format based on the second attribute value, 6. The method for processing subtitles according to claim 5, further comprising transmitting a subtitle image adapted to the predetermined format obtained by rendering the target subtitle on a canvas corresponding to the predetermined format based on the second attribute value to the display module of a terminal device so that the display module displays the subtitle on a screen.

7. before transmitting a subtitle image adapted to the predetermined format obtained by rendering the target subtitle on a canvas corresponding to the predetermined format based on the second attribute value to the display module of the terminal device so that the display module displays the subtitle on a screen; 7. The subtitle processing method according to claim 6, further comprising temporarily storing in a memory block RGBA data of a subtitle image adapted to the predetermined format obtained by rendering the target subtitle on a canvas corresponding to the predetermined format based on the second attribute value.

8. After obtaining the target subtitle placement information, Rendering a subtitle image based on the initial style of the target subtitle according to a first attribute value of the target style attribute; 3. The method for processing subtitles according to claim 1, further comprising: adjusting a subtitle image of the initial format based on a correspondence relationship between the predetermined format and an initial format of the target subtitle, to adjust the subtitle image to a canvas that matches the predetermined format.

9. 3. The subtitle processing method according to claim 1, wherein the target subtitle is a Closed Captions subtitle using the TTML2 standard in the ISDB-S3 standard.

10. A creation module adapted to create a canvas corresponding to a predetermined formula; an acquiring module for acquiring layout information of a target subtitle, the layout information including an initial format of the target subtitle and a first attribute value of a target style attribute; a correction module, which is used to correct the first attribute value to a second attribute value according to a corresponding relationship between the initial formula and the predetermined formula when the initial formula acquired by the acquisition module is different from the predetermined formula; a rendering module used for rendering the target subtitle on the canvas created by the creation module based on the second attribute value obtained by the modification module to obtain a subtitle image of the target subtitle that conforms to the predetermined format.

11. The predetermined format includes a predetermined resolution standard, the initial format includes an initial resolution standard of the target subtitle, and the correspondence relationship includes a numerical relationship corresponding to the predetermined resolution standard and the initial resolution standard; The subtitle processing device according to claim 10, wherein the modification module is used for determining the numerical relationship based on the predetermined resolution standard and the initial resolution standard acquired by the acquisition module, and modifying the first attribute value based on the numerical relationship to obtain a modified second attribute value.

12. The subtitle processing device according to claim 10 or 11, wherein the acquisition module is adapted to analyze an initial code stream and the initial format of the target subtitle from a media stream, and perform content analysis on the initial code stream to obtain the first attribute value.

13. The subtitle processing device according to claim 12, wherein the obtaining module is used for rendering a subtitle image based on the initial format of the target subtitle according to a first attribute value of the target style attribute, and for adjusting the subtitle image of the initial format according to a correspondence relationship between the predetermined format and the initial format of the target subtitle, to adjust the subtitle image to a canvas that matches the predetermined format.

14. The subtitle processing device according to claim 10 or 11, further comprising a display module used for displaying a subtitle image adapted to the predetermined format obtained by rendering the target subtitle on a canvas corresponding to the predetermined format by the rendering module based on the second attribute value.

15. The subtitle processing device according to claim 14, wherein the revealing module is used for transmitting a subtitle image adapted to the predetermined format obtained by rendering the target subtitle on a canvas corresponding to the predetermined format based on the second attribute value to the display module of a terminal device, so that the subtitle is displayed on a screen by a display module.

16. The subtitle processing device according to claim 14, wherein the revealing module is used for temporarily storing in a memory block RGBA data of a subtitle image adapted to the predetermined format obtained by rendering the target subtitle on a canvas corresponding to the predetermined format based on the second attribute value.

17. a memory adapted to store non-transitory computer readable instructions; A processor adapted to execute the computer-readable instructions to realize the subtitle processing method according to claim 1 or 2 when the computer-readable instructions are executed by the processor.

18. A computer storage medium containing computer instructions which, when executed on a device, cause the device to perform the method for processing subtitles according to claim 1 or 2.

Citation Information

Patent Citations

  • Method for producing and modifying captions

    CN101594481A

  • Mobile terminal and control method thereof

    EP2600628A2

  • Receiving apparatus and display device

    JP2007049747A

  • Data broadcasting content reproducing apparatus and data broadcasting content reproducing method

    JP2008067223A

  • Digital cinema reproduction apparatus, digital cinema reproduction method and digital cinema reproduction program

    JP2009081610A