Subtitle display method and related equipment

By setting up masks for subtitles, the problem of low subtitles recognition during video playback is solved, and the user experience is improved, ensuring that the simultaneous display of videos and subtitles does not affect the user's viewing effect.

CN119233003APending Publication Date: 2024-12-31PETAL CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411100055.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2021-06-30
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

When playing video, the color and brightness of the subtitles overlap with the color of the video, resulting in insufficient recognition of subtitles and affecting the user experience.

Method used

By setting masks for subtitles, adjusting the color and transparency of subtitles, improving the recognition of subtitles without changing the subtitles selected by the user, reducing the obstruction of subtitles on video content, and ensuring the visibility of video content.

Benefits of technology

On the basis of not changing the subtitle color, improve the recognition of subtitles, improve the user experience, and ensure that the simultaneous display of videos and subtitles does not affect the user's viewing effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119233003A_ABST
    Figure CN119233003A_ABST
Patent Text Reader

Abstract

The invention discloses a subtitle display method and related equipment, and electronic equipment obtains a video file to be played and a subtitle file to be displayed, then decodes the video file to obtain a video frame, decodes the subtitle file to obtain a subtitle frame, and then displays the subtitle frame in the video frame. The electronic equipment can extract subtitle color gamut information, subtitle position information and the like from a subtitle frame, extract color gamut information at a subtitle display position in a video frame corresponding to subtitles based on the subtitle position information, and calculate a subtitle recognition degree based on the subtitle color gamut information and the color gamut information at the subtitle display position in the video frame corresponding to the subtitles. And further calculating a color value and transparency of a mask corresponding to the subtitles based on the subtitle recognition degree to generate a subtitle frame with the mask, and then synthesizing the video frame and the subtitle frame with the mask, rendering and displaying the video frame and the subtitle frame with the mask to a video playing window. Therefore, on the basis of not changing the color of the subtitles, the subtitle identification degree is improved, meanwhile, certain visibility of the video content is ensured, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application. The application number of the original application is 202110742392.9, and the original application date is June 30, 2021. The entire contents of the original application are incorporated into this application by reference. Technical Field

[0002] The present application relates to the field of terminal technology, and in particular to a subtitle display method and related equipment. Background Art

[0003] With the rapid development of electronic products, electronic devices such as mobile phones, tablet computers, and smart TVs have been widely used in people's lives, and video playback has become an important application function of these electronic devices. When electronic devices play videos, the application scenario of displaying subtitles related to the played video in the video playback window is also relatively widespread. For example, subtitles synchronized with audio are displayed in the video playback window, or subtitles input by the user are displayed in the video playback window to increase the interactivity of the video.

[0004] However, in the application scenario where subtitles are displayed while the video is being played, if the color and brightness of the video cover the color of the subtitles, or the color of the subtitles has a high degree of overlap with the color and brightness of the video at the subtitle display position, for example, some light-colored subtitles are displayed in a highlight scene, and some white subtitles are displayed in a snowy scene, etc., the subtitles will be insufficiently recognizable and difficult for users to see clearly, resulting in a poor user experience. Summary of the invention

[0005] The embodiments of the present application provide a subtitle display method and related devices, which can solve the problem of low subtitle recognition when users watch videos and improve user experience.

[0006] In a first aspect, an embodiment of the present application provides a subtitle display method, the method comprising: an electronic device plays a first video; when the electronic device displays a first interface, the first interface comprises a first screen and a first subtitle, the first subtitle is displayed floatingly above a first area of ​​the first screen with a first mask as a background, the first area is an area in the first screen corresponding to the display position of the first subtitle, wherein the difference between the color value of the first subtitle and the color value of the first area is a first value; when the electronic device displays a second interface, the second interface comprises a second screen and the first subtitle, the first subtitle does not display a mask, the first subtitle is displayed floatingly above a second area of ​​the second screen, the second area is an area in the second screen corresponding to the display position of the first subtitle, wherein the difference between the color value of the first subtitle and the color value of the second area is a second value, and the second value is greater than the first value; wherein the first screen is a screen in the first video, and the second screen is another screen in the first video.

[0007] By implementing the above-mentioned subtitle display method, the electronic device can set a mask for the subtitles when the subtitles have low recognition, thereby improving the recognition of the subtitles without changing the color of the subtitles.

[0008] In a possible implementation, before the electronic device displays the first picture, the method also includes: the electronic device obtains a first video file and a first subtitle file, wherein the first video file and the first subtitle file carry the same time information; the electronic device generates a first video frame based on the first video file, and the first video frame is used to generate the first picture; the electronic device generates a first subtitle frame based on the first subtitle file, and obtains the color value and display position of the first subtitle in the first subtitle frame, wherein the time information carried by the first subtitle frame is the same as the time information carried by the first video frame; the electronic device determines the first area based on the display position of the first subtitle; the electronic device generates the first mask based on the color value of the first subtitle or the color value of the first area; the electronic device superimposes the first subtitle on the first mask in the first subtitle frame to generate a second subtitle frame, and synthesizes the second subtitle frame with the first video frame. In this way, the electronic device can obtain a video file to be played and a subtitle file to be displayed, and then decode the video file to obtain a video frame, and decode the subtitle file to obtain a subtitle frame. After that, the electronic device can extract subtitle color gamut information, subtitle position information, etc. from the subtitle frame, extract the color gamut information of the subtitle display position in the video frame corresponding to the subtitle based on the subtitle position information, and calculate the subtitle recognition based on the subtitle color gamut information and the color gamut information of the subtitle display position in the video frame corresponding to the subtitle, further calculate the color value of the mask corresponding to the subtitle based on the subtitle recognition to generate a masked subtitle frame, and then synthesize and render the video frame and the masked subtitle frame.

[0009] In a possible implementation, before the electronic device generates the first mask based on the color value of the first subtitle or the color value of the first region, the method further includes: the electronic device determining that the first value is less than a first threshold. In this way, the electronic device can further determine that the recognition of the subtitle is low by determining that the first value is less than the first threshold.

[0010] In a possible implementation, the electronic device determines that the first value is less than a first threshold value, specifically including: the electronic device divides the first area into N first sub-areas, where N is a positive integer; and the electronic device determines that the first value is less than the first threshold value based on the color value of the first subtitle and the color values ​​of the N first sub-areas. In this way, the electronic device can determine that the first value is less than the first threshold value based on the color value of the first subtitle and the color values ​​of the N first sub-areas.

[0011] In a possible implementation, the electronic device generates the first mask based on the color value of the first subtitle or the color value of the first region, specifically including: the electronic device determines a color value of the first mask based on the color value of the first subtitle or the color value of the N first subregions; the electronic device generates the first mask based on the color value of the first mask. In this way, the electronic device can determine a color value of the first mask based on the color value of the first subtitle or the color value of the N first subregions, and further generate the first mask for the first subtitle.

[0012] In a possible implementation, the electronic device determines that the first value is less than a first threshold value, specifically including: the electronic device divides the first area into N first sub-areas, where N is a positive integer; the electronic device determines whether to merge adjacent first sub-areas into second sub-areas based on the difference value of the color values ​​between adjacent first sub-areas; when the difference value of the color values ​​between adjacent first sub-areas is less than a second threshold value, the electronic device merges adjacent first sub-areas into second sub-areas; the electronic device determines that the first value is less than the first threshold value based on the color value of the first subtitle and the color value of the second sub-area. In this way, the electronic device can merge first sub-areas with similar color values ​​to generate a second sub-area, and further determine that the first value is less than the first threshold value based on the color value of the first subtitle and the color value of the second sub-area.

[0013] In a possible implementation, the first area includes M second sub-areas, where M is a positive integer and is less than or equal to N, and the second sub-area includes one or more first sub-areas, and each second sub-area includes the same or different number of the first sub-areas. In this way, the electronic device can divide the first area into M second sub-areas.

[0014] In a possible implementation, the electronic device generates the first mask based on the color value of the first subtitle or the color value of the first region, specifically including: the electronic device sequentially calculates the color values ​​of M first sub-masks based on the color value of the first subtitle or the color values ​​of the M second sub-regions; the electronic device generates the M first sub-masks based on the color values ​​of the M first sub-masks, wherein the M first sub-masks are combined into the first mask. In this way, the electronic device can generate M first sub-masks for the first subtitle.

[0015] In a possible implementation, the method further includes: when the electronic device displays a third interface, the third interface includes a third screen and the first subtitles, the first subtitles include at least a first part and a second part, the first part displays a second sub-mask, the second part displays a third sub-mask or does not display the third sub-mask, and the color value of the second sub-mask is different from the color value of the third sub-mask. In this way, subtitles corresponding to multiple sub-masks can be displayed on the electronic device.

[0016] In a possible implementation, the display position of the first mask is determined based on the display position of the first subtitle. In this way, the display position of the first mask can coincide with the display position of the first subtitle.

[0017] In a possible implementation, the difference between the color value of the first mask and the color value of the first subtitle is greater than the first value, so that the recognition of the subtitles can be improved.

[0018] In a possible implementation, in the first screen and the second screen, the display position of the first subtitle is not fixed or fixed relative to the display screen of the electronic device, and the first subtitle is a continuously displayed segment of text or symbol. In this way, the first subtitle can be a bullet screen or a subtitle synchronized with the audio, and the first subtitle is a subtitle, rather than all subtitles displayed on the display screen.

[0019] In a possible implementation, before the electronic device displays the first interface, the method further includes: the electronic device sets the transparency of the first mask to be less than 100%, so as to ensure that the video frame corresponding to the area where the first mask is located still has a certain degree of visibility.

[0020] In a possible implementation, before the electronic device displays the second interface, the method further includes: the electronic device generates a second mask based on the color value of the first subtitle or the color value of the second area, and superimposes the first subtitle on the second mask, wherein the color value of the second mask is a preset color value and the transparency of the second mask is 100%; or, the electronic device does not generate the second mask. In this way, for highly recognizable subtitles, the electronic device can set a mask with a transparency of 100% for it, or set a mask for it.

