WO2017166430A1 - 字幕显示方法及装置 - Google Patents

字幕显示方法及装置 Download PDF

Info

Publication number
WO2017166430A1
WO2017166430A1 PCT/CN2016/084872 CN2016084872W WO2017166430A1 WO 2017166430 A1 WO2017166430 A1 WO 2017166430A1 CN 2016084872 W CN2016084872 W CN 2016084872W WO 2017166430 A1 WO2017166430 A1 WO 2017166430A1
Authority
WO
WIPO (PCT)
Prior art keywords
encoding format
terminal
format
caption display
matching degree
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2016/084872
Other languages
English (en)
French (fr)
Inventor
柯杰燕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen TCL New Technology Co Ltd
Original Assignee
Shenzhen TCL New Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen TCL New Technology Co Ltd filed Critical Shenzhen TCL New Technology Co Ltd
Publication of WO2017166430A1 publication Critical patent/WO2017166430A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/431Generation of visual interfaces for content selection or interaction; Content or additional data rendering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/431Generation of visual interfaces for content selection or interaction; Content or additional data rendering
    • H04N21/4312Generation of visual interfaces for content selection or interaction; Content or additional data rendering involving specific graphical features, e.g. screen layout, special fonts or colors, blinking icons, highlights or animations
    • H04N21/4314Generation of visual interfaces for content selection or interaction; Content or additional data rendering involving specific graphical features, e.g. screen layout, special fonts or colors, blinking icons, highlights or animations for fitting data in a restricted space on the screen, e.g. EPG data in a rectangular grid
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/435Processing of additional data, e.g. decrypting of additional data, reconstructing software from modules extracted from the transport stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/435Processing of additional data, e.g. decrypting of additional data, reconstructing software from modules extracted from the transport stream
    • H04N21/4353Processing of additional data, e.g. decrypting of additional data, reconstructing software from modules extracted from the transport stream involving decryption of additional data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/435Processing of additional data, e.g. decrypting of additional data, reconstructing software from modules extracted from the transport stream
    • H04N21/4355Processing of additional data, e.g. decrypting of additional data, reconstructing software from modules extracted from the transport stream involving reformatting operations of additional data, e.g. HTML pages on a television screen
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/488Data services, e.g. news ticker
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/488Data services, e.g. news ticker
    • H04N21/4884Data services, e.g. news ticker for displaying subtitles

