WO2022227974A1 - 字幕处理方法、装置、设备及存储介质 - Google Patents

字幕处理方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2022227974A1
WO2022227974A1 PCT/CN2022/083209 CN2022083209W WO2022227974A1 WO 2022227974 A1 WO2022227974 A1 WO 2022227974A1 CN 2022083209 W CN2022083209 W CN 2022083209W WO 2022227974 A1 WO2022227974 A1 WO 2022227974A1
Authority
WO
WIPO (PCT)
Prior art keywords
subtitle
format
target
attribute value
original
Prior art date
Application number
PCT/CN2022/083209
Other languages
English (en)
French (fr)
Inventor
伍洋
罗阳志
Original Assignee
深圳Tcl新技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳Tcl新技术有限公司 filed Critical 深圳Tcl新技术有限公司
Priority to JP2023560195A priority Critical patent/JP2024513380A/ja
Publication of WO2022227974A1 publication Critical patent/WO2022227974A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/235Processing of additional data, e.g. scrambling of additional data or processing content descriptors
    • H04N21/2355Processing of additional data, e.g. scrambling of additional data or processing content descriptors involving reformatting operations of additional data, e.g. HTML pages
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/235Processing of additional data, e.g. scrambling of additional data or processing content descriptors
    • H04N21/2355Processing of additional data, e.g. scrambling of additional data or processing content descriptors involving reformatting operations of additional data, e.g. HTML pages
    • H04N21/2356Processing of additional data, e.g. scrambling of additional data or processing content descriptors involving reformatting operations of additional data, e.g. HTML pages by altering the spatial resolution
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/435Processing of additional data, e.g. decrypting of additional data, reconstructing software from modules extracted from the transport stream
    • H04N21/4355Processing of additional data, e.g. decrypting of additional data, reconstructing software from modules extracted from the transport stream involving reformatting operations of additional data, e.g. HTML pages on a television screen
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/435Processing of additional data, e.g. decrypting of additional data, reconstructing software from modules extracted from the transport stream
    • H04N21/4355Processing of additional data, e.g. decrypting of additional data, reconstructing software from modules extracted from the transport stream involving reformatting operations of additional data, e.g. HTML pages on a television screen
    • H04N21/4356Processing of additional data, e.g. decrypting of additional data, reconstructing software from modules extracted from the transport stream involving reformatting operations of additional data, e.g. HTML pages on a television screen by altering the spatial resolution, e.g. to reformat additional data on a handheld device, attached to the STB
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/488Data services, e.g. news ticker
    • H04N21/4884Data services, e.g. news ticker for displaying subtitles