[0021] In a second aspect, an embodiment of the present application provides an electronic device, comprising one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, and the computer program code comprises computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the method described in any possible implementation of the first aspect above.

[0022] In a third aspect, an embodiment of the present application provides a computer storage medium, wherein the computer storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed on an electronic device, the electronic device executes the method described in any possible implementation of the first aspect.

[0023] In a fourth aspect, an embodiment of the present application provides a computer program product, which, when executed on a computer, enables the computer to execute the method described in any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 It is a flowchart of a subtitle display method provided by an embodiment of the present application;

[0025] Figure 2A-2C is a set of user interface schematic diagrams provided in an embodiment of the present application;

[0026] Figure 3 is a flowchart of another subtitle display method provided by an embodiment of the present application;

[0027] Figure 4 is a schematic diagram of a subtitle frame provided by an embodiment of the present application;

[0028] Figure 5 It is a schematic diagram of the principle of generating a mask corresponding to a subtitle provided by an embodiment of the present application;

[0029] Fig. 6A is a schematic diagram of a subtitle frame with a mask provided in an embodiment of the present application;

[0030] Figure 6B-6C is a user interface schematic diagram of a group of subtitle displays provided in an embodiment of the present application;

[0031] Fig. 7A It is a flowchart of a method for generating a mask corresponding to a subtitle provided in an embodiment of the present application;

[0032] Figure 7B is another schematic diagram of the principle of generating a mask corresponding to a subtitle provided by an embodiment of the present application;

[0033] Fig. 8A is another schematic diagram of a subtitle frame with a mask provided in an embodiment of the present application;

[0034] Figure 8B-Figure 8C is a user interface schematic diagram of a group of subtitle displays provided in an embodiment of the present application;

[0035] Fig. 9 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;

[0036] Fig.10 It is a schematic diagram of the software structure of an electronic device provided in an embodiment of the present application;

[0037] Fig.11 is a schematic diagram of the structure of another electronic device provided in an embodiment of the present application;

[0038] Fig.12 It is a schematic diagram of the structure of another electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0039] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the text is only a description of the association relationship of the associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0040] It should be understood that the terms "first", "second", etc. in the specification, claims and drawings of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.

[0041] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments.

[0042] To facilitate understanding, some relevant concepts involved in the embodiments of the present application are first explained below.

[0043] 1. Video decoding:

[0044] The process of reading binary data of a video file and interpreting the image frame (also called video frame) data of the video playback according to the compression algorithm of the video file.

[0045] 2. Subtitles:

[0046] The text and symbol information displayed in the video playback window during video playback is independent of the video file.

[0047] 3. Video playback:

[0048] The process of displaying a set of images and corresponding sound information in chronological order in the video playback window after the video file has been decoded, rendered, and other operations.

[0049] 4. Barrage:

[0050] The subtitles are input by the user on a video playback client (or video application) and can be displayed on the video playback window of the input user or other users on the video playback window of the video playback client according to the image frame position of the video playback corresponding to the user input time.

[0051] With the rapid development of electronic products, electronic devices such as mobile phones, tablet computers, and smart TVs have been widely integrated into people's lives, and video playback has become an important application function of these electronic devices. While the electronic devices are playing videos, the application scenarios of displaying subtitles related to the played video in the video playback window are also relatively widespread. For example, subtitles synchronized with the audio are displayed in the video playback window, or subtitles entered by the user (i.e., bullet screen) are displayed in the video playback window to increase the interactivity of the video.

[0052] In the application scenario where subtitles synchronized with audio are displayed in a video playback window, the subtitles are usually synthesized with the corresponding video playback image frames by matching the timestamps of the subtitles with the timestamps of the video playback image frames at the bottom of the video playback window, that is, the subtitles are superimposed on the corresponding video frames, and the position of the subtitles and the overlapping position of the video frame are relatively fixed.

[0053] In the application scenario of displaying user-input subtitles (i.e., bullet comments) in a video playback window, there are usually multiple subtitles in the video playback window that flow from left to right or from right to left during video playback, and the position of the subtitles and the overlapping position of the video frame are relatively unfixed.

[0054] In some actual application scenarios, in order to enhance the fun of video playback, video playback platforms usually provide users with the ability to independently select the color of subtitles. In the application scenario where the video playback window displays subtitles synchronized with the audio, the subtitle color is usually the system default color. Users can independently select their favorite subtitle color when playing the video, and the electronic device will display the subtitles on the video playback window according to the color selected by the user. In the application scenario where the video playback window displays barrage, the user who sends the barrage can independently select the color of the barrage, and the barrage color seen by other users is consistent with the color of the barrage selected by the user who sent the barrage. Therefore, when users are watching the barrage, the color of each barrage displayed on the same video frame may be different.

[0055] To achieve the above two application scenarios, an embodiment of the present application provides a subtitle display method, whereby the electronic device can first obtain a video file to be played and a subtitle file to be displayed in a video playback window, and then can respectively decode the video file to obtain a video frame, and decode the subtitle file to obtain a subtitle frame. After that, the video frame and the subtitle frame can be aligned and matched in time sequence to synthesize the final video frame to be displayed and store it in a video frame queue. After that, the video frame to be displayed is read and rendered in time sequence, and finally, the rendered video frame is displayed in the video playback window.

[0056] The following is a detailed introduction to the method flow of the above subtitle display method.

[0057] Figure 1 The method flow of a subtitle display method provided by an embodiment of the present application is exemplified.

[0058] like Figure 1 As shown, the method can be applied to an electronic device 100 having a video playback capability. The specific steps of the method are described in detail below:

[0059] Stage 1: Video information stream and subtitle information stream acquisition stage

[0060] S101-S102, the electronic device 100 detects an operation of a user playing a video on a video application. In response to the operation, the electronic device 100 can obtain a video information stream and a subtitle information stream.

[0061] Specifically, a video application may be installed on the electronic device 100. After detecting a user's operation of playing a video on the video application, in response to the operation, the electronic device 100 may obtain the video information stream (or video file) and subtitle information stream (or subtitle file) corresponding to the video that the user wants to play.

[0062] For example, Figure 2A The figure shows a user interface (UI) provided by the electronic device 100 for displaying applications installed in the electronic device 100. The electronic device 100 can detect a user operation (e.g., a click operation) on the "video" application option 211 on the user interface 210, and in response to the operation, the electronic device 100 can display the following: Figure 2B The exemplary user interface 220 shown may be the main interface of a "video" application. When the electronic device 100 detects a user operation (such as a click operation) on a video playback option 221 on the user interface 220, in response to the operation, the electronic device 100 may obtain the video information stream and subtitle information stream corresponding to the video.

[0063] The video information stream and subtitle information stream may be files downloaded by the electronic device 100 from the server of the video application or files acquired by the electronic device 100. Both the video file and the subtitle file carry time information.

[0064] Understandably, Figure 2A and Figure 2B The user interface on the electronic device 100 is merely illustrated as an example and should not constitute a limitation on the embodiments of the present application.

[0065] Stage 2: Video decoding stage

[0066] S103 : The video application on the electronic device 100 sends a video information stream to the video decoding module on the electronic device 100 .

[0067] Specifically, after acquiring the video information stream, the video application may send the video information stream to the video decoding module.

[0068] S104 - S105 , the video decoding module on the electronic device 100 decodes the video information stream to generate video frames, and sends the video frames to the video frame synthesis module on the electronic device 100 .

[0069] Specifically, after receiving the video information stream sent by the video application, the video decoding module can decode the video information stream to generate video frames, which can be all video frames in the video playback process, wherein a video frame can also be called an image frame, and each video frame can carry the time information (i.e., timestamp) of the video frame. Afterwards, the video decoding module can send the decoded video frames to the video frame synthesis module for subsequent generation of video frames to be displayed.

[0070] The video decoding module can use the video decoding method in the prior art to decode the video information stream, which is not limited in the present embodiment. The specific implementation of the video decoding method can refer to the technical information related to video decoding, which will not be described here.

[0071] Stage 3: Subtitle decoding and subtitle corresponding mask generation stage

[0072] S106 : The video application on the electronic device 100 sends a subtitle information stream to a subtitle decoding module on the electronic device 100 .

[0073] Specifically, after acquiring the subtitle information stream, the video application may send the subtitle information stream to the subtitle decoding module.

[0074] S107 - S108 , the subtitle decoding module on the electronic device 100 decodes the subtitle information stream to generate subtitle frames, and sends the subtitle frames to the video frame synthesis module on the electronic device 100 .

[0075] Specifically, after receiving the subtitle information stream sent by the video application, the subtitle decoding module can decode the subtitle information stream to generate subtitle frames, which can be all subtitle frames in the video playback process, wherein each subtitle frame can include subtitle text, display position of subtitle text, font color of subtitle text, font format of subtitle text, etc., and can also carry time information (i.e., timestamp) of the subtitle frame. Afterwards, the subtitle decoding module can send the subtitle frames generated by decoding to the video frame synthesis module for subsequent generation of video frames to be displayed.

[0076] The subtitle decoding module can use the subtitle decoding method in the prior art to decode the subtitle information stream, which is not limited in the present embodiment. The specific implementation of the subtitle decoding method can refer to the technical information related to subtitle decoding, which will not be described here.

[0077] It should be noted that the embodiment of the present application only takes the steps of the stage two video decoding stage being executed first and then the steps of the stage three subtitle decoding stage being executed as an example. In some embodiments, the steps of the stage three subtitle decoding stage may be executed first and then the steps of the stage two video decoding stage, or the steps of the stage two video decoding stage and the steps of the stage three subtitle decoding stage may be executed simultaneously, and the embodiment of the present application does not limit this.

[0078] Stage 4: Video frame synthesis, rendering and display

[0079] S109-S110, the video frame synthesis module on the electronic device 100 superimposes and merges the received video frame and subtitle frame to generate a video frame to be displayed, and sends the video frame to be displayed to the video frame queue on the electronic device 100.