Definitions

  • the present invention relates to the field of terminal technologies, and in particular, to a subtitle display method and apparatus.
  • the user when playing video on the multimedia of the terminal, the user generally opens the subtitles to watch, especially the video that is different from the native language.
  • the terminal uses a television as an example. Since the subtitles are separately produced independently of the video, different production methods will result in different encoding formats for the text.
  • the internal code table (codepage) of the font corresponding to the same encoding format may be different, and the setting or selection of the internal code table is incorrect, so that the system cannot decode the normal text. In this way, in the process of watching the video, the user has some garbled characters or missing, and the accuracy of the subtitle display is greatly reduced. For a TV that does not manually switch the subtitle language or the encoding format function, the user cannot view the subtitles, which is very inconvenient and brings a bad experience to the user.
  • the main object of the present invention is to provide a caption display method and device, which aim to improve the accuracy and convenience of caption display.
  • the present invention provides a caption display method, including:
  • the encoding format with the highest matching degree in the encoding format with the matching degree being higher than the preset value is the default decoding format of the subtitle file, and is used to decode the subtitle file when the terminal plays the video;
  • the user is prompted to decode the subtitle file by the terminal;
  • the encoding format corresponding to the system language of the terminal is selected as the default decoding format of the subtitle file.
  • the method further includes:
  • the text data of the preset length is re-acquired from the subtitle file of the video to perform decoding and subsequent correlation steps.
  • the statistics further includes:
  • the invention also provides a caption display method, comprising:
  • the encoding format with the highest matching degree in the encoding format with the matching degree higher than the preset value is the default decoding format of the subtitle file, and is used to decode the subtitle file when the terminal plays the video.
  • the method further includes:
  • the user is prompted to decode the subtitle file by the terminal.
  • the method further includes:
  • the encoding format corresponding to the system language of the terminal is selected as the default decoding format of the subtitle file.
  • the method further includes:
  • the text data of the preset length is re-acquired from the subtitle file of the video to perform decoding and subsequent correlation steps.
  • the statistics further includes:
  • the present invention further provides a caption display device, including:
  • An acquiring module configured to acquire text data of a preset length in a subtitle file of the video before the terminal plays the video
  • a decryption module configured to select an encoding format supported by the terminal to separately decode the text data
  • a statistics module configured to calculate a matching degree between the text data decoded by each encoding format and the characters and/or punctuation marks in the code table of the corresponding font
  • a setting module configured to set a coding format with the highest matching degree in a coding format with a matching degree higher than a preset value as a default decoding format of the subtitle file, to decode the video when the terminal plays the video Subtitle file.
  • the caption display device further includes:
  • a prompting module configured to prompt the user to decode the subtitle file by the terminal when the matching degree of the statistics is not higher than the preset value.
  • the caption display device further includes:
  • a selection module configured to select, when the matching format of the matching degree is higher than the preset encoding value, the encoding format corresponding to the system language of the terminal is set as the default of the subtitle file Decoding format.
  • the caption display device further includes:
  • the processing module is configured to re-acquire the preset length of text data from the subtitle file of the video to perform decoding and subsequent correlation steps when the statistics are all zero.
  • the caption display device further includes:
  • the identifier module is configured to identify characters and punctuation marks in the code table of the font corresponding to all encoding formats supported by the terminal.
  • the terminal When performing the subtitle display, the terminal first decodes the text data of the preset length by using the encoding format supported by the terminal, and sets the text data decoded by each encoding format and the text in the corresponding code table. / or the matching degree of punctuation marks, the encoding format with the highest matching degree in the encoding format higher than the preset value is the default decoding format of the subtitle file, so that when the terminal plays the video, the subtitle file is decoded and the subtitles are displayed.
  • the terminal can automatically switch the encoding format to find the correct encoding format, display the subtitles normally, avoid garbled or lost subtitles, and improve the accuracy and convenience of the subtitle display.
  • FIG. 1 is a schematic flow chart of an embodiment of a caption display method according to the present invention.
  • FIG. 2 is a schematic diagram of functional modules of an embodiment of a caption display device of the present invention.
  • the caption display method of this embodiment includes:
  • Step S10 Before the terminal plays the video, acquiring text data of a preset length in the subtitle file of the video;
  • the type of the terminal may be set according to actual needs.
  • the terminal includes a terminal that can perform video playback, such as a television or a computer. The following will be described in detail by using the terminal as a television.
  • the video When the user chooses to open a video for playing, the video will obtain relevant information of the video before the video is played, and the related information of the video includes video files, subtitle files of the video, and the like.
  • the text data of the preset length is obtained from the subtitle file of the video, and the text data of the preset length is a piece of continuous text data, or may be a non-contiguous plurality of pieces of text data, and the preset length may be flexibly set according to a specific situation. For example, character data of 10 bytes in length is selected from the middle of the subtitle file, or text data of 20 bytes in length is obtained from the start position of the subtitle file.
  • Step S20 Select an encoding format supported by the terminal to separately decode the text data.
  • Step S30 Statistics of the matching degree between the text data decoded by each encoding format and the characters and/or punctuation marks in the corresponding codebook internal code table;
  • the television Before playing the subtitles, the television first selects an encoding format supported by the television for decoding, and decodes the text data of the preset length in the subtitle file of the obtained video. After the decoding is completed, the total number of characters and/or punctuation marks decoded by the encoding format is counted, and the decoded text and/or punctuation marks fall in the code table in the code table corresponding to the encoding format. / or the same number of punctuation marks for statistics.
  • the ratio between the number and the total number is used as the matching degree, that is, by the number/total number, the matching between the text and/or punctuation marks decoded by the encoding format and the characters and/or punctuation marks in the corresponding code table internal code table can be obtained. degree. For example, when the total number of characters and/or punctuation marks decoded by the encoding format is 10, the decoded text and/or punctuation marks are the same as the characters and/or punctuation marks in the code table in the font corresponding to the encoding format.
  • the degree of matching between the text and/or punctuation marks decoded by the encoding format and the characters and/or punctuation marks in the corresponding codebook internal code table is 90%. And so on, continue to use the next encoding format supported by the TV for decoding judgment, until the last encoding format is tried, and finally the text and/or punctuation marks obtained by decoding the respective encoding formats and the corresponding fonts in the internal code table are obtained.
  • the degree of matching of text and/or punctuation is 90%.
  • Step S40 The encoding format with the highest matching degree in the encoding format with the matching degree being higher than the preset value is the default decoding format of the subtitle file, and is used to decode the subtitle file when the terminal plays the video.
  • the encoding format obtained by the television in which the matching degree of each encoding format is higher than the preset encoding value is the default decoding format of the subtitle file, and is used when the terminal plays the video.
  • the subtitle file is decoded and the subtitles are displayed. That is, during the video playback of the television, the subtitle file is decoded by the default decoding format, and the decoded subtitles are displayed.
  • the preset value can be flexibly set according to the specific situation, for example, the preset value can be set to 95%.
  • the matching degree between the text and/or punctuation marks obtained by the encoding format A and the characters and/or punctuation marks in the corresponding codebook internal code table is 95%, and the decoded text and/or decoded text B format and/or
  • the matching degree between the punctuation marks and the characters and/or punctuation marks in the code table of the corresponding font is 100%, and the characters and/or punctuation marks decoded by the encoding format C and the characters and/or punctuation in the corresponding code table internal code table
  • the matching degree of the symbol is 98%, and in the process of video playback, the text data in the subtitle file is decoded by using the encoding format B as the default encoding format for video playback, and the decoded subtitle is displayed.
  • the television when displaying the subtitles, the television first decodes the text data of the preset length by using the encoding format supported by the television, and sets the text data decoded by each encoding format and the text in the corresponding code table. / or the matching degree of punctuation marks, the encoding format with the highest matching degree in the encoding format higher than the preset value is the default decoding format of the subtitle file, so that when the video is played on the television, the subtitle file is decoded and the subtitles are displayed.
  • the television can automatically switch the encoding format to find the correct encoding format, display the subtitles normally, avoid the garbled or lost subtitles, and improve the accuracy and convenience of the subtitle display.
  • the method includes: if the matching degree is not higher than the preset value, prompting the user to decode the terminal. The failure of the subtitle file.
  • the television determines that the appropriate encoding format is not found, and outputs prompt information related to the decoding result, for example, outputting a failure information of the television decoding subtitle file to prompt the user to perform corresponding processing.
  • the failure information may be that the matching of the characters and/or punctuation marks decoded by the respective encoding formats with the characters and/or punctuation marks in the corresponding codebook internal code table is displayed on the display interface of the television, or may be broadcasted by voice. A form of broadcast of the decoding result of each encoding format.
  • the encoding format of one of the encoding formats can be manually selected, and the television uses the encoding format as the default encoding format of the video playback to the text in the subtitle file according to the received setting instruction.
  • the data is decoded and the decoded subtitles are displayed.
  • the failure information of the television decoding subtitle file is output, and the user is prompted to perform corresponding processing.
  • the television can display the subtitle according to the coding format selected by the user, which reduces the garbled phenomenon of the subtitle and improves the accuracy of the subtitle display.
  • the method includes: if there is more than one encoding format with the highest matching degree in the encoding format with a matching degree higher than the preset value, An encoding format corresponding to a system language of the terminal is set as a default decoding format of the subtitle file.
  • the matching degree between the text and/or punctuation marks and the corresponding characters in the code table and/or the punctuation marks in the code table corresponding to the preset font is higher than the matching format in the encoding format of the preset value, for example, the matching degree of more than one encoding format. It is 100%. In this case, the system language of the TV is used as a reference.
  • the TV can select a corresponding encoding format according to the system language, and decode the text data in the subtitle file as the default encoding format for video playback, and
  • the decoded subtitles are displayed.
  • the preset value here is consistent with the preset value mentioned above, and can be flexibly set according to the specific situation. For example, the preset value can be set to 95%.
  • the following is an example.
  • the system language of the TV is Greek, and the text and/or punctuation obtained by decoding the CP1253 encoding format falls within the Greek font.
  • the matching degree of the code table CP1253 is 100%.
  • the default encoding format for video playback decodes the text data in the subtitle file.
  • the television selects a corresponding encoding format according to the system language and sets the default decoding format of the subtitle file.
  • the text data in the subtitle file is decoded and the subtitles are displayed.
  • the television can automatically switch the encoding format to find the correct default encoding format, display the subtitles normally, avoid garbled or lost subtitles, and improve the accuracy and convenience of subtitle display.
  • a fourth embodiment of the subtitle display method of the present invention is provided. After the step S30 in the embodiment, the method further includes: if the matching degree of the statistics is zero, re-obtaining the pre-read from the subtitle file of the video. Set the length of the text data for decoding and subsequent related steps.
  • the TV reacquires the video in the subtitle file.
  • the new text data of the preset length is respectively decoded according to all the encoding formats supported by the television according to the above method, and the text data decoded by each encoding format and the characters and/or punctuation in the corresponding code table internal code table are counted.
  • the degree of matching of the symbols is the default decoding format of the subtitle file, and is used to decode the subtitle file when the video is played on the television.
  • the user terminal when the matching degree corresponding to each encoding format is not higher than the preset value, the user terminal is prompted to decode the failure information of the subtitle file, and receives the setting instruction to select one of the encoding formats for decoding.
  • the encoding format corresponding to the system language of the television is selected as the default decoding format of the subtitle file, that is, according to the television.
  • the system language selects a corresponding encoding format for decoding.
  • the television when the matching degree corresponding to each encoding format is zero, the television re-acquires the new text data of the preset length in the subtitle file of the video for decoding and comparison, searches for the correct default encoding format, and displays the subtitles normally, avoiding
  • the garbled or lost subtitles not only improves the user experience, but also improves the accuracy and convenience of subtitle display.
  • the step S30 before the step S30 includes: identifying the characters and punctuation marks in the code table of the font corresponding to all the encoding formats supported by the terminal.
  • the subtitles generally only display characters and punctuation marks
  • the characters and punctuation marks in the code table of the font corresponding to all encoding formats supported by the television can be identified in advance.
  • the text data of the preset length in the subtitle file of the video is obtained, and the text data is separately decoded according to all encoding formats supported by the television, and the font internal code corresponding to each encoding format is pre-identified according to the code.
  • the text and punctuation marks in the table are used to count the matching degree between the text and/or punctuation marks decoded by each coding format and the identified characters and/or punctuation marks in the corresponding code table internal code table, and the television matches the corresponding coding formats.
  • an encoding format is selected as the default encoding format to decode the text data in the subtitle file played by the video and display the subtitles.
  • the characters and punctuation marks in the code table of the font corresponding to all encoding formats supported by the television are pre-identified, so that the television can quickly count the text data decoded by each encoding format and the text in the corresponding code table.
  • the matching degree of the and/or punctuation marks improves the speed of the subtitle display of the television.
  • the caption display device of this embodiment includes:
  • the obtaining module 100 is configured to acquire, before the terminal plays the video, text data of a preset length in the subtitle file of the video;
  • the type of the terminal may be set according to actual needs.
  • the terminal includes a terminal that can perform video playback, such as a television or a computer. The following will be described in detail by using the terminal as a television.
  • the acquiring module 100 will acquire related information of the video, and the related information of the video includes a video file, a subtitle file of the video, and the like.
  • the text data of the preset length is obtained from the subtitle file of the video, and the text data of the preset length is a piece of continuous text data, or may be a non-contiguous plurality of pieces of text data, and the preset length may be flexibly set according to a specific situation. For example, character data of 10 bytes in length is selected from the middle of the subtitle file, or text data of 20 bytes in length is obtained from the start position of the subtitle file.
  • the decryption module 200 is configured to select an encoding format supported by the terminal to separately decode the text data.
  • the statistics module 300 is configured to count the matching degree between the text data decoded by each encoding format and the characters and/or punctuation marks in the corresponding code table internal code table;
  • the decryption module 200 Before playing the subtitles, the decryption module 200 first selects an encoding format supported by the television for decoding, and decodes the text data of the preset length in the subtitle file of the obtained video. After the decoding is completed, the statistics module 300 performs statistics on the total number of characters and/or punctuation symbols decoded by the encoding format, and the decoded text and/or punctuation marks fall in the code table in the font corresponding to the encoding format. The number of words and/or punctuation is the same.
  • the ratio between the number and the total number is used as the matching degree, that is, by the number/total number, the matching between the text and/or punctuation marks decoded by the encoding format and the characters and/or punctuation marks in the corresponding code table internal code table can be obtained. degree. For example, when the total number of characters and/or punctuation marks decoded by the encoding format is 10, the decoded text and/or punctuation marks are the same as the characters and/or punctuation marks in the code table in the font corresponding to the encoding format.
  • the degree of matching between the text and/or punctuation marks decoded by the encoding format and the characters and/or punctuation marks in the corresponding codebook internal code table is 90%. And so on, continue to use the next encoding format supported by the TV for decoding judgment until the last encoding format is tried, and finally the text and/or punctuation marks obtained by decoding the respective encoding formats and the corresponding fonts in the internal code table are obtained.
  • the degree of matching of text and/or punctuation is 90%.
  • the setting module 400 is configured to set a coding format with the highest matching degree in the coding format with a matching degree higher than the preset value as a default decoding format of the subtitle file, and is used to decode the video when the terminal plays the video. Subtitle file.
  • the setting module 400 obtains the encoding format with the highest matching degree in the encoding format that is higher than the preset value in each encoding format as the default decoding format of the subtitle file, and is used to play the In the case of video, the subtitle file is decoded and the subtitles are displayed. That is, during the video playback of the television, the subtitle file is decoded by the default decoding format, and the decoded subtitles are displayed.
  • the preset value can be flexibly set according to the specific situation, for example, the preset value can be set to 95%.
  • the matching degree between the text and/or punctuation marks obtained by the encoding format A and the characters and/or punctuation marks in the corresponding codebook internal code table is 95%, and the decoded text and/or decoded text B format and/or
  • the matching degree between the punctuation marks and the characters and/or punctuation marks in the code table of the corresponding font is 100%, and the characters and/or punctuation marks decoded by the encoding format C and the characters and/or punctuation in the corresponding code table internal code table
  • the matching degree of the symbol is 98%, and in the process of video playback, the text data in the subtitle file is decoded by using the encoding format B as the default encoding format for video playback, and the decoded subtitle is displayed.
  • the television when displaying the subtitles, the television first decodes the text data of the preset length by using the encoding format supported by the television, and sets the text data decoded by each encoding format and the text in the corresponding code table. / or the matching degree of punctuation marks, the encoding format with the highest matching degree in the encoding format higher than the preset value is the default decoding format of the subtitle file, so that when the video is played on the television, the subtitle file is decoded and the subtitles are displayed.
  • the television can automatically switch the encoding format to find the correct encoding format, display the subtitles normally, avoid the garbled or lost subtitles, and improve the accuracy and convenience of the subtitle display.
  • the caption display device further includes: a prompting module, configured to prompt when the statistical matching degree is not higher than the preset value. The user fails to decode the subtitle file by the terminal.
  • the matching degree of each encoding format is smaller than Or equal to the preset value, indicating that the matching degree corresponding to all encoding formats is relatively low.
  • the preset value here is consistent with the preset value mentioned above, and can be flexibly set according to the specific situation. For example, the preset value can be set to 95%.
  • the television determines that the appropriate encoding format is not found, and the prompting module outputs the prompt information related to the decoding result.
  • the prompting module outputs the failure information of the television decoding subtitle file to prompt the user to perform corresponding processing.
  • the failure information may be that the matching of the characters and/or punctuation marks decoded by the respective encoding formats with the characters and/or punctuation marks in the corresponding codebook internal code table is displayed on the display interface of the television, or may be broadcasted by voice. A form of broadcast of the decoding result of each encoding format.
  • the encoding format of one of the encoding formats can be manually selected, and the television uses the encoding format as the default encoding format of the video playback to the text in the subtitle file according to the received setting instruction.
  • the data is decoded and the decoded subtitles are displayed.
  • the failure information of the television decoding subtitle file is output, and the user is prompted to perform corresponding processing.
  • the television can display the subtitle according to the coding format selected by the user, which reduces the garbled phenomenon of the subtitle and improves the accuracy of the subtitle display.
  • the caption display device further includes: a selecting module, wherein the encoding format with the highest matching degree in the encoding format with the matching degree higher than the preset value is not limited.
  • a selecting module wherein the encoding format with the highest matching degree in the encoding format with the matching degree higher than the preset value is not limited.
  • an encoding format corresponding to a system language of the terminal is selected as a default decoding format of the subtitle file.
  • the matching degree between the text and/or punctuation marks and the corresponding characters in the code table and/or the punctuation marks in the code table corresponding to the preset font is higher than the matching format in the encoding format of the preset value, for example, the matching degree of more than one encoding format. It is 100%. In this case, the system language of the TV is used as a reference.
  • the selection module can select a corresponding encoding format according to the system language, and decode the text data in the subtitle file as the default encoding format for video playback. And display the decoded subtitles.
  • the preset value here is consistent with the preset value mentioned above, and can be flexibly set according to the specific situation. For example, the preset value can be set to 95%.
  • the following is an example.
  • the system language of the TV is Greek, and the text and/or punctuation obtained by decoding the CP1253 encoding format falls within the Greek font.
  • the matching degree of the code table CP1253 is 100%.
  • the default encoding format for video playback decodes the text data in the subtitle file.
  • the television selects a corresponding encoding format according to the system language and sets the default decoding format of the subtitle file.
  • the text data in the subtitle file is decoded and the subtitles are displayed.
  • the television can automatically switch the encoding format to find the correct default encoding format, display the subtitles normally, avoid garbled or lost subtitles, and improve the accuracy and convenience of subtitle display.
  • the caption display device of the embodiment further includes:
  • the processing module is configured to re-acquire the preset length of text data from the subtitle file of the video to perform decoding and subsequent correlation steps when the statistics are all zero.
  • the processing module reacquires the subtitle file of the video.
  • the new text data of the preset length is decoded according to the above method according to all encoding formats supported by the television, and the text data decoded by each encoding format and the text and/or corresponding code in the internal code table are counted.
  • the degree of matching of punctuation is the encoding format with the highest matching degree in the encoding format with the matching degree higher than the preset value, and is used to decode the subtitle file when the video is played on the television.
  • the user terminal when the matching degree corresponding to each encoding format is not higher than the preset value, the user terminal is prompted to decode the failure information of the subtitle file, and receives the setting instruction to select one of the encoding formats for decoding.
  • the encoding format corresponding to the system language of the television is selected as the default decoding format of the subtitle file, that is, according to the television.
  • the system language selects a corresponding encoding format for decoding.
  • the television when the matching degree corresponding to each encoding format is zero, the television re-acquires the new text data of the preset length in the subtitle file of the video for decoding and comparison, searches for the correct default encoding format, and displays the subtitles normally, avoiding
  • the garbled or lost subtitles not only improves the user experience, but also improves the accuracy and convenience of subtitle display.
  • the caption display device of the embodiment further includes:
  • the identifier module is configured to identify characters and punctuation marks in the code table of the font corresponding to all encoding formats supported by the terminal.
  • the identification module can pre-identify the characters and punctuation marks in the code table in the font corresponding to all the encoding formats supported by the television.
  • the text data of the preset length in the subtitle file of the video is obtained, and the text data is separately decoded according to all encoding formats supported by the television, and the font internal code corresponding to each encoding format is pre-identified according to the code.
  • the text and punctuation marks in the table are used to count the matching degree between the text and/or punctuation marks decoded by each coding format and the identified characters and/or punctuation marks in the corresponding code table internal code table, and the television matches the corresponding coding formats.
  • an encoding format is selected as the default encoding format to decode the text data in the subtitle file played by the video and display the subtitles.
  • the characters and punctuation marks in the code table of the font corresponding to all encoding formats supported by the television are pre-identified, so that the television can quickly count the text data decoded by each encoding format and the text in the corresponding code table.
  • the matching degree of the and/or punctuation marks improves the speed of the subtitle display of the television.