Definitions

  • the present application relates to the field of multimedia technologies, and in particular, to a subtitle processing method, apparatus, device, and storage medium.
  • TTML2 Timed Text Markup Language 2
  • TTML2 Timed Text Markup Language 2
  • TTML2 Timed Text Markup Language 2
  • TTML2 Timed Text Markup Language 2
  • TTML2 Timed Text Markup Language 2
  • 4K format the second edition of Timed Text Markup Language
  • 8K format the difference between 2K and 4K formats.
  • the difference between 2K and 4K formats includes the different canvases they are in. For example, when the subtitle area is 960*540px, for a 2K canvas (1920*1080px), the rendering image should occupy 10% of the display screen.
  • the purpose of this application is to provide a new subtitle processing method, apparatus, device and storage medium.
  • a subtitle processing method proposed in the present application includes: acquiring configuration information of target subtitles, the configuration information including an original format of the target subtitle and a first attribute value of a target style attribute; When the formats are different, modify the first attribute value to a second attribute value according to the corresponding relationship between the original format and the preset format; according to the second attribute value on the canvas corresponding to the preset format
  • the target subtitle is rendered.
  • the preset format includes a preset resolution specification
  • the original format includes an original resolution specification of the target subtitle
  • the corresponding relationship includes the preset resolution specification and the original resolution specification
  • the modifying the first attribute value to the second attribute value according to the corresponding relationship between the original format and the preset format includes: according to the preset resolution specification and the original format
  • the resolution specification determines the numerical relationship; and the first attribute value is modified according to the numerical relationship to obtain the modified second attribute value.
  • the method before rendering the target subtitle on the canvas corresponding to the preset format according to the second attribute value, the method further includes: creating a canvas corresponding to the preset format.
  • the target style attribute includes a style attribute related to the display position or size of the target subtitle.
  • the obtaining the configuration information of the target subtitle includes: parsing the original code stream and the original format of the target subtitle from the media stream; performing content analysis on the original code stream to obtain the Describe the first attribute value.
  • the method further includes: rendering the target subtitle according to the second attribute value in the preset format.
  • a subtitle image adapted to the preset format obtained by rendering the target subtitle on the canvas corresponding to the format is displayed.
  • the target subtitles are Closed Captions subtitles using the TTML2 standard under the ISDB-S3 standard.
  • a subtitle processing apparatus proposed according to the present disclosure includes: an acquisition module configured to acquire configuration information of target subtitles, where the configuration information includes an original 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 the corresponding relationship between the original format and the preset format when the original format acquired by the acquiring module is different from the preset format; and , a rendering module, configured to render the target subtitle on the canvas corresponding to the preset standard according to the second attribute value modified by the modification module.
  • the preset format includes a preset resolution specification
  • the original format includes an original resolution specification of the target subtitle
  • the corresponding relationship includes the preset resolution specification and the original resolution specification corresponding numerical relationship
  • the modifying module is specifically configured to: determine the numerical relationship according to the preset resolution specification and the original resolution specification acquired by the acquisition module; The attribute value is modified to obtain the modified second attribute value
  • the aforementioned subtitle processing apparatus further includes: a creation module, configured to create a corresponding subtitle before the rendering module renders the target subtitle on the canvas corresponding to the preset format according to the second attribute value. Set the canvas corresponding to the format.
  • the target style attribute includes a style attribute related to the display position or size of the target subtitle.
  • the acquisition module is specifically configured to: parse out the original code stream and the original format of the target subtitle from the media stream; perform content analysis on the original code stream to obtain the first property value.
  • the aforementioned subtitle processing apparatus further includes: a display module for adapting the target subtitle obtained by the rendering module by rendering the target subtitle on the canvas corresponding to the preset format according to the second attribute value to the The subtitle image of the preset format is displayed.
  • a subtitle processing device proposed according to the present disclosure includes: a memory for storing non-transitory computer-readable instructions; and a processor for executing the computer-readable instructions, so that when the processor executes, any of the foregoing can be implemented.
  • a subtitle processing method includes: a memory for storing non-transitory computer-readable instructions; and a processor for executing the computer-readable instructions, so that when the processor executes, any of the foregoing can be implemented.
  • a computer-readable storage medium proposed according to the present disclosure is used to store non-transitory computer-readable instructions, and when the non-transitory computer-readable instructions are executed by a computer, the computer is made to perform any one of the foregoing subtitle processing. method.
  • the subtitle processing method, device, device and storage medium proposed in this application use a canvas of a unified preset format.
  • the original format of the target subtitle to be processed is different from the preset format, according to the original format of the target subtitle.
  • the corresponding relationship between the format and the preset format modify the original attribute value of the target style attribute of the target subtitle to obtain the modified attribute value suitable for the preset format, and then based on the modified attribute value on the canvas of the preset format.
  • Rendering can avoid the reconstruction of the canvas when the subtitle format changes, which is conducive to improving the system performance, and is conducive to subtitle processing such as subtitle canvas creation, subtitle image generation, storage and transmission.
  • FIG. 1 is a schematic flowchart of a subtitle processing method according to an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of a subtitle processing method according to another embodiment of the present application.
  • FIG. 3 is a schematic flowchart of a subtitle processing method according to another embodiment of the present application.
  • FIG. 4 is a schematic flowchart of two subtitle rendering modes provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of font scaling provided by an embodiment of the present application.
  • FIG. 6 is a schematic flowchart of a subtitle processing method according to another embodiment of the present application.
  • FIG. 7 is a schematic diagram of a subtitle processing apparatus according to an embodiment of the present application.
  • FIG. 8 is a schematic diagram of a subtitle processing apparatus according to another embodiment of the present application.
  • FIG. 9 is a schematic diagram of a subtitle processing device according to an embodiment of the present application.
  • FIG. 1 is a schematic flowchart of an embodiment of a subtitle processing method of the present application.
  • the subtitle processing method exemplified in the present application mainly includes steps S11 to S13 .
  • Step S11 the terminal device acquires configuration information of the target subtitle, where the configuration information includes the original format of the target subtitle and the first attribute value of the target style attribute.
  • the terminal device may be implemented in various forms, which may include, but are not limited to, fixed terminal devices such as televisions, desktop computers, etc., as well as smart phones, notebook computers, digital broadcast receivers, and PDAs (personal digital assistants).
  • PAD tablet computer
  • PMP portable multimedia player
  • navigation device vehicle terminal equipment, vehicle display terminal, vehicle electronic rearview mirror and other mobile terminal equipment and other electronic equipment.
  • the processed subtitles include subtitles in broadcast television signals, subtitles in media data stored in computer storage media, and the like.
  • the target subtitles are Closed Captions (CC for short, closed subtitles, using the TTML2 specification) subtitles under the ISDB-S3 standard.
  • the subtitle format may include a resolution specification of the subtitle.
  • the resolution of the subtitle may also be referred to as the size of the pixel representation, the resolution of the canvas, the size of the canvas, or the number of pixels of the canvas.
  • the canvas format involved in this application may be the current commonly used format or the standard format, or may not be the commonly used format or the standard format.
  • the resolution specification of the current subtitle can be any size, including but not limited to 1280 ⁇ 720, 1920 ⁇ 1080, 3840 ⁇ 2160, 2048 ⁇ 1080, 4096 ⁇ 2160, and so on.
  • the subtitle formats conforming to the TTML 2 specification in the ISDB-S3 standard generally include 2K, 4K and 8K formats.
  • the subtitle style attribute refers to an attribute related to the subtitle style.
  • the subtitle style attribute may include: font color (font color), font size (font size), background color (background color), display coordinate value (origin), transparency (opacity), subtitle display area of the subtitle A series of properties related to subtitle display, such as width and height (extent) or line-height (line-height), border width, font stroke size, font spacing, line spacing, character spacing, special effect position, offset position, etc.
  • the target style attribute includes one or more style attributes related to the display and/or size of the subtitle, for example, the target style attribute includes font size or display coordinate value, etc. Some or all properties related to size.
  • target style attribute may include other types of style attributes in addition to style attributes related to the display or size of subtitles, which are not limited in this embodiment of the present application.
  • the configuration information of the x-axis direction (display width direction) and the y-axis direction (display height direction) can be obtained separately.
  • the canvas width format and canvas height format of the target subtitle are obtained respectively.
  • the target style Attributes to obtain 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 also possible to obtain only the configuration information of the subtitle in one direction in the width direction and the height direction, without obtaining the configuration information in the other direction, and furthermore, in the subsequent steps, the subtitle style attribute value of the corresponding direction is not adjusted.
  • the terminal device first acquires configuration information of the target subtitle, where the configuration information includes the original format of the target subtitle and the first attribute value of the target style attribute.
  • the original format of the target subtitle refers to the original configured format of the target subtitle, for example, the original configured resolution specification.
  • the first attribute value of the target style attribute refers to the originally configured attribute value of the target style attribute of the target subtitle.
  • the terminal device parses the original format of the original configuration of the target subtitle and the original code stream of the target subtitle from the media stream.
  • the original format of the target subtitles obtained from the media stream is 4K.
  • the terminal device parses the content of the original code stream to obtain the first attribute value of the target style attribute.
  • the target style attribute includes the font size of the target subtitle, the display coordinate value, and the width and height of the display area.
  • the first attribute value of the target style attribute (that is, the originally configured attribute value) is obtained. ) are: the font size is 20px, the display coordinates are (200, 200), and the width and height of the display area (1000, 240).
  • the media stream generally has a field for identifying the subtitle format, which may be located in the subtitle control stream, and the original format of the target subtitle can be directly obtained by acquiring and parsing this field.
  • audio, video, and subtitle streams are generally mixed (mux) in the media stream, so the aforementioned original code stream for parsing the subtitles from the media stream includes demultiplexing the media stream (demux) to obtain the respective data. .
  • the configuration information of the target subtitles may include other types of information related to the target subtitles in addition to the original format of the target subtitles and the first attribute value of the target style attribute.
  • the embodiment does not limit this.
  • Step S12 when the original format of the target subtitle is different from the preset format, the terminal device modifies the first attribute value of the target subtitle to the second attribute value according to the corresponding relationship between the preset format and the original format of the target subtitle.
  • the preset format is a preset subtitle format.
  • the preset format is not related to the target subtitle, that is, it will not be changed according to the change of the target subtitle.
  • the preset format that can be preset may be a commonly used subtitle format under the adopted subtitle standard, or a subtitle format suitable for the specifications of display devices such as the screen on which the target subtitles are displayed, or a subtitle format that occupies less storage space.
  • the aforementioned display device specifications such as a screen include an aspect ratio of the screen, such as 16:9, 16:10, and the like.
  • the adopted subtitles are those based on the TTML2 specification under the ISDB-S3 standard.
  • Subtitles that conform to the TTML 2 specification in the ISDB-S3 standard generally include 2K, 4K, and 8K formats.
  • the preset preset format in the embodiment of this application is 2K, which is implemented in this application.
  • a preset 2K canvas is uniformly created, such as a 16:9 2K canvas with a size of 1920*1080.
  • the corresponding preset format can be determined for the x-axis direction (display width direction) and the y-axis direction (display height direction) respectively, for example, the preset value of the canvas width of the subtitle is preset to 1920, and the The canvas height preset value is preset to 1080.
  • the terminal device after the terminal device obtains the original format of the target subtitle and the first attribute value of the target style attribute, if the original format of the target subtitle is different from the preset format, the terminal device will use the preset format and the target subtitle according to the difference between the original format and the preset format.
  • the corresponding relationship of the original format is to modify the first attribute value of the target subtitle to the second attribute value. For example, if the original format of the target subtitle is 4K and the preset format is 2K, the terminal device modifies the first attribute value of the target style attribute of the target subtitle to be the same as the preset format 2K according to the corresponding relationship between 4K and 2K.
  • the corresponding second attribute value is to modify the first attribute value of the target style attribute of the target subtitle to be the same as the preset format 2K according to the corresponding relationship between 4K and 2K.
  • the corresponding relationship between the preset format and the original format may specifically refer to the corresponding numerical relationship between the original resolution specification of the target subtitle and the preset resolution specification.
  • the terminal device modifies the first attribute value originally taken by the target style attribute to the second attribute value according to the scaling coefficient.
  • the obtained second attribute value is the attribute value of the target style attribute corresponding to the preset standard 2K.
  • Table 1 a modification example of the target style attribute provided by the embodiment of the present application is provided.
  • the target style attribute in the embodiment of the present application includes the font size of the target subtitle, the display coordinate value, the width and height of the display area, and the line height, and the first attribute value (that is, the originally configured attribute value) is respectively:
  • the font size is 20px
  • the display coordinates are (200, 200)
  • the width and height of the display area are (1000, 240)
  • the line height is 240.
  • Table 1 shows an optional example of modification of the target style attribute, which should not be construed as a limitation to the present application.
  • any corresponding target style attribute can be modified.
  • the subtitle style attributes that can be adjusted may further include: border width size (Border-length), font stroke size (Outline-length), blur radius Size (Blur-radius), Padding, Letter-spacing, Shadow-offset, etc.
  • the correspondence between the preset format and the original format may also include other correspondences, and the above is only an example of the correspondence between the preset format and the original format, and should not be construed as a limitation to the present application.
  • Step S13 the terminal device renders the target subtitle on the canvas corresponding to the preset format according to the second attribute value of the target style attribute.
  • the terminal device modifies the first attribute value of the target subtitle to the second attribute value according to the corresponding relationship between the preset format and the original format of the target subtitle, according to the modified second attribute value in the
  • the target subtitle is rendered on the canvas corresponding to the preset format, so as to obtain a subtitle image (also referred to as a subtitle layer) of the target subtitle that is adapted to the preset format.
  • the canvas corresponding to the preset format is any time before the terminal device performs the aforementioned "rendering the target subtitles on the canvas corresponding to the preset format according to the second attribute value of the target style attribute". created.
  • the canvas is the abstract space on which the subtitles are rendered.
  • the subtitles are rendered as an image on the canvas, and the size of the canvas can be set to 1920*1080; while the specifications of the video or screen are the logical concept of display, which needs to be displayed. Scale the 1920*1080 image to the size of the display form.
  • a subtitle image based on a preset format is obtained after rendering the subtitle data, rather than a subtitle image based on the original format of the target subtitle.
  • the rendering in this embodiment of the present application refers to the process of subtitles being expressed from original text to drawing image content on a canvas.
  • the result of rendering on the canvas is RGBA (representing a color space that includes red, green, blue, and alpha channels) data stored in a memory block, which is kept in memory.
  • the terminal device After rendering the image data of the target subtitle, the terminal device will temporarily store the image data for subsequent processing such as display.
  • a canvas of a unified preset format is used.
  • the original format of the target subtitle to be processed is different from the preset format, the corresponding relationship between the original format and the preset format of the target subtitle is determined.
  • modify the first (original) attribute value of the target style attribute of the target subtitle to obtain the second attribute value suitable for the preset format, and finally render on the canvas of the preset format based on the modified second attribute value, In this way, canvas reconstruction during the system switching process can be avoided, which is beneficial to improve system performance.
  • switching of subtitle formats may occur in many situations, including but not limited to when different sources are switched to each other, the canvas format on which subtitles are based may change.
  • the format of the subtitles of the TV program generally also changes with the format of the TV program.
  • the subtitle format may change because the resolution of the message, news, or advertisement may be different from the currently playing media format.
  • the subtitle format switching will also occur when the subtitles are switched.
  • the subtitle processing method provided in the embodiment of the present application performs subtitle processing, when the canvas format on which the subtitles are based changes, the pre-created canvas corresponding to the preset format is used to render the switched subtitles instead of creating a new canvas. Thereby, the canvas reconstruction during the system switching process can be reduced.
  • FIG. 2 is a schematic diagram of another embodiment of a subtitle processing method provided by an embodiment of the present application.
  • Another embodiment of the subtitle processing method provided by the embodiment of the present application shown in FIG. 2 includes steps S21 to S26.
  • Step S21 creating a canvas corresponding to a preset format, where the preset format is a preset low format that occupies less storage space.
  • the terminal device reads a preconfigured preset subtitle format that occupies a small storage space, and creates a canvas corresponding to the preset subtitle format, and the canvas is used for rendering subtitle images in subsequent steps.
  • the canvas corresponding to the preset format is created in advance by the terminal device.
  • the terminal device can create a canvas corresponding to the preset format only once, and in a subsequent preset time period, the terminal device can render subtitles based on the canvas for the subtitles in any media stream received by the terminal device.
  • the preset format in this embodiment is a preset low format that occupies less storage space, for example, is a low format that occupies less storage space or the smallest storage space among commonly used subtitle formats.
  • the subtitles conforming to the TTML2 specification in the ISDB-S3 standard generally include the 2K, 4K and 8K formats specified in the specification, and the subtitles are performed using the methods shown in the embodiments of the present application.
  • a 2K canvas is created uniformly, which can be a 16:9 2K canvas with a size of 1920*1080.
  • Step S22 obtaining configuration information of the target subtitle.
  • the terminal device acquires the media stream, parses the original format and original code stream of the target subtitle from the media stream, and performs content analysis on the original code stream to obtain the first subtitle of the target style attribute of the target subtitle.
  • An attribute value original attribute value
  • the process of obtaining the original format of the target subtitles specifically includes: parsing the subtitle specifications used by the current TTML subtitles from the pcap stream, for example, determining whether the target subtitles are 2K, 4K or 8K format, for example, the original format is 4K.
  • the process of obtaining the first attribute value of the target style attribute of the target subtitle specifically includes: parsing the original code stream of the current TTML subtitle from the pcap code stream, and performing content analysis on the TTML subtitle to obtain the original attribute set by the target style of the subtitle. value, that is, the aforementioned first attribute value.
  • the target style attribute includes the font size of the target subtitle, the display coordinate value, and the width and height of the display area.
  • the first attribute value of the target style attribute (that is, the originally configured attribute value) is obtained. ) are: the font size is 20px, the display coordinates are (200, 200), and the width and height of the display area (1000, 240).
  • the pcap stream is a datagram commonly used in network packet capture and network packet analysis. It should be noted that this application does not limit the media stream to be used, in addition to the aforementioned pcap code stream, other types and formats of data such as RTP code stream packets can also be used.
  • step S22 in this embodiment of the present application can be understood by referring to step S11 in FIG. 1 , and details are not described here.
  • Step S23 judging whether the original format of the target subtitle is the same as the preset format.
  • step S22 after step S22 is performed to obtain the original format of the target subtitles, the terminal device judges according to the original format and the preset preset format in step S21: the original format and preset format of the target subtitles is the same.
  • step S24 if the judgment result in step S23 is that the original format of the target subtitle is different from the preset format, the terminal device modifies the first attribute value of the target subtitle according to the corresponding relationship between the preset format and the original format of the target subtitle. is the second attribute value, where the preset format is a preset low format that occupies less storage space.
  • step S24 in this embodiment of the present application can be understood by referring to step S12 in FIG. 1 , and details are not described here.
  • Step S25 according to the second attribute value of the target style attribute of the target subtitle, the target subtitle is rendered on the canvas corresponding to the preset format, so as to obtain the subtitle image of the target subtitle that is suitable for the preset low format subtitle image that occupies a small storage space .
  • step S25 in this embodiment of the present application can be understood by referring to the step S13 in FIG. 1 , and details are not repeated here.
  • Step S26 displaying the subtitle image.
  • the terminal device after obtaining the subtitle image of the target subtitle that is suitable for the preset format, the terminal device will also display the subtitle image, and generally the rendered subtitle image can be transmitted to the display module of the terminal device (for example, a TV or the graphics processor GPU in the computer) for the display module to display the subtitles on the screen.
  • the display module can adjust and zoom by itself to display full screen or adjust to any other display area.
  • the subtitle processing method provided by the embodiment adopts a canvas of a unified preset format, and when the original format of the target subtitle to be processed is different from the preset format, according to the difference between the original format of the target subtitle and the preset format The corresponding relationship between the two, modify the first (original) attribute value of the target style attribute of the target subtitle to obtain the second attribute value suitable for the preset format, and finally use the modified second attribute value in the preset format canvas.
  • Rendering is performed on the system, so as to avoid canvas reconstruction during the system switching process, which is beneficial to improve system performance.
  • the preset format used is a preset low format that occupies less storage space, it can reduce the memory space required for subtitle processing such as canvas creation, subtitle image generation, storage, transmission, and on-screen display, etc. It can reduce the memory consumption in the rendering process, and avoid the subtitles that cannot be displayed due to the application of large memory.
  • the use of the subtitle processing method shown in this application can reduce the memory usage of ISDB-S3CC subtitles, and on devices such as TVs, it is avoided that the memory usage is too high and other processes are cleared due to insufficient memory (kill) , while also improving rendering efficiency.
  • FIG. 3 is a schematic diagram of another embodiment of a subtitle processing method provided by an embodiment of the present application.
  • Another embodiment of the subtitle processing method provided by the embodiment of the present application shown in FIG. 3 includes steps S31 to S36.
  • Step S31 creating a canvas corresponding to a preset format, where the preset format is a preset high-definition high-definition format.
  • the terminal device reads a preconfigured high-definition preset subtitle format, and creates a canvas corresponding to the preset subtitle format, and the canvas is used for rendering subtitle images in subsequent steps.
  • the canvas corresponding to the preset format is created in advance by the terminal device.
  • the terminal device can create a canvas corresponding to the preset format only once, and in a subsequent preset time period, the terminal device can render subtitles based on the canvas for the subtitles in any media stream received by the terminal device.
  • the preset format in this embodiment is a preset high-definition high-definition format, for example, a high-definition high-definition format among commonly used subtitle formats.
  • the subtitles conforming to the TTML2 specification in the ISDB-S3 standard generally include the 2K, 4K and 8K formats specified in the specification, and the subtitles are performed using the methods shown in the embodiments of the present application.
  • Unity creates the highest definition 8K canvas possible.
  • step S32 the configuration information of the target subtitle is acquired.
  • the terminal device acquires the media stream, parses the original format and original code stream of the target subtitle from the media stream, and performs content analysis on the original code stream to obtain the first subtitle of the target style attribute of the target subtitle.
  • An attribute value original attribute value
  • the process of obtaining the original format of the target subtitles specifically includes: parsing the subtitle specifications used by the current TTML subtitles from the pcap stream, for example, determining whether the target subtitles are 2K, 4K or 8K format, for example, the original format is 4K.
  • the process of obtaining the first attribute value of the target style attribute of the target subtitle specifically includes: parsing the original code stream of the current TTML subtitle from the pcap code stream, and performing content analysis on the TTML subtitle to obtain the original attribute set by the target style of the subtitle. value, that is, the aforementioned first attribute value.
  • the target style attribute includes the font size of the target subtitle, the display coordinate value, and the width and height of the display area.
  • the first attribute value of the target style attribute (that is, the originally configured attribute value) is obtained. ) are: the font size is 20px, the display coordinates are (200, 200), and the width and height of the display area (1000, 240).
  • the pcap stream is a datagram commonly used in network packet capture and network packet analysis. It should be noted that this application does not limit the media stream to be used, in addition to the aforementioned pcap code stream, other types and formats of data such as RTP code stream packets can also be used.
  • step S32 in this embodiment of the present application can be understood by referring to the step S11 in FIG. 1 , which is not repeated here.
  • Step S33 judging whether the original format of the target subtitle is the same as the preset format.
  • step S32 is performed to obtain the original format of the target subtitles
  • the terminal device judges according to the original format and the preset preset format in step S31: the original format of the target subtitles and the preset format is the same.
  • Step S34 if the judgment result in step S33 is that the original format of the target subtitle is different from the preset format, then the terminal device modifies the first attribute value of the target subtitle according to the corresponding relationship between the preset format and the original format of the target subtitle. is the second attribute value, wherein the preset format is a preset high-definition format.
  • step S34 in this embodiment of the present application can be understood by referring to step S12 in FIG. 1 , and details are not described here.
  • Step S35 Render the target subtitle on the canvas corresponding to the preset format according to the second attribute value of the target style attribute of the target subtitle, so as to obtain a subtitle image of the target subtitle that is suitable for the preset high-definition format.
  • Step S36 displaying the subtitle image.
  • the terminal device after obtaining the subtitle image of the target subtitle that is suitable for the preset format, the terminal device will also display the subtitle image, and generally the rendered subtitle image can be transmitted to the display module of the terminal device (for example, a TV or the graphics processor GPU in the computer) for the display module to display the subtitles on the screen.
  • the display module can adjust and zoom by itself to display full screen or adjust to any other display area.
  • the subtitle processing method provided by the embodiment adopts a canvas of a unified preset format, and when the original format of the target subtitle to be processed is different from the preset format, according to the difference between the original format of the target subtitle and the preset format The corresponding relationship between the two, modify the first (original) attribute value of the target style attribute of the target subtitle to obtain the second attribute value suitable for the preset format, and finally use the modified second attribute value in the preset format canvas.
  • Rendering is performed on the system, so as to avoid canvas reconstruction during the system switching process, which is beneficial to improve system performance.
  • the preset format used is a preset high-definition format, the definition of the subtitle can be improved, and the problem of blurring caused by being enlarged by the display module in the subsequent processing of the subtitle can be avoided.
  • the preset preset subtitle format is a canvas format that conforms to screen specifications, or a canvas format that is a commonly used standard format.
  • subtitles of different formats can be adjusted to subtitles that conform to screen specifications and subtitles of common standard formats, which is conducive to canvas creation and subtitle image generation. , storage, transmission and presentation of subtitle processing.
  • the aforementioned embodiments of the present application adopt the source-side scaling method, that is, scaling at the starting position of the business process, also known as the style attribute value modification method: firstly, the first attribute value of the target style attribute is adjusted to obtain the second style attribute value. attribute value, and then render according to the second attribute value to obtain a subtitle image conforming to the preset format. Therefore, when the foregoing embodiment is used, the style attribute value at the source endpoint will be directly adjusted to the value of the target point in proportion.
  • the end scaling method can also be used, that is, scaling at the end of the business process, also known as the method of modifying during rendering: first, according to the original setting value of the target style attribute of the subtitle (ie, the first attribute value) to render the subtitle image of the target subtitle based on its original format, and then adjust the subtitle image of its original format according to the corresponding relationship between the preset format and the original format of the target subtitle to adjust the subtitle image to the canvas that conforms to the preset format superior.
  • the original setting value of the target style attribute of the subtitle ie, the first attribute value
  • FIG. 4 is a schematic flowchart of two subtitle rendering methods proposed in the present application.
  • the original format of the target subtitle is 4K canvas resolution
  • the preset format is 2K canvas resolution.
  • the upper part in Figure 4 shows the situation where the aforementioned terminal scaling method (that is, the method of modification during rendering) is used: first render the content of 4K subtitles into 4K standard subtitles with a width and height of 400 ⁇ 100, and then scale them to width and height A subtitle layer with a height of 200 ⁇ 50 is placed on the 2K canvas, and finally the subtitle layer is sent to the display module for the hardware of the display module to scale it to a 4K picture for display.
  • FIG. 4 shows the situation in which the aforementioned source-side scaling method (that is, the method of modifying the style attribute value) is adopted.
  • the content of 4K subtitles is directly rendered on the 2K canvas according to the adjusted attribute values to obtain a subtitle layer with a width and height of 200 ⁇ 50, and finally the subtitle layer is sent to the display module for the hardware of the display module to render it.
  • Zoom to 4K for display It can be seen from this that the subtitles are rendered in the original 4K format and then scaled to 2K, which requires one more memory application (the size of the memory is the original size of the 4K subtitles, 400 ⁇ 100 ⁇ 4B) than when the subtitles are directly rendered in 2K format. The time it takes to zoom one more time. Therefore, using the source-side scaling method mentioned in the foregoing embodiments of the present application has great advantages in terms of memory and time consumption.
  • the adjustment of the subtitle image by the display module is performed by the display module (generally related to the GPU), generally only related to the set display window size, and is related to the style attribute modification and rendering mentioned in this application. Modifications are irrelevant.
  • the display module is to display a 1920*768px picture, whether it is to display the picture in full screen or only display 1/4 of the screen size (any coordinates), the display module will first decode and restore the picture to a 1920*768px picture (Of course, it is generally allowed to decode part of the image first, otherwise the image of tens of billions of pixels will consume memory), and then zoom to the size of the area set by the specified display window.
  • target subtitles utilize vector-based fonts.
  • Subtitles in vector fonts are different from subtitles such as PNG resources in that vector data can be scaled arbitrarily when text is rendered without affecting its clarity.
  • the rendering process of the aforementioned step S13 includes: scaling, shifting, rotating, and/or tilting the original vector glyph corresponding to the text of the target subtitle to obtain a subtitle image of the target subtitle that conforms to the second attribute value.
  • a matrix can be used to scale, shift, rotate, and/or tilt the vector glyph during rendering, so as to obtain a subtitle image that is adapted to a preset format.
  • the formula for subtitle scaling using a matrix can be expressed as where the matrix is a scaling matrix that scales all coordinate values by a factor of 2. Similarly, you can also use displacement matrix, rotation matrix, tilt matrix, etc. to adjust the subtitle style.
  • the style attribute is first scaled when the subtitle format is modified, and the theoretical basis of style scaling is a proportional relationship.
  • the rendering of glyphs is based on a unified "canvas", so that the font size can have a simple multiple relationship.
  • TTF full name is TrueType
  • SVG full name is Scalable Vector Graphics
  • Vector expression is a mathematical expression based on a specified space. If normalized, it can be understood as the value of each key point. The percentage of coordinates in the specified space. For example, as shown in Figure 5, for a vector glyph whose font is set to Advance as 2048, the original vector representation of the font is based on the space of 2048*2048. When the font is set to 144px*72px, it will be expressed based on the space of 2048*2048 The vector diagram is scaled to 144*72.
  • the aforementioned font setting of 144px*72px means that the size in the horizontal direction is 144px, and the size in the vertical direction is 72px, and the size includes the blank space; in addition, it should be noted that the horizontal and vertical directions are allowed to be set separately. So if the canvas is enlarged by a certain factor, the font size is scaled by the same factor.
  • the font should also have a 2x scaling relationship, which is equivalent to scaling 2048*2048 to 72px*36px, then 4K
  • the set 144px font size is equal to the 72px font size set by 2K, that is, the font size is scaled by the same multiple.
  • the subtitle processing method exemplified in the present application further includes: judging whether the original format of the target subtitle is consistent with the preset format; The process of step S12 and step S13 is to adjust the original code stream of the subtitle to be adapted to the subtitle image of the preset format, and then can be sent to the display module for display; if the judgment result is consistent, then directly according to the original code stream of the subtitle Rendered and can be sent to the display module for display.
  • the subtitles are soft-decoded, and the subtitle stream obtained by demultiplexing the media stream is processed separately, and then displayed on a separate layer.
  • the subtitle and video are independent, the subtitle image is formed as one display layer, and the video is another display layer, the subtitle layer and the video layer are processed and sent to the display module respectively.
  • the processing of subtitles and video is generally independent and unrelated; the connection between subtitles and video is that both subtitles and video operate in the same timeline, and the time of the two should be synchronized. , playback, fast-forward and other operations, both should be performed in the same way, so that the subtitles and video can be displayed synchronously.
  • the subtitle processing method proposed in the present application further includes: mixing the subtitle image with the video content.
  • the display module and the apparatus for executing the subtitle processing method of the present application may be two independent apparatuses.
  • a module can be a GPU within it.
  • the device for executing the subtitle processing method of the present application includes a subtitle processing module and a display module, that is, the same device is used to perform the operation of the subtitle processing method of the present application and the operation performed by the display module .
  • the step of displaying the subtitles by the display module according to the subtitle images of the target subtitles that are adapted to the preset format may specifically include: the display module adapts the target subtitles to the preset format.
  • the subtitle image is displayed by adjusting the image to fit the size and position of the display area.
  • the final display condition of the subtitle image includes but is not limited to the size and display position set by the original format of the subtitle.
  • the size and position of the display area of the subtitles on the screen can be arbitrary, and the playback interface of the subtitles can be of any size, such as non-full-screen display, split-screen display, and picture-in-picture mode etc. to display.
  • the image is displayed with the size of the display window set by the application as the display range, so that the display module can adjust the subtitle image, make the subtitle image larger or smaller, and also change the display position to suit the size of the display area.
  • Size and position for example, when the display area of the video deviates from the center of the screen, you can adjust the display position of the subtitles, and the display area here is the final display range.
  • the original format of the target subtitle may be the resolution specification of 3840*2160 (may be referred to as 4K for short), if the preset format of the default setting is the resolution specification of 1920*1080 (may be referred to as 2K for short), use
  • the aforementioned method can render a 2K canvas-based subtitle image; if the screen resolution is 4K, and if the display range set by the application is full screen, the display module will restore the 2K canvas-based subtitle image to a 4K canvas for display; and If the display range set by the application is in a non-full screen state, for example, the display range is 1/4 of the screen, the display module will adjust the subtitle image based on the 2K canvas to fit the size of 1/4 of the screen for display.
  • some style attributes of subtitles may not be represented by specific values, but by the corresponding relationship with the canvas.
  • styles such as coordinates, font size, etc. are allowed to be expressed as a percentage relative to the canvas size.
  • the style attribute in such proportional form can be converted into a specific value form and processed by the subtitle processing method shown in FIG. 1, the subtitle processing can also be performed directly by using the style attribute in such proportional form.
  • FIG. 6 is a schematic flowchart of another embodiment of the subtitle processing method of the present application.
  • the embodiment of the present application further provides another subtitle processing method, which mainly includes steps S41-S43:
  • step S41 the configuration information of the target subtitle is acquired.
  • the configuration information includes the corresponding relationship between the target style attribute of the target subtitle and the canvas.
  • the corresponding relationship can be the ratio value of the attribute value of the target style attribute and the attribute value of the canvas.
  • Step S42 according to the corresponding relationship between the target style attribute of the target subtitle and the canvas, and the attribute of the canvas corresponding to the preset format, determine the value of the style attribute of the target subtitle suitable for the preset format.
  • Step S43 rendering the target subtitle on the canvas corresponding to the preset format according to the value of the style attribute of the target subtitle that is suitable for the preset format.
  • the value of the style attribute of the target subtitle determined based on the attribute of the canvas corresponding to the preset format is not the style attribute of the target subtitle.
  • the original value is a modified style attribute adapted to the preset standard, which is equivalent to the second attribute value in the foregoing embodiment corresponding to FIG. 1 .
  • the target style attribute of the target subtitle includes attributes related to the display position and size; the aforementioned attributes of the canvas corresponding to the preset format include the position and size of the canvas; the aforementioned corresponding relationship between the target style attribute and the canvas includes The ratio of the target style properties to the canvas properties. Therefore, when adjusting the style attributes such as coordinates, position, and spacing, if the percentage relationship between the style attribute and the canvas in the x-axis and y-axis directions is determined, then when the canvas is adjusted by a factor of ⁇ , the 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.
  • the preset format is a preset low format that occupies less storage space, or a high format that has large resolution, or a format suitable for the specifications of the display device.
  • FIG. 7 is a schematic block diagram of a subtitle processing apparatus according to an embodiment of the present application.
  • an embodiment of the present application further provides a subtitle processing apparatus 100 , the apparatus mainly includes an acquisition module 101 , a modification module 102 and a rendering module 103 .
  • the obtaining module 101 is configured to obtain configuration information of the target subtitle, wherein the configuration information includes the original format of the target subtitle and the first attribute value of the target style attribute.
  • the obtaining module 101 is specifically configured to: parse out the original code stream and original format of the target subtitle from the media stream; and, perform content analysis on the original code stream to obtain the first attribute value .
  • the modification module 102 is configured to: when the original format acquired by the acquisition module 101 is different from the preset format, modify the first attribute value to the second attribute value according to the corresponding relationship between the original format and the preset format.
  • the rendering module 103 is configured to: render the target subtitle on the canvas corresponding to the preset standard according to the second attribute value modified by the modification module 102 .
  • the aforementioned target style attribute includes a style attribute related to the display position or size of the target subtitle.
  • the preset format includes the preset resolution specification
  • the original format includes the original resolution specification of the target subtitle
  • the corresponding relationship between the original format of the target subtitle and the preset format includes the preset resolution specification
  • the modification module 102 is specifically configured to: determine a numerical relationship according to the preset resolution specification and the original resolution specification obtained by the acquisition module 101; and modify the first attribute value according to the numerical relationship to obtain a modified second attribute value.
  • the subtitle processing apparatus 100 further includes: a creation module (not shown in the figure), used for the rendering module 103 to create target subtitles on the canvas corresponding to the preset format according to the second attribute value Before rendering, create a canvas corresponding to the preset format.
  • a creation module (not shown in the figure), used for the rendering module 103 to create target subtitles on the canvas corresponding to the preset format according to the second attribute value Before rendering, create a canvas corresponding to the preset format.
  • the subtitle processing apparatus 100 further includes: a display module (not shown in the figure), configured to display the target subtitles on the canvas corresponding to the preset format by the rendering module 103 according to the second attribute value Subtitle images adapted to the preset format obtained by rendering are displayed.
  • the various subtitle processing apparatuses 100 shown in the embodiments of the present application include modules and units corresponding to executing the methods described in the foregoing embodiments, and the detailed descriptions and technical effects thereof may refer to the corresponding descriptions in the foregoing embodiments. This will not be repeated here.
  • FIG. 8 is a schematic block diagram of a subtitle processing apparatus according to another embodiment of the present application.
  • an embodiment of the present application further provides a subtitle processing apparatus 100', which mainly includes: an acquisition module 101', a determination module 112, and a rendering module 103'.
  • the obtaining module 101' is used for: obtaining the configuration information of the target subtitle, wherein the configuration information includes the corresponding relationship between the target style attribute of the subtitle and the canvas.
  • the determining module 112 is configured to: determine the value of the style attribute of the target subtitle suitable for the preset format according to the corresponding relationship between the target style attribute of the target subtitle and the canvas, and the attribute of the canvas corresponding to the preset format.
  • the subtitle rendering module 103' is used for: rendering the target subtitle on the canvas corresponding to the preset format according to the value of the style attribute of the target subtitle suitable for the preset format.
  • the various subtitle processing apparatuses 100 ′ shown in the embodiments of the present application include modules and units corresponding to the methods described in the foregoing corresponding embodiments, and the detailed description and technical effects thereof may refer to the corresponding descriptions in the foregoing embodiments. It is not repeated here.
  • FIG. 9 is a schematic block diagram illustrating a subtitle processing apparatus according to an embodiment of the present application.
  • a subtitle processing apparatus 200 according to an embodiment of the present disclosure includes a memory 201 and a processor 202 .
  • the memory 201 is used to store non-transitory computer readable instructions.
  • memory 201 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory.
  • the volatile memory may include, for example, random access memory (RAM) and/or cache memory (cache), among others.
  • the non-volatile memory may include, for example, read only memory (ROM), hard disk, flash memory, and the like.
  • the processor 202 may be a central processing unit (CPU) or other form of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in the subtitle processing device 200 to perform desired functions.
  • the processor 202 is configured to execute the computer-readable instructions stored in the memory 201, so that the subtitle processing device 200 executes all or part of the subtitle processing methods of the foregoing embodiments of the present disclosure step.
  • this embodiment may also include well-known structures such as communication buses and interfaces, and these well-known structures should also be included in the protection scope of the present application within.
  • Embodiments of the present application also provide a computer storage medium, where computer instructions are stored in the computer storage medium, and when the computer instructions are executed on the device, the device executes the above related method steps to implement the subtitle processing method in the above embodiment.
  • Embodiments of the present application further provide a computer program product, which, when the computer program product runs on a computer, causes the computer to execute the above-mentioned relevant steps, so as to realize the subtitle processing method in the above-mentioned embodiment.
  • the embodiments of the present application also provide an apparatus, which may specifically be a chip, a component or a module, and the apparatus may include a connected processor and a memory; wherein, the memory is used for storing computer execution instructions, and when the apparatus is running, The processor can execute the computer-executable instructions stored in the memory, so that the chip executes the subtitle processing methods in the foregoing method embodiments.
  • the device, computer storage medium, computer program product or chip provided in this application are all used to execute the corresponding method provided above, therefore, the beneficial effects that can be achieved can be referred to in the corresponding method provided above The beneficial effects will not be repeated here.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

本申请涉及一种字幕处理方法、装置、设备及存储介质,包括:获取目标字幕的配置信息,配置信息包括目标字幕的原始制式和目标样式属性的第一属性值;当原始制式与预置制式不同时,根据原始制式和预置制式的对应关系,将第一属性值修改为第二属性值;根据第二属性值在预置制式对应的画布上对目标字幕进行渲染,能够避免制式切换过程中的画布重建,有利于提升系统性能。

Description

字幕处理方法、装置、设备及存储介质
本申请要求于2021年04月26日提交中国专利局、申请号为202110455647.3、申请名称为“字幕处理方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及多媒体技术领域,特别是涉及一种字幕处理方法、装置、设备及存储介质。
背景技术
随着4K技术的普及以及TTML2(Timed Text Markup Language 2,时序文本标记语言第二版)字幕规范越来越受重视,对字幕的要求也越来越多,在日本的ISDB-S3标准(第三代综合业务数字广播标准)中,TTML字幕可以被划分为多种制式,一般包括2K制式、4K制式、8K制式等。简单而言,2K与4K制式的区别包括两者所处于的画布不同,如当字幕区域范围表意为960*540px时,对于2K画布(1920*1080px)而言,其渲染图应占显示屏幕的1/4,而对于4K画布(3840*2160px)而言,则是1/16显示域。反之,为形成占屏幕1/4显示域的字幕,2K需要960*540px的图,4K则需要1920*1080px的图。
对于一般观众而言,不同制式之间只是参照物不同而存在缩放关系。但对于字幕实现而言,不同制式的字幕在内存使用上则存在着较大差异,不同制式切换时,需要频繁的进行画布重建,对系统性能造成一定的影响。
发明内容
本申请的目的在于提供一种新的字幕处理方法、装置、设备及存储介质。
本申请的目的采用以下技术方案来实现。依据本申请提出的一种字幕处理方法,包括:获取目标字幕的配置信息,所述配置信息包括所述目标字幕的原始制式和目标样式属性的第一属性值;当所述原始制式与预置制式不同时,根据所述原始制式和所述预置制式的对应关系,将所述第一属性值修改为第二属性值;根据所述第二属性值在所述预置制式对应的画布上对所述目标字幕进行渲染。
本申请的目的还可以采用以下的技术措施来进一步实现。
前述的字幕处理方法,所述预置制式包括预置分辨率规格,所述原始制式包括所述目标字幕的原始分辨率规格,所述对应关系包括所述预置分辨率规格和原始分辨率规格对应的数值关系;所述根据所述原始制式和所述预置制式的对应关系,将所述第一属性值修改为第二属性值,包括:根据所述预置分辨率规格与所述原始分辨率规格确定所述数值关系;根据所述数值关系对所述第一属性值进行修改,以得到修改后的所述第二属性值。
前述的字幕处理方法,所述根据所述第二属性值在所述预置制式对应的画布上对所述目标字幕进行渲染之前,还包括:创建与所述预置制式对应的画布。
前述的字幕处理方法,所述目标样式属性包括与所述目标字幕的显示位置或尺寸相关的样式属性。
前述的字幕处理方法,所述获取目标字幕的配置信息,包括:从媒体流中解析出所述目标字幕的原始码流和所述原始制式;对所述原始码流进行内容解析,以得到所述第一属性值。
前述的字幕处理方法,所述根据所述第二属性值在所述预置制式对应的画布上对所述目标字幕进行渲染之后,还包括:将根据所述第二属性值在所述预置制式对应的画布上对所述目标字幕进行渲染而得到的适应于所述预置制式的字幕图像进行展示。
前述的字幕处理方法,所述目标字幕为ISDB-S3标准下的使用TTML2规范的Closed  Captions字幕。
本申请的目的还采用以下技术方案来实现。依据本公开提出的一种字幕处理装置,包括:获取模块,用于获取目标字幕的配置信息,所述配置信息包括所述目标字幕的原始制式和目标样式属性的第一属性值;修改模块,用于当所述获取模块获取的所述原始制式与预置制式不同时,根据所述原始制式和所述预置制式的对应关系,将所述第一属性值修改为第二属性值;以及,渲染模块,用于根据所述修改模块修改得到的所述第二属性值在所述预置制式对应的画布上对所述目标字幕进行渲染。
本申请的目的还可以采用以下的技术措施来进一步实现。
前述的字幕处理装置,所述预置制式包括预置分辨率规格,所述原始制式包括所述目标字幕的原始分辨率规格,所述对应关系包括所述预置分辨率规格和原始分辨率规格对应的数值关系;所述修改模块具体用于:根据所述预置分辨率规格与所述获取模块获取的所述原始分辨率规格确定所述数值关系;根据所述数值关系对所述第一属性值进行修改,以得到修改后的所述第二属性值
前述的字幕处理装置,还包括:创建模块,用于在所述渲染模块根据所述第二属性值在所述预置制式对应的画布上对所述目标字幕进行渲染之前,创建与所述预置制式对应的画布。
前述的字幕处理装置,所述目标样式属性包括与所述目标字幕的显示位置或尺寸相关的样式属性。
前述的字幕处理装置,所述获取模块具体用于:从媒体流中解析出所述目标字幕的原始码流和所述原始制式;对所述原始码流进行内容解析,以得到所述第一属性值。
前述的字幕处理装置,还包括:展示模块,用于将所述渲染模块根据所述第二属性值在所述预置制式对应的画布上对所述目标字幕进行渲染而得到的适应于所述预置制式的字幕图像进行展示。
本申请的目的还采用以下技术方案来实现。依据本公开提出的一种字幕处理设备,包括:存储器,用于存储非暂时性计算机可读指令;以及处理器,用于运行所述计算机可读指令,使得所述处理器执行时实现前述任意一种字幕处理方法。
本申请的目的还采用以下技术方案来实现。依据本公开提出的一种计算机可读存储介质,用于存储非暂时性计算机可读指令,当所述非暂时性计算机可读指令由计算机执行时,使得所述计算机执行前述任意一种字幕处理方法。
本申请与现有技术相比具有明显的优点和有益效果。借由上述技术方案,本申请提出的字幕处理方法、装置、设备及存储介质采用统一的预置制式的画布,当待处理的目标字幕的原始制式与预置制式不同时,根据目标字幕的原始制式和预设制式之间的对应关系,对目标字幕的目标样式属性的原始属性值进行修改,得到适应于预设制式的修改属性值,而后基于该修改属性值在预设制式的画布上进行渲染,从而能够避免字幕制式发生变化时的画布重建,有利于提升系统性能,有利于进行字幕画布创建、字幕图像的生成存储和传输等字幕处理。
上述说明仅是本申请技术方案的概述,为了能更清楚了解本申请的技术手段,而可依照说明书的内容予以实施,并且为让本申请的上述和其他目的、特征和优点能够更明显易懂,以下特举较佳实施例,并配合附图,详细说明如下。
附图说明
图1是本申请一个实施例的字幕处理方法的流程示意图。
图2是本申请另一实施例的字幕处理方法的流程示意图。
图3是本申请另一实施例的字幕处理方法的流程示意图。
图4是本申请一个实施例提供的两种字幕渲染方式的示意性流程图。
图5是本申请一个实施例提供的字形缩放的示意图。
图6是本申请又一实施例的字幕处理方法的流程示意图。
图7是本申请一个实施例的字幕处理装置的示意图。
图8是本申请另一实施例的字幕处理装置的示意图。
图9是本申请一个实施例的字幕处理设备的示意图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
为更进一步阐述本申请为达成预定申请目的所采取的技术手段及功效,以下结合附图及较佳实施例,对依据本申请提出的字幕处理方法、装置、设备及存储介质的具体实施方式、结构、特征及其功效,详细说明如后。
需要说明的是,在本文中,诸如“第一”、“第二”等关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。另外,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
图1为本申请的字幕处理方法一个实施例的示意性流程框图。在本申请的一些实施例中,请参阅图1,本申请示例的字幕处理方法主要包括步骤S11-步骤S13。
步骤S11,终端设备获取目标字幕的配置信息,该配置信息包括目标字幕的原始制式和目标样式属性的第一属性值。
本申请实施例中,终端设备可以以各种形式来实施,可以包括但不限于诸如电视、台式计算机等的固定终端设备、以及智能电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、导航装置、车载终端设备、车载显示终端、车载电子后视镜等的移动终端设备等等电子设备。
在申请的一些可选实施例中,被处理的字幕包括广播电视信号中的字幕、计算机存储介质中存储的媒体数据中的字幕等等。作为一个具体实施例,目标字幕为ISDB-S3标准下的Closed Captions(简称CC,可隐藏的字幕,使用TTML2规范)字幕。
本申请实施例中,字幕制式可以包括字幕的分辨率规格。其中,字幕的分辨率也可以称为像素表达的大小、画布分辨率、画布尺寸、或画布的像素点数等。需注意,本申请涉及的画布制式可以是当前的常用制式或标准制式,也可以并非是常用制式或标准制式。以画布分辨率为例,当前字幕的分辨率规格可以是任意的尺寸,包括但不局限于1280×720、1920×1080、3840×2160、2048×1080、4096×2160等等。以ISDB-S3标准下的基于TTML2规范的字幕为例,符合ISDB-S3标准中的TTML 2规范的字幕制式一般包括2K、4K和8K制式。
本申请实施例中,字幕样式属性是指与字幕样式相关的属性。本申请实施例中,字幕样式属性可以包括:字幕的字体颜色(font color)、字体大小(font size)、背景色(background color)、显示坐标值(origin)、透明度(opacity)、字幕显示区域的宽与高(extent)或行高(line-height)、边框宽度、字体描边大小、字形间距、行间距、字间距、特效位置、偏移 位置等一系列与字幕显示相关的属性。在本申请的一些可选实施例中,目标样式属性包括与字幕的显示和/或尺寸相关的一种或多种样式属性,例如,目标样式属性包括字体大小或显示坐标值等与字幕显示或尺寸相关的部分或全部属性。
需要说明的是,目标样式属性除了包括与字幕的显示或尺寸相关的样式属性之外,还可以包括其他类型的样式属性,本申请实施例对此不做限定。
可选的,可以分别获取x轴方向(显示器宽度方向)和y轴方向(显示器高度方向)的配置信息,例如,对于原始制式,分别获取目标字幕的画布宽度制式、画布高度制式,对于目标样式属性,分别获取字幕显示区域的宽、字体的宽、字幕显示区域的高、字体的高。事实上,也可以仅获取字幕的宽度方向、高度方向中的一个方向的配置信息,而不获取另一方向的配置信息,进而在后续步骤中也不对相应方向的字幕样式属性值进行调整。
本申请实施例中,终端设备首先获取目标字幕的配置信息,该配置信息包括目标字幕的原始制式和目标样式属性的第一属性值。其中,目标字幕的原始制式是指目标字幕的原始被配置的制式,例如原始被配置的分辨率规格。目标样式属性的第一属性值是指目标字幕的目标样式属性原始被配置的属性值。
可选地,本申请实施例中,终端设备是从媒体流中解析出目标字幕原始被配置的原始制式和目标字幕的原始码流。例如,从媒体流中获取到目标字幕的原始制式为4K。终端设备对原始码流的内容进行解析,得到目标样式属性的第一属性值。例如,目标样式属性包括目标字幕的字体大小、显示坐标值和显示区域的宽和高,通过对原始码流的内容进行解析,得到目标样式属性的第一属性值(即原始被配置的属性值)分别是:字体大小为20px、显示坐标值为(200,200)和显示区域的宽和高(1000,240)。需注意,媒体流中一般具有用于标识字幕制式的字段,该字段可能位于字幕控制流中,通过获取并解析该字段可以直接得到目标字幕的原始制式。另外需注意,媒体流中一般混合(mux)有音频、视频、字幕流,因此前述的从媒体流中解析出字幕的原始码流包括对媒体流进行解复用(demux)以得到各自的数据。
需要说明的是,本申请实施例中,目标字幕的配置信息除了包括目标字幕的原始制式和目标样式属性的第一属性值之外,还可以包含与目标字幕相关的其他类型的信息,本申请实施例对此不做限定。
步骤S12,当目标字幕的原始制式与预置制式不同时,终端设备根据该预置制式与目标字幕的该原始制式的对应关系,将目标字幕的第一属性值修改为第二属性值。
本申请实施例中,预置制式是预先设置的字幕制式。本申请实施例中,预置制式与目标字幕不相关,即不会根据目标字幕的改变而改变。
可选的,可预先设置的预置制式可以是所采用的字幕标准下的常用的字幕制式、或适合于目标字幕所展示于的屏幕等显示设备规格的字幕制式、或占用存储空间较小的或最小的字幕制式、或常用的字幕制式中的占用存储空间较小的或最小的字幕制式、或清晰度较高或最高分辨率较大或最大的字幕制式等等。可选的,前述的屏幕等显示设备规格包括屏幕的宽高比,例如16:9、16:10等。
例如,所采用的字幕为ISDB-S3标准下的基于TTML2规范的字幕。符合ISDB-S3标准中的TTML 2规范的字幕一般包括2K、4K和8K制式,无论待处理的目标字幕是何种制式,在本申请实施例中预先设置的预置制式为2K,本申请实施例中均统一创建预置制式的2K画布,例如尺寸为1920*1080的16:9的2K画布。
可选的,可以分别对x轴方向(显示器宽度方向)和y轴方向(显示器高度方向)确定对应的预置制式,例如分别将字幕的画布宽度预置值预先设定为1920,将字幕的画布高度预置值预先设定为1080。事实上,也可以仅设置宽度方向、高度方向中的一个的预置制 式,而不对另一方向预先设置的预置制式,也不对对应方向的字幕样式属性进行调整。
本申请实施例中,终端设备在获取目标字幕的原始制式和目标样式属性的第一属性值之后,若目标字幕的原始制式与预置制式不同时,终端设备根据该预置制式与目标字幕的该原始制式的对应关系,将目标字幕的第一属性值修改为第二属性值。例如,目标字幕原始被配置的原始制式为4K,而预置制式为2K,则终端设备根据4K和2K的对应关系,将目标字幕的目标样式属性的第一属性值修改为与预置制式2K对应的第二属性值。
可选地,本申请实施例中,预置制式与原始制式的对应关系具体可以是指目标字幕的原始分辨率规格与预置分辨率规格的对应的数值关系。
例如,目标字幕的原始制式是4K,预置制式是2K,则可确定原始分辨率规格与预置分辨率规格的对应的数值关系为缩放系数1/2。终端设备根据该缩放系数,将目标样式属性原始所取的第一属性值按照该缩放系数修改为第二属性值。而所得到的该第二属性值是目标样式属性的与预置制式2K对应的属性值。如表1所示,为本申请实施例提供的一种目标样式属性的修改示例。
表1本申请实施例提供的一种目标样式属性的修改示例
Figure PCTCN2022083209-appb-000001
其中,本申请实施例中的目标样式属性包括目标字幕的字体大小、显示坐标值、显示区域的宽和高、以及行高,其第一属性值(即原始被配置的属性值)分别是:字体大小为20px、显示坐标值为(200,200)、显示区域的宽和高(1000,240)、以及行高240。根据目标字幕的原始制式4K和预置制式2K之间的缩放系数1/2,将字体大小的第一属性值20px修改为第二属性值10px,显示坐标值的第一属性值(200,200)修改为第二属性值(100,100),显示区域的宽和高的第一属性值(1000,240)修改为第二属性值(500,120),行高的第一属性值240修改为第二属性值120。
需注意,表1示出的是目标样式属性的修改的一个可选示例,不应理解为对本申请的限制。为得到适应于预置制式的字幕图像,可以修改任意相应的目标样式属性。例如,为了生成目标字幕的适应于预置的画布分辨率的字幕图像,可以调整的字幕样式属性还可以包括:边框宽度大小(Border-length)、字体描边大小(Outline-length)、模糊半径大小(Blur-radius)、内间距(Padding)、字形间距(Letter-spacing)、阴影偏移坐标设置(Shadow-offset)等等。
需要说明的是,预置制式与原始制式的对应关系也可以包括其他的对应关系,上述仅为预置制式与原始制式的对应关系的一种示例,不应理解为对本申请的限制。
步骤S13,终端设备根据目标样式属性的第二属性值,在预置制式对应的画布上对目标字幕进行渲染。
本申请实施例中,终端设备在根据该预置制式与目标字幕的该原始制式的对应关系, 将目标字幕的第一属性值修改为第二属性值之后,根据修改后的第二属性值在预置制式对应的画布上对目标字幕进行渲染,从而得到目标字幕的适应于预置制式的字幕图像(也可以称为字幕图层)。
本申请实施例中,预置制式对应的画布是终端设备在进行前述的“根据目标样式属性的第二属性值,在预置制式对应的画布上对目标字幕进行渲染”之前的任意时间,预先创建好的。
需注意,画布是字幕渲染时所基于的抽象空间,字幕在画布上渲染成一个图片,可以将画布的大小设置为1920*1080;而视频或者屏幕的规格是显示时的逻辑概念,显示时需要将1920*1080的图缩放到显示窗体的大小。
需注意,在本申请实施例中,对字幕数据进行渲染后得到的是基于预置制式的字幕图像,而不是基于目标字幕的原始制式的字幕图像。
其中,本申请实施例中的渲染指的是:字幕从原始的文本表达到在画布上画出图像内容的过程。可选的,在画布上进行渲染的结果是用一个内存块存储的RGBA(表示包括红色、绿色、蓝色和Alpha通道的色彩空间)数据,该数据保存在内存中。
一般来说,在渲染得到目标字幕的图像数据后,终端设备会对该图像数据进行暂存,以便后续进行显示等处理。
本申请实施例提供的字幕处理方法中采用统一的预置制式的画布,当待处理的目标字幕的原始制式与预置制式不同时,根据目标字幕的原始制式和预设制式之间的对应关系,对目标字幕的目标样式属性的第一(原始)属性值进行修改,得到适应于预设制式的第二属性值,最后基于修改后的第二属性值在预设制式的画布上进行渲染,从而可以避免制式切换过程中的画布重建,有利于提升系统性能。
需要说明的是,在很多情形中都可能发生字幕制式的切换,包括但不限于在不同信源互切的时候,字幕所基于的画布制式可能发生变化。例如,2K信号源的电视节目切换到4K信号源的电视节目、或者4K的电视节目切换到2K时,电视节目的字幕的制式一般也会随电视节目的制式而改变。又如,在电影、电视节目、网络直播过程中插播消息、新闻、广告的时候,由于消息、新闻、广告的分辨率可能与当前播放的媒体制式不同,也可能发生字幕制式变化。再如,播放电影时,如果预存的多个字幕(例如多种语言字幕)的字幕制式不同,在切换字幕时,也会发生字幕制式切换。本申请实施例提供的字幕处理方法进行字幕处理时,当字幕所基于的画布制式发生变化时,利用已预先创建的与预置制式对应的画布对切换后的字幕进行渲染,而不是新建画布,从而能够减少制式切换过程中的画布重建。
图2为本申请实施例提供的字幕处理方法的另一个实施例示意图。
图2示出的本申请实施例提供的字幕处理方法的另一个实施例,包括步骤S21-步骤S26。
步骤S21,创建预置制式对应的画布,其中,该预置制式是预先设置的占用存储空间小的低制式。本申请实施例中,终端设备读取预先配置的占用存储空间小的预置字幕制式,创建与该预置字幕制式对应的画布,该画布用于在后续步骤中渲染字幕图像。
本申请实施例中,预置制式对应的画布是终端设备预先创建好的。终端设备可以仅创建一次预置制式对应的画布,在后续一段预置的时间周期内,终端设备对于接收到的任意媒体流中的字幕,都可以基于此画布上进行字幕的渲染。
特别的,本实施例中的预置制式是预先设置的占用存储空间小的低制式,例如是常用的字幕制式中的占用存储空间较小的或最小的低制式。以ISDB-S3标准下的基于TTML2 规范的字幕为例,符合ISDB-S3标准中的TTML 2规范的字幕一般包括该规范所规定的2K、4K和8K制式,利用本申请实施例示出方法进行字幕处理时,统一创建2K画布,具体可以是尺寸为1920*1080的16:9的2K画布。
步骤S22,获取目标字幕的配置信息。本申请实施例中,终端设备获取媒体流,并从媒体流中解析出目标字幕的原始制式和原始码流,以及,对该原始码流进行内容解析,以得到目标字幕的目标样式属性的第一属性值(原始属性值)。
作为一个具体实施例,以TTML字幕为例,获取目标字幕的原始制式的过程具体包括:从pcap码流中解析出当前的TTML字幕所采用的字幕规格,例如确定目标字幕是2K、4K还是8K制式,例如原始制式是4K。获取目标字幕的目标样式属性的第一属性值的过程具体包括:从pcap码流中解析出当前的TTML字幕的原始码流,并对TTML字幕进行内容解析,得到字幕的目标样式设置的原始属性值,即前述第一属性值。例如,目标样式属性包括目标字幕的字体大小、显示坐标值和显示区域的宽和高,通过对原始码流的内容进行解析,得到目标样式属性的第一属性值(即原始被配置的属性值)分别是:字体大小为20px、显示坐标值为(200,200)和显示区域的宽和高(1000,240)。其中,pcap码流是一种在网络抓包和网络封包分析中常用到的数据报。需注意,本申请并不限制所采用的媒体流,除了可以采用前述pcap码流之外,也可以采用诸如RTP码流包等其他类型和格式的数据。
本申请实施例的该步骤S22的详细说明可以参阅图1的步骤S11进行理解,此处不进行赘述。
步骤S23,判断目标字幕的原始制式与预置制式是否相同。
本申请实施例中,在进行步骤S22而获取到目标字幕的原始制式之后,终端设备根据该原始制式、与步骤S21中的预先设置的预置制式进行判断:目标字幕的原始制式与预置制式是否相同。
步骤S24,若步骤S23中的判断结果为目标字幕的原始制式与预置制式不同,则终端设备根据该预置制式与目标字幕的该原始制式的对应关系,将目标字幕的第一属性值修改为第二属性值,其中,预置制式是预先设置的占用存储空间小的低制式。
本申请实施例的该步骤S24的详细说明可以参阅图1的步骤S12进行理解,此处不进行赘述。
步骤S25,根据目标字幕的目标样式属性的第二属性值,在预置制式对应的画布上对目标字幕进行渲染,以得到目标字幕的适应于预置的占用存储空间小的低制式的字幕图像。
本申请实施例的该步骤S25的详细说明可以参阅图1的步骤S13进行理解,此处不进行赘述。
步骤S26,对字幕图像进行展示。
本申请实施例中,在得到目标字幕的适应于预置制式的字幕图像之后,终端设备还会对该字幕图像进行显示,一般可以将渲染后的字幕图像传给终端设备的显示模块(例如电视或计算机中的图形处理器GPU),以供显示模块在屏幕上展示字幕。需注意,对应一个任意大小的图片、任意分辨率的视频,显示模块都可以自行去调整缩放以进行全屏显示或调整到其他任意的显示区域。
本申请实施例中,实施例提供的字幕处理方法中采用统一的预置制式的画布,当待处理的目标字幕的原始制式与预置制式不同时,根据目标字幕的原始制式和预设制式之间的对应关系,对目标字幕的目标样式属性的第一(原始)属性值进行修改,得到适应于预设制式的第二属性值,最后基于修改后的第二属性值在预设制式的画布上进行渲染,从而可以避免制式切换过程中的画布重建,有利于提升系统性能。另外,由于所采用的预置制式是预先设置的占用存储空间小的低制式,因此能够降低创建画布、字幕图像的生成、存储、 传输和上屏显示等字幕处理过程中所需的内存空间,能够降低渲染过程中的内存消耗,避免了申请不到大内存而无法显示字幕。以ISDB-S3CC字幕为例,利用本申请示出的字幕处理方法能够降低ISDB-S3CC字幕的内存使用,在电视等设备上,避免内存占用过高影响其他进程因内存不足而被清除(kill),同时也可以提高渲染效率。
图3为本申请实施例提供的字幕处理方法的另一个实施例示意图。
图3示出的本申请实施例提供的字幕处理方法的另一个实施例,包括步骤S31-步骤S36。
步骤S31,创建预置制式对应的画布,其中,该预置制式是预先设置的高清晰度的高制式。本申请实施例中,终端设备读取预先配置的高清晰度的预置字幕制式,创建与该预置字幕制式对应的画布,该画布用于在后续步骤中渲染字幕图像。
本申请实施例中,预置制式对应的画布是终端设备预先创建好的。终端设备可以仅创建一次预置制式对应的画布,在后续一段预置的时间周期内,终端设备对于接收到的任意媒体流中的字幕,都可以基于此画布上进行字幕的渲染。
特别的,本实施例中的预置制式是预先设置的高清晰度的高制式,例如是常用的字幕制式中的高清晰度的高制式。以ISDB-S3标准下的基于TTML2规范的字幕为例,符合ISDB-S3标准中的TTML 2规范的字幕一般包括该规范所规定的2K、4K和8K制式,利用本申请实施例示出方法进行字幕处理时,统一创建清晰度最高的8K画布。
步骤S32,获取目标字幕的配置信息。本申请实施例中,终端设备获取媒体流,并从媒体流中解析出目标字幕的原始制式和原始码流,以及,对该原始码流进行内容解析,以得到目标字幕的目标样式属性的第一属性值(原始属性值)。
作为一个具体实施例,以TTML字幕为例,获取目标字幕的原始制式的过程具体包括:从pcap码流中解析出当前的TTML字幕所采用的字幕规格,例如确定目标字幕是2K、4K还是8K制式,例如原始制式是4K。获取目标字幕的目标样式属性的第一属性值的过程具体包括:从pcap码流中解析出当前的TTML字幕的原始码流,并对TTML字幕进行内容解析,得到字幕的目标样式设置的原始属性值,即前述第一属性值。例如,目标样式属性包括目标字幕的字体大小、显示坐标值和显示区域的宽和高,通过对原始码流的内容进行解析,得到目标样式属性的第一属性值(即原始被配置的属性值)分别是:字体大小为20px、显示坐标值为(200,200)和显示区域的宽和高(1000,240)。其中,pcap码流是一种在网络抓包和网络封包分析中常用到的数据报。需注意,本申请并不限制所采用的媒体流,除了可以采用前述pcap码流之外,也可以采用诸如RTP码流包等其他类型和格式的数据。
本申请实施例的该步骤S32的详细说明可以参阅图1的步骤S11进行理解,此处不进行赘述。
步骤S33,判断目标字幕的原始制式与预置制式是否相同。
本申请实施例中,在进行步骤S32而获取到目标字幕的原始制式之后,终端设备根据该原始制式、与步骤S31中的预先设置的预置制式进行判断:目标字幕的原始制式与预置制式是否相同。
步骤S34,若步骤S33中的判断结果为目标字幕的原始制式与预置制式不同,则终端设备根据该预置制式与目标字幕的该原始制式的对应关系,将目标字幕的第一属性值修改为第二属性值,其中,预置制式是预先设置的清晰度高的高制式。
本申请实施例的该步骤S34的详细说明可以参阅图1的步骤S12进行理解,此处不进行赘述。
步骤S35,根据目标字幕的目标样式属性的第二属性值,在预置制式对应的画布上对目标字幕进行渲染,以得到目标字幕的适应于预置的高清晰度的高制式的字幕图像。
步骤S36,对字幕图像进行展示。
本申请实施例中,在得到目标字幕的适应于预置制式的字幕图像之后,终端设备还会对该字幕图像进行显示,一般可以将渲染后的字幕图像传给终端设备的显示模块(例如电视或计算机中的图形处理器GPU),以供显示模块在屏幕上展示字幕。需注意,对应一个任意大小的图片、任意分辨率的视频,显示模块都可以自行去调整缩放以进行全屏显示或调整到其他任意的显示区域。
本申请实施例中,实施例提供的字幕处理方法中采用统一的预置制式的画布,当待处理的目标字幕的原始制式与预置制式不同时,根据目标字幕的原始制式和预设制式之间的对应关系,对目标字幕的目标样式属性的第一(原始)属性值进行修改,得到适应于预设制式的第二属性值,最后基于修改后的第二属性值在预设制式的画布上进行渲染,从而可以避免制式切换过程中的画布重建,有利于提升系统性能。另外,由于所采用的预置制式是预先设置的高清晰度的高制式,因此能够提高字幕的清晰度,能够避免在字幕的后续处理中被显示模块放大而变模糊的问题。
在本申请提出的字幕处理方法的又一些实施例中,预先设置的预置字幕制式为符合屏幕规格的画布制式、或常用标准制式的画布制式。通过基于预先设置的符合屏幕规格的画布、或常用标准制式的画布来渲染字幕,能够将不同制式的字幕调整为符合屏幕规格的字幕、常用标准制式的字幕,有利于画布创建、字幕图像的生成、存储、传输和展示等字幕处理过程的执行。
需注意,可以采用不同方式来进行得到符合预置制式的字幕图像。本申请的前述实施例采用的是源端缩放方式,即在业务流程的起始位置进行缩放,也称为样式属性值修改的方式:先对目标样式属性的第一属性值进行调整得到第二属性值,再根据该第二属性值进行渲染,得到符合预置制式的字幕图像。从而运用前述实施例时,在源端点的样式属性值会按比例直接调整到目标点的值。在另一些实施例中,也可以采用末端缩放方式,即在业务流程的末尾位置进行缩放,也称为渲染时修改的方式:先根据字幕的目标样式属性的原始设定值(即第一属性值)渲染出目标字幕的基于其原始制式的字幕图像,再根据预置制式与目标字幕的原始制式的对应关系来调整其原始制式的字幕图像以将该字幕图像调整到符合预置制式的画布上。
需注意,前述的这两种修改方式在内存和时间的消耗上具有较大差异。图4为根据本申请提出的两种字幕渲染方式的示意性流程图。请参阅图4,目标字幕的原始制式为4K画布分辨率,预置制式为2K画布分辨率。图4中的上半部分表示采用前述的末端缩放方式(即渲染时修改的方式)的情形:先将4K字幕的内容渲染为宽和高为400×100的4K制式字幕,再缩放为宽和高为200×50的字幕图层,然后放到2K画布上,最后将该字幕图层发出至显示模块,以供显示模块的硬件将其缩放至4K画面进行展示。图4中的下半部分表示采用前述的源端缩放方式(即样式属性值修改的方式)的情形:先对4K字幕的符合4K制式的原始属性值进行调整得到符合2K制式的属性值,再对4K字幕的内容根据调整后的属性值、直接在2K画布上渲染得到宽和高为200×50的字幕图层,最后将该字幕图层发出至显示模块,以供显示模块的硬件将其缩放至4K画面进行展示。由此可以看出,字幕以原始的4K制式渲染再缩放到2K上,比直接以2K形式渲染多申请一次内存(该内存的大小为4K字幕的原始大小,400×100×4B),同时还要多一次缩放的时耗。因此,利用本申请前述实施例提及的源端缩放方式,在内存和时间的消耗上具有较大优势。
需注意,显示模块对字幕图像的调整是由显示模块所进行的处理(一般与GPU相关),一般只与设置的显示窗体大小相关,与本申请提及的对样式属性修改、渲染时的修改不相关。例如,显示模块为显示一张1920*768px的图,无论是让该图全屏显示,还是只显示屏 幕的1/4大小(坐标任意),显示模块都会先把该图解码还原成一张1920*768px的图(当然,一般允许先解码出图的部分区域,否则几百亿像素的图会耗光内存),然后再缩放到指定显示窗体设置的区域大小上。
在本申请的一些实施例中,目标字幕利用基于矢量的字体。矢量字体的字幕与PNG资源等字幕不同,在文本渲染时矢量数据具有任意缩放而不影响其清晰度的特性。
进一步地,前述步骤S13的渲染过程包括:对目标字幕的文本对应的原始矢量字形进行缩放、位移、旋转、和/或倾斜,得到目标字幕的符合第二属性值的字幕图像。具体的,在渲染时可以利用矩阵来对矢量字形进行缩放、位移、旋转、和/或倾斜,以得到适应于预置制式的字幕图像。
作为的一个具体示例,利用矩阵进行字幕缩放的算式可以表示为
Figure PCTCN2022083209-appb-000002
其中矩阵
Figure PCTCN2022083209-appb-000003
是一个用于缩放的矩阵,用于将坐标值全部放大2倍。同理还可以利用位移矩阵、旋转矩阵、倾斜矩阵等来调整字幕样式。
需注意,在改变画布制式而需要进行缩放时,对于图片而言即是基础的解码缩放;而对于文本渲染,最大的问题是字体大小是否能直接缩放。在本申请的一些实施例中,字幕制式修改时采用的是先对样式属性进行缩放的方式,而样式缩放的理论依据是比例关系。并且在本申请一些实施例中,字形的渲染是基于统一的“画布”,从而字体大小可以具有简单的倍数关系。
形成不同字体尺寸(font size)的字的过程实际是对原始字形的缩放。一般来说,TTF(全称为TrueType)、SVG(全称为Scalable Vector Graphics)字形都采用矢量表达,矢量表达是基于一个指定空间的数学表达,如果归一化的话,可以理解为每个关键点的坐标在指定空间的百分比。例如,如图5所示,对于字体设置为Advance为2048的矢量字形,其字体的原始矢量表达是基于2048*2048的空间,当字体设置为144px*72px时,就是将基于2048*2048空间表达的矢量图缩放到144*72。需注意,前述的字体设置为144px*72px表示水平方向的尺寸为144px,垂直方向的尺寸为72px,该尺寸包括留白;另外需注意,水平方向与垂直方向是允许分开设置的。因此如果画布放大一定倍数,字体大小缩放同等倍数。例如当4K被缩放到2K时,画布在水平与垂直方向上均产生2倍缩放关系,那么字体也应具有2倍缩放关系,则就等价于2048*2048缩放到72px*36px,则4K所设置的144px字体大小等于2K所设置的72px字体大小,即字体大小缩放同等倍数。最后经过屏幕缩放(显示模块缩放)后,用户感觉到的是相对于屏幕而言同样大小的字。
需注意,如果目标字幕的原始制式与预置制式一致,则可以不必进行字幕图像的调整,而是直接利用原始码流进行播放。具体的,在本申请的一些实施例中,在前述步骤S12之前,本申请示例的字幕处理方法还包括:判断目标字幕的原始制式与预置制式是否一致;如果判断结果为不一致,则进行前述的步骤S12和步骤S13的过程,以将字幕的原始码流调整为适应于预置制式的字幕图像,之后可以发送到显示模块进行展示;如果判断结果为一致,则直接根据字幕的原始码流进行渲染,并可以发送至显示模块进行展示。
在本申请的一些实施例中,字幕是软解的,对媒体流解复用得到的字幕流是单独处理的,然后显示在单独的图层上。例如,字幕与视频两者是独立的,字幕图像形成为一个显示图层,视频是另一个显示图层,对字幕图层与视频图层分别进行处理、分别发送至显示模块。需注意,字幕与视频的处理一般是独立而不相关的;字幕与视频两者之间的联系在于,字幕与视频两者在同一时间轴中进行操作,两者的时间要同步,在进行暂停、播放、快进等操作的时候,两者要同样执行,从而能够同步展示字幕与视频。
在本申请的一些实施例中,本申请提出的字幕处理方法还包括:将字幕图像与视频内容进行混合。
在本申请的一些示例中,显示模块与执行本申请的字幕处理方法的装置可以是两个独立的装置,例如,字幕处理装置可以是电视、电脑、智能手机等终端设备中的CPU,而显示模块可以是其中的GPU。而在本申请的另一些示例中,执行本申请的字幕处理方法的装置包括执行字幕处理的模块和显示模块,即利用同一装置来执行本申请的字幕处理方法的操作和显示模块所进行的操作。
在本申请的一些实施例中,前述实施例提及的显示模块根据目标字幕的适应于预置制式的字幕图像来展示字幕的步骤可以具体包括:显示模块将目标字幕的适应于预置制式的字幕图像调整为符合显示区域的尺寸和位置的图像来展示。需注意,字幕图像的最终显示情况包括但不限于字幕的原始制式所设置的尺寸和显示位置。事实上,字幕在屏幕上的显示区域的尺寸大小、显示区域的位置都可以是任意的,字幕的播放界面可以是任意大小的,例如,以非全屏显示、分屏显示、以画中画模式等方式来显示。可选的,图像以应用程序设置的显示窗体的大小为显示范围来进行显示,从而显示模块可以调整字幕图像,将字幕图像变大或变小、还可以改变显示位置,以适应显示区域的尺寸和位置,例如视频的显示区域偏离屏幕中心时可以调整字幕的显示位置,此处的显示区域才是最后的显示范围。
作为一个具体示例,目标字幕的原始制式可以是3840*2160(不妨简称为4K)的分辨率规格,如果默认设置的预置制式为1920*1080(不妨简称为2K)的分辨率规格,则利用前述方法可以渲染得到基于2K画布的字幕图像;如果屏幕分辨率为4K,而且如果应用程序设置的显示范围是全屏,则显示模块会将基于2K画布的字幕图像还原为4K画布来进行展示;而如果应用程序设置的显示范围是非全屏状态,例如显示范围是1/4屏幕,则显示模块会将基于2K画布的字幕图像调整为适合1/4屏幕的尺寸来进行展示。
在一些字幕规范中,字幕的有些样式属性可以不用具体取值来表示,而是利用与画布的对应关系来表示。例如,在TTML2规范中,允许使用相对于画布大小的百分比来表示坐标、字体大小等样式。虽然可以将这类比例形式的样式属性转换为具体取值形式并利用前述图1所示的字幕处理方法来进行处理,但也可以直接利用这类比例形式的样式属性进行字幕处理。
图6为本申请的字幕处理方法另一实施例的示意性流程框图。请参阅图6,本申请的实施例还提供另一种字幕处理方法,主要包括步骤S41-步骤S43:
步骤S41,获取目标字幕的配置信息。其中,该配置信息包括目标字幕的目标样式属性与画布的对应关系。以显示位置和尺寸相关的样式属性蔚来,该对应关系可以是目标样式属性的属性值与画布的属性值的比例值。
步骤S42,根据目标字幕的目标样式属性与画布的对应关系、以及与预置制式对应的画布的属性,确定目标字幕的适于预置制式的样式属性取值。
步骤S43,根据目标字幕的该适于预置制式的样式属性取值、在与预置制式对应的画布上对目标字幕进行渲染。
需注意,当目标字幕的原始制式与预置制式不同时,前述步骤S42中,基于预置制式对应的画布的属性而确定的目标字幕的样式属性的取值,并非是目标字幕的样式属性的原始取值,而是适应于预置制式的修改样式属性,其相当于前述的图1对应的实施例中的第二属性值。
作为一个具体示例,目标字幕的目标样式属性包括与显示位置和尺寸相关的属性;前述的与预置制式对应的画布的属性包括画布的位置和尺寸;前述的目标样式属性与画布的对应关系包括目标样式属性与画布属性的比例关系。从而,在对坐标、位置、间距等样式 属性进行调整时,若该样式属性在x轴、y轴方向上的与画布的百分比关系是确定的,则当画布进行放大δ倍的调整后,该样式属性与画布的百分比关系不变、该样式属性的属性值同等放大δ倍。
可选的,该预置制式是预先设置的占用存储空间小的低制式、或清晰度大的高制式、或适合于显示设备规格的制式。
需注意,由于图6示例的字幕处理方法与图1示例的字幕处理方法的区别主要在于最初获取的目标字幕的配置信息的形式有所不同,而后续的渲染过程是基本一致的,因此前述的与图1对应的具体细节也适用于图6示例的字幕处理方法,而其详细说明和技术效果可以参考前述各实施例中的相应说明,在此不再赘述。
图7为根据本申请的一个实施例的字幕处理装置的示意性框图。请参阅图7,本申请的实施例还提供一种字幕处理装置100,该装置主要包括:获取模块101、修改模块102以及渲染模块103。
其中,获取模块101用于:获取目标字幕的配置信息,其中,该配置信息包括目标字幕的原始制式和目标样式属性的第一属性值。
在本申请的一些可选实施例中,获取模块101具体用于:从媒体流中解析出目标字幕的原始码流和原始制式;和,对原始码流进行内容解析,以得到第一属性值。
该修改模块102用于:当获取模块101获取的原始制式与预置制式不同时,根据原始制式与预置制式的对应关系,将第一属性值修改为第二属性值。
该渲染模块103用于:根据修改模块102修改得到的第二属性值在预置制式对应的画布上对目标字幕进行渲染。在本申请的一些可选实施例中,前述目标样式属性包括与目标字幕的显示位置或尺寸相关的样式属性。
在本申请的一些可选实施例中,预置制式包括预置分辨率规格,原始制式包括目标字幕的原始分辨率规格,目标字幕的原始制式与预置制式的对应关系包括预置分辨率规格和原始分辨率规格对应的数值关系。而修改模块102具体用于:根据预置分辨率规格与获取模块101获取的原始分辨率规格确定数值关系;根据数值关系对第一属性值进行修改,以得到修改后的第二属性值。
在本申请的一些可选实施例中,字幕处理装置100还包括:创建模块(图中未示出),用于在渲染模块103根据第二属性值在预置制式对应的画布上对目标字幕进行渲染之前,创建与预置制式对应的画布。
在本申请的一些可选实施例中,字幕处理装置100还包括:展示模块(图中未示出),用于将渲染模块103根据第二属性值在预置制式对应的画布上对目标字幕进行渲染而得到的适应于预置制式的字幕图像进行展示。
另外,本申请实施例示出的各种字幕处理装置100包括有用于执行前述各个实施例所述方法对应的模块和单元,而其详细说明和技术效果可以参考前述各实施例中的相应说明,在此不再赘述。
图8为根据本申请的另一实施例的字幕处理装置的示意性框图。请参阅图8,本申请的实施例还提供一种字幕处理装置100’,该装置主要包括:获取模块101’、确定模块112、以及渲染模块103’。
其中,该获取模块101’用于:获取目标字幕的配置信息,其中,该配置信息包括字幕的目标样式属性与画布的对应关系。
该确定模块112用于:根据目标字幕的目标样式属性与画布的对应关系、以及与预置制式对应的画布的属性,确定目标字幕的适于预置制式的样式属性取值。
该字幕渲染模块103’用于:根据目标字幕的适于预置制式的样式属性取值、在与预 置制式对应的画布上对目标字幕进行渲染。
另外,本申请实施例示出的各种字幕处理装置100’包括有用于执行前述相应实施例所述方法对应的模块和单元,而其详细说明和技术效果可以参考前述各实施例中的相应说明,在此不再赘述。
图9是图示根据本申请的一个实施例的字幕处理设备的示意性框图。如图9所示,根据本公开实施例的字幕处理设备200包括存储器201和处理器202。
该存储器201用于存储非暂时性计算机可读指令。具体地,存储器201可以包括一个或多个计算机程序产品,该计算机程序产品可以包括各种形式的计算机可读存储介质,例如易失性存储器和/或非易失性存储器。该易失性存储器例如可以包括随机存取存储器(RAM)和/或高速缓冲存储器(cache)等。该非易失性存储器例如可以包括只读存储器(ROM)、硬盘、闪存等。
该处理器202可以是中央处理单元(CPU)或者具有数据处理能力和/或指令执行能力的其它形式的处理单元,并且可以控制字幕处理设备200中的其它组件以执行期望的功能。在本公开的一个实施例中,该处理器202用于运行该存储器201中存储的该计算机可读指令,使得该字幕处理设备200执行前述的本公开各实施例的字幕处理方法的全部或部分步骤。
本领域技术人员应能理解,为了解决如何获得良好用户体验效果的技术问题,本实施例中也可以包括诸如通信总线、接口等公知的结构,这些公知的结构也应包含在本申请的保护范围之内。
有关本实施例的详细说明和技术效果可以参考前述各实施例中的相应说明,在此不再赘述。
本申请的实施例还提供一种计算机存储介质,该计算机存储介质中存储有计算机指令,当该计算机指令在设备上运行时,使得设备执行上述相关方法步骤实现上述实施例中的字幕处理方法。
本申请的实施例还提供一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关步骤,以实现上述实施例中的字幕处理方法。
另外,本申请的实施例还提供一种装置,这个装置具体可以是芯片,组件或模块,该装置可包括相连的处理器和存储器;其中,存储器用于存储计算机执行指令,当装置运行时,处理器可执行存储器存储的计算机执行指令,以使芯片执行上述各方法实施例中的字幕处理方法。
其中,本申请提供的装置、计算机存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。
以上所述,仅是本申请的较佳实施例而已,并非对本申请做任何形式上的限制,虽然本申请已以较佳实施例揭露如上,然而并非用以限定本申请,任何熟悉本专业的技术人员,在不脱离本申请技术方案范围内,当可利用上述揭示的技术内容做出些许更动或修饰为等同变化的等效实施例,但凡是未脱离本申请技术方案的内容,依据本申请的技术实质对以上实施例所做的任何简单修改、等同变化与修饰,均仍属于本申请技术方案的范围内。