[0080] Specifically, the video frame synthesis module can match the time information corresponding to the video frame with the time information corresponding to the subtitle frame, and after the matching is completed, the subtitle frame is superimposed on the corresponding video frame, and the subtitle frame is merged to generate a video frame to be displayed. Afterwards, the video frame synthesis module can send the video frame to be displayed to the video frame queue.

[0081] S111-S113, the video rendering module can read the video frames to be displayed from the video frame queue in time sequence, and render the video frames to be displayed in time sequence to generate rendered video frames.

[0082] Specifically, the video rendering module can obtain the video frames to be displayed in the video frame queue in real time (or at regular intervals). After the video frame synthesis module sends the video frames to be displayed to the video frame queue, the video rendering module can read and render the video frames to be displayed from the video frame queue in time sequence to generate rendered video frames. Afterwards, the video rendering module can send the rendered video frames to the video application.

[0083] The video rendering module can render the video frames to be displayed using the video rendering method in the prior art, which is not limited in the present embodiment. The specific implementation of the video rendering method can refer to the technical information related to video rendering, which will not be described in detail here.

[0084] S114. The electronic device 100 displays the rendered video frame.

[0085] Specifically, after receiving the rendered video frame sent by the video rendering module, the video application on the electronic device 100 can display the rendered video frame on the display screen of the electronic device 100 (ie, the video playback window).

[0086] For example, Figure 2C The electronic device 100 may perform Figure 1 The screen of a frame in the rendered video frame displayed after the subtitle display method shown. Among them, the subtitles "I am a subtitle that spans multiple color gamuts", "highly recognizable subtitles", and "indistinct color subtitles" are all bullet screens, and the display position of the bullet screen is not fixed relative to the display screen of the electronic device 100. The display position of the subtitles "subtitles synchronized with audio" is fixed relative to the display screen of the electronic device 100. From Figure 2CIt is easy to see that the color difference between the front and back ends of the subtitle "I am a subtitle spanning multiple color gamuts" and the video color is small, resulting in low subtitle recognition and users cannot clearly see the subtitles; the subtitles "highly recognizable subtitles" and "subtitles synchronized with audio" have a large color difference with the video color, and the subtitles are highly recognizable, so users can clearly see the subtitles; although the subtitle color of the subtitle "indistinct color subtitles" is not very different from the video color, it may be due to the high brightness of the video, which also leads to low subtitle recognition and users cannot clearly see the subtitles.

[0087] from Figure 2C It can be seen that using Figure 1 In the application scenario where the subtitles are displayed while the video is playing, if the color of the subtitles has a high degree of overlap with the color and brightness of the video at the subtitle display position, the subtitles will be difficult to recognize and the user will find it difficult to see clearly, resulting in a poor user experience.

[0088] To solve the above problems, an embodiment of the present application provides another subtitle display method. The electronic device can first obtain a video file to be played and a subtitle file to be displayed in a video playback window, and then can respectively decode the video file to obtain a video frame and decode the subtitle file to obtain a subtitle frame. After that, the electronic device can extract subtitle color gamut information, subtitle position information, etc. from the subtitle frame, and extract the color gamut information at the subtitle display position in the video frame corresponding to the subtitle based on the subtitle position information. Then, based on the subtitle color gamut information and the color gamut information at the subtitle display position in the video frame corresponding to the subtitle, the subtitle recognition is calculated. If the subtitle recognition is low, a mask can be added to the subtitle, and the color value and transparency of the mask are calculated based on the subtitle recognition, so as to generate a subtitle frame with a mask. After that, the video frame and the subtitle frame with a mask can be aligned and matched in time sequence to synthesize the final video frame to be displayed and cached in a video frame queue. After that, the video frame to be displayed is read and rendered in time sequence. Finally, the rendered video frame is displayed in the video playback window. In this way, the problem of low subtitle recognition can be solved by adjusting the color and transparency of the subtitle mask without changing the subtitle color selected by the user. At the same time, the subtitles can reduce the occlusion of the video content, ensure a certain visibility of the video content, and improve the user experience.

[0089] Another subtitle display method provided by an embodiment of the present application is introduced below.

[0090] Figure 3 The method flow of another subtitle display method provided by an embodiment of the present application is exemplified.

[0091] like Figure 3As shown, the method can be applied to an electronic device 100 having a video playback capability. The specific steps of the method are described in detail below:

[0092] Stage 1: Video information stream and subtitle information stream acquisition stage

[0093] S301-S302, the electronic device 100 detects an operation of a user playing a video on a video application. In response to the operation, the electronic device 100 can obtain a video information stream and a subtitle information stream.

[0094] The specific execution process of step S301-step S302 can refer to the aforementioned Figure 1 The relevant contents in step S101 and step S102 in the illustrated embodiment will not be repeated here.

[0095] Stage 2: Video decoding stage

[0096] S303 : The video application on the electronic device 100 sends a video information stream to the video decoding module on the electronic device 100 .

[0097] S304 - S305 , the video decoding module on the electronic device 100 decodes the video information stream to generate video frames, and sends the video frames to the video frame synthesis module on the electronic device 100 .

[0098] The specific execution process of steps S303 to S305 can refer to the aforementioned Figure 1 The relevant contents in step S103 to step S105 in the illustrated embodiment will not be repeated here.

[0099] Stage 3: Subtitle decoding stage

[0100] S306 : The video application on the electronic device 100 sends a subtitle information stream to the subtitle decoding module on the electronic device 100 .

[0101] S307: The subtitle decoding module on the electronic device 100 decodes the subtitle information stream to generate subtitle frames.

[0102] The specific execution process of steps S306-S307 can refer to the aforementioned Figure 1 The relevant contents in step S106 and step S107 in the illustrated embodiment will not be repeated here.

[0103] Figure 4 The diagram exemplarily shows one of the subtitle frames generated by the subtitle decoding module decoding the subtitle information stream.

[0104] like Figure 4As shown, the area inside the rectangular solid line frame may represent a subtitle frame display area (or a video playback window area), which may overlap with the video frame display area. One or more subtitles may be displayed in the area, for example, "I am a subtitle that spans multiple color gamuts", "highly recognizable subtitles", "indistinct color subtitles", "subtitles synchronized with audio", etc., "I am a subtitle that spans multiple color gamuts", "highly recognizable subtitles", etc. may be respectively referred to as a subtitle, and all subtitles displayed in the area may be referred to as a subtitle group, for example, "I am a subtitle that spans multiple color gamuts", "highly recognizable subtitles", "indistinct color subtitles", "subtitles synchronized with audio" may be referred to as a subtitle group.

[0105] in, Figure 4 The rectangular dotted frame outside each subtitle shown is only an auxiliary element for marking the position of each subtitle and may not be displayed during video playback.

[0106] Based on the above explanations of subtitles and subtitle groups, Figure 2C As shown, it is easy to understand. Figure 2C The screen shown shows four subtitles, namely "I am a subtitle spanning multiple color gamuts", "Highly recognizable subtitles", "Unclear color subtitles", and "Subtitles synchronized with audio". These four subtitles form a subtitle group.

[0107] S308: The subtitle decoding module on the electronic device 100 extracts subtitle position information, subtitle color gamut information, etc. of each subtitle in the subtitle frame, and generates subtitle group information.

[0108] Specifically, after generating a subtitle frame, the subtitle decoding module can extract the subtitle position information, subtitle color gamut information, etc. of each subtitle in the subtitle frame, thereby generating subtitle group information. The subtitle position information may be the display position of each subtitle in the display area of ​​the subtitle frame, and the subtitle color gamut information may include the color value of each subtitle. The subtitle group information may include the subtitle position information, subtitle color gamut information, etc. of all subtitles in the subtitle frame.

[0109] Optionally, the subtitle color gamut information may also include information such as the brightness of the subtitles.

[0110] The following is a detailed description of the extraction process of subtitle position information and subtitle color gamut information:

[0111] 1. Subtitle position information extraction process:

[0112] The subtitle display position area can be Figure 4 The inner area of ​​the rectangular dotted frame shown can just cover the subtitles, or other inner areas of any shape that can cover the subtitles, which is not limited in the embodiments of the present application.

[0113] In the embodiment of the present application, the subtitle position information extraction process is introduced by taking the inner area of ​​the rectangular dotted line frame as the display position area of ​​the subtitle as an example:

[0114] To extract Figure 4 Taking the subtitle position information of the subtitle "I am a subtitle that spans multiple color gamuts" as an example, the subtitle decoding module can first establish an XOY plane rectangular coordinate system in the subtitle frame display area, and then select a point in the subtitle frame display area (for example, the lower left corner vertex of the rectangular solid line frame) as the reference coordinate point O, and the coordinates of the reference coordinate point O can be set to (0, 0). According to mathematical knowledge, the coordinates (x1, y1), (x2, y2), (x3, y3), and (x4, y4) at the four vertices of the rectangular dotted line frame outside the subtitle "I am a subtitle that spans multiple color gamuts" can all be calculated, and the position information of the subtitle "I am a subtitle that spans multiple color gamuts" can include the coordinates at the four vertices of the rectangular dotted line frame, or, since the rectangle is a regular figure, it is only necessary to determine the coordinates of the two vertices on a diagonal line of the rectangular dotted line frame to determine the position area where the rectangle is located. Therefore, the position information of the subtitle "I am a subtitle that spans multiple color gamuts" can also only include the coordinates at the two vertices on a diagonal line of the rectangular dotted line frame.

[0115] Similarly, Figure 4 The subtitle position information of other subtitles shown can also be extracted by the above subtitle position extraction method, which will not be described in detail here.

[0116] When the subtitle decoding module determines the position information of all subtitles in the subtitle frame, it means that the subtitle decoding module completes the extraction of subtitle position information.

[0117] It should be noted that the subtitle position information extraction process introduced above is only one possible implementation method for extracting subtitle position information. The implementation method for extracting subtitle position information may also be other implementation methods in the prior art, and the embodiments of the present application are not limited to this.

[0118] 2. Subtitle color gamut information extraction process:

[0119] First, we introduce the relevant concepts involved in the subtitle color gamut extraction process:

