Content of the invention
The present invention provides a kind of remote subtitle processing method of intelligent television media player, for solving existing intelligence electricity
It is unable to the problem of direct access remote subtitle file depending on media player.
A kind of a kind of present invention also offers remote subtitle processing meanss of intelligent television media player, and intelligence electricity
Depending on to ensure said method application in practice.
In order to solve the above problems, the invention discloses a kind of remote subtitle process side of intelligent television media player
Method, including:Set up the connection of described intelligent television and remote server;The remote media playing request of receive user;From described
Remote server reads media file to be played, decoded rear generation decoding media data;Described media file to be played includes
Audio file and video file;Whether preserve to be played with described in the file judging described media file place to be played
The corresponding subtitle file of media file, if so, reads from the file that described media file to be played is located and to parse this right
The subtitle file answered, generates caption data;Synthesize described decoding media data and caption data, in described media renderer plays
Output.
Preferably, whether preserve and described matchmaker to be played in judging the file that described media file to be played is located
Before body file corresponding subtitle file step, also include:Judge the default local captions of described intelligent television media player
Subtitle file corresponding with above-mentioned media file to be played whether is preserved in file;If so, from described local subtitle file
Read and parse this corresponding subtitle file in folder, generate caption data, then, turn follow-up data synthesis, play step.
Preferably, judge whether preserve in the file that local subtitle file folder or described media file to be played are located
The method of subtitle file corresponding with described media file to be played, specially:Judge whether that principal name is treated with described
Play media file principal name identical subtitle file.
Preferably, judge whether preserve in the file that local subtitle file folder or described media file to be played are located
The method of subtitle file corresponding with described media file to be played, specially:Judge whether in file name, to comprise institute
State the subtitle file of media file principal name to be played;Wherein, when local subtitle file folder or described media file to be played
When preserving, in the file being located, the subtitle file comprising described media file principal name to be played in multiple file names,
Choose matching degree highest subtitle file as subtitle file corresponding with described media file to be played.
Preferably, judge whether preserve in the file that local subtitle file folder or described media file to be played are located
The method of subtitle file corresponding with described media file to be played, specially:Judge whether in file content, to comprise institute
State the subtitle file of media file principal name to be played;Wherein, when local subtitle file folder or described media file to be played
When preserving, in the file being located, the subtitle file comprising described media file principal name to be played in multiple file contents,
Choose matching degree highest subtitle file as subtitle file corresponding with described media file to be played.
According to another preferred embodiment of the present invention, also disclose at a kind of remote subtitle of intelligent television media player
Reason device, including:Network connection unit, for setting up the connection of described intelligent television and remote server;Playing request receives
Unit, for the remote media playing request of receive user;Media decoding unit, described for reading from described remote server
Media file to be played, decoded rear generation decoding media data;Described media file to be played includes audio file and video
File;First captions acquiring unit, for judging whether preserve and institute in the file that described media file to be played is located
State the corresponding subtitle file of media file to be played, if so, read simultaneously from the file that described media file to be played is located
Parse this corresponding subtitle file, generate caption data;Media play unit, for by described decoding media data and captions number
After synthesis, in the output of described media renderer plays.
Preferably, also include:Second captions acquiring unit, for judging default of described intelligent television media player
Subtitle file corresponding with above-mentioned media file to be played whether is preserved in ground subtitle file folder;If so, directly from described
Read in ground subtitle file folder and parse this corresponding subtitle file, call media play unit synthesis, play described decoding matchmaker
Volume data and caption data.
Preferably, described first captions acquiring unit specifically includes:First subtitle file searches subelement, for following
Mode searches subtitle file corresponding with described media file to be played from the file that described media file to be played is located:
Search principal name and described media file principal name identical subtitle file to be played;Or, comprising in locating file title
The subtitle file of described media file principal name to be played, when preserving in the file that described media file to be played is located
Comprise in multiple file names described media file principal name to be played subtitle file when, choose matching degree highest captions
File is as subtitle file corresponding with described media file to be played;Or, comprising described matchmaker to be played in locating file content
The subtitle file of body document body title, as guarantor in the file at local subtitle file folder or described media file place to be played
Have when comprising the subtitle file of described media file principal name to be played in multiple file contents, choose matching degree highest
Subtitle file is as subtitle file corresponding with described media file to be played;First subtitle file parsing subelement, for from
Read and parse this corresponding subtitle file in the file that described media file to be played is located, generate caption data.
Preferably, described second captions acquiring unit specifically includes:Second subtitle file searches subelement, for following
Mode searches subtitle file corresponding with described media file to be played from described local subtitle file presss from both sides:Search principal name
With described media file principal name identical subtitle file to be played;Or, comprising described matchmaker to be played in locating file title
The subtitle file of body document body title, when preserving multiple file names in the file that described media file to be played is located
In comprise described media file principal name to be played subtitle file when, choose matching degree highest subtitle file as with institute
State the corresponding subtitle file of media file to be played;Or, comprising described media file main body name to be played in locating file content
The subtitle file claiming, when preserving multiple files in the file that local subtitle file folder or described media file to be played are located
Comprise in content described media file principal name to be played subtitle file when, choose matching degree highest subtitle file conduct
Subtitle file corresponding with described media file to be played;Second subtitle file parsing subelement, for from described local captions
Read and parse this corresponding subtitle file in file, generate caption data.
According to the further preferred embodiment of the present invention, disclose a kind of intelligent television, including any one intelligence electricity above-mentioned
Remote subtitle processing meanss depending on media player.
Compared with prior art, the present invention has advantages below:
The remote server file folder passing through to be located in the preferred embodiment of the present invention from media file to be played obtains corresponding
Subtitle file mode, it is possible to resolve, before playing above-mentioned audio-video document, needing will its corresponding captions literary composition for prior art
Part is saved in default subtitle file folder, otherwise cannot normally show the problem of caption content.
Specific embodiment
Understandable for enabling the above objects, features and advantages of the present invention to become apparent from, below in conjunction with the accompanying drawings and specifically real
The present invention is further detailed explanation to apply mode.It is pointed out that the enforcement in the case of not conflicting, in the present invention
Feature in example and embodiment can be mutually combined, and forms new technical scheme.
With reference to Fig. 1, show the stream of remote subtitle processing method one embodiment of intelligent television media player of the present invention
Journey, specifically includes following steps:
Step S101:Set up the connection of intelligent television and remote server;
In the present invention program, described remote server can be the webserver or intelligence on the Internet
The webserver in local area network that TV is located, can also be the shared file server in local area network.
Step S102:The remote media playing request of receive user;
According to the type of the media file to be played preserving in remote server, the above-mentioned remote media playing request of user
Can be audio frequency playing request, video playback request or other kinds of multimedia file playing request.
Step S103:Read media file to be played, decoded rear generation decoding media data from described remote server;
Above-mentioned media file to be played can be audio file, video file or other kinds of multimedia file;
When being decoded to media file to be played, because the media file of different-format is to should have different decoding sides
Method, therefore, before media file is decoded, can determine the form of media file to be played first, then further according to
The corresponding decoding process of file format, is decoded to media file to be played.Treat wherein it is possible to determine in several ways
Play the form of media file, for example, it is possible to obtain it is also possible to according to media number according to the suffix name of media file to be played
According in related pattern information(As File header information)Obtain., video file is to be moved by video taking video file to be played as a example
State image composition, but actually dynamic image is according to regular hour order arrangement group by still image one by one
Become, it is simply that playing still image according to this time sequencing, due to the time interval between each frame during playing
Very short, therefore, finally give the result of broadcast of continuous dynamic play.That is, for video file, wherein comprising
Information not only include the data content of each two field picture(Such as display content in each pixel etc.), also include each two field picture pair
The temporal information answered.Therefore, after media file to be played is decoded, can obtain in the concrete data of each two field picture
Hold and corresponding temporal information.For temporal information, in follow-up being synthesized with subtitle file of the embodiment of the present invention
For step, have great importance, hereinafter have and introduce in detail.
Step S106:Judge whether preserve and described matchmaker to be played in the file that described media file to be played is located
The corresponding subtitle file of body file, if so, goes to step S107;Otherwise, directly play and export above-mentioned decoding media data;
Subtitle file of the present invention is usually the single file existing independent of media file to be played, and
There is specific file format, for example, srt, ssa, ass, sup etc..Wherein, it is most commonly used that srt form and ssa form,
Srt form is simple timing code and content of text, and ssa can make the specially good effect of some, such as the size of specific font,
Color and some simple animations(Roll, move ...)Deng.In actual applications, subtitle file be probably some users voluntarily
Make, or typically also have the special provider making subtitle file, etc..In a word, for same media literary composition to be played
For part, relevant folder there may be the available subtitle file of one or more parts.
For the relatedness judgment mode of media file to be played and subtitle file, can adopt but be not limited to following judgements
Mode or a combination thereof:
Mode one, filename accurately mate mode.Generally, subtitle file and media file to be played can have phase
With file body name, therefore, if subtitle file is identical with the title of media file to be played, using subtitle file as with
The subtitle file of this media file association to be played.
Mode two, filename fuzzy match mode.Some subtitle file names can be more than the main body name of media file to be played
Go out some contents, the content for example having more is probably the mark of subtitle language type, e.g., chs(Chinese Simplified)
Represent simplified form of Chinese Character, cht(Chinese Traditional)Represent Chinese-traditional, eng(English)Represent English subtitles.Example
As the filename of certain subtitle file is probably " video 1.chs.srt ", and the filename of media file to be played is probably " gold
Three armed escorts. rmvb " that is to say, that subtitle file name is incomplete same with media file name to be played, but subtitle file
Comprise media file main body name to be played in filename, now, be usually corresponding same video between the two, there is association and close
System.Therefore, if including media file main body name to be played in subtitle file title, this subtitle file is treated as with this
Play the subtitle file of media file association;
In the preferred embodiment, when preserving in multiple file names bag in the file that media file to be played is located
During subtitle file containing described media file principal name to be played, choose matching degree highest subtitle file and treat as with described
Play the corresponding subtitle file of media file.With regard to the determination mode of matching degree, after this preferred embodiment is based on subtitle file
Sew title and time suffix title judges:The principal name of subtitle file is the character string before first point, and suffix is entitled
Character string after a point afterwards, the entitled character string between last point and penultimate point of secondary suffix, if word
Curtain filename only one of which point, secondly entitled sky of suffix, e.g., the principal name of subtitle file " video 1.chs.srt " be " depending on
Frequently 1 ", suffix entitled " srt ", secondary suffix is entitled " chs ";The principal name of subtitle file " video 2.ssa " is " video
2 ", suffix entitled " ssa ", the entitled sky of secondary suffix.In this preferred embodiment, the suffix title first according to file sorts
(As by from high to low order be respectively srt, ssa,...), then sort further according to secondary suffix title(As by from high to low
Order be respectively chs, cht, eng,...).
Mode three, content fuzzy match mode, if include media file main body to be played in subtitle file content
Name, then using this subtitle file as the subtitle file associating with this media file to be played.
Similar with mode two, comprise institute in multiple file contents when preserving in the file that media file to be played is located
State media file principal name to be played subtitle file when, choose matching degree highest subtitle file as to be played with described
The corresponding subtitle file of media file.With regard to the determination mode of matching degree, the suffix name based on subtitle file for this preferred embodiment
Claim and time suffix title judges:The principal name of subtitle file is the character string before first point, suffix entitled last
Character string after individual point, the entitled character string between last point and penultimate point of secondary suffix, if captions are civilian
Part name only one of which point, the secondly entitled sky of suffix, e.g., the principal name of subtitle file " video 1.chs.srt " is " video
1 ", suffix entitled " srt ", secondary suffix is entitled " chs ";The principal name of subtitle file " video 2.ssa " is " video 2 ",
Suffix entitled " ssa ", the entitled sky of secondary suffix.In this preferred embodiment, the suffix title first according to file sorts(As pressed
Order from high to low be respectively srt, ssa,...), then sort further according to secondary suffix title(As by order from high to low
Be respectively chs, cht, eng,...).It is of course also possible to determine the matching degree of subtitle file using other modes, the present invention refuses
Limit.
Step S107:Read and parse this corresponding captions literary composition from the file that described media file to be played is located
Part, generates caption data;
Step S108:Synthesize above-mentioned decoding media data and caption data, in the output of described media renderer plays.
Also temporal information is included, this is just to carry with the synthesis of the decoding media data of media file to be played in subtitle file
Supply basis.In order to make it easy to understand, illustrating to as a example text formatting subtitle file below.The extension name of text formatting captions
Typically srt, smi, ssa or sub, wherein srt text subtitle is most popular, and it makes and modification is very simple:When one
Between+one captions of code.As for following srt subtitle file contents:
45
00:02:52,184 --> 00:02:53,617
Take your time
Represent:45th row captions, the display time start from audio frequency and video the 2nd point 52.184 seconds to the 2nd point 53.617 seconds, word
Curtain content be:Take your time.
Therefore, in the generating process of generated data stream, each can wrap according in decoding media data and caption content
Corresponding relation between the temporal information containing(As decoding data is consistent with the timestamp in caption content attribute), media will be decoded
Data is superimposed with corresponding caption content.
The present invention is by above-mentioned technological means, it is possible to resolve prior art play above-mentioned audio-video document before, need by
Its corresponding subtitle file is saved in default subtitle file folder, otherwise cannot normally show the problem of caption content.
In a further preferred embodiment of this method embodiment, for improving response speed, saving network traffics,
Also contemplate the situation that intelligent television locally whether there is the corresponding subtitle file of media file to be played.For this reason, at this preferably
In embodiment, before step S106, also include step S104 and step S105, wherein:
Step S104:Judge whether to preserve in intelligent television media player default local subtitle file folder with above-mentioned
The corresponding subtitle file of media file to be played;If so, go to step S105;Otherwise, go to step S106;
With regard to subtitle file relatedness judgment mode, similar with remote subtitle ff mode mentioned above.
Step S105:Read and parse this corresponding subtitle file from described local subtitle file presss from both sides, generate captions number
According to;Go to step S108.
It should be noted that for aforesaid each method embodiment, simple in order to describe, therefore it is all expressed as a series of
Combination of actions, but those skilled in the art should know, the present invention is not limited by described sequence of movement, because
It is according to the present invention, some steps serially or simultaneously can be executed using other;As above-mentioned steps S106 and S107(I.e. captions literary composition
The lookup of part, reading and resolving)Can be in step S103(The i.e. reading of media file to be played, decoding process)Before,
Carry out afterwards or simultaneously.Secondly, those skilled in the art also should know, said method embodiment belongs to preferred embodiment,
Necessary to involved action and the module not necessarily present invention.
With reference to Fig. 2, show the remote subtitle processing meanss first embodiment of intelligent television media player of the present invention
Structural representation.In this preferred embodiment, obtained corresponding by the remote server file folder being located from media file to be played
Subtitle file mode, it is possible to resolve, before playing above-mentioned audio-video document, needing will its corresponding captions literary composition for prior art
Part is saved in default subtitle file folder, otherwise cannot normally show the problem of caption content.This device embodiment includes:
Network connection unit 21, for setting up the connection of intelligent television and remote server;
Playing request receiving unit 23, for the remote media playing request of receive user;
Media decoding unit 25, for reading described media file to be played from described remote server, decoded rear raw
Become decoding media data;Described media file to be played includes audio file and video file;
First captions acquiring unit 27, for judging whether preserve in the file that described media file to be played is located
Subtitle file corresponding with described media file to be played, if so, reads from the file that described media file to be played is located
Take and parse this corresponding subtitle file, generate caption data;
In the preferred embodiment, the first captions acquiring unit 27 specifically includes the first subtitle file and searches subelement 271
Parse subelement 272 with the first subtitle file, wherein:
First subtitle file searches subelement 271, for the literary composition being located from described media file to be played with the following methods
Subtitle file corresponding with described media file to be played is searched in part folder:Search principal name and described media file to be played
Principal name identical subtitle file;Or, comprising the captions of described media file principal name to be played in locating file title
File, comprises described media to be played when preserving in the file that described media file to be played is located in multiple file names
During the subtitle file of document body title, choose matching degree highest subtitle file as corresponding with described media file to be played
Subtitle file;Or, comprising the subtitle file of described media file principal name to be played in locating file content, when local word
Preserve in the file that curtain file or described media file to be played are located comprise in multiple file contents described to be played
During the subtitle file of media file principal name, choose matching degree highest subtitle file as with described media file to be played
Corresponding subtitle file;
First subtitle file parsing subelement 272, for reading from the file that described media file to be played is located
And parse this corresponding subtitle file, generate caption data.
Media play unit 20, after synthesizing decoding media data and caption data, broadcasts in described media player
Put output.
With reference to Fig. 3, show the remote subtitle processing meanss second embodiment of intelligent television media player of the present invention
Structural representation.In this preferred embodiment, for improving response speed, saving network traffics, this device embodiment is removed described in Fig. 2
Network connection unit 21 included by first device embodiment, playing request receiving unit 23, media decoding unit 25, the first word
Outside curtain acquiring unit 27 and media play unit 20, also include:
Second captions acquiring unit 29, for reading to obtain caption data from remote server in the first captions acquiring unit 27
Before, judge whether preserve and above-mentioned media literary composition to be played in the default local subtitle file folder of intelligent television media player
The corresponding subtitle file of part;If so, directly from described local subtitle file presss from both sides, read and parse this corresponding subtitle file, raw
Become caption data, then call media play unit 20 to synthesize, play above-mentioned decoding media data and caption data.
In the preferred embodiment, the second captions acquiring unit 29 specifically includes the second subtitle file and searches subelement 291
Parse subelement 292 with the second subtitle file, wherein:
Second subtitle file searches subelement 291, for search from described local subtitle file presss from both sides with the following methods with
The corresponding subtitle file of described media file to be played:Search principal name identical with described media file principal name to be played
Subtitle file;Or, comprising the subtitle file of described media file principal name to be played in locating file title, treat when described
Play to preserve in the file that media file is located and in multiple file names, comprise described media file principal name to be played
Subtitle file when, choose matching degree highest subtitle file as subtitle file corresponding with described media file to be played;
Or, comprising the subtitle file of described media file principal name to be played in locating file content, when local subtitle file folder or
Preserve in the file that described media file to be played is located and in multiple file contents, comprise described media file master to be played
During the subtitle file of body title, choose matching degree highest subtitle file as captions corresponding with described media file to be played
File;
Second subtitle file parsing subelement 292, for reading in pressing from both sides from described local subtitle file and parsing this correspondence
Subtitle file, generate caption data.
In addition, the invention also discloses a kind of intelligent television including said apparatus, in playing remote server
During media file to be played, automatically can obtain subtitle file from the file that remotely media file to be played is located, solve intelligence
Energy TV, before playing above-mentioned media file to be played, needs for its corresponding subtitle file to be saved in default subtitle file
In folder, otherwise cannot normally show the problem of caption content.This intelligent television can be configured using following:
Operating system:Using Android operation system 4.0 or more version;
Master chip:Using integral intelligent TV master chip, dominant frequency is not less than 800MHz, ARM framework, carries DSP(Video is hard
Decoding);
Internal memory:Using the DDR2 being not less than 256MB;
Internal storage device:Using Nand flash memory or EMC flash memory, capacity is not less than 2G;
External apparatus interface:Including at least 2 USB port, USB flash disk can be connected, portable hard drive, keyboard, mouse, wireless key mouse connect
Receive device, Wi-Fi wireless network card, game paddle etc.;
Remote control:At least there is the buttons such as upper and lower, left and right, confirmation, return, menu, Home, ten key;
LCDs:Resolution is not less than 1280*720.
It should be noted that said apparatus embodiment belongs to preferred embodiment, involved unit and module might not
It is necessary to the present invention.
Each embodiment in this specification is all described by the way of going forward one by one, what each embodiment stressed be with
The difference of other embodiment, between each embodiment identical similar partly mutually referring to.Dress for the present invention
For putting embodiment, due to itself and embodiment of the method basic simlarity, so description is fairly simple, real referring to method in place of correlation
The part applying example illustrates.
Remote subtitle processing method to a kind of intelligent television provided by the present invention and its media player and dress above
Put, be described in detail, specific case used herein is set forth to the principle of the present invention and embodiment, above
The explanation of embodiment is only intended to help and understands the method for the present invention and its core concept;General skill simultaneously for this area
Art personnel, according to the thought of the present invention, all will change in specific embodiments and applications, in sum, this
Description should not be construed as limitation of the present invention.