Landscapes

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

Abstract

本发明公开了一种字幕显示方法,包括:在终端播放视频前,获取所述视频的字幕文件中预设长度的文字数据;选取所述终端支持的编码格式来分别对所述文字数据进行解码;统计被各个编码格式解码后的所述文字数据与对应的字库内码表中的文字和/或标点符号的匹配度;及设定匹配度高于预设值的编码格式中匹配度最高的编码格式为所述字幕文件的默认解码格式,用以在所述终端播放所述视频时,解码所述字幕文件。本发明还公开了一种字幕显示装置。本发明提高了字幕显示的准确率及便捷性。

Description

字幕显示方法及装置
技术领域
本发明涉及终端技术领域,尤其涉及一种字幕显示方法及装置。
背景技术
目前,在终端的多媒体上播放视频时,用户一般打开字幕观看,特别是与母语不一样的视频。该终端以电视为例,由于字幕是独立于视频另外制作的,因此不同的制作方式将会造成文字的编码格式有所不同。此外,同一编码格式所对应的字库的内码表(codepage)可能不一样,内码表的设置或选择错误,导致系统无法解码出正常的文字。如此一来,用户在观看视频的过程中,就存在字幕显示出来是一些乱码或存在缺失,字幕显示的准确率大大降低。而对于没有手动切换字幕语言或编码格式功能的电视,导致用户无法观看字幕,非常不便捷,给用户带来不好的体验。
发明内容
本发明的主要目的在于提供一种字幕显示方法及装置,旨在提高字幕显示的准确率及便捷性。
为实现上述目的,本发明提供了一种字幕显示方法,包括:
在终端播放视频前,获取所述视频的字幕文件中预设长度的文字数据;
选取所述终端支持的编码格式来分别对所述文字数据进行解码;
统计被各个编码格式解码后的所述文字数据与对应的字库内码表中的文字和/或标点符号的匹配度;及
设定匹配度高于预设值的编码格式中匹配度最高的编码格式为所述字幕文件的默认解码格式,用以在所述终端播放所述视频时,解码所述字幕文件;
其中,若统计的所述匹配度均不高于所述预设值,则提示用户所述终端解码所述字幕文件的失败;
若匹配度高于预设值的编码格式中匹配度最高的编码格式不止一种,则从中选取与所述终端的系统语言对应的编码格式设定为所述字幕文件的默认解码格式。
可选地,该方法还包括:
若统计的所述匹配度均为零,则重新从所述视频的字幕文件中获取所述预设长度的文字数据来进行解码及后续相关步骤。
可选地,所述统计被各个编码格式解码后的所述文字数据与对应的字库内码表中的文字和/或标点符号的匹配度之前还包括:
对所述终端支持的所有编码格式对应的字库内码表中的文字和标点符号进行标识。
本发明还提供了一种字幕显示方法,包括:
在终端播放视频前,获取所述视频的字幕文件中预设长度的文字数据;
选取所述终端支持的编码格式来分别对所述文字数据进行解码;
统计被各个编码格式解码后的所述文字数据与对应的字库内码表中的文字和/或标点符号的匹配度;及
设定匹配度高于预设值的编码格式中匹配度最高的编码格式为所述字幕文件的默认解码格式,用以在所述终端播放所述视频时,解码所述字幕文件。
可选地,该方法还包括:
若统计的所述匹配度均不高于所述预设值,则提示用户所述终端解码所述字幕文件的失败。
可选地,该方法还包括:
若匹配度高于预设值的编码格式中匹配度最高的编码格式不止一种,则从中选取与所述终端的系统语言对应的编码格式设定为所述字幕文件的默认解码格式。
可选地,该方法还包括:
若统计的所述匹配度均为零,则重新从所述视频的字幕文件中获取所述预设长度的文字数据来进行解码及后续相关步骤。
可选地,所述统计被各个编码格式解码后的所述文字数据与对应的字库内码表中的文字和/或标点符号的匹配度之前还包括:
对所述终端支持的所有编码格式对应的字库内码表中的文字和标点符号进行标识。
此外,为实现上述目的,本发明还提供了一种字幕显示装置,包括:
获取模块,用于在终端播放视频前,获取所述视频的字幕文件中预设长度的文字数据;
解密模块,用于选取所述终端支持的编码格式来分别对所述文字数据进行解码;
统计模块,用于统计被各个编码格式解码后的所述文字数据与对应的字库内码表中的文字和/或标点符号的匹配度;
设定模块,用于设定匹配度高于预设值的编码格式中匹配度最高的编码格式为所述字幕文件的默认解码格式,用以在所述终端播放所述视频时,解码所述字幕文件。
可选地,所述字幕显示装置还包括:
提示模块,用于在统计的所述匹配度均不高于所述预设值时,提示用户所述终端解码所述字幕文件的失败。
可选地,所述字幕显示装置还包括:
选取模块,用于在匹配度高于预设值的编码格式中匹配度最高的编码格式不止一种时,从中选取与所述终端的系统语言对应的编码格式设定为所述字幕文件的默认解码格式。
可选地,所述字幕显示装置还包括:
处理模块,用于在统计的所述匹配度均为零时,重新从所述视频的字幕文件中获取所述预设长度的文字数据来进行解码及后续相关步骤。
可选地,所述字幕显示装置还包括:
标识模块,用于对所述终端支持的所有编码格式对应的字库内码表中的文字和标点符号进行标识。
本发明实施例终端在进行字幕显示时,首先通过终端支持的编码格式分别对预设长度的文字数据进行解码,设定各个编码格式解码后的文字数据与对应的字库内码表中的文字和/或标点符号的匹配度,高于预设值的编码格式中匹配度最高的编码格式为字幕文件的默认解码格式,以在终端播放该视频时,解码字幕文件,对字幕进行显示。使得终端可以自动地切换编码格式来寻找正确的编码格式,将字幕进行正常显示,避免字幕乱码或丢失,提高了字幕显示的准确率及便捷性。
附图说明
图1为本发明字幕显示方法一实施例的流程示意图;
图2为本发明字幕显示装置一实施例的功能模块示意图。
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
如图1所示,示出了本发明一种字幕显示方法第一实施例。该实施例的字幕显示方法包括:
步骤S10、在终端播放视频前,获取所述视频的字幕文件中预设长度的文字数据;
本实施例中,终端的类型可根据实际需要进行设置,例如,该终端包括电视、电脑等可进行视频播放的终端,以下将以该终端为电视进行详细说明。
当用户选择打开一个视频进行播放时,电视播放该视频之前,将会获取视频的相关信息,视频的相关信息包括视频文件、视频的字幕文件等。从视频的字幕文件中获取预设长度的文字数据,预设长度的文字数据看是一段连续的文字数据,也可以是不连续的多段文字数据,该预设长度可根据具体情况而灵活设置,例如,从字幕文件的中间选取10个字节长度的文字数据,或者从字幕文件的起始位置获取20个字节长度的文字数据。
步骤S20、选取所述终端支持的编码格式来分别对所述文字数据进行解码;
步骤S30、统计被各个编码格式解码后的所述文字数据与对应的字库内码表中的文字和/或标点符号的匹配度;
由于字幕一般只是显示文字和标点符号,因此,只需要将解码得到的文字和标点符号与对应的字库内码表中的文字和标点符号进行比较。电视在播放字幕前,先选取电视支持的一种编码格式进行解码,对获取得到的视频的字幕文件中预设长度的文字数据进行解码。解码完成后,对该编码格式所解码出来的文字和/或标点符号的总数进行统计,以及对解码出来的文字和/或标点符号落在与该编码格式对应的字库内码表中的文字和/或标点符号相同的个数进行统计。将个数与总数之间比值作为匹配度,即由个数/总数,可得到该编码格式解码得到的文字和/或标点符号与对应的字库内码表中的文字和/或标点符号的匹配度。例如,当该编码格式解码出来的文字和/或标点符号的总数为10,解码出来的文字和/或标点符号落在与该编码格式对应的字库内码表中的文字和/或标点符号相同的个数为9,则该编码格式解码得到的文字和/或标点符号与对应的字库内码表中的文字和/或标点符号的匹配度为90%。以此类推,继续用电视支持的下一种编码格式进行解码判断,直到尝试完最后一种编码格式,最后得到各个编码格式解码得到的文字和/或标点符号与对应的字库内码表中的文字和/或标点符号的匹配度。
步骤S40、设定匹配度高于预设值的编码格式中匹配度最高的编码格式为所述字幕文件的默认解码格式,用以在所述终端播放所述视频时,解码所述字幕文件。
由于错误编码格式导致字幕无法显示的概率要高于正确编码格式正常解码的概率,因此,对上述得到各个编码格式解码得到的文字和/或标点符号与对应的字库内码表中的文字和/或标点符号的匹配度后,电视将各个编码格式得到的匹配度高于预设值的编码格式中匹配度最高的编码格式为字幕文件的默认解码格式,用以在终端播放所述视频时,解码字幕文件,对字幕进行显示。即电视进行视频播放的过程中,通过该默认解码格式解码字幕文件,显示解码得到的字幕。该预设值可根据具体情况而灵活设置,例如,预设值可设置为95%。
以下进行举例说明,假设编码格式A解码得到的文字和/或标点符号与对应的字库内码表中的文字和/或标点符号的匹配度为95%,编码格式B解码得到的文字和/或标点符号与对应的字库内码表中的文字和/或标点符号的匹配度为100%,编码格式C解码得到的文字和/或标点符号与对应的字库内码表中的文字和/或标点符号的匹配度为98%,则在视频播放的过程中,以编码格式B作为视频播放的默认编码格式对字幕文件中的文字数据进行解码,显示解码得到的字幕。
本发明实施例电视在进行字幕显示时,首先通过电视支持的编码格式分别对预设长度的文字数据进行解码,设定各个编码格式解码后的文字数据与对应的字库内码表中的文字和/或标点符号的匹配度,高于预设值的编码格式中匹配度最高的编码格式为字幕文件的默认解码格式,以在电视播放该视频时,解码字幕文件,对字幕进行显示。使得电视可以自动地切换编码格式来寻找正确的编码格式,将字幕进行正常显示,避免字幕乱码或丢失,提高了字幕显示的准确率及便捷性。
进一步地,提出了本发明字幕显示方法第二实施例,该实施例中上述步骤S30之后包括:若统计的所述匹配度均不高于所述预设值,则提示用户所述终端解码所述字幕文件的失败。
本实施例中,在将各个编码格式解码得到的文字和/或标点符号与对应的字库内码表中的文字和/或标点符号进行比较的过程中,若各个编码格式对应的匹配度均小于或等于预设值,说明所有的编码格式对应的匹配度都比较低。这里的预设值与上述提到的预设值一致,可根据具体情况而灵活设置,例如,预设值可设置为95%。此时,电视判定没有找到合适的编码格式,输出解码结果相关的提示信息,例如,输出电视解码字幕文件的失败信息,以提示用户进行相应的处理。该失败信息可以是在电视的显示界面上显示各个编码格式解码得到的文字和/或标点符号与对应的字库内码表中的文字和/或标点符号的匹配度,也可以是通过语音播报的形式对各个编码格式解码结果的播报。用户通过提示信息了解各个编码格式的解码情况后,可以通过手动方式选择其中的一种的编码格式,电视根据接收到的设置指令将该编码格式作为视频播放的默认编码格式对字幕文件中的文字数据进行解码,并显示解码得到的字幕。
本实施例当各个编码格式解码得到的匹配度均小于或等于预设值时,输出电视解码字幕文件的失败信息,提示用户进行相应处理。使得电视可以根据用户选取的编码格式将字幕进行显示,减少了字幕乱码现象,提高了字幕显示的准确率。
进一步地,提出了本发明字幕显示方法第三实施例,该实施例中上述步骤S30之后包括:若匹配度高于预设值的编码格式中匹配度最高的编码格式不止一种,则从中选取与所述终端的系统语言对应的编码格式设定为所述字幕文件的默认解码格式。
本实施例中,在上述将各个编码格式解码得到的文字和/或标点符号与对应的字库内码表中的文字和/或标点符号进行比较的过程中,当存在多个编码格式解码得到的文字/或标点符号与对应的字库内码表中的文字和/或标点符号的匹配度高于预设值的编码格式中匹配度最高的编码格式,例如,多于一种编码格式的匹配度是100%,这种情况则以电视的系统语言作为参考,此时,电视可根据系统语言选取对应的一种编码格式,作为视频播放的默认编码格式对字幕文件中的文字数据进行解码,并显示解码得到的字幕。这里的预设值与上述提到的预设值一致,可根据具体情况而灵活设置,例如,预设值可设置为95%。以下进行举例说明,假设电视的系统语言是希腊语,而CP1253编码格式解码得到的文字和/或标点符号落在希腊语的字库内码表CP1253的匹配度为100%,则选择该编码格式作为视频播放的默认编码格式对字幕文件中的文字数据进行解码。
本实施例中,当匹配度高于预设值的编码格式中匹配度最高的编码格式不止一种时,电视根据系统语言选取对应的一种编码格式设定为字幕文件的默认解码格式,对字幕文件中的文字数据进行解码并显示字幕。使得电视可以自动地切换编码格式来寻找正确的默认编码格式,将字幕进行正常显示,避免字幕乱码或丢失,提高了字幕显示的准确率及便捷性。
进一步地,提出了本发明字幕显示方法第四实施例,该实施例中上述步骤S30之后包括:若统计的所述匹配度均为零,则重新从所述视频的字幕文件中获取所述预设长度的文字数据来进行解码及后续相关步骤。
本实施例中,当电视统计支持的所有编码格式统计解码得到的文字和/或标点符号与对应的字库内码表中的文字和/或标点符号的匹配度后,若各个编码格式对应的匹配度均为零,说明可能是由于电视获取得到的字幕文件中预设长度的文字数据恰好为非文字或标点符号,为了能够获取正确的默认编码格式进行解码,则电视重新获取视频的字幕文件中预设长度的新文字数据,按照上述方法根据电视支持的所有编码格式分别对新文字数据进行解码,统计被各个编码格式解码后的文字数据与对应的字库内码表中的文字和/或标点符号的匹配度。将重新解码得到的匹配度中,设定匹配度高于预设值的编码格式中匹配度最高的编码格式为字幕文件的默认解码格式,用以在电视播放该视频时,解码字幕文件。可以理解的是,当各个编码格式对应的匹配度均不高于预设值时,提示用户终端解码字幕文件的失败信息,并接收设置指令选取其中的一种的编码格式进行解码。或者,当匹配度高于预设值的编码格式中匹配度最高的编码格式不止一种,则从中选取与电视的系统语言对应的编码格式设定为字幕文件的默认解码格式,即根据电视的系统语言选取对应的一种编码格式进行解码。
本实施例当各个编码格式对应的匹配度均为零时,电视重新获取该视频的字幕文件中预设长度的新文字数据进行解码比较,寻找正确的默认编码格式,将字幕进行正常显示,避免字幕乱码或丢失,不仅提升了用户体验,而且提高了字幕显示的准确率及便捷性。
进一步地,提出了本发明字幕显示方法第五实施例,该实施例中上述步骤S30之前包括:对所述终端支持的所有编码格式对应的字库内码表中的文字和标点符号进行标识。
本实施例中,由于字幕一般只是显示文字与标点符号,为了使电视可快速统计被各个编码格式解码后的文字数据与对应的字库内码表中的文字和/或标点符号的匹配度,因此,可预先将电视所支持的所有编码格式对应的字库内码表中的文字和标点符号标识出来。在电视播放视频进行字幕显示前,先获取视频的字幕文件中预设长度的文字数据,根据电视支持的所有编码格式分别对该文字数据进行解码,并根据预先标识各个编码格式对应的字库内码表中的文字和标点符号,统计各个编码格式解码得到的文字和/或标点符号与对应的字库内码表中已标识的文字和/或标点符号的匹配度,电视将各个编码格式对应的匹配度进行比较后,选择一种编码格式作为默认编码格式对视频播放的的字幕文件中的文字数据进行解码并显示字幕。
本实施例预先对电视支持的所有编码格式对应的字库内码表中的文字和标点符号进行标识,使得电视可快速统计被各个编码格式解码后的文字数据与对应的字库内码表中的文字和/或标点符号的匹配度,提高了电视进行字幕显示的快捷性。
对应地,如图2所示,提出本发明一种字幕显示装置第一实施例。该实施例的字幕显示装置包括:
获取模块100,用于在终端播放视频前,获取所述视频的字幕文件中预设长度的文字数据;
本实施例中,终端的类型可根据实际需要进行设置,例如,该终端包括电视、电脑等可进行视频播放的终端,以下将以该终端为电视进行详细说明。
当用户选择打开一个视频进行播放时,电视播放该视频之前,获取模块100将会获取视频的相关信息,视频的相关信息包括视频文件、视频的字幕文件等。从视频的字幕文件中获取预设长度的文字数据,预设长度的文字数据看是一段连续的文字数据,也可以是不连续的多段文字数据,该预设长度可根据具体情况而灵活设置,例如,从字幕文件的中间选取10个字节长度的文字数据,或者从字幕文件的起始位置获取20个字节长度的文字数据。
解密模块200,用于选取所述终端支持的编码格式来分别对所述文字数据进行解码;
统计模块300,用于统计被各个编码格式解码后的所述文字数据与对应的字库内码表中的文字和/或标点符号的匹配度;
由于字幕一般只是显示文字和标点符号,因此,只需要将解码得到的文字和标点符号与对应的字库内码表中的文字和标点符号进行比较。电视在播放字幕前,解密模块200先选取电视支持的一种编码格式进行解码,对获取得到的视频的字幕文件中预设长度的文字数据进行解码。解码完成后,统计模块300对该编码格式所解码出来的文字和/或标点符号的总数进行统计,以及对解码出来的文字和/或标点符号落在与该编码格式对应的字库内码表中的文字和/或标点符号相同的个数进行统计。将个数与总数之间比值作为匹配度,即由个数/总数,可得到该编码格式解码得到的文字和/或标点符号与对应的字库内码表中的文字和/或标点符号的匹配度。例如,当该编码格式解码出来的文字和/或标点符号的总数为10,解码出来的文字和/或标点符号落在与该编码格式对应的字库内码表中的文字和/或标点符号相同的个数为9,则该编码格式解码得到的文字和/或标点符号与对应的字库内码表中的文字和/或标点符号的匹配度为90%。依此类推,继续用电视支持的下一种编码格式进行解码判断,直到尝试完最后一种编码格式,最后得到各个编码格式解码得到的文字和/或标点符号与对应的字库内码表中的文字和/或标点符号的匹配度。
设定模块400,用于设定匹配度高于预设值的编码格式中匹配度最高的编码格式为所述字幕文件的默认解码格式,用以在所述终端播放所述视频时,解码所述字幕文件。
由于错误编码格式导致字幕无法显示的概率要高于正确编码格式正常解码的概率,因此,对上述得到各个编码格式解码得到的文字和/或标点符号与对应的字库内码表中的文字和/或标点符号的匹配度后,设定模块400将各个编码格式得到的匹配度高于预设值的编码格式中匹配度最高的编码格式为字幕文件的默认解码格式,用以在终端播放所述视频时,解码字幕文件,对字幕进行显示。即电视进行视频播放的过程中,通过该默认解码格式解码字幕文件,显示解码得到的字幕。该预设值可根据具体情况而灵活设置,例如,预设值可设置为95%。
以下进行举例说明,假设编码格式A解码得到的文字和/或标点符号与对应的字库内码表中的文字和/或标点符号的匹配度为95%,编码格式B解码得到的文字和/或标点符号与对应的字库内码表中的文字和/或标点符号的匹配度为100%,编码格式C解码得到的文字和/或标点符号与对应的字库内码表中的文字和/或标点符号的匹配度为98%,则在视频播放的过程中,以编码格式B作为视频播放的默认编码格式对字幕文件中的文字数据进行解码,显示解码得到的字幕。
本发明实施例电视在进行字幕显示时,首先通过电视支持的编码格式分别对预设长度的文字数据进行解码,设定各个编码格式解码后的文字数据与对应的字库内码表中的文字和/或标点符号的匹配度,高于预设值的编码格式中匹配度最高的编码格式为字幕文件的默认解码格式,以在电视播放该视频时,解码字幕文件,对字幕进行显示。使得电视可以自动地切换编码格式来寻找正确的编码格式,将字幕进行正常显示,避免字幕乱码或丢失,提高了字幕显示的准确率及便捷性。
进一步地,提出了本发明字幕显示装置第二实施例,该实施例中上述字幕显示装置还包括:提示模块,用于在统计的所述匹配度均不高于所述预设值时,提示用户所述终端解码所述字幕文件的失败。
本实施例中,在将各个编码格式解码得到的文字和/或标点符号与对应的字库内码表中的文字和/或标点符号进行比较的过程中,若各个编码格式对应的匹配度均小于或等于预设值,说明所有的编码格式对应的匹配度都比较低。这里的预设值与上述提到的预设值一致,可根据具体情况而灵活设置,例如,预设值可设置为95%。此时,电视判定没有找到合适的编码格式,由提示模块输出解码结果相关的提示信息,例如,提示模块输出电视解码字幕文件的失败信息,以提示用户进行相应的处理。该失败信息可以是在电视的显示界面上显示各个编码格式解码得到的文字和/或标点符号与对应的字库内码表中的文字和/或标点符号的匹配度,也可以是通过语音播报的形式对各个编码格式解码结果的播报。用户通过提示信息了解各个编码格式的解码情况后,可以通过手动方式选择其中的一种的编码格式,电视根据接收到的设置指令将该编码格式作为视频播放的默认编码格式对字幕文件中的文字数据进行解码,并显示解码得到的字幕。
本实施例当各个编码格式解码得到的匹配度均小于或等于预设值时,输出电视解码字幕文件的失败信息,提示用户进行相应处理。使得电视可以根据用户选取的编码格式将字幕进行显示,减少了字幕乱码现象,提高了字幕显示的准确率。
进一步地,提出了本发明字幕显示装置第三实施例,该实施例中上述字幕显示装置还包括:选取模块,用于在匹配度高于预设值的编码格式中匹配度最高的编码格式不止一种时,从中选取与所述终端的系统语言对应的编码格式设定为所述字幕文件的默认解码格式。
本实施例中,在上述将各个编码格式解码得到的文字和/或标点符号与对应的字库内码表中的文字和/或标点符号进行比较的过程中,当存在多个编码格式解码得到的文字/或标点符号与对应的字库内码表中的文字和/或标点符号的匹配度高于预设值的编码格式中匹配度最高的编码格式,例如,多于一种编码格式的匹配度是100%,这种情况则以电视的系统语言作为参考,此时,选取模块可根据系统语言选取对应的一种编码格式,作为视频播放的默认编码格式对字幕文件中的文字数据进行解码,并显示解码得到的字幕。这里的预设值与上述提到的预设值一致,可根据具体情况而灵活设置,例如,预设值可设置为95%。以下进行举例说明,假设电视的系统语言是希腊语,而CP1253编码格式解码得到的文字和/或标点符号落在希腊语的字库内码表CP1253的匹配度为100%,则选择该编码格式作为视频播放的默认编码格式对字幕文件中的文字数据进行解码。
本实施例中,当匹配度高于预设值的编码格式中匹配度最高的编码格式不止一种时,电视根据系统语言选取对应的一种编码格式设定为字幕文件的默认解码格式,对字幕文件中的文字数据进行解码并显示字幕。使得电视可以自动地切换编码格式来寻找正确的默认编码格式,将字幕进行正常显示,避免字幕乱码或丢失,提高了字幕显示的准确率及便捷性。
进一步地,提出了本发明字幕显示装置第四实施例,该实施例中上述字幕显示装置还包括:
处理模块,用于在统计的所述匹配度均为零时,重新从所述视频的字幕文件中获取所述预设长度的文字数据来进行解码及后续相关步骤。
本实施例中,当电视统计支持的所有编码格式统计解码得到的文字和/或标点符号与对应的字库内码表中的文字和/或标点符号的匹配度后,若各个编码格式对应的匹配度均为零,说明可能是由于电视获取得到的字幕文件中预设长度的文字数据恰好为非文字或标点符号,为了能够获取正确的默认编码格式进行解码,则处理模块重新获取视频的字幕文件中预设长度的新文字数据,按照上述方法根据电视支持的所有编码格式分别对新文字数据进行解码,统计被各个编码格式解码后的文字数据与对应的字库内码表中的文字和/或标点符号的匹配度。将重新解码得到的匹配度中,设定匹配度高于预设值的编码格式中匹配度最高的编码格式为字幕文件的默认解码格式,用以在电视播放该视频时,解码字幕文件。可以理解的是,当各个编码格式对应的匹配度均不高于预设值时,提示用户终端解码字幕文件的失败信息,并接收设置指令选取其中的一种的编码格式进行解码。或者,当匹配度高于预设值的编码格式中匹配度最高的编码格式不止一种,则从中选取与电视的系统语言对应的编码格式设定为字幕文件的默认解码格式,即根据电视的系统语言选取对应的一种编码格式进行解码。
本实施例当各个编码格式对应的匹配度均为零时,电视重新获取该视频的字幕文件中预设长度的新文字数据进行解码比较,寻找正确的默认编码格式,将字幕进行正常显示,避免字幕乱码或丢失,不仅提升了用户体验,而且提高了字幕显示的准确率及便捷性。
进一步地,提出了本发明字幕显示装置第五实施例,该实施例中上述字幕显示装置还包括:
标识模块,用于对所述终端支持的所有编码格式对应的字库内码表中的文字和标点符号进行标识。
本实施例中,由于字幕一般只是显示文字与标点符号,为了使电视可快速统计被各个编码格式解码后的文字数据与对应的字库内码表中的文字和/或标点符号的匹配度,因此,标识模块可预先将电视所支持的所有编码格式对应的字库内码表中的文字和标点符号标识出来。在电视播放视频进行字幕显示前,先获取视频的字幕文件中预设长度的文字数据,根据电视支持的所有编码格式分别对该文字数据进行解码,并根据预先标识各个编码格式对应的字库内码表中的文字和标点符号,统计各个编码格式解码得到的文字和/或标点符号与对应的字库内码表中已标识的文字和/或标点符号的匹配度,电视将各个编码格式对应的匹配度进行比较后,选择一种编码格式作为默认编码格式对视频播放的的字幕文件中的文字数据进行解码并显示字幕。
本实施例预先对电视支持的所有编码格式对应的字库内码表中的文字和标点符号进行标识,使得电视可快速统计被各个编码格式解码后的文字数据与对应的字库内码表中的文字和/或标点符号的匹配度,提高了电视进行字幕显示的快捷性。
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。