[0120] Color value:

[0121] Color value refers to the color value corresponding to a certain color in different color modes. Take the RGB color mode as an example. In the RGB color mode, a color is a mixture of red, green, and blue. The color value of each color can be represented by (r, g, b), where r, g, and b represent the values ​​of the three primary colors of red, green, and blue, respectively, and the value range is [0, 255]. For example, the color value of red can be represented as (255, 0, 0), the color value of green can be represented as (0, 255, 0), the color value of blue can be represented as (0, 0, 255), the color value of black can be represented as (0, 0, 0), and the color value of white can be represented as (255, 255, 255).

[0122] Color gamut:

[0123] The color gamut is a set of color values, that is, the set of colors that can be generated in a certain color mode. It is easy to understand that in the RGB color mode, a maximum of 256×256×256=16777216 different colors can be generated, that is, 2 24 Different colors, the color range is [0, 2 24 -1]. This 2 24 Different colors and the color value corresponding to each color can form a color value table, and the color value corresponding to each color can be found in the color value table.

[0124] After extracting the subtitle position information, the subtitle decoding module may search the color value corresponding to the font color in the color value table based on the font color of the subtitle at the position where the subtitle is located, thereby determining the color value of the subtitle.

[0125] When the subtitle decoding module determines the color values ​​of all subtitles in the subtitle frame, it means that the subtitle decoding module completes the extraction of subtitle color gamut information.

[0126] S309: The subtitle decoding module on the electronic device 100 sends an instruction for obtaining subtitle group mask parameters to the video frame color gamut interpretation module on the electronic device 100. The instruction carries the time information of the subtitle frame, the subtitle group information, etc.

[0127] Specifically, after generating the subtitle group information, the subtitle decoding module can send an instruction to obtain the mask parameters of the subtitle group to the video frame color gamut interpretation module, and the instruction is used to instruct the video frame color gamut interpretation module to send the mask parameters corresponding to the subtitle group (including the color value and transparency of the mask) to the subtitle decoding module. A color value and a transparency can be called a set of mask parameters. The instruction can carry the time information of the subtitle frame, the subtitle group information, etc., wherein the time information of the subtitle frame can be used to obtain the video frame corresponding to the subtitle group in the subsequent steps, and the subtitle group information can be used to analyze the subtitle recognition in the subsequent steps.

[0128] S310: The video frame color gamut interpretation module on the electronic device 100 sends an instruction for obtaining a video frame corresponding to a subtitle group to the video decoding module on the electronic device 100. The instruction carries time information of the subtitle frame, etc.

[0129] Specifically, after receiving the instruction for obtaining the mask parameters of the subtitle group sent by the subtitle decoding module, the video frame color gamut interpretation module may send an instruction for obtaining the video frame corresponding to the subtitle group to the video decoding module, and the instruction is used to instruct the video decoding module to send the video frame corresponding to the subtitle group to the video frame color gamut interpretation module. The instruction may carry the time information of the subtitle frame, and the time information of the subtitle frame may be used by the video decoding module to find the video frame corresponding to the subtitle group.

[0130] S311-S312, the video decoding module on the electronic device 100 searches for the video frame corresponding to the subtitle group, and sends the video frame corresponding to the subtitle group to the video frame color gamut interpretation module on the electronic device 100.

[0131] Specifically, after the video decoding module receives the instruction for obtaining the video frame corresponding to the subtitle group sent by the video frame color gamut interpretation module, the video decoding module can find the video frame corresponding to the subtitle group based on the time information of the subtitle frame carried in the instruction. Since the video decoding module has decoded and obtained the time information of all video frames in the video decoding stage, the video decoding module can match the time information of all video frames with the time information of the subtitle frame. If the match is successful (that is, the time information of the video frame is consistent with the time information of the subtitle frame), the video frame is the video frame corresponding to the subtitle group. Afterwards, the video decoding module can send the video frame corresponding to the subtitle group to the video frame color gamut interpretation module.

[0132] S313: The video frame color gamut interpretation module on the electronic device 100 obtains the color gamut information at the position of each subtitle in the video frame corresponding to the subtitle group based on the position information of each subtitle in the subtitle group information.

[0133] Specifically, after obtaining the video frame corresponding to the subtitle group, the video frame color gamut interpretation module can determine the video frame area corresponding to the position of each subtitle based on the position information of each subtitle in the subtitle group information. Further, the video frame color gamut interpretation module can calculate the color gamut information of the video frame area corresponding to the position of each subtitle.

[0134] The following is a detailed description of the process by which the video frame color gamut interpretation module calculates the color gamut information of the video frame area corresponding to the location of each subtitle:

[0135] Assumptions Figure 2CThe subtitle “I am a subtitle that spans multiple color gamuts” in the picture shown is subtitle 1, and the video frame color gamut interpretation module is taken as an example to calculate the color gamut information of the video frame area corresponding to subtitle 1.

[0136] like Figure 5 As shown, the video frame area corresponding to the position of subtitle 1 can be Figure 5 The area inside the top rectangular solid frame, because a video frame area may contain pixel areas of different color gamuts, a video frame area can be divided into multiple sub-areas, each of which can be called a video frame color gamut extraction unit. The sub-areas can be divided according to a preset width or according to the width of each word in the subtitle. For example, subtitle 1 has 13 words in total, then Figure 5 According to the width of each character in subtitle 1, the video frame area corresponding to the position of subtitle 1 is divided into 13 sub-areas, that is, 13 video frame color gamut extraction units.

[0137] Furthermore, the video frame color gamut interpretation module can calculate the color gamut information of each sub-region in order from left to right (or from right to left). Taking the calculation of the color gamut information of a sub-region in the video frame region as an example, the video frame color gamut interpretation module can obtain the color values ​​of all pixels in the sub-region, and then superimpose and average the color values ​​of all pixels, so as to obtain the average value of the color values ​​of all pixels in the sub-region, and the average value is the color value of the sub-region, and the color value of the sub-region is the color gamut information of the sub-region.

[0138] For example, assuming that the sub-region is m pixels wide and n pixels high, the sub-region has a total of m*n pixels, and the color value x of each pixel can be represented by (r, g, b). Then, the average color value of all pixels in the sub-region is Then

[0139]

[0140] Among them, r i is the average red color value of all pixels in the sub-region, g i is the average green color value of all pixels in the sub-region, b i is the average blue color value of all pixels in the sub-region, is the red color value of the i-th pixel, is the green color value of the i-th pixel, is the blue color value of the i-th pixel.

[0141] Similarly, the video frame color gamut interpretation module can calculate the color gamut information of all sub-areas of the video frame area corresponding to the position of each subtitle, that is, the color gamut information of the subtitle position in the video frame corresponding to the subtitle group.

[0142] It should be understood that the number of sub-regions into which the video frame region corresponding to the subtitle is divided can be determined based on a preset division rule, and the embodiment of the present application does not limit this.

[0143] Optionally, the color gamut information of the video frame region may also include information such as brightness of the video frame region.

[0144] It should be noted that the above-described process of calculating the color gamut information of the video frame area corresponding to the position of each subtitle is only one possible implementation method, and other implementation methods can also be used, which is not limited in the embodiments of the present application.

[0145] S314: The video frame color gamut interpretation module on the electronic device 100 generates a superimposed subtitle recognition analysis result based on each subtitle color gamut information in the subtitle group information and the color gamut information at each subtitle position in the video frame corresponding to the subtitle group.

[0146] Specifically, after calculating the color gamut information of the subtitle position in the video frame corresponding to the subtitle group, the video frame color gamut interpretation module can perform superimposed subtitle recognition analysis based on the subtitle color gamut information in the subtitle group information and the color gamut information at the subtitle position in the video frame corresponding to the subtitle group. Furthermore, the superimposed subtitle recognition analysis can generate a superimposed subtitle recognition analysis result, which is used to indicate the recognition level (also called recognizability level) of each subtitle in the subtitle group.

[0147] That is to say, the video frame color gamut interpretation module can determine the difference between the color of the subtitles and the color of the video frame area corresponding to the subtitles after the subtitle group is superimposed on the subtitle position in the video frame corresponding to the subtitle group. If the difference is small, it means that the subtitle recognition is low and is not easy to be recognized by the user.

[0148] The following is a detailed description of the process of analyzing the recognition of superimposed subtitles using the video frame color gamut interpretation module:

[0149] The video frame color gamut interpretation module can determine the color difference value between the subtitle color and the color of the video frame area corresponding to the subtitle, and the color difference value is used to indicate the difference between the subtitle color and the color of the video frame area corresponding to the subtitle. The color difference value can be determined using a related algorithm in the prior art.

[0150] In a possible implementation, the color difference value Diff may be calculated using the following formula:

[0151]

[0152] Among them, k is the number of all sub-areas of the video frame area corresponding to a subtitle, r iis the average red color value of all pixels in the sub-region, g i is the average green color value of all pixels in the sub-region, b i is the average blue color value of all pixels in the sub-area, r0 is the red color value of the subtitle, g0 is the green color value of the subtitle, and b0 is the blue color value of the subtitle.

[0153] Furthermore, after the video frame color gamut interpretation module calculates the color difference value, the recognition degree of the subtitle can be determined by judging whether the color difference value is less than a preset color difference threshold.

[0154] If the color difference value is smaller than a preset color difference threshold (also referred to as a first threshold), it indicates that the subtitle recognition is low.

[0155] In some embodiments, the degree of subtitle recognition may be further determined in combination with the brightness of the video frame region corresponding to the subtitle.

[0156] For example, Figure 2C The subtitles shown are "unclear color subtitles". Although the color difference between the subtitle color and the video frame area corresponding to the subtitle is not very small, since the brightness of the video frame area corresponding to the subtitle is too high, there is still a problem of low subtitle recognition. Therefore, in this case, the subtitle recognition can be further judged based on the brightness of the video frame area corresponding to the subtitle. If the brightness of the video frame area corresponding to the subtitle is higher than a preset brightness threshold, it means that the subtitle recognition is low.

