Summary of the invention
In view of this, main purpose of the present invention is to provide a kind of method and system of media sync, to realize synchronous between a plurality of Media Streams.
For achieving the above object, technical scheme of the present invention is achieved in that
A kind of method that the invention provides media sync, the method comprises:
Determine to need synchronous a plurality of Media Streams, and select one of them Media Stream as with reference to Media Stream;
Obtain the time parameter of described reference medium stream, described time parameter comprises to be play absolute time and plays relative time;
According to the time parameter of described reference medium stream, the broadcast state of adjusting other Media Streams in described a plurality of Media Stream is synchronizeed with described reference medium stream.
Described according to the time parameter of reference medium stream, the broadcast state of adjusting other Media Streams in a plurality of Media Streams is synchronizeed with reference medium stream, is specially:
According to the broadcasting absolute time of described reference medium stream, obtain other each Media Streams at the corresponding broadcasting relative time of described broadcasting absolute time;
The broadcasting relative time of other each Media Streams that obtain is compared with the broadcasting relative time of reference medium stream respectively, obtain playing the difference of relative time;
According to the difference of the broadcasting relative time of other each Media Streams and reference medium stream, the broadcast state of adjusting other each Media Streams is synchronizeed with reference medium stream.
Described media sync is initiated by message control module, or is initiated by the terminal of playing described Media Stream.
Described media sync is carried out in media recommendation process, specifically comprises:
The active direction message control module request media that media are recommended are recommended business, and in request, carry the time parameter of Media Stream that masters is recommended;
Described message control module sends media to passive side and recommends, and the time parameter of recommended Media Stream is sent to described passive side's media function module;
Described passive side's media function module is according to the time parameter receiving, and adjusts institute's Media Stream of recommending and starts the state of broadcasting and in the current playing status synchronism of masters passive side.
In the media play process of described media sync after media are recommended, carry out, specifically comprise:
The active direction passive side that media are recommended recommends Media Stream, and described masters and passive side set up corresponding Media Stream with media function module separately respectively;
Message control module selects Media Stream that masters plays as with reference to Media Stream, and from the media function module of masters, obtains the time parameter of reference medium stream;
Described message control module request passive side's media function module is adjusted the broadcast state of passive side's Media Stream, and in described request, carries the time parameter of reference medium stream;
Described passive side's media function module is according to the time parameter in request, the playing status synchronism of the Media Stream broadcast state of adjusting described passive side and reference medium stream in masters.
The present invention also provides a kind of system of media sync, and this system comprises: message control module and media function module, wherein,
Described message control module, for determining, need synchronous a plurality of Media Streams, select one of them Media Stream as with reference to Media Stream, and from described media function module, obtain the time parameter of described reference medium stream, described time parameter comprises to be play absolute time and plays relative time; Also, for according to the time parameter of described reference medium stream, notify described media function module to adjust the broadcast state of other Media Streams in a plurality of Media Streams;
Described media function module, for media services are provided, and provides the time parameter of Media Stream for described message control module; Also, for according to the notice of described message control module, adjust the broadcast state of other Media Streams in a plurality of Media Streams, described other Media Streams are adjusted to reference medium and flowed identical broadcasting relative time.
Described media function module is further used for, and according to the broadcasting absolute time of described reference medium stream, obtains other each Media Streams at the corresponding broadcasting relative time of described broadcasting absolute time; The broadcasting relative time of other each Media Streams that obtain is compared with the broadcasting relative time of reference medium stream respectively, obtain playing the difference of relative time; According to the difference of the broadcasting relative time of other each Media Streams and reference medium stream, the broadcast state of adjusting other each Media Streams is synchronizeed with reference medium stream.
Described media sync is initiated by message control module, or is initiated by the terminal of playing described Media Stream.
Described media sync is carried out in media recommendation process, corresponding,
Described message control module is further used for, when the media that send in the masters that receives media recommendation are recommended service request, to passive side, send media and recommend, and the time parameter of the Media Stream that masters is recommended carrying in described request is sent to described passive side's media function module;
Described passive side's media function module is further used for, and according to the time parameter receiving, adjusts institute's Media Stream of recommending and starts the state of broadcasting and in the current playing status synchronism of masters passive side.
In the media play process of described media sync after media are recommended, carry out, corresponding,
Described message control module is further used for, and selects Media Stream that masters plays as with reference to Media Stream, and from the media function module of masters, obtains the time parameter of reference medium stream; Also for asking the broadcast state of passive side's media function module adjustment passive side Media Stream, and in described request, carry the time parameter of reference medium stream;
Described media function module is further used for, and sets up corresponding Media Stream respectively with masters and the passive side of media recommendation; Passive side's media function module, according to from the time parameter in the request of message control module, is adjusted the broadcast state of passive side's Media Stream and is flowed playing status synchronism with the reference medium in masters.
The method and system of a kind of media sync provided by the present invention, first determine to need synchronous a plurality of Media Streams, and selects one of them Media Stream as with reference to Media Stream; Then obtain the time parameter of reference medium stream, this time parameter comprises to be play absolute time and plays relative time; According to the time parameter of reference medium stream, the broadcast state of adjusting other Media Streams in a plurality of Media Streams is synchronizeed with reference medium stream again.By method and system of the present invention, realized synchronous between a plurality of Media Streams, for the unified realization of controlling of media provides prerequisite.
Embodiment
Below in conjunction with the drawings and specific embodiments, the technical solution of the present invention is further elaborated.
The invention provides a kind of medium synchronization, be intended to select a Media Stream as with reference to Media Stream in the middle of a plurality of relevant Media Streams, and according to the play position of reference medium stream, adjust the play position of other related media streams, thereby it is synchronous to realize the broadcasting of a plurality of Media Streams.As shown in Figure 1, the method mainly comprises the following steps:
Step 101, determine to need synchronous a plurality of Media Streams, and selects one of them Media Stream as with reference to Media Stream.
Because only have the Media Stream that media file is identical just to have synchronous necessity, so need synchronous a plurality of Media Streams, must be to select from the identical Media Stream of media file.The selection of reference medium stream, according to determining according to actual needs, does not limit in the present invention.
Step 102, obtains the time parameter that reference medium flows, and this time parameter comprises to be play absolute time and play relative time.
For media play, the parameter of statement Media playing position is shift time normally, also claims to play relative time, and its expression current media is play the shift time of relative media file original position.The so-called absolute time of playing, refers to the system time obtaining while playing relative time.System being by playing absolute time and playing relative time, just can determine at the accurate location of media play sometime.
Step 103, according to the time parameter of reference medium stream, the broadcast state of adjusting other Media Streams in a plurality of Media Streams is synchronizeed with reference medium stream.
Concrete synchronous processing comprises: first according to the broadcasting absolute time of reference medium stream, obtain other each Media Streams and playing the corresponding broadcasting relative time of absolute time; Then the broadcasting relative time of other each Media Streams that obtain is compared with the broadcasting relative time of reference medium stream respectively, obtain playing the difference of relative time; According to the difference of the broadcasting relative time of other each Media Streams and reference medium stream, the broadcast state of adjusting other each Media Streams is synchronizeed with reference medium stream again.
Corresponding above-mentioned medium synchronization, the present invention also provides a kind of media sync system of correspondence, comprising: message control module and media function module.Wherein, message control module, for determine needing synchronous a plurality of Media Streams, selects one of them Media Stream as with reference to Media Stream, and obtaining from media function module the time parameter that reference medium flows, this time parameter comprises to be play absolute time and plays relative time; Also, for according to the time parameter of reference medium stream, notify media function module to adjust the broadcast state of other Media Streams in a plurality of Media Streams.Media function module, for media services are provided, and provides the time parameter of Media Stream for message control module; Also, for according to the notice of message control module, adjust the broadcast state of other Media Streams in a plurality of Media Streams, other Media Streams are adjusted to reference medium and flowed identical broadcasting relative time.
Below in conjunction with the IPTV system based on NGN shown in Fig. 2, medium synchronization of the present invention is further elaborated.In the structure of the system of IPTV shown in Fig. 2, terminal can be the equipment such as the Set Top Box, palmtop PC (PDA, Personal Digital Assistant) of Digital Television.Media function module is the chief component of content distributing network in IPTV system (CDN, Content Delivery Network), and it provides media services for terminal, comprises that media are controlled and the function such as media delivery.Media control function is in different standards, its title and structure are different, at (the ITU-T of standardization department of international telecommunication union telecommunication, International Telecommunication Union Telecommunications standardization sector) in standard, the distribution of media control function corresponding content and storage (Content Delivery and Storage); Business and agreement (TISPAN in the communication for high-level network and the Internet converged, Telecommunicationand Internet converged Services and Protocols for Advanced Networking) corresponding media function (MF, Media Function) in; In open IPTV forum (OIPF, Open IPTV Forum) standard, corresponding cluster is controlled (CC, Clustered Control) and media delivery function (CDF).Message control module is the control functional entity of business, comprises that the rights of using of this business are controlled, service logic is controlled etc.; The message control module of corresponding IPTV, is responsible for the logic control of IPTV business, and all IPTV business are all carried out under the control of this message control module.Service conversation control module, the IP Multimedia System (IMS, IP Multimedia Subsystem) of being responsible in NGN is controlled function, is responsible for the unified of all IMS signalings and controls.
Wherein, IPTV message control module, for determine needing synchronous a plurality of Media Streams, selects one of them Media Stream as with reference to Media Stream, and obtaining from media function module the time parameter that reference medium flows, this time parameter comprises to be play absolute time and plays relative time; Also, for according to the time parameter of reference medium stream, notify media function module to adjust the broadcast state of other Media Streams in a plurality of Media Streams.Media function module, for media services are provided, and provides the time parameter of Media Stream for message control module; Also, for according to the notice of message control module, adjust the broadcast state of other Media Streams in a plurality of Media Streams, other Media Streams are adjusted to reference medium and flowed identical broadcasting relative time.For example: in Fig. 2, IPTV message control module is determined needs synchronous Media Stream 1 and Media Stream 2, and select Media Stream 1 for reference medium stream, from media function module, obtain the time parameter of Media Stream 1; According to the time parameter of Media Stream 1, notice media function module is adjusted the broadcast state of Media Stream 2, carries the time parameter of Media Stream 1 in this notice; Media function module receives after notice, adjusts the broadcast state of Media Stream 2 according to the time parameter of Media Stream 1, and Media Stream 2 is adjusted to the broadcasting relative time identical with Media Stream 1, thereby it is synchronous to realize the broadcasting of Media Stream 2 and Media Stream 1.
It should be noted that, in the present invention, needing synchronous a plurality of Media Streams can be both to be controlled by identical media function module, can be also to be controlled by different media function modules.In addition, medium synchronization of the present invention is applicable to media and recommends business, and media sync operation both can carry out in media recommendation process, also can in the media play process after media are recommended, carry out.Below in conjunction with specific embodiment, describe.
In the embodiment mono-shown in Fig. 3, media sync operation occurs in the media play process after media are recommended, and need to synchronous a plurality of Media Streams (Media Stream 1, Media Stream 2) be to be controlled by different media function modules.As shown in Figure 3, media sync mainly comprises the following steps:
Step 301, the mode of recommending by media, terminal 1 (masters that media are recommended) is set up corresponding Media Stream with media function module 1, and terminal 2 (passive side that media are recommended) is set up corresponding Media Stream with media function module 2.
Terminal 1 in a business network, terminal 2 are built up relevant media streaming services to media function module 1 and media function module 2 respectively.These two relevant Media Streams are that the mode of recommending by media is set up, for example: the user of terminal 1 recommends its in progress Media Stream the user of terminal 2, allows the user of terminal 2 together watch; After recommending, terminal 1 is set up corresponding Media Stream with media function module 1 so, and terminal 2 is set up corresponding Media Stream with media function module 2.
Step 302, IPTV message control module selects Media Stream 1 conduct with reference to Media Stream, and the request of initiating to obtain Media Stream 1 time parameter by service conversation control module is to media function module 1.
It should be noted that, in actual applications, the synchronization request of Media Stream both can be initiated by terminal 1 or terminal 2, also can be from IPTV service control function module self; When IPTV service control function module, know while having Media Stream synchronisation requirement, just start to perform step 302 operation.
Step 303, media function module 1 is returned to the time parameter of Media Stream 1 to IPTV message control module by service conversation control module, and this time parameter comprises: play absolute time and play relative time.
The so-called relative time of playing, refers to that the broadcasting of current media stream 1 is with respect to the shift time of media file original position; Play absolute time, refer to the system time while obtaining this shift time.
Step 304~305, IPTV message control module is by service conversation control module, and request media function module 2 is revised the broadcast state of Media Stream 2 according to the time parameter of Media Stream 1.
In sending to the request of media function module 2, carried the time parameter of Media Stream 1, i.e. the broadcasting absolute time of Media Stream 1 and play relative time, this is the foundation that media function module 2 is adjusted Media Stream 2 broadcast states.
Step 306~308, media function module 2, according to the time parameter in request, is adjusted the broadcast state of Media Stream 2, and is returned and confirmed that response is to IPTV message control module by service conversation control module.
Media function module 2 is according to the time parameter in request (the broadcasting absolute time of Media Stream 1 and broadcasting relative time), computing medium stream 2 and the difference of Media Stream 1 on broadcasting relative time, then according to this difference, adjust the current broadcasting relative time of Media Stream 2, and then realize the playing status synchronism of broadcast state and the Media Stream 1 of Media Stream 2.
In the embodiment bis-shown in Fig. 4, media sync operation occurs in media recommendation process, and need to synchronous a plurality of Media Streams (Media Stream 1, Media Stream 2) be to be controlled by different media function modules.As shown in Figure 4, media sync mainly comprises the following steps:
Step 401, terminal 1 (media recommend masters) is recommended business to IPTV message control module request media, and in request the time parameter of the Media Stream 1 of carried terminal 1 current broadcasting, i.e. the broadcasting absolute time of Media Stream 1 and play relative time.
Step 402, IPTV message control module sends media to terminal 2 (passive side that media are recommended) and recommends, and the time parameter of the Media Stream of recommendation 1 is sent to media function module 2.
IPTV message control module receives the media of terminal 1 and recommends after service request, and notice media function module 2 is set up and is connected with the media of terminal 2, and the time parameter of the Media Stream of recommendation 1 is sent to media function module 2.
Step 403, media function module 2 is according to the time parameter of Media Stream 1, is directly adjusted at the broadcast state of the Media Stream 2 of playing in terminal 2, makes Media Stream 2 start the state play and the current playing status synchronism of Media Stream 1.
The above, be only preferred embodiment of the present invention, is not intended to limit protection scope of the present invention.