Claims (20)

  1. 一种字幕显示方法,其特征在于,所述字幕显示方法包括以下步骤:
    在终端播放视频前,获取所述视频的字幕文件中预设长度的文字数据;
    选取所述终端支持的编码格式来分别对所述文字数据进行解码;
    统计被各个编码格式解码后的所述文字数据与对应的字库内码表中的文字和/或标点符号的匹配度;及
    设定匹配度高于预设值的编码格式中匹配度最高的编码格式为所述字幕文件的默认解码格式,用以在所述终端播放所述视频时,解码所述字幕文件;
    其中,若统计的所述匹配度均不高于所述预设值,则提示用户所述终端解码所述字幕文件的失败;
    若匹配度高于预设值的编码格式中匹配度最高的编码格式不止一种,则从中选取与所述终端的系统语言对应的编码格式设定为所述字幕文件的默认解码格式。
  2. 权利要求1所述的字幕显示方法,其特征在于,该方法还包括:
    若统计的所述匹配度均为零,则重新从所述视频的字幕文件中获取所述预设长度的文字数据来进行解码及后续相关步骤。
  3. 权利要求1所述的字幕显示方法,其特征在于,所述统计被各个编码格式解码后的所述文字数据与对应的字库内码表中的文字和/或标点符号的匹配度之前还包括:
    对所述终端支持的所有编码格式对应的字库内码表中的文字和标点符号进行标识。
  4. 权利要求2所述的字幕显示方法,其特征在于,所述统计被各个编码格式解码后的所述文字数据与对应的字库内码表中的文字和/或标点符号的匹配度之前还包括:
    对所述终端支持的所有编码格式对应的字库内码表中的文字和标点符号进行标识。
  5. 一种字幕显示方法,其特征在于,所述字幕显示方法包括以下步骤:
    在终端播放视频前,获取所述视频的字幕文件中预设长度的文字数据;
    选取所述终端支持的编码格式来分别对所述文字数据进行解码;
    统计被各个编码格式解码后的所述文字数据与对应的字库内码表中的文字和/或标点符号的匹配度;及
    设定匹配度高于预设值的编码格式中匹配度最高的编码格式为所述字幕文件的默认解码格式,用以在所述终端播放所述视频时,解码所述字幕文件。
  6. 权利要求5所述的字幕显示方法,其特征在于,该方法还包括:
    若统计的所述匹配度均不高于所述预设值,则提示用户所述终端解码所述字幕文件的失败。
  7. 权利要求5所述的字幕显示方法,其特征在于,该方法还包括:
    若匹配度高于预设值的编码格式中匹配度最高的编码格式不止一种,则从中选取与所述终端的系统语言对应的编码格式设定为所述字幕文件的默认解码格式。
  8. 权利要求5所述的字幕显示方法,其特征在于,该方法还包括:
    若统计的所述匹配度均为零,则重新从所述视频的字幕文件中获取所述预设长度的文字数据来进行解码及后续相关步骤。
  9. 权利要求5所述的字幕显示方法,其特征在于,所述统计被各个编码格式解码后的所述文字数据与对应的字库内码表中的文字和/或标点符号的匹配度之前还包括:
    对所述终端支持的所有编码格式对应的字库内码表中的文字和标点符号进行标识。
  10. 权利要求6所述的字幕显示方法,其特征在于,所述统计被各个编码格式解码后的所述文字数据与对应的字库内码表中的文字和/或标点符号的匹配度之前还包括:
    对所述终端支持的所有编码格式对应的字库内码表中的文字和标点符号进行标识。
  11. 权利要求7所述的字幕显示方法,其特征在于,所述统计被各个编码格式解码后的所述文字数据与对应的字库内码表中的文字和/或标点符号的匹配度之前还包括:
    对所述终端支持的所有编码格式对应的字库内码表中的文字和标点符号进行标识。
  12. 权利要求8所述的字幕显示方法,其特征在于,所述统计被各个编码格式解码后的所述文字数据与对应的字库内码表中的文字和/或标点符号的匹配度之前还包括:
    对所述终端支持的所有编码格式对应的字库内码表中的文字和标点符号进行标识。
  13. 一种字幕显示装置,其特征在于,所述字幕显示装置包括:
    获取模块,用于在终端播放视频前,获取所述视频的字幕文件中预设长度的文字数据;
    解密模块,用于选取所述终端支持的编码格式来分别对所述文字数据进行解码;
    统计模块,用于统计被各个编码格式解码后的所述文字数据与对应的字库内码表中的文字和/或标点符号的匹配度;
    设定模块,用于设定匹配度高于预设值的编码格式中匹配度最高的编码格式为所述字幕文件的默认解码格式,用以在所述终端播放所述视频时,解码所述字幕文件。
  14. 权利要求13所述的字幕显示装置,其特征在于,所述字幕显示装置还包括:
    提示模块,用于在统计的所述匹配度均不高于所述预设值时,提示用户所述终端解码所述字幕文件的失败。
  15. 权利要求13所述的字幕显示装置,其特征在于,所述字幕显示装置还包括:
    选取模块,用于在匹配度高于预设值的编码格式中匹配度最高的编码格式不止一种时,从中选取与所述终端的系统语言对应的编码格式设定为所述字幕文件的默认解码格式。
  16. 权利要求13所述的字幕显示装置,其特征在于,所述字幕显示装置还包括:
    处理模块,用于在统计的所述匹配度均为零时,重新从所述视频的字幕文件中获取所述预设长度的文字数据来进行解码及后续相关步骤。
  17. 权利要求13所述的字幕显示装置,其特征在于,所述字幕显示装置还包括:
    标识模块,用于对所述终端支持的所有编码格式对应的字库内码表中的文字和标点符号进行标识。
  18. 权利要求14所述的字幕显示装置,其特征在于,所述字幕显示装置还包括:
    标识模块,用于对所述终端支持的所有编码格式对应的字库内码表中的文字和标点符号进行标识。
  19. 权利要求15所述的字幕显示装置,其特征在于,所述字幕显示装置还包括:
    标识模块,用于对所述终端支持的所有编码格式对应的字库内码表中的文字和标点符号进行标识。
  20. 权利要求16所述的字幕显示装置,其特征在于,所述字幕显示装置还包括:
    标识模块,用于对所述终端支持的所有编码格式对应的字库内码表中的文字和标点符号进行标识。