[0157] For pure color subtitles, the extracted subtitle color gamut information may only include a color value corresponding to the subtitle. For non-pure color subtitles, the extracted subtitle color gamut information may include multiple parameters. For example, for gradient color subtitles, the extracted subtitle color gamut information may include multiple parameters such as the starting color value, the ending color value, and the gradient direction. In this case, in a possible implementation, the average value of the starting color value and the ending color value of the subtitle can be calculated first, and then the average value is used as the color value corresponding to the subtitle to perform superimposed subtitle recognition analysis.

[0158] It should be noted that the above-mentioned process of performing superimposed subtitle recognition analysis by the video frame color gamut interpretation module is only one possible implementation method, and other implementation methods can also be used, which is not limited in the embodiments of the present application.

[0159] S315: The video frame color gamut interpretation module on the electronic device 100 calculates the color value and transparency of the mask corresponding to each subtitle in the subtitle group based on the superimposed subtitle recognition analysis result.

[0160] Specifically, after generating the superimposed subtitle recognition analysis result, the video frame color gamut interpretation module can calculate the color value and transparency of the mask corresponding to each subtitle in the subtitle frame based on the result.

[0161] For subtitles with higher recognition (such as Figure 2C The subtitles "highly recognizable subtitles" and subtitles "subtitles synchronized with audio"), the color value of the mask corresponding to the subtitle can be a preset fixed value, and the transparency can be set to 100%.

[0162] For subtitles with low recognition (such as Figure 2C For example, in the subtitle "I am a subtitle that spans multiple color gamuts" or "Unclear color subtitles"), the color value and transparency of the mask corresponding to the subtitle need to be further determined based on the subtitle color gamut information or the color gamut information of the video frame area corresponding to the subtitle position.

[0163] There are many ways to specifically determine the color value and transparency of the mask corresponding to the subtitle, which is not limited in the embodiments of the present application, and those skilled in the art can choose according to needs.

[0164] In a possible implementation, the color value corresponding to a color with the largest color difference value with the color value of the subtitle or the color value of the video frame area corresponding to the subtitle can be determined as the color value of the mask corresponding to the subtitle. In this way, the user can see the subtitles more clearly. The color value corresponding to a color with a middle color difference value with the color value of the subtitle or the color value of the video frame area corresponding to the subtitle can also be determined as the color value of the mask corresponding to the subtitle. In this way, while ensuring that the user can see the subtitles clearly, it can also avoid eye discomfort caused by excessive color differences to the user, and so on.

[0165] For example, the electronic device 100 may calculate the color difference value Diff between the color value corresponding to each color in the color value table and the color value of the subtitle, and then may select the color value corresponding to a color with the largest / center color difference value Diff as the color value of the mask. In a possible implementation, the color difference value Diff between the color value corresponding to each color in the color value table and the color value of the subtitle may be calculated using the following formula:

[0166] Diff=(r0-R0) 2 +(g0-G0) 2 +(b0-B0) 2

[0167] Among them, assuming that the color value corresponding to a certain color in the color value table is (R0, G0, B0), R0 is the red color value corresponding to the color, G0 is the green color value corresponding to the color, and B0 is the blue color value corresponding to the color; r0 is the red color value of the subtitles, g0 is the green color value of the subtitles, and b0 is the blue color value of the subtitles.

[0168] For another example, the electronic device 100 may calculate the color difference value Diff between the color value corresponding to each color in the color value table and the color value of the video frame area corresponding to the subtitle, and then select the color value corresponding to a color with the largest / center color difference value Diff as the color value of the mask. In a possible implementation, the color difference value Diff between the color value corresponding to each color in the color value table and the color value of the video frame area corresponding to the subtitle may be calculated using the following formula:

[0169]

[0170] Assume that the color value corresponding to a certain color in the color value table is (R0, G0, B0), R0 is the red color value corresponding to the color, G0 is the green color value corresponding to the color, and B0 is the blue color value corresponding to the color; k is the number of all sub-areas in the video frame area corresponding to the subtitle, r i is the average red color value of all pixels in the sub-region, g i is the average green color value of all pixels in the sub-region.

[0171] In a possible implementation, the transparency of the mask corresponding to the subtitles can be further determined based on the color value of the mask corresponding to the subtitles. For example, when the color value of the mask corresponding to the subtitles is significantly different from the color value of the subtitles, the transparency of the mask corresponding to the subtitles can be appropriately selected to be a larger value (e.g., a value greater than 50%), so that the subtitles can be clearly seen by the user while the subtitles can be less blocked by the subtitles superimposed area on the video screen.

[0172] S316: The video frame color gamut interpretation module on the electronic device 100 sends the color value and transparency of the mask corresponding to each subtitle in the subtitle group to the subtitle decoding module on the electronic device 100.

[0173] Specifically, after calculating the color value and transparency of the mask corresponding to each subtitle in the subtitle group, the video frame color gamut interpretation module can send the color value and transparency of the mask corresponding to each subtitle in the subtitle group to the subtitle decoding module. At the same time, it can also carry the subtitle position information of the subtitles corresponding to the mask, so that the subtitle decoding module can match the subtitles with the mask one by one.

[0174] S317: The subtitle decoding module on the electronic device 100 generates a corresponding mask based on the color value and transparency of the mask corresponding to each subtitle in the subtitle group, and superimposes each subtitle in the subtitle group and its corresponding mask to generate a subtitle frame with a mask.

[0175] Specifically, after receiving the color value and transparency of the mask corresponding to each subtitle in the subtitle group sent by the video frame color gamut interpretation module, the subtitle decoding module can generate a mask corresponding to the subtitle based on the color value and transparency of the mask corresponding to the subtitle and the subtitle position information of the subtitle (for example, Figure 5 The mask corresponding to the subtitle 1 shown in the figure), wherein the shape of the mask can be a rectangle or any other shape that can cover the subtitle, which is not limited in the embodiment of the present application.

[0176] Similarly, the subtitle decoding module can generate a mask corresponding to each subtitle in the subtitle group.

[0177] For example, Figure 2C As shown, it is easy to see that there are four subtitles in the picture, so the subtitle decoding module can generate four masks, one subtitle corresponds to one mask.

[0178] Furthermore, the subtitle decoding module can superimpose the subtitles onto the mask layer corresponding to the subtitles to generate subtitles with masks (e.g. Figure 5 Subtitles with masks shown in 1).

[0179] Similarly, the subtitle decoding module can superimpose each subtitle in the subtitle group and its corresponding mask to generate a subtitle frame with a mask.

[0180] Fig. 6A An example of a subtitle frame with a mask is shown. It can be seen that each subtitle is superimposed with a mask. The transparency of the mask corresponding to the highly recognizable subtitles (such as "highly recognizable subtitles" and "subtitles synchronized with audio") is 100%, and the transparency of the mask corresponding to the less recognizable subtitles (such as "I am a subtitle spanning multiple color gamuts" and "indistinct color subtitles") is less than 100%, with a certain color value.

[0181] S318: The subtitle decoding module on the electronic device 100 sends the subtitle frame with the mask to the video frame synthesis module on the electronic device 100.

[0182] Specifically, after generating the subtitle frame with a mask, the subtitle decoding module may send the subtitle frame with a mask to the video frame synthesis module for subsequent generation of a video frame to be displayed.

[0183] Stage 4: Video frame synthesis, rendering and display

[0184] S319-S320, the video frame synthesis module on the electronic device 100 superimposes and merges the received video frame and the masked subtitle frame to generate a video frame to be displayed, and sends the video frame to be displayed to the video frame queue on the electronic device 100.

[0185] S321-S323, the video rendering module can read the video frames to be displayed from the video frame queue in time sequence, and render the video frames to be displayed in time sequence to generate rendered video frames.

[0186] S324: The electronic device 100 displays the rendered video frame.

[0187] The specific execution process of steps S319 to S324 can refer to the aforementioned Figure 1 The relevant contents in step S109 to step S114 in the illustrated embodiment will not be repeated here.

[0188] It should be noted that, in some embodiments, the above-mentioned video decoding module, subtitle decoding module, video frame color gamut interpretation module, video frame synthesis module, video frame queue, and video rendering module can also be integrated into the above-mentioned video application to execute the subtitle display method provided in the embodiments of the present application, and the embodiments of the present application are not limited to this.

[0189] For example, Figure 6B The electronic device 100 may perform Figure 3 The subtitle display method shown in FIG. 1 (one subtitle can correspond to one mask) is followed by displaying a certain frame of the rendered video frame. Figure 2C Compared with the picture shown in the figure, after adding the corresponding mask to the subtitle group, the recognition of the subtitles "I am a subtitle spanning multiple color gamuts" and "Unclear color subtitles" has been greatly improved. At the same time, since the mask corresponding to the subtitles has a certain transparency, the subtitle overlay area does not completely block the video screen. In this way, the effects of video display and subtitle display are comprehensively considered. On the basis of not changing the subtitle color selected by the user, it is guaranteed that the user can see the subtitles clearly while ensuring a certain visibility of the video screen, thereby improving the user experience.

[0190] Furthermore, during the entire video playback process, the position of the subtitles, the color of the video background, etc. may change, so the above subtitle display method can be executed all the time, so that the user can clearly see the subtitles during the entire video playback process. Figure 6B It can be a schematic diagram of the first user interface when the video playback progress is at 8:00. Figure 6CIt can be a schematic diagram of a second user interface at 8:02 of the video playback progress, where the video frames included in the first user interface are different from the video frames included in the second user interface. Figure 6C As shown in the figure, it can be seen that the subtitle "I am a subtitle across multiple color gamuts", the subtitle "highly recognizable subtitles", and the subtitle "indistinct color subtitles" are relatively Figure 6B For example, the subtitle "I am a subtitle that spans multiple color gamuts" has moved to the left side of the display screen. The electronic device 100 will recalculate the color value and transparency of the mask corresponding to the subtitle based on the color value of the subtitle and the color value of the current video frame area corresponding to the subtitle, and generate the mask corresponding to the subtitle. It is easy to see that in the second user interface, the video background color of the subtitle "I am a subtitle that spans multiple color gamuts" corresponding to the current video frame area has changed, and the recognition of the subtitle has also increased. Therefore, the mask corresponding to the subtitle "I am a subtitle that spans multiple color gamuts" is relatively Figure 6B There is also a change. It can be seen that the subtitle does not display the mask. Specifically, the transparency of the mask corresponding to the subtitle becomes 100%, or the subtitle has no mask.