Claims (20)

  1. 一种字幕处理方法,其中,所述方法包括:
    获取目标字幕的配置信息,所述配置信息包括所述目标字幕的原始制式和目标样式属性的第一属性值;
    当所述原始制式与预置制式不同时,根据所述原始制式和所述预置制式的对应关系,将所述第一属性值修改为第二属性值;
    根据所述第二属性值在所述预置制式对应的画布上对所述目标字幕进行渲染。
  2. 根据权利要求1所述的方法,其中,所述预置制式包括预置分辨率规格,所述原始制式包括所述目标字幕的原始分辨率规格,所述对应关系包括所述预置分辨率规格和原始分辨率规格对应的数值关系;
    所述根据所述原始制式和所述预置制式的对应关系,将所述第一属性值修改为第二属性值,包括:
    根据所述预置分辨率规格与所述原始分辨率规格确定所述数值关系;
    根据所述数值关系对所述第一属性值进行修改,以得到修改后的所述第二属性值。
  3. 根据权利要求1或2所述的方法,其中,所述根据所述第二属性值在所述预置制式对应的画布上对所述目标字幕进行渲染之前,还包括:
    创建与所述预置制式对应的画布。
  4. 根据权利要求1或2所述的方法,其中,所述目标样式属性包括与所述目标字幕的显示位置或尺寸相关的样式属性。
  5. 根据权利要求1或2所述的方法,其中,所述获取目标字幕的配置信息,包括:
    从媒体流中解析出所述目标字幕的原始码流和所述原始制式;
    对所述原始码流进行内容解析,以得到所述第一属性值。
  6. 根据权利要求1或2所述的方法,其中,所述根据所述第二属性值在所述预置制式对应的画布上对所述目标字幕进行渲染之后,还包括:
    将根据所述第二属性值在所述预置制式对应的画布上对所述目标字幕进行渲染而得到的适应于所述预置制式的字幕图像进行展示。
  7. 根据权利要求6所述的方法,其中,所述将根据所述第二属性值在所述预置制式对应的画布上对所述目标字幕进行渲染而得到的适应于所述预置制式的字幕图像进行展示,包括:
    将根据所述第二属性值在所述预置制式对应的画布上对所述目标字幕进行渲染而得到的适应于所述预置制式的字幕图像传给终端设备的显示模块,以便所述显示模块在屏幕上显示字幕。
  8. 根据权利要求7所述的方法,其中,所述将根据所述第二属性值在所述预置制式对应的画布上对所述目标字幕进行渲染而得到的适应于所述预置制式的字幕图像传给终端设备的显示模块,以便所述显示模块在屏幕上显示字幕之前,还包括:
    将根据所述第二属性值在所述预置制式对应的画布上对所述目标字幕进行渲染而得到的适应于所述预置制式的字幕图像的RGBA数据暂存在内存块中。
  9. 根据权利要求1或2所述的方法,其中,所述获取目标字幕的配置信息之后,还包括:
    根据所述目标样式属性的第一属性值渲染出所述目标字幕的基于所述原始制式的字幕图像;
    根据所述预置制式与所述目标字幕的原始制式的对应关系调整所述原始制式的字幕图像,以将所述字幕图像调整到符合所述预置制式的画布上。
  10. 根据权利要求1或2中所述的方法,其中,所述目标字幕为ISDB-S3标准下的使 用TTML2规范的Closed Captions字幕。
  11. 一种字幕处理装置,其中,包括:
    获取模块,用于获取目标字幕的配置信息,所述配置信息包括所述目标字幕的原始制式和目标样式属性的第一属性值;
    修改模块,用于当所述获取模块获取的所述原始制式与预置制式不同时,根据所述原始制式和所述预置制式的对应关系,将所述第一属性值修改为第二属性值;以及,
    渲染模块,用于根据所述修改模块修改得到的所述第二属性值在所述预置制式对应的画布上对所述目标字幕进行渲染。
  12. 根据权利要求11所述的装置,其中,
    所述预置制式包括预置分辨率规格,所述原始制式包括所述目标字幕的原始分辨率规格,所述对应关系包括所述预置分辨率规格和原始分辨率规格对应的数值关系;
    所述修改模块具体用于:根据所述预置分辨率规格与所述获取模块获取的所述原始分辨率规格确定所述数值关系;根据所述数值关系对所述第一属性值进行修改,以得到修改后的所述第二属性值。
  13. 根据权利要求11或12所述的装置,其中,还包括:
    创建模块,用于在所述渲染模块根据所述第二属性值在所述预置制式对应的画布上对所述目标字幕进行渲染之前,创建与所述预置制式对应的画布。
  14. 根据权利要求11或12所述的装置,其中,
    所述获取模块具体用于:从媒体流中解析出所述目标字幕的原始码流和所述原始制式;对所述原始码流进行内容解析,以得到所述第一属性值。
  15. 根据权利要求14所述的装置,其中,
    所述获取模块具体用于:根据所述目标样式属性的第一属性值渲染出所述目标字幕的基于所述原始制式的字幕图像;根据所述预置制式与所述目标字幕的原始制式的对应关系调整所述原始制式的字幕图像,以将所述字幕图像调整到符合所述预置制式的画布上。
  16. 根据权利要求11或12所述的装置,其中,还包括:
    展示模块,用于将所述渲染模块根据所述第二属性值在所述预置制式对应的画布上对所述目标字幕进行渲染而得到的适应于所述预置制式的字幕图像进行展示。
  17. 根据权利要求16所述的装置,其中,
    所述展示模块具体用于:将根据所述第二属性值在所述预置制式对应的画布上对所述目标字幕进行渲染而得到的适应于所述预置制式的字幕图像传给终端设备的显示模块,以便所述显示模块在屏幕上显示字幕。
  18. 根据权利要求16所述的装置,其特征在于,
    所述展示模块具体用于:将根据所述第二属性值在所述预置制式对应的画布上对所述目标字幕进行渲染而得到的适应于所述预置制式的字幕图像的RGBA数据暂存在内存块中。
  19. 一种字幕处理设备,包括:
    存储器,用于存储非暂时性计算机可读指令;以及
    处理器,用于运行所述计算机可读指令,使得所述计算机可读指令被所述处理器执行时实现权利要求1至10中任一项所述的字幕处理方法。
  20. 一种计算机存储介质,其中,包括计算机指令,当所述计算机指令在设备上运行时,使得所述设备执行如权利要求1至10中任一项所述的字幕处理方法。