PCT/CN2016/084872 2016-03-28 2016-06-04 字幕显示方法及装置 Ceased WO2017166430A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610184443.XA CN105847931B (zh) 2016-03-28 2016-03-28 字幕显示方法及装置
CN201610184443.X 2016-03-28

Publications (1)

Publication Number Publication Date
WO2017166430A1 true WO2017166430A1 (zh) 2017-10-05

Family

ID=56583800

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/084872 Ceased WO2017166430A1 (zh) 2016-03-28 2016-06-04 字幕显示方法及装置

Country Status (2)

Country Link
CN (1) CN105847931B (zh)
WO (1) WO2017166430A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108108267B (zh) * 2016-11-25 2021-06-22 北京国双科技有限公司 数据的恢复方法和装置
CN107302722B (zh) * 2017-05-12 2020-08-14 广州视源电子科技股份有限公司 Dtv码流解码方法及装置
CN108091354A (zh) * 2017-12-13 2018-05-29 深圳市沃特沃德股份有限公司 车载系统歌词解析方法和装置
CN113992960B (zh) * 2021-10-27 2024-10-22 海信视像科技股份有限公司 显示设备上字幕预览方法及显示设备

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060025988A1 (en) * 2004-07-30 2006-02-02 Ming Xu Fast text character set recognition
CN102194503A (zh) * 2010-03-12 2011-09-21 腾讯科技(深圳)有限公司 一种播放器及字幕文件的字符编码检测方法和装置
CN102595082A (zh) * 2012-01-30 2012-07-18 深圳创维-Rgb电子有限公司 电视机自动显示多格式隐藏字幕方法和系统
US20130077855A1 (en) * 2011-05-16 2013-03-28 ISYS Search Software Pty Ltd. Systems and methods for processing documents of unknown or unspecified format
CN104156373A (zh) * 2013-05-15 2014-11-19 宏碁股份有限公司 编码格式检测方法及装置
CN104516862A (zh) * 2013-09-29 2015-04-15 北大方正集团有限公司 一种选择读取目标文档的编码格式的方法及其系统
CN104750666A (zh) * 2015-03-12 2015-07-01 明博教育科技有限公司 一种文本字符编码方式的识别方法及系统

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001008161A (ja) * 1999-06-23 2001-01-12 Hitachi Ltd 映像信号変換装置および映像信号記録再生装置
CN102164248B (zh) * 2011-02-15 2014-12-10 Tcl集团股份有限公司 一种自动化字幕测试方法及系统
CN102799572B (zh) * 2012-07-27 2015-09-09 深圳万兴信息科技股份有限公司 一种文本编码方式和文本编码装置
CN104331692A (zh) * 2014-11-28 2015-02-04 广东欧珀移动通信有限公司 基于双重特征进行人脸识别的方法和终端

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060025988A1 (en) * 2004-07-30 2006-02-02 Ming Xu Fast text character set recognition
CN102194503A (zh) * 2010-03-12 2011-09-21 腾讯科技(深圳)有限公司 一种播放器及字幕文件的字符编码检测方法和装置
US20130077855A1 (en) * 2011-05-16 2013-03-28 ISYS Search Software Pty Ltd. Systems and methods for processing documents of unknown or unspecified format
CN102595082A (zh) * 2012-01-30 2012-07-18 深圳创维-Rgb电子有限公司 电视机自动显示多格式隐藏字幕方法和系统
CN104156373A (zh) * 2013-05-15 2014-11-19 宏碁股份有限公司 编码格式检测方法及装置
CN104516862A (zh) * 2013-09-29 2015-04-15 北大方正集团有限公司 一种选择读取目标文档的编码格式的方法及其系统
CN104750666A (zh) * 2015-03-12 2015-07-01 明博教育科技有限公司 一种文本字符编码方式的识别方法及系统