[0191] Figure 6B and Figure 6C The video playback screen shown can be displayed in full screen or in partial screen, which is not limited in the embodiments of the present application.

[0192] Above Figure 6B The masks corresponding to the subtitles shown are all masks that span the entire subtitle area, that is, each subtitle corresponds to only one mask. In some actual application scenarios, a subtitle may span multiple areas with large color gamut differences, resulting in a part of the subtitle being more recognizable and another part being less recognizable. In this case, multiple masks can be generated for a subtitle. For example, Figure 2C As shown in the subtitle "I am a subtitle spanning multiple color gamuts", the subtitle recognition of the front end of the area where the subtitle is located is low (i.e., the four words "I am a subtitle spanning multiple color gamuts" are not easy for users to see clearly), and the subtitle recognition of the back end of the area where the subtitle is located is also low (i.e., the four words "subtitle spanning multiple color gamuts" are not easy for users to see clearly), while the subtitle recognition of the middle part of the area where the subtitle is located is high (i.e., the five words "spanning multiple color gamuts" are easy for users to see clearly). Therefore, in this case, a corresponding mask can be generated for the front end, middle part, and back end of the area where the subtitle is located, respectively, that is, the subtitle can have three corresponding masks.

[0193] For the application scenario where one subtitle corresponds to multiple masks, the embodiment of the present application can be Figure 3 Based on the method shown, some corresponding improvements are made to steps S313 to S317, so that one subtitle corresponds to multiple masks. Other steps do not need to be changed.

[0194] The following is a detailed description of the process of implementing a subtitle corresponding to multiple masks:

[0195] In the process of generating the color gamut information of the subtitle position in the video frame corresponding to the subtitle group, the video frame color gamut interpretation module can calculate the color value of each sub-region in sequence from left to right (or from right to left). In the above-mentioned application scenario where one subtitle needs to correspond to multiple masks, that is, in the application scenario where one subtitle spans multiple areas with large color gamut differences, the video frame color gamut interpretation module can compare the color values ​​of adjacent sub-regions. If the color values ​​of adjacent sub-regions are similar, they are merged into one area, and the merged area corresponds to a mask. If the color values ​​of adjacent sub-regions are very different, they are not merged, and the two unmerged areas correspond to their own masks respectively. Therefore, one subtitle may correspond to multiple masks.

[0196] like Fig. 7A As shown, in the case where a subtitle may correspond to multiple masks, steps S313 to S317 can be specifically performed according to the following steps. Figure 7B The subtitle 1 shown is Figure 2C The subtitle shown is "I am a subtitle that spans multiple color gamuts" as an example for explanation.

[0197] S701. The video frame color gamut interpretation module sequentially calculates the color value of each sub-region of the video frame region corresponding to the subtitle position, and merges sub-regions with similar color values ​​to obtain M second sub-regions.

[0198] Specifically, based on step S313, after the video frame color gamut interpretation module calculates the color value of each sub-region in order from left to right (or from right to left), it is also necessary to compare the color values ​​of adjacent sub-regions, merge sub-regions with similar color values, and obtain M second sub-regions, where M is a positive integer. Figure 7B As shown, the video frame color gamut interpretation module compares the color values ​​of adjacent sub-regions, merges the sub-regions with similar color values, and then divides the video frame region corresponding to the position of the subtitle into three regions (i.e., three second sub-regions): region A, region B, and region C. It is assumed that region A is formed by merging a sub-regions, region B is formed by merging b sub-regions, and region A is formed by merging c sub-regions.

[0199] The similar color values ​​may refer to that the difference in color values ​​of the two sub-regions is less than a second threshold value, and the second threshold value is preset.

[0200] S702: The video frame color gamut interpretation module performs superimposed subtitle recognition analysis on the M second sub-regions respectively, and generates superimposed subtitle recognition analysis results for the M second sub-regions.

[0201] Specifically, the video frame color gamut interpretation module needs to perform superimposed subtitle recognition analysis on region A, region B, and region C respectively, rather than directly performing superimposed subtitle recognition analysis on the entire video frame region. Similarly, the video frame color gamut interpretation module can also use the color difference value in step S314 to perform superimposed subtitle recognition analysis on region A, region B, and region C respectively, and the process is as follows:

[0202] The color difference value Diff1 of area A:

[0203]

[0204] Where a is the number of sub-areas included in area A, r i is the average red color value of all pixels in the sub-region of region A, g i is the average green color value of all pixels in the sub-region of region A, b i is the average blue color value of all pixels in the sub-region of region A, r0 is the red color value of the subtitles in region A, g0 is the green color value of the subtitles in region A, and b0 is the blue color value of the subtitles in region A.

[0205] The color difference value Diff2 of area B:

[0206]

[0207] Where b is the number of sub-regions included in region B, r i is the average red color value of all pixels in the sub-region of region B, g i is the average green color value of all pixels in the sub-region of region B, b i is the average blue color value of all pixels in the sub-area of ​​area B, r0 is the red color value of the subtitles in area B, g0 is the green color value of the subtitles in area B, and b0 is the blue color value of the subtitles in area B.

[0208] The color difference value Diff3 of area C:

[0209]

[0210] Where c is the number of sub-regions included in region C, r i is the average red color value of all pixels in the sub-region of region C, g i is the average green color value of all pixels in the sub-region of region C, b i is the average blue color value of all pixels in the sub-area of ​​area C, r0 is the red color value of the subtitles in area C, g0 is the green color value of the subtitles in area C, and b0 is the blue color value of the subtitles in area C.

[0211] After the video frame color gamut interpretation module calculates the color difference values ​​of area A, area B, and area C respectively, it can determine whether the color difference values ​​of these three areas are less than a preset color difference threshold. If so, it means that the subtitle recognition degree of the area is low.

[0212] S703: The video frame color gamut interpretation module determines the color values ​​and transparency of the masks corresponding to the M second sub-regions based on the subtitle color gamut information and the superimposed subtitle recognition analysis results of the M second sub-regions.

[0213] Specifically, the video frame color gamut interpretation module needs to determine the color value and transparency of the mask corresponding to region A, the color value and transparency of the mask corresponding to region B, and the color value and transparency of the mask corresponding to region C based on the subtitle color gamut information and the superimposed subtitle recognition analysis results of region A, region B, and region C. The process of specifically determining the color value and transparency of the mask corresponding to each second sub-region is similar to the process of determining the color value and transparency of the mask corresponding to the entire video frame region corresponding to the subtitle position in step S315, and can refer to the aforementioned related content, which will not be repeated here.

[0214] S704: The video frame color gamut interpretation module sends the color value, transparency, and position information of the masks corresponding to the M second sub-regions to the subtitle decoding module.

[0215] Specifically, since a subtitle may correspond to multiple masks, the video frame color gamut interpretation module needs to send the position information of each mask (or the position information of each mask relative to its corresponding subtitle) to the subtitle decoding module in addition to sending the color value and transparency of the mask corresponding to each subtitle in the subtitle group to the subtitle decoding module, wherein the position information of each mask can be obtained based on the subtitle position information. Specifically, if a subtitle corresponds to multiple masks, since the subtitle position information is known, the position information of all sub-areas of the video frame area where the subtitle is located can be inferred, and the position information of the mask corresponding to each second sub-area can be further inferred.

[0216] S705. The subtitle decoding module generates a mask corresponding to the subtitle based on the color value, transparency, and position information of the masks corresponding to the M second sub-regions, and superimposes the subtitle on the mask to generate a subtitle with a mask.

