Summary of the invention
The invention provides a kind of long-range method for processing caption of intelligent television media player, for solving existing intelligent television media player, can not directly obtain the problem of long-range subtitle file.
The present invention also provides a kind of long-range captions process device of intelligent television media player, and a kind of intelligent television, to guarantee said method application in practice.
In order to address the above problem, the invention discloses a kind of long-range method for processing caption of intelligent television media player, comprising: set up being connected of described intelligent television and remote server; Receive user's remote media playing request; From described remote server, read media file to be played, after decoding, generate decoding media data; Described media file to be played comprises audio file and video file; Judge in the file at described media file to be played place and whether preserve the subtitle file corresponding with described media file to be played, if, from the file at described media file to be played place, read and resolve this corresponding subtitle file, generate caption data; Synthetic described decoded media data and caption data, in described media renderer plays output.
Preferably, whether preserve the subtitle file step corresponding with described media file to be played in the file that judges described media file to be played place before, also comprise: judge in the default local subtitle file folder of described intelligent television media player whether preserve the subtitle file corresponding with above-mentioned media file to be played; If so, from described local subtitle file folder, read and resolve this corresponding subtitle file, generate caption data, then, turn follow-up data and synthesize, play step.
Preferably, judge the method for whether preserving the subtitle file corresponding with described media file to be played in the file at local subtitle file folder or described media file to be played place, be specially: judge whether the subtitle file that exists principal name identical with described media file principal name to be played.
Preferably, judge the method for whether preserving the subtitle file corresponding with described media file to be played in the file at local subtitle file folder or described media file to be played place, be specially: judge whether to exist the subtitle file that comprises described media file principal name to be played in file name; Wherein, while preserving the subtitle file that comprises described media file principal name to be played in a plurality of file names in the file at local subtitle file folder or described media file to be played place, choose subtitle file that matching degree is the highest as the subtitle file corresponding with described media file to be played.
Preferably, judge the method for whether preserving the subtitle file corresponding with described media file to be played in the file at local subtitle file folder or described media file to be played place, be specially: judge whether to exist the subtitle file that comprises described media file principal name to be played in file content; Wherein, while preserving the subtitle file that comprises described media file principal name to be played in a plurality of file contents in the file at local subtitle file folder or described media file to be played place, choose subtitle file that matching degree is the highest as the subtitle file corresponding with described media file to be played.
According to another preferred embodiment of the present invention, a kind of long-range captions process device of intelligent television media player is also disclosed, comprising: network connection unit, for setting up being connected of described intelligent television and remote server; Playing request receiving element, for receiving user's remote media playing request; Media decodes unit for read described media file to be played from described remote server, generates decoding media data after decoding; Described media file to be played comprises audio file and video file; The first captions acquiring unit, for judging whether the file at described media file to be played place preserves the subtitle file corresponding with described media file to be played, if, from the file at described media file to be played place, read and resolve this corresponding subtitle file, generate caption data; Media play unit, after synthetic by described decoded media data and caption data, in described media renderer plays output.
Preferably, also comprise: the second captions acquiring unit, for judging whether the default local subtitle file folder of described intelligent television media player preserves the subtitle file corresponding with above-mentioned media file to be played; If so, directly from described local subtitle file folder, read and resolve this corresponding subtitle file, call media play unit and synthesize, play described decoded media data and caption data.
Preferably, described the first captions acquiring unit specifically comprises: the first subtitle file is searched subelement, for searching the subtitle file corresponding with described media file to be played from the file at described media file to be played place with the following methods: search the subtitle file that principal name is identical with described media file principal name to be played; Or, the subtitle file that comprises described media file principal name to be played in locating file title, while preserving the subtitle file that comprises described media file principal name to be played in a plurality of file names in the file at described media file to be played place, choose subtitle file that matching degree is the highest as the subtitle file corresponding with described media file to be played; Or, the subtitle file that comprises described media file principal name to be played in locating file content, while preserving the subtitle file that comprises described media file principal name to be played in a plurality of file contents in the file at local subtitle file folder or described media file to be played place, choose subtitle file that matching degree is the highest as the subtitle file corresponding with described media file to be played; The first subtitle file is resolved subelement, for reading and resolve this corresponding subtitle file from the file at described media file to be played place, generates caption data.
Preferably, described the second captions acquiring unit specifically comprises: the second subtitle file is searched subelement, for searching the subtitle file corresponding with described media file to be played from described local subtitle file folder with the following methods: search the subtitle file that principal name is identical with described media file principal name to be played; Or, the subtitle file that comprises described media file principal name to be played in locating file title, while preserving the subtitle file that comprises described media file principal name to be played in a plurality of file names in the file at described media file to be played place, choose subtitle file that matching degree is the highest as the subtitle file corresponding with described media file to be played; Or, the subtitle file that comprises described media file principal name to be played in locating file content, while preserving the subtitle file that comprises described media file principal name to be played in a plurality of file contents in the file at local subtitle file folder or described media file to be played place, choose subtitle file that matching degree is the highest as the subtitle file corresponding with described media file to be played; The second subtitle file is resolved subelement, for reading and resolve this corresponding subtitle file from described local subtitle file folder, generates caption data.
According to an also preferred embodiment of the present invention, a kind of intelligent television is disclosed, comprise the long-range captions process device of above-mentioned any one intelligent television media player.
Compared with prior art, the present invention has the following advantages:
In the preferred embodiment of the present invention, by the remote server file folder from media file to be played place, obtain the mode of corresponding subtitle file, can solve prior art before playing above-mentioned audio-video document, its corresponding subtitle file need to be saved in default subtitle file folder, otherwise cannot normally show the problem of caption content.
Embodiment
For above-mentioned purpose of the present invention, feature and advantage can be become apparent more, below in conjunction with the drawings and specific embodiments, the present invention is further detailed explanation.It is pointed out that in the situation that not conflicting, embodiment and the feature in embodiment in the present invention can combine mutually, form new technical scheme.
With reference to Fig. 1, show the flow process of long-range method for processing caption one embodiment of intelligent television media player of the present invention, specifically comprise the following steps:
Step S101: set up being connected of intelligent television and remote server;
In the present invention program, described remote server can be the webserver on internet, can be also the webserver in the local area network at intelligent television place, can also be the shared file server in local area network.
Step S102: the remote media playing request that receives user;
According to the type of the media file to be played of preserving in remote server, user's above-mentioned remote media playing request can be the multimedia file playing request of audio frequency playing request, video playback request or other types.
Step S103: read media file to be played from described remote server, generate decoding media data after decoding;
Above-mentioned media file to be played can be the multimedia file of audio file, video file or other types;
When media file to be played is decoded, because the media file of different-format is to there being different coding/decoding methods, therefore, before media file is decoded, can first determine the form of media file to be played, and then the decoding process corresponding according to file format, media file to be played is decoded.Wherein, can determine in several ways the form of media file to be played, for example, can obtain according to the suffix name of media file to be played, also can obtain according to the related pattern information in media data (as file header information).Take video file to be played as example, video file is comprised of video dynamic image, but in fact dynamic image is to be rearranged according to regular hour order by still image one by one, in the process of playing, be exactly to play still image according to this time sequencing, because the time interval between each frame is very short, therefore, finally obtain the result of broadcast of continuous dynamic play.That is to say, for video file, the information wherein comprising not only comprises the data content (such as displaying contents in each pixel etc.) of each two field picture, also comprises the temporal information that each two field picture is corresponding.Therefore,, after media file to be played is decoded, can obtain concrete data content and the corresponding temporal information of each two field picture.For temporal information, the embodiment of the present invention follow-up with the step such as subtitle file synthesizes, have great importance, have hereinafter at length and introduce.
Step S106: judge in the file at described media file to be played place whether preserve the subtitle file corresponding with described media file to be played, if so, go to step S107; Otherwise, play-over the above-mentioned decoded media data of output;
Subtitle file of the present invention is to be generally independent of media file to be played and the independent file that exists, and has specific file format, for example, and srt, ssa, ass, sup etc.Wherein, the most frequently used is srt form and ssa form, and srt form is simple timing code and content of text, and ssa can make the special efficacy of some, as (the rolling, mobile of the size of specific font, color and some simple animations ...) etc.In actual applications, subtitle file may be some user's self manufacture, or generally also has the provider of special making subtitle file, etc.In a word, for same media file to be played, in relevant folder, may there are a or many parts of available subtitle files.
For the relevance judgment mode of media file to be played and subtitle file, can adopt but be not limited to following judgment mode or its combination:
Mode one, filename exact matching mode.Generally, subtitle file can have identical filename main body with media file to be played, therefore, if subtitle file is identical with the title of media file to be played, using subtitle file as the subtitle file associated with this media file to be played.
Mode two, filename fuzzy matching mode.Some subtitle file names can have more some contents than the main body name of media file to be played, the content for example having more may be the sign of subtitle language type, as, chs(Chinese Simplified) represent simplified form of Chinese Character, cht(Chinese Traditional) represent Chinese-traditional, eng(English) represent English subtitles.For example, the filename of certain subtitle file may be " video 1.chs.srt ", the filename of media file to be played may be " The Good The Bad and The Ugly. rmvb ", that is to say, subtitle file name and media file name to be played are incomplete same, but in the filename of subtitle file, comprise media file main body name to be played, now, be generally corresponding same video between the two, there is incidence relation.Therefore, if include media file main body name to be played in subtitle file title, using this subtitle file as the subtitle file associated with this media file to be played;
In this preferred embodiment, while preserving the subtitle file that comprises described media file principal name to be played in a plurality of file names in the file at media file to be played place, choose subtitle file that matching degree is the highest as the subtitle file corresponding with described media file to be played.Definite mode about matching degree, the suffix title of this preferred embodiment based on subtitle file and time suffix title judgement: the principal name of subtitle file is the character string before first point, suffix name is called the character string after last point, inferior suffix name is called the character string between last point and penultimate point, if subtitle file name only has a point, secondly suffix name is called sky, as, the principal name of subtitle file " video 1.chs.srt " is " video 1 ", suffix name is called " srt ", and inferior suffix name is called " chs "; The principal name of subtitle file " video 2.ssa " is " video 2 ", and suffix name is called " ssa ", and inferior suffix name is called sky.In this preferred embodiment, first according to the suffix title sequence of file (as the order by be from high to low respectively srt, ssa.。。), and then according to the sequence of inferior suffix title (as the order by be from high to low respectively chs, cht, eng.。。)。
Mode three, content fuzzy matching mode, if include media file main body name to be played in subtitle file content, using this subtitle file as the subtitle file associated with this media file to be played.
Similar with mode two, while preserving the subtitle file that comprises described media file principal name to be played in a plurality of file contents in the file at media file to be played place, choose subtitle file that matching degree is the highest as the subtitle file corresponding with described media file to be played.Definite mode about matching degree, the suffix title of this preferred embodiment based on subtitle file and time suffix title judgement: the principal name of subtitle file is the character string before first point, suffix name is called the character string after last point, inferior suffix name is called the character string between last point and penultimate point, if subtitle file name only has a point, secondly suffix name is called sky, as, the principal name of subtitle file " video 1.chs.srt " is " video 1 ", suffix name is called " srt ", and inferior suffix name is called " chs "; The principal name of subtitle file " video 2.ssa " is " video 2 ", and suffix name is called " ssa ", and inferior suffix name is called sky.In this preferred embodiment, first according to the suffix title sequence of file (as the order by be from high to low respectively srt, ssa.。。), and then according to the sequence of inferior suffix title (as the order by be from high to low respectively chs, cht, eng.。。)。Certainly, also can adopt other modes to determine the matching degree of subtitle file, the present invention will not limit.
Step S107: read and resolve this corresponding subtitle file from the file at described media file to be played place, generate caption data;
Step S108: synthetic above-mentioned decoded media data and caption data, in described media renderer plays output.
In subtitle file, also include temporal information, this just provides the foundation for the decoded media data with media file to be played are synthetic.For the ease of understanding, to text formatting subtitle file, be that example describes below.The extension name of text formatting captions is srt, smi, ssa or sub normally, and wherein srt text subtitle is most popular, and its making and modification are very simple: time code+mono-captions.As, for following srt subtitle file content:
45
00:02:52,184?-->?00:02:53,617
take your time
Represent: the 45th row captions, the 2nd minute 52.184 seconds to the 2nd minute and 53.617 seconds of starting from audio frequency and video of displaying time, caption content is: take your time.
Therefore, in the generative process of generated data stream, can, according to decoded media data and the corresponding relation between each self-contained temporal information in caption content (as consistent in the timestamp in decoded data and caption content attribute), decoded media data be superimposed with corresponding caption content.
The present invention is by above-mentioned technological means, can solve prior art before playing above-mentioned audio-video document, its corresponding subtitle file need to be 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 considered whether intelligent television this locality exists the situation of the subtitle file that media file to be played is corresponding.For this reason, in this preferred embodiment, before step S106, also comprise step S104 and step S105, wherein:
Step S104: judge in the default local subtitle file folder of intelligent television media player whether preserve the subtitle file corresponding with above-mentioned media file to be played; If so, go to step S105; Otherwise, go to step S106;
About subtitle file relevance judgment mode, to search mode similar with long-range subtitle file mentioned above.
Step S105: read and resolve this corresponding subtitle file from described local subtitle file folder, generate caption data; Go to step S108.
It should be noted that, for aforesaid each embodiment of the method, simple in order to describe, therefore it is all expressed as to a series of combination of actions, but those skilled in the art should know, the present invention is not subject to the restriction of described sequence of movement, because according to the present invention, some step can adopt other orders or carry out simultaneously; If above-mentioned steps S106 and S107(are searching, read and resolving of subtitle file) can be the reading of media file to be played, decode procedure at step S103() carry out before, afterwards or simultaneously.Secondly, those skilled in the art also should know, said method embodiment all belongs to preferred embodiment, and related action and module might not be that the present invention is necessary.
With reference to Fig. 2, show the structural representation of long-range captions process device first embodiment of intelligent television media player of the present invention.In this preferred embodiment, by the remote server file folder from media file to be played place, obtain the mode of corresponding subtitle file, can solve prior art before playing above-mentioned audio-video document, its corresponding subtitle file need to be saved in default subtitle file folder, otherwise cannot normally show the problem of caption content.This device embodiment comprises:
Network connection unit 21, for setting up being connected of intelligent television and remote server;
Playing request receiving element 23, for receiving user's remote media playing request;
Media decodes unit 25 for read described media file to be played from described remote server, generates decoding media data after decoding; Described media file to be played comprises audio file and video file;
The first captions acquiring unit 27, for judging whether the file at described media file to be played place preserves the subtitle file corresponding with described media file to be played, if, from the file at described media file to be played place, read and resolve this corresponding subtitle file, generate caption data;
In this preferred embodiment, the first captions acquiring unit 27 specifically comprises that the first subtitle file is searched subelement 271 and the first subtitle file is resolved subelement 272, wherein:
The first subtitle file is searched subelement 271, for searching the subtitle file corresponding with described media file to be played from the file at described media file to be played place with the following methods: search the subtitle file that principal name is identical with described media file principal name to be played; Or, the subtitle file that comprises described media file principal name to be played in locating file title, while preserving the subtitle file that comprises described media file principal name to be played in a plurality of file names in the file at described media file to be played place, choose subtitle file that matching degree is the highest as the subtitle file corresponding with described media file to be played; Or, the subtitle file that comprises described media file principal name to be played in locating file content, while preserving the subtitle file that comprises described media file principal name to be played in a plurality of file contents in the file at local subtitle file folder or described media file to be played place, choose subtitle file that matching degree is the highest as the subtitle file corresponding with described media file to be played;
The first subtitle file is resolved subelement 272, for reading and resolve this corresponding subtitle file from the file at described media file to be played place, generates caption data.
Media play unit 20, after synthetic by decoded media data and caption data, in described media renderer plays output.
With reference to Fig. 3, show the structural representation of long-range captions process device second embodiment of intelligent television media player of the present invention.In this preferred embodiment, for improving response speed, saving network traffics, this device embodiment, except the included network connection unit 21 of the first device embodiment described in Fig. 2, playing request receiving element 23, media decodes unit 25, the first captions acquiring unit 27 and media play unit 20, also comprises:
The second captions acquiring unit 29, for before the first captions acquiring unit 27 reads to obtain caption data from remote server, judge in the default local subtitle file folder of intelligent television media player whether preserve the subtitle file corresponding with above-mentioned media file to be played; If so, directly from described local subtitle file folder, read and resolve this corresponding subtitle file, generate caption data, then call media play unit 20 and synthesize, play above-mentioned decoded media data and caption data.
In this preferred embodiment, the second captions acquiring unit 29 specifically comprises that the second subtitle file is searched subelement 291 and the second subtitle file is resolved subelement 292, wherein:
The second subtitle file is searched subelement 291, for searching the subtitle file corresponding with described media file to be played from described local subtitle file folder with the following methods: search the subtitle file that principal name is identical with described media file principal name to be played; Or, the subtitle file that comprises described media file principal name to be played in locating file title, while preserving the subtitle file that comprises described media file principal name to be played in a plurality of file names in the file at described media file to be played place, choose subtitle file that matching degree is the highest as the subtitle file corresponding with described media file to be played; Or, the subtitle file that comprises described media file principal name to be played in locating file content, while preserving the subtitle file that comprises described media file principal name to be played in a plurality of file contents in the file at local subtitle file folder or described media file to be played place, choose subtitle file that matching degree is the highest as the subtitle file corresponding with described media file to be played;
The second subtitle file is resolved subelement 292, for reading and resolve this corresponding subtitle file from described local subtitle file folder, generates caption data.
In addition, the invention also discloses a kind of intelligent television that includes said apparatus, during media file to be played in playing remote server, can automatically from the file at long-range media file to be played place, obtain subtitle file, solved intelligent television before playing above-mentioned media file to be played, its corresponding subtitle file need to be saved in default subtitle file folder, otherwise cannot normally show the problem of caption content.This intelligent television can adopt following configuration:
Operating system: adopt Android operating system 4.0 or above version;
Master chip: adopt integral intelligent TV master chip, dominant frequency is not less than 800MHz, ARM framework, band DSP(video hard decoder);
Internal memory: adopt the DDR2 that is not less than 256MB;
Internal storage device: adopt Nand flash memory or EMC flash memory, capacity is not less than 2G;
External apparatus interface: comprise at least 2 USB mouths, can connect USB flash disk, portable hard drive, keyboard, mouse, cordless key mouse receiver, Wi-Fi wireless network card, game paddle etc.;
Remote controller: at least there are upper and lower, left and right, confirm, return, the button such as menu, Home, ten key;
LCDs: resolution is not less than 1280*720.
It should be noted that, said apparatus embodiment belongs to preferred embodiment, and related unit and module might not be that the present invention is necessary.
Each embodiment in this specification all adopts the mode of going forward one by one to describe, and each embodiment stresses is the difference with other embodiment, between each embodiment identical similar part mutually referring to.For device embodiment of the present invention, because it is substantially similar to embodiment of the method, so description is fairly simple, relevant part is referring to the part explanation of embodiment of the method.
Long-range method for processing caption and device to a kind of intelligent television provided by the present invention and media player thereof above, be described in detail, applied specific case herein principle of the present invention and execution mode are set forth, the explanation of above embodiment is just for helping to understand method of the present invention and core concept thereof; , for one of ordinary skill in the art, according to 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 meanwhile.