PCT/CN2022/083209 2021-04-26 2022-03-25 字幕处理方法、装置、设备及存储介质 WO2022227974A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2023560195A JP2024513380A (ja) 2021-04-26 2022-03-25 字幕の処理方法、装置、機器及び記憶媒体

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110455647.3A CN113438514B (zh) 2021-04-26 2021-04-26 字幕处理方法、装置、设备及存储介质
CN202110455647.3 2021-04-26

Publications (1)

Publication Number Publication Date
WO2022227974A1 true WO2022227974A1 (zh) 2022-11-03

Family

ID=77752992

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/083209 WO2022227974A1 (zh) 2021-04-26 2022-03-25 字幕处理方法、装置、设备及存储介质

Country Status (3)

Country Link
JP (1) JP2024513380A (zh)
CN (1) CN113438514B (zh)
WO (1) WO2022227974A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116668285A (zh) * 2022-12-05 2023-08-29 荣耀终端有限公司 配置制式的方法、设备和存储介质

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113438514B (zh) * 2021-04-26 2022-07-08 深圳Tcl新技术有限公司 字幕处理方法、装置、设备及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060017845A1 (en) * 2004-07-23 2006-01-26 Funai Electric Co., Ltd. Television broadcast receiver
CN101086834A (zh) * 2006-06-06 2007-12-12 华为技术有限公司 一种控制字幕显示效果的方法及控制设备
CN101594481A (zh) * 2008-05-30 2009-12-02 新奥特(北京)视频技术有限公司 一种制作和修改字幕的方法
CN102739994A (zh) * 2011-05-10 2012-10-17 新奥特(北京)视频技术有限公司 一种字幕工程在不同制式下切换的方法
CN107736032A (zh) * 2015-06-30 2018-02-23 索尼公司 接收装置、接收方法、传输装置和传输方法
CN113438514A (zh) * 2021-04-26 2021-09-24 深圳Tcl新技术有限公司 字幕处理方法、装置、设备及存储介质

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5805153A (en) * 1995-11-28 1998-09-08 Sun Microsystems, Inc. Method and system for resizing the subtitles of a video
US8754984B2 (en) * 2011-05-02 2014-06-17 Futurewei Technologies, Inc. System and method for video caption re-overlaying for video adaptation and retargeting
CN102932607B (zh) * 2012-10-29 2015-05-20 北京东方艾迪普科技发展有限公司 一种字幕图文信息生成方法及装置
CN103686352A (zh) * 2013-11-15 2014-03-26 乐视致新电子科技(天津)有限公司 智能电视媒体播放器及其字幕处理方法、智能电视
CA2991102A1 (en) * 2015-07-09 2017-01-12 Sony Corporation Reception apparatus, reception method, transmission apparatus, and transmission method
CN105554589A (zh) * 2015-12-14 2016-05-04 武汉兴图新科电子股份有限公司 一种后端显示的字幕叠加方法
TWI728061B (zh) * 2016-03-15 2021-05-21 日商新力股份有限公司 送訊裝置及收訊裝置
CN107135415A (zh) * 2017-04-11 2017-09-05 青岛海信电器股份有限公司 视频字幕处理方法及装置
CN109819343A (zh) * 2019-01-08 2019-05-28 深圳市华曦达科技股份有限公司 一种字幕处理方法、装置及电子设备

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060017845A1 (en) * 2004-07-23 2006-01-26 Funai Electric Co., Ltd. Television broadcast receiver
CN101086834A (zh) * 2006-06-06 2007-12-12 华为技术有限公司 一种控制字幕显示效果的方法及控制设备
CN101594481A (zh) * 2008-05-30 2009-12-02 新奥特(北京)视频技术有限公司 一种制作和修改字幕的方法
CN102739994A (zh) * 2011-05-10 2012-10-17 新奥特(北京)视频技术有限公司 一种字幕工程在不同制式下切换的方法
CN107736032A (zh) * 2015-06-30 2018-02-23 索尼公司 接收装置、接收方法、传输装置和传输方法
CN113438514A (zh) * 2021-04-26 2021-09-24 深圳Tcl新技术有限公司 字幕处理方法、装置、设备及存储介质

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116668285A (zh) * 2022-12-05 2023-08-29 荣耀终端有限公司 配置制式的方法、设备和存储介质
CN116668285B (zh) * 2022-12-05 2024-05-03 荣耀终端有限公司 配置制式的方法、设备和存储介质