[0217] Specifically, for a subtitle corresponding to multiple masks, the subtitle decoding module may generate three masks corresponding to the subtitle (for example, Figure 7B The subtitle decoding module can then overlay the subtitle onto the mask layer corresponding to the subtitle to generate a subtitle with a mask (e.g. Figure 7B Subtitles with masks shown in 1).

[0218] like Figure 2C As shown, since the three subtitles "highly recognizable subtitles", "indistinct color subtitles" and "subtitles synchronized with audio" do not span multiple areas with large color gamut differences, these three subtitles still correspond to one mask.

[0219] The subtitle decoding module can superimpose each subtitle in the subtitle group and its corresponding mask to generate a subtitle frame with a mask.

[0220] Fig. 8A An example of a subtitle frame with a mask is shown. It can be seen that the subtitle "I am a subtitle that spans multiple color gamuts" is superimposed with three masks. Among them, "I am a subtitle" and "subtitles of multiple color gamuts" have low recognition, so the transparency of the corresponding mask is less than 100%, and there is a certain color value, while "spanning multiple colors" has a high recognition, so the transparency of the corresponding mask is 100%. The remaining three are each superimposed with a mask. Among them, the subtitles "highly recognizable subtitles" and "subtitles synchronized with audio" have high recognition, so the transparency of the corresponding mask is 100%, and the subtitles "unclear color subtitles" have low recognition, so the transparency of the corresponding mask is less than 100%, and there is a certain color value.

[0221] For example, Figure 8B The electronic device 100 may be shown as executing the improved Figure 3 A frame of a rendered video frame is displayed after the subtitle display method shown in the figure (subtitles spanning multiple areas with large color gamut differences can correspond to multiple masks). Figure 6B Compared to the picture shown, since the subtitle "I am a subtitle that spans multiple color gamuts" spans multiple areas with large color gamut differences, the mask corresponding to the subtitle has changed. It is easy to see that since the middle part of the area where the subtitle is located (i.e., the "spanning multiple colors" part) has a higher degree of subtitle recognition, the transparency of the mask corresponding to this part is set to 100% (i.e., fully transparent), or no mask is required. Since the front end part (i.e., the "I am a" part) and the back end part (i.e., the "subtitle of the domain" part) of the area where the subtitle is located have lower degree of subtitle recognition, the color value and transparency of the mask corresponding to these two parts are calculated based on the subtitle color gamut information and the color gamut information of the area where the two parts are located. In this way, since the transparency of the mask corresponding to the middle part of the area where the subtitle "I am a subtitle that spans multiple color gamuts" is 100%, or no mask is required, after reaching Figure 6B On the basis of the beneficial effects shown, the mask's occlusion of the video image is further reduced, and the user experience is further improved.

[0222] Furthermore, during the entire video playback process, the position of the subtitles, the color of the video background, etc. may change, so the above subtitle display method can be executed all the time, so that the user can clearly see the subtitles during the entire video playback process. Figure 8B It can be a user interface diagram of the video playback progress at 8:00, including the first video frame, Figure 8C It can be a user interface schematic diagram of the video playback progress at 8:01, including the second video frame, and the first video frame and the second video frame are the same. Figure 8C As shown in the figure, it can be seen that the subtitle "I am a subtitle across multiple color gamuts", the subtitle "highly recognizable subtitles", and the subtitle "indistinct color subtitles" are relatively Figure 8B For example, the subtitles have moved to the left side of the display screen. The electronic device 100 will recalculate the color value and transparency of the mask corresponding to the subtitles based on the color value of the subtitles and the color value of the current video frame area corresponding to the subtitles, and generate the mask corresponding to the subtitles. It is easy to see that Figure 8C The mask corresponding to the subtitle "I am a subtitle that spans multiple color gamuts" in Figure 8B There has been a significant change. Figure 8B In the example, the less recognizable parts of the subtitles are "I am a line" and "domain subtitles", so the masks corresponding to these two parts have certain color values, and the transparency of the corresponding masks is less than 100%. The more recognizable part of the subtitles is "spanning multiple colors", so this part does not display the mask. Specifically, the transparency of the mask corresponding to the subtitles can be 100%, or no mask is set. Figure 8C In the video, the less recognizable part of the subtitle becomes "I am a span" and "subtitles", so the electronic device 100 will recalculate the color value and transparency of the masks corresponding to these two parts based on the color value of the subtitle and the color value of the current video frame area corresponding to the subtitle. Since the two parts are less recognizable, the masks corresponding to these two parts have certain color values, and the transparency of the corresponding masks is less than 100%. The more recognizable part of the subtitle becomes "multiple color gamuts", so this part does not display the mask. Specifically, the transparency of the mask corresponding to the subtitle can be set to 100%, or no mask can be set. Among them, Figure 8C The generation process of the mask corresponding to the subtitle is the same as the above Figure 8B The process of generating the mask corresponding to the Chinese subtitle is similar and will not be repeated here.

[0223] Figure 8B and Figure 8C The video playback screen shown can be displayed in full screen or in partial screen, which is not limited in the embodiments of the present application.

[0224] In an embodiment of the present application, for subtitles with high recognition, the electronic device 100 will also generate a mask for the subtitles, the color value of the mask can be a preset color value, and the transparency of the mask is 100%. In some embodiments, for subtitles with high recognition, the electronic device 100 may not generate a mask for the subtitles, that is, if the electronic device 100 determines that the subtitles have high recognition, the electronic device 100 may no longer perform further processing on the subtitles, so the subtitles do not have a corresponding mask, that is, the subtitles are not set with a mask.

[0225] In the embodiment of the present application, a subtitle corresponds to a mask (i.e., a subtitle corresponds to a set of mask parameters), which may mean that a subtitle corresponds to a mask including a color value and a transparency, a subtitle corresponds to multiple masks (i.e., a subtitle corresponds to multiple sets of mask parameters), which may mean that a subtitle corresponds to multiple masks with different color values ​​and different transparencies, or, a subtitle corresponds to a mask including different color values ​​and different transparencies (i.e., multiple masks with different color values ​​and different transparencies are combined into a mask including different color values ​​and different transparencies).

[0226] The electronic device 100 in the embodiment of the present application takes a mobile phone as an example. The electronic device 100 may also be a tablet computer (Pad), a personal digital assistant (PDA), a laptop computer, or other portable electronic device. The embodiment of the present application does not limit the type, physical form, or size of the electronic device 100.

[0227] In the embodiment of the present application, the first video may be Figure 2B The video played by the electronic device 100 after the video play option 221 is shown, the first interface can be Figure 6B The user interface shown in the figure can be Figure 6B In the video frame picture shown, the first subtitle may be a subtitle "I am a subtitle spanning multiple color gamuts", the first area is an area in the first picture corresponding to the display position of the first subtitle, the first value may be a color difference value between the color of the first subtitle and the color of the first picture area corresponding to the display position of the first subtitle, and the second interface may be Figure 6C The user interface shown in the figure can be Figure 6CIn the video frame picture shown, the second area is the area in the second picture corresponding to the display position of the first subtitle, the second value can be a color difference value between the color of the first subtitle and the color of the second picture area corresponding to the display position of the first subtitle, the first video file can be a video file corresponding to the first video, the first subtitle file can be a subtitle file corresponding to the first video, the first video frame is a video frame used to generate the first picture, the first subtitle frame is a subtitle frame containing the first subtitle and carrying the same time information as the first video frame, the second subtitle frame is a subtitle frame generated after the first subtitle is superimposed on the first mask (that is, a subtitle frame with a mask), the first sub-area can be a video frame color gamut extraction unit, the second sub-area can be an area after adjacent first sub-areas with similar color values ​​are merged (for example, area A, area B, area C), the first sub-mask can be a mask corresponding to each second sub-area, and the first mask can be Figure 6B The mask corresponding to the subtitle "I am a subtitle that spans multiple color gamuts" shown can also be Figure 8B The mask corresponding to the subtitle "I am a subtitle that spans multiple color gamuts" shown in the third interface can be Figure 8B The third screen may be Figure 8B In the video frame shown in FIG. 1 , the first part may be the “I am a line” in the subtitle “I am a line that spans multiple color gamuts”, the second part may be the “spans multiple colors” in the subtitle “I am a line that spans multiple color gamuts”, and the second sub-mask may be the mask corresponding to “I am a line” (i.e. Figure 7B The third sub-mask may be a mask corresponding to "spanning multiple colors" (i.e. Figure 7B The second mask may be Figure 6C The mask corresponding to the subtitle "I am a subtitle spanning multiple color gamuts" is shown.

[0228] The structure of an electronic device 100 provided in an embodiment of the present application is introduced below.

[0229] Fig. 9 The structure of an electronic device 100 provided in an embodiment of the present application is exemplarily shown.

[0230] like Fig. 9As shown, the electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0231] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0232] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0233] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0234] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0235] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0236] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface, thereby realizing the touch function of the electronic device 100.

[0237] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.

[0238] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0239] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.

[0240] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the electronic device 100.

[0241] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0242] The USB interface 130 is an interface that complies with the USB standard specification, and can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other terminal devices, such as AR devices, etc.

[0243] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0244] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device 100 through the power management module 141.

[0245] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0246] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0247] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0248] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0249] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0250] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0251] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0252] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0253] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0254] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0255] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.

[0256] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0257] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0258] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0259] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0260] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0261] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0262] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0263] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.

[0264] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.

[0265] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.

[0266] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to microphone 170C to input the sound signal into microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.

[0267] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0268] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.

[0269] The gyro sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.

[0270] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.

[0271] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover according to the magnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, the flip cover can be automatically unlocked.

[0272] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device 100 and is applied to applications such as horizontal and vertical screen switching and pedometers.

[0273] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.

[0274] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.

[0275] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.

[0276] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.

[0277] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of a processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 performs a boost on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.

[0278] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.

[0279] The bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone block of the vocal part of the human body. The bone conduction sensor 180M can also contact the human pulse to receive a blood pressure beat signal. In some embodiments, the bone conduction sensor 180M can also be set in an earphone and combined into a bone conduction earphone. The audio module 170 can parse out a voice signal based on the vibration signal of the vibrating bone block of the vocal part obtained by the bone conduction sensor 180M to realize a voice function. The application processor can parse the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M to realize a heart rate detection function.

[0280] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0281] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0282] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0283] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0284] It should be understood that Fig. 9 The electronic device 100 shown is only an example, and the electronic device 100 may have more Fig. 9 More or fewer components may be shown, two or more components may be combined, or there may be a different configuration of components. Fig. 9 The various components shown in the EMBODIMENTS 2000 may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application specific integrated circuits.

[0285] The following introduces a software structure of an electronic device 100 provided in an embodiment of the present application.

[0286] Fig.10 The software structure of an electronic device 100 provided in an embodiment of the present application is exemplified.

[0287] like Fig.10 As shown, the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The software structure of the electronic device 100 is exemplarily described below.

[0288] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the software structure of the electronic device 100 is divided into three layers, namely, the application layer, the application framework layer, and the kernel layer from top to bottom.

[0289] The application layer can include a series of application packages.

[0290] like Fig.10As shown, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications. Among them, video may refer to the video application mentioned in the embodiment of the present application.

[0291] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0292] like Fig.10 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, a video processing system, and the like.

[0293] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0294] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0295] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0296] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).

[0297] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0298] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

[0299] The video processing system can be used to execute the subtitle display method provided in the embodiment of the present application. The video processing system may include a subtitle decoding module, a video frame color gamut interpretation module, a video frame synthesis module, a video frame queue, and a video rendering module, wherein the specific functions of each module may refer to the relevant contents in the aforementioned embodiment, and will not be repeated here.

[0300] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, Bluetooth driver, and sensor driver.

[0301] The following is an illustrative description of the workflow of the software and hardware of the electronic device 100 in conjunction with capturing a photo scene.

[0302] When the touch sensor 180K receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including touch coordinates, timestamp of the touch operation, and other information). The raw input event is stored in the kernel layer. The application framework layer obtains the raw input event from the kernel layer and identifies the control corresponding to the input event. For example, if the touch operation is a touch single-click operation and the control corresponding to the single-click operation is the control of the camera application icon, the camera application calls the interface of the application framework layer to start the camera application, and then starts the camera driver by calling the kernel layer to capture static images or videos through the camera 193.