Also Published As

Publication number Publication date
CN105847931A (zh) 2016-08-10
CN105847931B (zh) 2019-08-27

Similar Documents

Publication Publication Date Title
WO2016192254A1 (zh) 网络视频在线播放的方法和装置
WO2017166430A1 (zh) 字幕显示方法及装置
WO2017016310A1 (zh) 遥控功能数据动态配置的方法和装置
WO2017101266A1 (zh) 语音控制方法及系统
WO2015085765A1 (zh) 推送资讯信息的方法和智能终端
WO2017152603A1 (zh) 显示方法及装置
WO2016091011A1 (zh) 字幕切换方法及装置
WO2016192270A1 (zh) 媒体文件的快速启播方法及装置
WO2017177524A1 (zh) 音视频同步播放的方法及装置
WO2018032693A1 (zh) 电视显示内容的处理方法、装置及系统
WO2017028601A1 (zh) 智能终端的语音控制方法、装置及电视机系统
WO2017084311A1 (zh) 单分片视频播放加速方法及装置
WO2013143341A1 (zh) 一种更新移动终端的应用信息的方法及装置
WO2015058570A1 (zh) 自动识别网络运营商以实现数据配置的方法及装置
WO2017126835A1 (en) Display apparatus and controlling method thereof
WO2017197802A1 (zh) 字符串模糊匹配方法及装置
WO2017063368A1 (zh) 视频广告的插播方法及装置
WO2018023926A1 (zh) 电视与移动终端的互动方法及系统
WO2017113594A1 (zh) 数字电视应急广播的播放方法和数字电视终端
WO2017036209A1 (zh) 基于智能电视的音频数据播放方法、智能电视及系统
WO2017063366A1 (zh) 应用启动方法和系统
WO2017084301A1 (zh) 音频数据播放方法、装置及智能电视机
WO2019137016A1 (zh) 电视节目推荐方法、设备及计算机可读存储介质
WO2016090991A1 (zh) 流媒体数据的下载方法及装置
WO2019080401A1 (zh) 脚本语句转换方法、装置及计算机可读存储介质

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

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

Ref document number: 16896204

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 16896204

Country of ref document: EP

Kind code of ref document: A1