Also Published As

Publication number Publication date
JP2024513380A (ja) 2024-03-25
CN113438514B (zh) 2022-07-08
CN113438514A (zh) 2021-09-24

Similar Documents

Publication Publication Date Title
US10031712B2 (en) System and method for display mirroring
WO2022227974A1 (zh) 字幕处理方法、装置、设备及存储介质
JP4541482B2 (ja) 画像処理装置及び画像処理方法
US11350069B2 (en) Source device and control method thereof, and sink device and image quality improvement processing method thereof
JP4711675B2 (ja) ウェブブラウザ及びビデオディスプレイ用のビデオ解像度制御
US8723891B2 (en) System and method for efficiently processing digital video
EP3751862B1 (en) Display method and device, television set, and storage medium
US9449585B2 (en) Systems and methods for compositing a display image from display planes using enhanced blending hardware
WO2021212463A1 (zh) 一种显示设备及投屏方法
JP2002033972A (ja) Osdヘッダを連鎖させることにより単一のosdピクスマップを複数のビデオラスタサイズにわたって使用するための方法およびシステム
CN113905268A (zh) 移动终端投屏显示的去黑边方法
US6919929B1 (en) Method and system for implementing a video and graphics interface signaling protocol
CN113825020B (zh) 视频清晰度切换方法、装置、设备、存储介质及程序产品
CN101448108A (zh) 图像处理装置与相关方法
WO2016056223A1 (en) System for terminal resolution adaptation for devices
CN111064982B (zh) 一种显示控制方法、存储介质及显示设备
US9418631B2 (en) Display control apparatus and method and image processing method
US9317891B2 (en) Systems and methods for hardware-accelerated key color extraction
JP2014041455A (ja) 画像処理装置、画像処理方法、及びプログラム
JP5303059B2 (ja) コンテンツ表示装置、テレビ受像機
US20220247891A1 (en) Processing method and processing device
CN115396717A (zh) 显示设备及显示画质调节方法
CN114979773A (zh) 显示设备、视频处理方法及存储介质
CN118155589A (zh) 一种智能电视ui平滑切换到高分辨率的方法
CN116996743A (zh) 一种视频处理方法、装置、电子设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22794447

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2023560195

Country of ref document: JP

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22794447

Country of ref document: EP

Kind code of ref document: A1