[0303] The structure of another electronic device 100 provided in an embodiment of the present application is introduced below.

[0304] Fig.11 The structure of another electronic device 100 provided in an embodiment of the present application is exemplified.

[0305] like Fig.11 As shown, the electronic device 100 may include: a video application 1100 and a video processing system 1110 .

[0306] The video application 1100 may be a system application installed on the electronic device 100 (eg, Figure 2A The “Video” application shown in the figure) can also be an application with video playing capability provided by a third party and installed on the electronic device 100, which is mainly used for playing videos.

[0307] The video processing system 1110 may include: a video decoding module 1111 , a subtitle decoding module 1112 , a video frame color gamut interpretation module 1113 , a video frame synthesis module 1114 , a video frame queue 1115 , and a video rendering module 1116 .

[0308] The video decoding module 1111 can receive the video information stream sent by the video application 1100, and decode the video information stream to generate video frames.

[0309] The subtitle decoding module 1112 can receive the subtitle information stream sent by the video application 1100, and decode the subtitle information stream to generate subtitle frames, and can generate masked subtitle frames based on the mask parameters sent by the video frame color gamut interpretation module 1113, thereby improving the recognition of subtitles.

[0310] The video frame color gamut interpretation module 1113 can analyze the subtitle recognition, generate a subtitle recognition analysis result, and calculate the mask parameters (mask color value, transparency) corresponding to the subtitle based on the subtitle recognition analysis result.

[0311] The video frame synthesis module 1114 can superimpose and merge the video frame and the subtitle frame to generate a video frame to be displayed.

[0312] The video frame queue 1115 can store the video frames to be displayed sent by the video frame synthesis module 1114 .

[0313] The video rendering module 1116 can render the video frames to be displayed in time sequence, generate rendered video frames, and send them to the video application 1100 for video playback.

[0314] For more details about the functions and working principles of the electronic device 100, please refer to the relevant contents of the above embodiments, which will not be repeated here.

[0315] It should be understood that Fig.11 The electronic device 100 shown is only one example, and the electronic device 100 may have more Fig.11 More or fewer components may be shown, two or more components may be combined, or there may be a different configuration of components. Fig.11 The various components shown in the drawings can be implemented in hardware, software, or a combination of hardware and software.

[0316] The above modules can be divided according to functions. In actual products, different functions can be performed by the same software module.

[0317] The structure of another electronic device 100 provided in an embodiment of the present application is introduced below.

[0318] Fig.12 The structure of another electronic device 100 provided in an embodiment of the present application is exemplified.

[0319] like Fig.12As shown, the electronic device 100 may include: a video application 1200, wherein the video application 1200 may include: a video decoding module 1211, a subtitle decoding module 1212, a video frame color gamut interpretation module 1213, a video frame synthesis module 1214, a video frame queue 1215, and a video rendering module 1216.

[0320] The video application 1200 may be a system application installed on the electronic device 100 (eg, Figure 2A The “Video” application shown in the figure) can also be an application with video playing capability provided by a third party and installed on the electronic device 100, which is mainly used for playing videos.

[0321] The acquisition and display module 1210 can acquire the video information stream and the subtitle information stream, and display the rendered video frames sent by the video rendering module 1216, etc.

[0322] The video decoding module 1211 can receive the video information stream sent by the acquisition and display module 1210, and decode the video information stream to generate video frames.

[0323] The subtitle decoding module 1212 can receive the subtitle information stream sent by the acquisition and display module 1210, and decode the subtitle information stream to generate subtitle frames, and can generate masked subtitle frames based on the mask parameters sent by the video frame color gamut interpretation module 1213, thereby improving the recognition of subtitles.

[0324] The video frame color gamut interpretation module 1213 can analyze the subtitle recognition, generate a subtitle recognition analysis result, and calculate the mask parameters (mask color value, transparency) corresponding to the subtitle based on the subtitle recognition analysis result.

[0325] The video frame synthesis module 1214 can superimpose and merge the video frame and the subtitle frame to generate a video frame to be displayed.

[0326] The video frame queue 1215 can store the video frames to be displayed sent by the video frame synthesis module 1214 .

[0327] The video rendering module 1216 can render the video frames to be displayed in time sequence, generate rendered video frames, and send them to the acquisition and display module 1210 for video playback.

[0328] For more details about the functions and working principles of the electronic device 100, please refer to the relevant contents of the above embodiments, which will not be repeated here.

[0329] It should be understood that Fig.12 The electronic device 100 shown is only one example, and the electronic device 100 may have more Fig.12 More or fewer components may be shown, two or more components may be combined, or there may be a different configuration of components. Fig.12 The various components shown in the drawings can be implemented in hardware, software, or a combination of hardware and software.

[0330] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A subtitle display method, characterized in that: The method comprises: The application plays the first video; When the application displays a first interface, the first interface includes a first screen and a first subtitle, the first subtitle is displayed in a floating manner on a first area of ​​the first screen with a first mask as a background, the first area is an area in the first screen corresponding to a display position of the first subtitle, wherein a difference between a color value of the first subtitle and a color value of the first area is a first value; When the application displays a second interface, the second interface includes a second screen and the first subtitles, the first subtitles do not display a mask, and the first subtitles are displayed in a floating manner on a second area of ​​the second screen, the second area is an area in the second screen corresponding to a display position of the first subtitles, wherein a difference between a color value of the first subtitle and a color value of the second area is a second value, and the second value is greater than the first value; The first picture is a picture in the first video, and the second picture is another picture in the first video.

2. The method according to claim 1, characterized in that Before the application displays the first interface, the method further includes: The application program obtains a first video file and a first subtitle file, wherein the first video file and the first subtitle file carry the same time information; The application generates a first video frame based on the first video file, where the first video frame is used to generate the first picture; The application generates a first subtitle frame based on the first subtitle file, and obtains a color value and a display position of the first subtitle in the first subtitle frame, wherein time information carried by the first subtitle frame is the same as time information carried by the first video frame; The application determines the first area based on a display position of the first subtitle; The application generates the first mask based on the color value of the first subtitle or the color value of the first area; The application program overlays the first subtitle on the first mask in the first subtitle frame to generate a second subtitle frame, and synthesizes the second subtitle frame with the first video frame.

3. The method according to claim 2, characterized in that Before the application generates the first mask based on the color value of the first subtitle or the color value of the first area, the method further includes: The application determines that the first value is less than a first threshold.

4. The method according to claim 3, characterized in that The application determines that the first value is less than a first threshold value, specifically including: The application divides the first area into N first sub-areas, where N is a positive integer; The application determines that the first value is less than the first threshold based on the color value of the first subtitle and the color values ​​of the N first sub-regions.

5. The method according to claim 4, characterized in that The application generates the first mask based on the color value of the first subtitle or the color value of the first area, specifically comprising: The application determines a color value of the first mask based on the color value of the first subtitle or the color values ​​of the N first sub-areas; The application generates the first mask based on the color values ​​of the first mask.

6. The method according to claim 3, characterized in that The application determines that the first value is less than a first threshold value, specifically including: The application divides the first area into N first sub-areas, where N is a positive integer; The application determines whether to merge adjacent first sub-regions into a second sub-region based on a difference value of color values ​​between adjacent first sub-regions; When the difference value of the color values ​​between adjacent first sub-regions is less than a second threshold, the application program merges the adjacent first sub-regions into the second sub-region; The application determines that the first value is less than the first threshold based on the color value of the first subtitle and the color value of the second sub-region.

7. The method according to claim 6, characterized in that The first region includes M second sub-regions, where M is a positive integer and is less than or equal to N. The second sub-region includes one or more first sub-regions, and the number of the first sub-regions included in each second sub-region is the same or different.

8. The method according to claim 7, characterized in that The application generates the first mask based on the color value of the first subtitle or the color value of the first area, specifically comprising: The application program sequentially calculates color values ​​of M first sub-masks based on the color value of the first subtitle or the color values ​​of the M second sub-regions; The application generates the M first sub-masks based on color values ​​of the M first sub-masks, wherein the M first sub-masks are combined into the first mask.

9. The method according to any one of claims 1 to 8, characterized in that: The method further comprises: When the application displays a third interface, the third interface includes a third screen and the first subtitles, the first subtitles include at least a first part and a second part, the first part displays a second sub-mask, the second part displays a third sub-mask or does not display the third sub-mask, and a color value of the second sub-mask is different from a color value of the third sub-mask.

10. The method according to any one of claims 1 to 9, characterized in that: The display position of the first mask is determined based on the display position of the first subtitle.

11. The method according to any one of claims 1 to 10, characterized in that: The difference between the color value of the first mask and the color value of the first subtitle is greater than the first value.

12. The method according to any one of claims 1 to 11, characterized in that: In the first picture and the second picture, the display position of the first subtitle is unfixed or fixed relative to the display screen of the application, and the first subtitle is a continuously displayed section of text or symbols.

13. The method according to any one of claims 1 to 12, characterized in that: Before the application displays the first interface, the method further includes: The application sets the transparency of the first mask to be less than 100%.

14. The method according to any one of claims 1 to 13, characterized in that: Before the application displays the second interface, the method further includes: The application generates a second mask based on the color value of the first subtitle or the color value of the second area, and superimposes the first subtitle on the second mask, wherein the color value of the second mask is a preset color value and the transparency of the second mask is 100%; or, The application does not generate the second mask.

15. An electronic device, characterized in that: The electronic device includes one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and the one or more memories are used to store applications, and when the applications are executed by the processors, the method described in any one of claims 1-14 is implemented.

16. A computer storage medium, characterized in that: The computer storage medium stores an application program, and when the application program is executed by a processor, the method according to any one of claims 1 to 14 is implemented.

17. A computer program product, characterized in that The method comprises instructions, which, when executed by a processor, implement the method according to any one of claims 1 to 14.