CN106792114B - The switching method and device of subtitle - Google Patents
The switching method and device of subtitle Download PDFInfo
- Publication number
- CN106792114B CN106792114B CN201611127290.1A CN201611127290A CN106792114B CN 106792114 B CN106792114 B CN 106792114B CN 201611127290 A CN201611127290 A CN 201611127290A CN 106792114 B CN106792114 B CN 106792114B
- Authority
- CN
- China
- Prior art keywords
- caption information
- subtitle
- information item
- subtitle file
- caption
- 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.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing 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/433—Content storage operation, e.g. storage operation in response to a pause request, caching operations
- H04N21/4331—Caching operations, e.g. of an advertisement for later insertion during playback
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/47—End-user applications
- H04N21/485—End-user interface for client configuration
- H04N21/4856—End-user interface for client configuration for language selection, e.g. for the menu or subtitles
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/47—End-user applications
- H04N21/488—Data services, e.g. news ticker
- H04N21/4884—Data services, e.g. news ticker for displaying subtitles
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Human Computer Interaction (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
- Television Signal Processing For Recording (AREA)
- Studio Circuits (AREA)
Abstract
The invention discloses a kind of switching methods of subtitle, which comprises obtains the subtitle file that video includes and parsing, obtains caption information item, establish caption information data list according to the offset in the path of the subtitle file and caption information item;The path of to be switched subtitle file is obtained according to the switching subtitle instructions that user triggers;Extract the caption information item for meeting preset condition in the list of caption information data;Caption information item identical with the path of to be switched subtitle file is searched in the caption strips information extracted, and obtains the address offset amount of the caption information item, reads the caption data of the address offset amount;The caption data read is carried out output to show.The invention also discloses a kind of switching devices of subtitle.The present invention can be improved the efficiency of switching subtitle.
Description
Technical field
The present invention relates to internet television field more particularly to the switching methods and device of a kind of subtitle.
Background technique
In many countries and regions, especially European some video content services quotient, in order to preferably be different language
The people of country provide video frequency request program service, and the subtitle of different language is all embedded in inside the video file of program.People
When watching program, pass through remote controler, carry out different language subtitle switching.
Currently, the method for carrying out subtitle switching usually stops the data of current subtitle being sent into caching first, empty slow
It deposits space and empties the data of subtitle decoder module caching by carrying out flush operation to subtitle decoder module;Then,
The data of to be switched subtitle are sent into spatial cache, the data of spatial cache are sent into subtitle decoder mould by data cache module
Block;Then, subtitle decoder module is decoded after the data for receiving to be switched subtitle.To decoded caption data
After synchronizing in time with audio or video, it is output to output module;Finally, output module receive it is decoded
After caption data, carries out output and show, subtitle finishing switching.Subtitle is switched over through the above way, subtitle can not be broadcast
Putting the time is quickly positioned.
Summary of the invention
It is a primary object of the present invention to propose the switching method and device of a kind of subtitle, it is intended to which solution can not be to subtitle
The technical issues of play time is quickly positioned.
To achieve the above object, the switching method of a kind of subtitle provided by the invention, the described method comprises the following steps:
Obtain the video subtitle file that includes and parsing, obtain caption information item, according to the path of the subtitle file and
The offset of caption information item establishes caption information data list;
The path of to be switched subtitle file is obtained according to the switching subtitle instructions that user triggers;
Extract the caption information item for meeting preset condition in the list of caption information data;
Caption information item identical with the path of to be switched subtitle file is searched in the caption strips information extracted, and is obtained
The address offset amount for taking the caption information item reads the caption data of the address offset amount;
The caption data read is carried out output to show.
Optionally, the step of meeting the caption information of preset condition in the extraction caption information data list packet
It includes:
Obtain the video data current display time stamp in playing;
It will divide at the beginning of caption information item in the timestamp and the list of caption information data with the end time
It does not compare;
If there are the time starteds less than or equal to timestamp and end for the caption information item in caption information data list
Time is greater than or equal to the caption information item of timestamp, then extracts the caption information item;
If there is no the time starteds in the caption information of caption information data list to be less than or equal to timestamp and end
Time is greater than or equal to the caption information item of timestamp, then extracts and the timestamp is separated by nearest caption information item.
Optionally, the side by the caption data read carry out output display the step of include:
The to be switched subtitle file for carrying out output display is obtained, the to be switched subtitle file is parsed;
The caption information data of the to be switched subtitle file is obtained, current play time is obtained and stabs and work as by described in
It is successively compared at the beginning of preceding play time stabs the caption information item with the to be switched subtitle file with the end time;
Time started in the caption information item of the to be switched subtitle file is less than or equal to the current play time
The caption information item that stamp and current play time stamp are less than or equal to the end time carries out rendering display captioned test information;
End time in the caption information item of the to be switched subtitle file is greater than to the word of current play time stamp
Curtain information bar is removed, and searches next caption data;
Time started in the caption information item of the to be switched subtitle file is less than to the word of current play time stamp
Curtain information bar caching.
Optionally, described to obtain the subtitle file and parsing that video includes, caption information item is obtained, according to the subtitle text
The step of path of part and the offset of caption information item establish caption information data list include:
The subtitle file that video includes is obtained, and the subtitle file is saved into caching, the subtitle file includes
The path of subtitle file content and subtitle file;
Parse the subtitle file, according to every subtitle at the beginning of and the end time subtitle split into multiple subtitles
Information bar obtains offset, time started, end time, content of text and the renderer property of caption information item;
Caption information data list is established according to the offset in the path of subtitle file and caption information item, and by subtitle
At the beginning of information bar, end time, content of text and renderer property save into caption information data list;
The time attribute of all caption information items parsed is traversed, at the beginning of extracting caption information item and is terminated
Time, according to the caption information item at the beginning of carry out ascending sort, described in the name of the time attribute of caption information item
Caption information item is simultaneously saved into caption information data list.
Optionally, the method also includes:
Judge to be switched subtitle file whether be current language subtitle file;
If so, continuing to output the subtitle file of display current language;
If it is not, then obtaining to be switched subtitle file.
In addition, to achieve the above object, the present invention also provides a kind of switching device of subtitle, described device includes:
Module is established, for obtaining the subtitle file and parsing that video includes, caption information item is obtained, according to the subtitle
The path of file and the offset of caption information item establish caption information data list
First obtains module, and the switching subtitle instructions for being triggered according to user obtain the path of to be switched subtitle file;
Extraction module, for extracting the caption information item for meeting preset condition in caption information data list;
Read module, for searching word identical with the path of to be switched subtitle file in the caption strips information extracted
Curtain information bar, and the address offset amount of the caption information item is obtained, read the caption data of the address offset amount;
First display module is shown for the caption data read to be carried out output.
Optionally, the extraction module includes:
Acquiring unit, for obtaining the stamp of the video data current display time in playing;
Comparison unit, for by the beginning of the caption information of the timestamp and the list of caption information data in knot
The beam time compares respectively;
First extraction unit, if for being less than or waiting there are the time started in the caption information of caption information data list
In timestamp and the end time is more than or equal to the caption information item of timestamp, then extracts the caption information item;
Second extraction unit, if in the caption information of caption information data list be not present the time started be less than or
Equal to timestamp and the end time is greater than or equal to the caption information item of timestamp, then extraction and the timestamp are separated by nearest
Caption information item.
Optionally, first display module includes:
First resolution unit, for obtaining the to be switched subtitle file for carrying out output display, by the to be switched word
Curtain file is parsed;
Comparing unit obtains current play time for obtaining the caption information data of the to be switched subtitle file
Stab and by the beginning of current play time stamp and the caption information item of the to be switched subtitle file and at the end of
Between be successively compared;
Rendering unit, it is described for the time started in the caption information item of the to be switched subtitle file to be less than or equal to
The caption information item that current play time stamp and current play time stamp are less than or equal to the end time carries out rendering and shows
Captioned test information;
Searching unit, for currently broadcasting the end time in the caption information item of the to be switched subtitle file greater than described
The caption information item for putting timestamp is removed, and searches next caption data;
Cache unit, for currently broadcasting the time started in the caption information item of the to be switched subtitle file less than described
Put the caption information item caching of timestamp.
Optionally, the module of establishing includes:
Acquiring unit, the subtitle file for including for obtaining video, and the subtitle file is saved into caching, it is described
Subtitle file includes the path of subtitle file content and subtitle file;
Second resolution unit, for parsing the subtitle file, according to every subtitle at the beginning of and the end time will
Subtitle splits into multiple caption information items, obtain the offset of caption information item, the time started, the end time, content of text and
Renderer property;
Unit is established, for establishing caption information data according to the path of subtitle file and the offset of caption information item
List, and by the beginning of caption information item, end time, content of text and renderer property save to caption information data
In list;
Storage unit extracts caption information item for traversing the time attribute of all caption information items parsed
Time started and end time, according to the caption information item at the beginning of carry out ascending sort, with caption information item when
Between caption information item described in attribute names and save into caption information data list.
Optionally, described device further include:
Judgment module, for judge to be switched subtitle file whether be current language subtitle file;
Second display module continues to output aobvious if being the subtitle file of current language for be switched subtitle file
Show the subtitle file of current language;
Second obtains module, if not being the subtitle file of current language for be switched subtitle file, obtains to be cut
Change subtitle file.
The switching method and device for the subtitle that example of the present invention proposes obtain the institute that video includes first before video playing
There is subtitle file and parse the subtitle file, so that the caption information item of subtitle file is obtained, then according to the subtitle
The path of file and the offset of caption information item establish caption information data list;Switch subtitle when detecting that user triggers
When instruction, the path of to be switched subtitle file is obtained according to the switching subtitle instructions that user triggers;Then caption information item is extracted
Meet the caption information item of preset condition in data list;It is searched and to be switched subtitle file in the caption strips information extracted
The identical caption information item in path, and obtain the address offset amount of the caption information item, read the address offset amount
Caption data;The caption data read is carried out output again to show, so that the subtitle after switching can when switching subtitle
To be quickly shown on corresponding timestamp.
Detailed description of the invention
Fig. 1 is the flow diagram of the switching method first embodiment of subtitle of the present invention;
Fig. 2 is that the thin of the step of meeting the caption information of preset condition in the list of caption information data is extracted in Fig. 1
Change flow diagram;
Fig. 3 is the refinement flow diagram the step of caption data read is carried out output display in Fig. 1;
Fig. 4 is that subtitle file and the parsing that video includes are obtained in Fig. 1, obtains caption information item, according to the subtitle text
The refinement flow diagram for the step of path of part and the offset of caption information item establish caption information data list;
Fig. 5 is the flow diagram of the switching method second embodiment of subtitle of the present invention;
Fig. 6 is the functional block diagram of the switching device first embodiment of subtitle of the present invention;
Fig. 7 is the refinement the functional block diagram of extraction module in Fig. 6;
Fig. 8 is the refinement the functional block diagram of the first display module in Fig. 6;
Fig. 9 is the refinement the functional block diagram that module is established in Fig. 6;
Figure 10 is the functional block diagram of the switching device second embodiment of subtitle of the present invention;
Figure 11 is the preservation form schematic diagram of the caption information item after parsing;
Figure 12 is the preservation form schematic diagram of the caption information item after being ranked up.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The present invention provides a kind of switching method of subtitle.
Referring to Fig.1, Fig. 1 is the flow diagram of the switching method first embodiment of subtitle of the present invention.
In the present embodiment, this method comprises:
Step S10 obtains the subtitle file that video includes and parsing, caption information item is obtained, according to the subtitle file
Path and the offset of caption information item establish caption information data list;
In the present embodiment, before user plays out video, need to obtain whole words that the video includes in advance
Curtain file, and the subtitle file is saved in the buffer.Then the subtitle file is parsed, obtains multiple caption informations
The offset of item, path and caption information item further according to the subtitle file establishes caption information data list.
Step S20 obtains the path of to be switched subtitle file according to the switching subtitle instructions that user triggers.
Specifically, when family is used in viewing audio/video file, the subtitle of discovery default display is not the subtitle that oneself is needed, then
Subtitle switching can be carried out by equipment such as remote controlers.Specifically, subtitle handoff functionality is selected, and in the option list of pop-up
The subtitle type of selection demand generates subtitle switching command and receives the subtitle when terminal detects the subtitle switching command and cut
Change instruction.Then according to the path of the to be switched subtitle file of subtitle switching command.
Step S30 extracts the caption information item for meeting preset condition in the list of caption information data.
Specifically, the current play time stamp for obtaining currently playing video first, then stabs the current play time
With at the beginning of the caption information item in caption information data list and the end time successively compares, obtain comparison knot
Time started in comparing result is less than or equal to timestamp and the end time is greater than or equal to the caption information item of timestamp by fruit
It extracts.
Step S40 searches subtitle letter identical with the path of to be switched subtitle file in the caption strips information extracted
Item is ceased, and obtains the address offset amount of the caption information item, reads the caption data of the address offset amount.
It is less than or equal to timestamp in the time started extracted and the end time is greater than or equal to the word of timestamp
After curtain information bar, the caption information item with to be switched subtitle file path same paths is searched in the caption information item,
And the address offset amount of the caption information item is obtained, read the caption data of the address offset amount.
The caption data read is carried out output and shown by step S50.
The caption data read is carried out output to show, so that when the broadcasting of the subtitle and currently playing video after switching
Between match.
The switching method for the subtitle that the present embodiment proposes obtains all subtitles that video includes first before video playing
File simultaneously parses the subtitle file, so that the caption information item of subtitle file is obtained, then according to the subtitle file
The offset of path and caption information item establishes caption information data list;Switch subtitle instructions when detecting that user triggers
When, the path of to be switched subtitle file is obtained according to the switching subtitle instructions that user triggers;Then caption information data is extracted
Meet the caption information item of preset condition in list;The road with to be switched subtitle file is searched in the caption strips information extracted
The identical caption information item of diameter, and the address offset amount of the caption information item is obtained, read the subtitle of the address offset amount
Data;The caption data read is carried out output again to show, so that the subtitle after switching can be fast when switching subtitle
Speed is shown on corresponding timestamp.
It further, is that the subtitle for meeting preset condition in the list of caption information data is extracted in Fig. 1 referring to Fig. 2, Fig. 2
The refinement flow diagram of the step of information.
Based on the present invention is based on the switching method first embodiment of subtitle of the present invention, the step S30 may include:
Step S31 obtains the video data current display time stamp in playing;
Step S32, by the beginning of the caption information item in the timestamp and the list of caption information data with knot
The beam time compares respectively;
Step S33, if there are the time starteds in the caption information of caption information data list to be less than or equal to timestamp
And the end time is greater than or equal to the caption information item of timestamp, then extracts the caption information item;
Step S34, if there is no the time starteds in the caption information of caption information data list to be less than or equal to the time
Stamp and end time are greater than or equal to the caption information item of timestamp, then extract and the timestamp is separated by nearest caption information
Item.
In the present embodiment, the stamp of the video data current display time in playing is obtained first;Then by the timestamp
It is compared respectively at the beginning of the caption information item in caption information data list with the end time;If caption information
It is less than or equal to timestamp there are the time started in the caption information of data list and the end time is greater than or equal to timestamp
Caption information item, then extract the caption information item;If there is no start in the caption information of caption information data list
Time is less than or equal to timestamp and the end time is greater than or equal to the caption information item of timestamp, then extracts and the timestamp
It is separated by nearest caption information item.
Further, referring to the refinement that Fig. 3, Fig. 3 are the step of the caption data read is carried out output display in Fig. 1
Flow diagram.
Switching method first embodiment based on subtitle of the present invention, the step S50 may include:
Step S51 obtains the to be switched subtitle file for carrying out output display, and the to be switched subtitle file is carried out
Parsing;
Step S52 obtains the caption information data of the to be switched subtitle file, obtain current play time stamp and
By at the beginning of current play time stamp and the caption information item of the to be switched subtitle file and the end time successively
It is compared;
Time started in the caption information item of the to be switched subtitle file is less than or equal to described current by step S53
The caption information item that play time stamp and current play time stamp are less than or equal to the end time carries out rendering display subtitle
Text information;
Step S54, when the end time in the caption information item of the to be switched subtitle file is greater than described currently playing
Between the caption information item that stabs remove, and search next caption data;
Step S55, when the time started in the caption information item of the to be switched subtitle file is less than described currently playing
Between stab caption information item caching.
In the present embodiment, obtain after output shows the to be switched subtitle file after offset will be navigated to
The to be switched subtitle file for carrying out output display, the to be switched subtitle file is parsed;It obtains described to be switched
The caption information data of subtitle file, obtain current play time stamp and by the current play time stamp with it is described to be cut
It is successively compared at the beginning of changing the caption information item of subtitle file with the end time;Then by the to be switched subtitle text
The time started is less than or equal to current play time stamp in the caption information item of part and current play time stamp is less than
Or rendering display captioned test information is carried out equal to the caption information item of end time;By the subtitle of the to be switched subtitle file
The caption information item that the end time is greater than current play time stamp in information bar is removed, and searches next caption data;
Time started in the caption information item of the to be switched subtitle file is less than to the caption information item of current play time stamp
Caching.
Further, it is to obtain subtitle file and the parsing that video includes in Fig. 1 referring to Fig. 4, Fig. 4, obtains caption information
Item, the step of caption information data list is established according to the offset in the path of the subtitle file and caption information item it is thin
Change flow diagram.
Based on the present invention is based on the switching method first embodiment of subtitle of the present invention, the step S10 may include:
Step S11 obtains the subtitle file that video includes, and the subtitle file is saved into caching, the subtitle
File includes the path of subtitle file content and subtitle file;
Step S12 parses the subtitle file, according to every subtitle at the beginning of and the end time subtitle is split into
Multiple caption information items obtain offset, time started, end time, content of text and the renderer property of caption information item;
Step S13 establishes caption information data list according to the offset in the path of subtitle file and caption information item,
And by the beginning of caption information item, end time, content of text and renderer property save to caption information data list
In;
Step S13 traverses the time attribute of all caption information items parsed, at the beginning of extracting caption information item
Between and the end time, according to the caption information item at the beginning of carry out ascending sort, with the time attribute of caption information item
It names the caption information item and saves into caption information data list.
In the present embodiment, the video subtitle file that includes is obtained before player shows first frame, and by the word
Curtain file is saved into caching, and the subtitle file includes the path of subtitle file content and subtitle file.Then successively to institute
The plug-in subtitle file having is parsed, according to every subtitle at the beginning of and the end time subtitle split into multiple subtitles
Information bar, thus to obtain the offset of caption information item, time started, end time, content of text and renderer property, then root
Caption information data list, and opening caption information item are established according to the path of subtitle file and the offset of caption information item
Time beginning, end time, content of text and renderer property are saved into caption information data list, and saving format can be word
Curtain file URL (path), the time started, the end time, content of text, renderer property, offset, as shown in figure 11.Traversal institute
There is a time attribute of the caption information item parsed, at the beginning of obtaining every caption information item and the end time, extracts
At the beginning of the caption information item and the end time, according to the caption information item at the beginning of carry out ascending sort,
It names the caption information item with the time attribute of caption information item and saves and save format into caption information data list
Can be subtitle file URL (path), content of text, renderer property, offset, as shown in figure 12.
It further, is the flow diagram of the switching method second embodiment of subtitle of the present invention referring to Fig. 5, Fig. 5.
Switching method first embodiment based on subtitle of the present invention, the method also includes:
Step S60, judge to be switched subtitle file whether be current language subtitle file;
Step S70, if so, continuing to output the subtitle file of display current language;
Step S80, if it is not, then obtaining to be switched subtitle file.
In the present embodiment, user is during watching video, it may occur that accidentally by the operation of the equipment such as remote controler.When with
When the operation of the equipment such as remote controler is pressed accidentally to switch subtitle in family, it is current language that user, which can choose switching language, to continue
Watch the video of current output language.Therefore the list of caption information data is obtained in the switching subtitle instructions triggered according to user
And before to be switched subtitle file, it is necessary first to judge to be switched subtitle file whether be current language subtitle file, such as
The selected to be switched subtitle of fruit user then can determine whether that user triggers maloperation, without cutting as the subtitle of current language
Language is changed, then continues to output the subtitle of display current language;If user selected to be switched subtitle and current language
Subtitle is different, then obtains to be switched subtitle file.
The present invention further provides a kind of switching devices of subtitle.
It is the functional block diagram of the switching device first embodiment of subtitle of the present invention referring to Fig. 6, Fig. 6.
In the present embodiment, which includes:
Module 10 is established, for obtaining the subtitle file and parsing that video includes, caption information item is obtained, according to the word
The path of curtain file and the offset of caption information item establish caption information data list.
In the present embodiment, before user plays out video, need to obtain whole words that the video includes in advance
Curtain file, and the subtitle file is saved in the buffer.Then the subtitle file is parsed, obtains multiple caption informations
The offset of item, path and caption information item further according to the subtitle file establishes caption information data list.
First obtains module 20, and the switching subtitle instructions for being triggered according to user obtain the road of to be switched subtitle file
Diameter.
Specifically, when family is used in viewing audio/video file, the subtitle of discovery default display is not the subtitle that oneself is needed, then
Subtitle switching can be carried out by equipment such as remote controlers.Specifically, subtitle handoff functionality is selected, and in the option list of pop-up
The subtitle type of selection demand generates subtitle switching command and receives the subtitle when terminal detects the subtitle switching command and cut
Change instruction.Then according to the path of the to be switched subtitle file of subtitle switching command.
Extraction module 30, for extracting the caption information item for meeting preset condition in caption information data list.
Specifically, the current play time stamp for obtaining currently playing video first, then stabs the current play time
With at the beginning of the caption information item in caption information data list and the end time successively compares, obtain comparison knot
Time started in comparing result is less than or equal to timestamp and the end time is greater than or equal to the caption information item of timestamp by fruit
It extracts.
Read module 40, it is identical with the path of to be switched subtitle file for being searched in the caption strips information extracted
Caption information item, and the address offset amount of the caption information item is obtained, read the caption data of the address offset amount.
It is less than or equal to timestamp in the time started extracted and the end time is greater than or equal to the word of timestamp
After curtain information bar, the caption information item with to be switched subtitle file path same paths is searched in the caption information item,
And the address offset amount of the caption information item is obtained, read the caption data of the address offset amount.
First display module 50 is shown for the caption data read to be carried out output.
The caption data read is carried out output to show, so that when the broadcasting of the subtitle and currently playing video after switching
Between match.
The switching device for the subtitle that the present embodiment proposes obtains all subtitles that video includes first before video playing
File simultaneously parses the subtitle file, so that the caption information item of subtitle file is obtained, then according to the subtitle file
The offset of path and caption information item establishes caption information data list;Switch subtitle instructions when detecting that user triggers
When, the path of to be switched subtitle file is obtained according to the switching subtitle instructions that user triggers;Then caption information data is extracted
Meet the caption information item of preset condition in list;The road with to be switched subtitle file is searched in the caption strips information extracted
The identical caption information item of diameter, and the address offset amount of the caption information item is obtained, read the subtitle of the address offset amount
Data;The caption data read is carried out output again to show, so that the subtitle after switching can be fast when switching subtitle
Speed is shown on corresponding timestamp.
It further, is the refinement the functional block diagram of extraction module in Fig. 6 referring to Fig. 7, Fig. 7.
Based on the present invention is based on the switching device first embodiment of subtitle of the present invention, the extraction module 30 may include:
Module 31 is obtained, for obtaining the stamp of the video data current display time in playing;
Comparison unit 32, for will be at the beginning of the caption information item in the timestamp and the list of caption information data
Between compared respectively with the end time;;
First extraction unit 33, if be less than in caption information for caption information data list there are the time started or
Equal to timestamp and the end time is greater than or equal to the caption information item of timestamp, then extracts the caption information item;
Second extraction unit 34 to be less than if there is no the time starteds in caption information for caption information data list
Or equal to timestamp and the end time is greater than or equal to the caption information item of timestamp, then extracts and the timestamp is separated by recently
Caption information item.
In the present embodiment, the stamp of the video data current display time in playing is obtained first;Then by the timestamp
It is compared respectively at the beginning of the caption information item in caption information data list with the end time;If caption information
It is less than or equal to timestamp there are the time started in the caption information of data list and the end time is greater than or equal to timestamp
Caption information item, then extract the caption information item;If there is no start in the caption information of caption information data list
Time is less than or equal to timestamp and the end time is greater than or equal to the caption information item of timestamp, then extracts and the timestamp
It is separated by nearest caption information item.
It further, is the refinement the functional block diagram of the first display module 50 in Fig. 6 referring to Fig. 8, Fig. 8.
Based on the present invention is based on the switching device first embodiment of subtitle of the present invention, first display module 50 be can wrap
It includes:
First resolution unit 51 will be described to be switched for obtaining the to be switched subtitle file for carrying out output display
Subtitle file is parsed;
Comparing unit 52, for obtaining the caption information data of the to be switched subtitle file, when obtaining currently playing
Between stab and at the beginning of current play time stamp and the caption information item of the to be switched subtitle file and will terminate
Time is successively compared;
Rendering unit 53, for the time started in the caption information item of the to be switched subtitle file to be less than or equal to institute
It states current play time stamp and current play time stamp carries out rendering less than or equal to the caption information item of end time and shows
Show captioned test information;
Searching unit 54, it is described current for the end time in the caption information item of the to be switched subtitle file to be greater than
The caption information item of play time stamp is removed, and searches next caption data;
Cache unit 55, it is described current for the time started in the caption information item of the to be switched subtitle file to be less than
The caption information item caching of play time stamp.
In the present embodiment, obtain after output shows the to be switched subtitle file after offset will be navigated to
The to be switched subtitle file for carrying out output display, the to be switched subtitle file is parsed;It obtains described to be switched
The caption information data of subtitle file, obtain current play time stamp and by the current play time stamp with it is described to be cut
It is successively compared at the beginning of changing the caption information item of subtitle file with the end time;Then by the to be switched subtitle text
The time started is less than or equal to current play time stamp in the caption information item of part and current play time stamp is less than
Or rendering display captioned test information is carried out equal to the caption information item of end time;By the subtitle of the to be switched subtitle file
The caption information item that the end time is greater than current play time stamp in information bar is removed, and searches next caption data;
Time started in the caption information item of the to be switched subtitle file is less than to the caption information item of current play time stamp
Caching.
It further, is the refinement the functional block diagram that module is established in Fig. 6 referring to Fig. 9, Fig. 9.
Based on the present invention is based on the switching device first embodiment of subtitle of the present invention, the module 10 of establishing may include:
Acquiring unit 11, the subtitle file for including for obtaining video, and the subtitle file is saved into caching, institute
State the path that subtitle file includes subtitle file content and subtitle file;
Second resolution unit 12, for parsing the subtitle file, according to every subtitle at the beginning of and the end time
Subtitle is split into multiple caption information items, obtains offset, the time started, end time, content of text of caption information item
And renderer property;
Unit 13 is established, for establishing caption information item number according to the path of subtitle file and the offset of caption information item
According to list, and by the beginning of caption information item, end time, content of text and renderer property save to caption information item number
According in list;
Storage unit 14 extracts caption information item for traversing the time attribute of all caption information items parsed
At the beginning of and the end time, according to the caption information item at the beginning of carry out ascending sort, with caption information item
Time attribute is named the caption information item and is saved into caption information data list.
In the present embodiment, the video subtitle file that includes is obtained before player shows first frame, and by the word
Curtain file is saved into caching, and the subtitle file includes the path of subtitle file content and subtitle file.Then successively to institute
The plug-in subtitle file having is parsed, according to every subtitle at the beginning of and the end time subtitle split into multiple subtitles
Information bar, thus to obtain the offset of caption information item, time started, end time, content of text and renderer property, then root
Caption information data list, and opening caption information item are established according to the path of subtitle file and the offset of caption information item
Time beginning, end time, content of text and renderer property are saved into caption information data list, and saving format can be word
Curtain file URL (path), the time started, the end time, content of text, renderer property, offset, as shown in figure 11.Traversal institute
There is a time attribute of the caption information item parsed, at the beginning of obtaining every caption information item and the end time, extracts
At the beginning of the caption information item and the end time, according to the caption information item at the beginning of carry out ascending sort,
It names the caption information item with the time attribute of caption information item and saves and save format into caption information data list
Can be subtitle file URL (path), content of text, renderer property, offset, as shown in figure 12.
Further, 0, Figure 10 illustrates referring to Fig.1 for the functional module of the switching device second embodiment of subtitle of the present invention
Figure.
Switching device first embodiment based on subtitle of the present invention, described device further include:
Judgment module 60, for judge to be switched subtitle file whether be current language subtitle file;
Second display module 70 continues to output if being the subtitle file of current language for be switched subtitle file
Show the subtitle file of current language;
Second obtains module 80, if for be switched subtitle file not being the subtitle file of current language, obtain to
Switch subtitle file.
In the present embodiment, user is during watching video, it may occur that accidentally by the operation of the equipment such as remote controler.When with
When the operation of the equipment such as remote controler is pressed accidentally to switch subtitle in family, it is current language that user, which can choose switching language, to continue
Watch the video of current output language.Therefore the list of caption information data is obtained in the switching subtitle instructions triggered according to user
And before to be switched subtitle file, it is necessary first to judge to be switched subtitle file whether be current language subtitle file, such as
The selected to be switched subtitle of fruit user then can determine whether that user triggers maloperation, without cutting as the subtitle of current language
Language is changed, then continues to output the subtitle of display current language;If user selected to be switched subtitle and current language
Subtitle is different, then obtains to be switched subtitle file.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair
Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills
Art field, is included within the scope of the present invention.
Claims (8)
1. a kind of switching method of subtitle, which is characterized in that the described method comprises the following steps:
The subtitle file that video includes and parsing are obtained, caption information item is obtained, according to the path of the subtitle file and subtitle
The offset of information bar establishes caption information data list;
The path of to be switched subtitle file is obtained according to the switching subtitle instructions that user triggers;
Extract the caption information item for meeting preset condition in the list of caption information data;
Caption information item identical with the path of to be switched subtitle file is searched in the caption strips information extracted, and obtains institute
The address offset amount for stating caption information item reads the caption data of the address offset amount;
The caption data read is carried out output to show;
It is described to obtain the video subtitle file that includes and parsing, obtain caption information item, according to the path of the subtitle file and
The offset of caption information item establishes the step of caption information data list and includes:
The subtitle file that video includes is obtained, and the subtitle file is saved into caching, the subtitle file includes subtitle
The path of file content and subtitle file;
Parse the subtitle file, according to every subtitle at the beginning of and the end time subtitle split into multiple caption informations
Item obtains offset, time started, end time, content of text and the renderer property of caption information item;
Caption information data list is established according to the offset in the path of subtitle file and caption information item, and by caption information
At the beginning of item, end time, content of text and renderer property save into caption information data list;
Traverse the time attribute of all caption information items parsed, at the beginning of extracting caption information item and at the end of
Between, according to the caption information item at the beginning of carry out ascending sort, the word is named with the time attribute of caption information item
Curtain information bar is simultaneously saved into caption information data list.
2. the switching method of subtitle as described in claim 1, which is characterized in that in the extraction caption information data list
The step of meeting the caption information of preset condition include:
Obtain the video data current display time stamp in playing;
By at the beginning of the caption information item in the timestamp and the list of caption information data with the end time respectively into
Row comparison;
If there are the time starteds less than or equal to timestamp and end time for the caption information item in caption information data list
More than or equal to the caption information item of timestamp, then the caption information item is extracted;
If there is no the time starteds in the caption information of caption information data list to be less than or equal to timestamp and end time
More than or equal to the caption information item of timestamp, then extracts and the timestamp is separated by nearest caption information item.
3. the switching method of subtitle as described in claim 1, which is characterized in that described that the caption data read progress is defeated
The step of showing out include:
The to be switched subtitle file for carrying out output display is obtained, the to be switched subtitle file is parsed;
The caption information data of the to be switched subtitle file is obtained, current play time is obtained and stabs and currently broadcast described
It is successively compared at the beginning of putting the caption information item of timestamp and the to be switched subtitle file with the end time;
By the time started in the caption information item of the to be switched subtitle file be less than or equal to the current play time stab and
The caption information item that the current play time stamp is less than or equal to the end time carries out rendering display captioned test information;
End time in the caption information item of the to be switched subtitle file is greater than to the subtitle letter of current play time stamp
It ceases item to remove, and searches next caption data;
Time started in the caption information item of the to be switched subtitle file is less than to the subtitle letter of current play time stamp
Cease item caching.
4. the switching method of subtitle as described in any one of claims 1-3, which is characterized in that the method also includes:
Judge to be switched subtitle file whether be current language subtitle file;
If so, continuing to output the subtitle file of display current language;
If it is not, then obtaining to be switched subtitle file.
5. a kind of switching device of subtitle, which is characterized in that described device includes:
Module is established, for obtaining the subtitle file and parsing that video includes, caption information item is obtained, according to the subtitle file
Path and the offset of caption information item establish caption information data list
First obtains module, and the switching subtitle instructions for being triggered according to user obtain the path of to be switched subtitle file;
Extraction module, for extracting the caption information item for meeting preset condition in caption information data list;
Read module, for searching subtitle letter identical with the path of to be switched subtitle file in the caption strips information extracted
Item is ceased, and obtains the address offset amount of the caption information item, reads the caption data of the address offset amount;
First display module is shown for the caption data read to be carried out output;
The module of establishing includes:
Acquiring unit, the subtitle file for including for obtaining video, and the subtitle file is saved into caching, the subtitle
File includes the path of subtitle file content and subtitle file;
Second resolution unit, for parsing the subtitle file, according to every subtitle at the beginning of and the end time by subtitle
Multiple caption information items are split into, offset, time started, end time, content of text and the rendering of caption information item are obtained
Attribute;
Unit is established, for establishing caption information data column according to the path of subtitle file and the offset of caption information item
Table, and by the beginning of caption information item, end time, content of text and renderer property save to caption information data and arrange
In table;
Storage unit extracts the beginning of caption information item for traversing the time attribute of all caption information items parsed
Time and end time, according to the caption information item at the beginning of carry out ascending sort, belonged to time of caption information item
The life name caption information item is simultaneously saved into caption information data list.
6. the switching device of subtitle as claimed in claim 5, which is characterized in that the extraction module includes:
Acquiring unit, for obtaining the stamp of the video data current display time in playing;
Comparison unit, for by the beginning of the caption information of the timestamp and the list of caption information data at the end of
Between compare respectively;
First extraction unit, if when for being less than or equal in the caption information of caption information data list there are the time started
Between stab and the end time be greater than or equal to timestamp caption information item, then extract the caption information item;
Second extraction unit to be less than or equal to if there is no the time starteds in caption information for caption information data list
Timestamp and end time are greater than or equal to the caption information item of timestamp, then extract and the timestamp is separated by nearest subtitle
Information bar.
7. the switching device of subtitle as claimed in claim 5, which is characterized in that first display module includes:
First resolution unit, for obtaining the to be switched subtitle file for carrying out output display, by the to be switched subtitle text
Part is parsed;
Comparing unit obtains current play time stamp simultaneously for obtaining the caption information data of the to be switched subtitle file
And by the beginning of current play time stamp and the caption information item of the to be switched subtitle file and the end time according to
It is secondary to be compared;
Rendering unit, it is described current for the time started in the caption information item of the to be switched subtitle file to be less than or equal to
The caption information item that play time stamp and current play time stamp are less than or equal to the end time carries out rendering display subtitle
Text information;
Searching unit, when for the end time in the caption information item of the to be switched subtitle file to be greater than described currently playing
Between the caption information item that stabs remove, and search next caption data;
Cache unit, when for the time started in the caption information item of the to be switched subtitle file to be less than described currently playing
Between stab caption information item caching.
8. such as the switching device of the described in any item subtitles of claim 5-7, which is characterized in that described device further include:
Judgment module, for judge to be switched subtitle file whether be current language subtitle file;
Second display module continues to output display and works as if being the subtitle file of current language for be switched subtitle file
The subtitle file of preceding language;
Second obtains module, if not being the subtitle file of current language for be switched subtitle file, obtains to be switched word
Curtain file.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611127290.1A CN106792114B (en) | 2016-12-06 | 2016-12-06 | The switching method and device of subtitle |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611127290.1A CN106792114B (en) | 2016-12-06 | 2016-12-06 | The switching method and device of subtitle |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106792114A CN106792114A (en) | 2017-05-31 |
CN106792114B true CN106792114B (en) | 2019-12-03 |
Family
ID=58882045
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611127290.1A Active CN106792114B (en) | 2016-12-06 | 2016-12-06 | The switching method and device of subtitle |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106792114B (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107864393A (en) * | 2017-11-17 | 2018-03-30 | 青岛海信电器股份有限公司 | The method and device that video is shown with captioning synchronization |
CN108040277B (en) | 2017-12-04 | 2020-08-25 | 海信视像科技股份有限公司 | Subtitle switching method and device for multi-language subtitles obtained after decoding |
CN108495171A (en) * | 2018-04-03 | 2018-09-04 | 优视科技有限公司 | Method for processing video frequency and its device, storage medium, electronic product |
CN112055262B (en) * | 2020-08-11 | 2022-10-21 | 视若飞信息科技(上海)有限公司 | Method and system for displaying network streaming media subtitles |
CN113455012A (en) * | 2020-09-03 | 2021-09-28 | 深圳市大疆创新科技有限公司 | Rendering method, rendering device, mobile terminal and storage medium |
WO2023015416A1 (en) * | 2021-08-09 | 2023-02-16 | 深圳Tcl新技术有限公司 | Subtitle processing method and apparatus, and storage medium |
CN114466219A (en) * | 2021-11-23 | 2022-05-10 | 海信视像科技股份有限公司 | Display device, subtitle data processing method, and storage medium |
CN116886941B (en) * | 2023-06-09 | 2024-03-26 | 北京医百科技有限公司 | Method and device for switching caption content in cloud broadcasting guide station |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102164248A (en) * | 2011-02-15 | 2011-08-24 | Tcl集团股份有限公司 | Automatic caption testing method and system |
EP2416318A1 (en) * | 2010-08-04 | 2012-02-08 | Nero Ag | Multi-language buffering during media playback |
CN102843603A (en) * | 2012-08-17 | 2012-12-26 | Tcl集团股份有限公司 | Intelligent television and method for controlling caption thereof |
CN103117077A (en) * | 2013-01-17 | 2013-05-22 | 广东欧珀移动通信有限公司 | Display system and display method of blu-ray player disc VSFilter |
CN103778929A (en) * | 2012-10-18 | 2014-05-07 | 三星电子株式会社 | Blu-ray disc player and method of displaying subtitles in the Blu-ray disc player |
CN105744346A (en) * | 2014-12-12 | 2016-07-06 | 深圳Tcl数字技术有限公司 | Subtitle switching method and device |
CN106060634A (en) * | 2016-05-31 | 2016-10-26 | 乐视控股(北京)有限公司 | Method and device for displaying rolling subtitles |
-
2016
- 2016-12-06 CN CN201611127290.1A patent/CN106792114B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP2416318A1 (en) * | 2010-08-04 | 2012-02-08 | Nero Ag | Multi-language buffering during media playback |
CN102164248A (en) * | 2011-02-15 | 2011-08-24 | Tcl集团股份有限公司 | Automatic caption testing method and system |
CN102843603A (en) * | 2012-08-17 | 2012-12-26 | Tcl集团股份有限公司 | Intelligent television and method for controlling caption thereof |
CN103778929A (en) * | 2012-10-18 | 2014-05-07 | 三星电子株式会社 | Blu-ray disc player and method of displaying subtitles in the Blu-ray disc player |
CN103117077A (en) * | 2013-01-17 | 2013-05-22 | 广东欧珀移动通信有限公司 | Display system and display method of blu-ray player disc VSFilter |
CN105744346A (en) * | 2014-12-12 | 2016-07-06 | 深圳Tcl数字技术有限公司 | Subtitle switching method and device |
CN106060634A (en) * | 2016-05-31 | 2016-10-26 | 乐视控股(北京)有限公司 | Method and device for displaying rolling subtitles |
Also Published As
Publication number | Publication date |
---|---|
CN106792114A (en) | 2017-05-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106792114B (en) | The switching method and device of subtitle | |
US20080059526A1 (en) | Playback apparatus, searching method, and program | |
KR100792261B1 (en) | System for managing video based on topic and method usign the same and method for searching video based on topic | |
CN102291542B (en) | Multilingual subtitle setting method and device thereof | |
JP5135024B2 (en) | Apparatus, method, and program for notifying content scene appearance | |
KR20070020208A (en) | Method and apparatus for locating content in a program | |
US9813773B2 (en) | Subtitle display method and subtitle display device | |
US20090208184A1 (en) | Video content playback assistance method, video content playback assistance system, and information distribution program | |
CN105744346A (en) | Subtitle switching method and device | |
EP1898643A2 (en) | Method for automatically searching for data applications for all channels and video apparatus adopting the method | |
JP2009010797A (en) | Information presenting method and apparatus | |
JP5197841B1 (en) | Video playback apparatus and video playback method | |
US20100053442A1 (en) | Video processing apparatus and video processing method | |
CN108259963A (en) | A kind of TV ends player | |
KR20130032653A (en) | System and method for serching images using caption of moving picture in keyword | |
CN103414934A (en) | Method and system for terminal to display television program information | |
CN101534386B (en) | Video replacing method, video playing system and device | |
CN101827194A (en) | Method and device for playing television program | |
JP2012249059A (en) | Image processing apparatus and recording apparatus | |
CN114640874A (en) | Subtitle synchronization method and device, set top box and computer readable storage medium | |
CN105791953B (en) | Control method for playing back and device | |
JP2009004872A (en) | One-segment broadcast receiver, one-segment broadcast receiving method and medium recording one-segment broadcast receiving program | |
KR101317079B1 (en) | System and method for changing channel of similar contents | |
CN110475121B (en) | Video data processing method and device and related equipment | |
CN112055262B (en) | Method and system for displaying network streaming media subtitles |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |