Summary of the invention
The object of the invention is to solve in digital court's live court's trial system, the programme televised live seen by the Portal page user and program pictures are controlled flexibly and switch, so that can according to court hearing situation, can switch at any time the live image content of outer net, public network.
For reaching above-mentioned purpose, the present invention specifically provides a kind of flexible control and changing method of direct broadcast band, described method comprises: play end and open listening port, and when described broadcasting end obtains data source, the described relevant information playing end is sent to streaming media server; Described streaming media server is set up according to described broadcasting end relevant information and is play end list; When live picture occurs abnormal, background control end obtains each relevant information playing end in the list of broadcasting end and the list of described broadcasting end of playing current live picture, and sends channel switching instruction to each broadcasting end in described streaming media server and/or the list of described broadcasting end; Described broadcasting end switches live picture according to described channel switching instruction.
In the flexible control and changing method of above-mentioned direct broadcast band, preferably, in described streaming media server, demanding channel is to there being multiple standby address.
In the flexible control and changing method of above-mentioned direct broadcast band, preferably, when the described audit window playing end conflicts with other windows, described broadcasting end unlatching one idle port is as audit window.
In the flexible control and changing method of above-mentioned direct broadcast band, preferably, the described relevant information playing end comprises the label information that described IP address of playing end belongs to public network or private network.
In the flexible control and changing method of above-mentioned direct broadcast band, preferably, when accessing described streaming media server after described broadcasting end is by fire compartment wall or network address translation, described streaming media server adds specific identifier described broadcasting in end list to the described relevant information playing end.
In the flexible control and changing method of above-mentioned direct broadcast band, preferably, described background control end obtains described broadcasting end list by described streaming media server and the standby address switched will be needed to be sent to described streaming media server; Described background control end sends described channel switching instruction and direct broadcast band address for subsequent use to the described each broadcasting end play without specific identifier in end list, and described broadcasting end is according to described channel switching instruction and described direct broadcast band address switchover current live picture for subsequent use.
In the flexible control and changing method of above-mentioned direct broadcast band, preferably, described end of playing switches live picture according to described channel switching instruction and also comprises: described background control end is obtained by described streaming media server and describedly plays end list and the standby address of needs switching is sent to described streaming media server; Described standby address is pushed the broadcasting end with specific identifier by described streaming media server; Current broadcast address switches to described standby address to play by described broadcasting end.
In the flexible control and changing method of above-mentioned direct broadcast band, preferably, the broadcasting end that described standby address pushes with specific identifier comprises by described streaming media server: described streaming media server is by the Redirect method in RTSP agreement, be connected by TCP between streaming media server with player, described standby address is pushed the broadcasting end with specific identifier.
In the flexible control and changing method of above-mentioned direct broadcast band, preferably, the described relevant information playing end also comprises the described listening port information playing IP address information and the described broadcasting end held.
Advantageous Effects of the present invention is: can solve the problem that backstage directly cannot control live client player, also can guarantee the live client operated on public network and operate in after fire compartment wall, the direct broadcast band switching controls of the player client after NAT address transition, can reduce whole live client simultaneously and all be undertaken controlling and the impact of convection media server forwarding data performance by streaming media server.
Embodiment
For making the object of the embodiment of the present invention, technical scheme and advantage clearly understand, below in conjunction with embodiment and accompanying drawing, the present invention is described in further details.At this, schematic description and description of the present invention is for explaining the present invention, but not as a limitation of the invention.
The present invention specifically provides a kind of flexible control and changing method of direct broadcast band, please refer to shown in Fig. 1, described method comprises: play end and open listening port, and when described broadcasting end obtains data source, the described relevant information playing end is sent to streaming media server; Described streaming media server is set up according to described broadcasting end relevant information and is play end list; When live picture occurs abnormal, background control end obtains each relevant information playing end in the list of broadcasting end and the list of described broadcasting end of playing current live picture, and sends channel switching instruction to each broadcasting end in described streaming media server and/or the list of described broadcasting end; Described broadcasting end switches live picture according to described channel switching instruction.
In the above-described embodiments, in described streaming media server demanding channel to there being multiple standby address.Wherein each standby address can be and pre-sets, the addresses such as rest picture, urgent image switching, wait picture, when live address occurs abnormal, play end stops playing current live broadcasting pictures according to instruction, after obtaining new appointment standby address by streaming media server, play the broadcasting pictures that described standby address is corresponding.Wherein, streaming media server is responsible for sending URL address to the playback terminal with private net address and is redirected strategy, switches broadcasting channel voluntarily by playback terminal; Send new URL address to the playback terminal with public network address by background control end, and be switched to new broadcasting channel voluntarily by these playback terminals, follow-uply will do specific explanations to it.
What deserves to be explained is, when the initial audit window of described broadcasting end conflicts with other windows, described broadcasting end unlatching one idle port, as audit window, performs monitoring action with this.The described relevant information playing end comprises the described identification number playing address and the described listening port held.
In the above-described embodiments, described streaming media server also comprises: set up and play end list, described broadcasting end relevant information is saved in the list of described broadcasting end.The described relevant information playing end comprises the label information that described IP address of playing end belongs to public network or private network; Thereafter, when live picture occurs abnormal, described background control end checks wherein all broadcasting end relevant informations all over sequence after getting the list of described broadcasting end, according to described broadcasting end relevant information, channel switching instruction is sent to the broadcasting end that IP address is the correspondence of public network; As described in play in end list release that to comprise IP address be the broadcasting end of private network time, then the standby address replaced will be needed to be sent to described streaming media server; Thereafter, by described streaming media server, described standby address is pushed to described player, described player obtains standby address information, carries out broadcasting and switches.
In the above-described embodiments, described IP address is that the broadcasting end of private network specifically refers to broadcasting end access stream media server and non-immediate access, it is through having a fire compartment wall or carrying out network address translation, for such special circumstances, streaming media server described in the present invention inquire described broadcasting end by fire compartment wall or network address translation after visit again described streaming media server time, described broadcasting in end list, the described relevant information interpolation specific identifier playing end of this kind of speical play end is marked, so that play end to these to carry out particular procedure.
After having carried out mark to above-mentioned speical play end, described background control end has obtained described broadcasting by described streaming media server and has held list and the standby address switched will be needed to be sent to described streaming media server; Described standby address is pushed the broadcasting end with specific identifier by described streaming media server; Current broadcast address switches to described standby address to play by described broadcasting end.Concrete is exactly, described streaming media server is by the Redirect method in RTSP agreement, be connected by TCP between streaming media server with player, described standby address is pushed the broadcasting end with specific identifier, described broadcasting end, according to the standby address in described pushed information, carries out broadcasting and switches.
For further illustrating flexible control and the changing method of direct broadcast band provided by the present invention, illustrate so that court is live below:
On the whole, the flexible control that the present invention is directed to direct broadcast band is realized by Portal backstage with switching, and according to the different hardware configuration of each court, adopts different changing methods, be divided into the following two kinds situation specifically.
Under there is in court special live TV stream encoder situation:
Because court has the encoder of special user live broadcast video, its encoding stream exported is supplied to external public direct broadcast service, now by switching audio and video matrix, just can change the video pictures of input coding device.So only need to dispose several playing box in court, playing box Inner eycle exports some video pictures for subsequent use, such as can be divided into a few class such as " opening a court session to prepare video pictures ", " in dies non video pictures ", " emergent video pictures ", by switching audio and video matrix, these pictures can be switched and encode to for live encoder, and be watched to audient by network direct broadcasting; And different alternate video fragments, which adopts on earth, when switch, decided according to the advance stages of court's trial business and current actual conditions by Portal backstage with regard to all, once need to switch, only need Portal backstage to send switching command to audio and video matrix, adopt and switch in such a way, be switched to non-court's trial picture from court's trial picture, speed is fast, do not affect the viewing effect of beholder, when player plays video, there is no blank screen, do not have picture stop to feel immediately.
When not having special live TV stream encoder in court:
When owing to not having special live TV stream encoder in court, Portal background service is now needed to carry out sending controling instruction for each live client player, but the Portal page of each client is once after starting player, just lose the control to player, directly cannot control player.If each player can provide a serve port receiving control command at any time, just can receive the control command on Portal backstage, but synchronously needing to solve currently has how many player clients will receive this instruction, and their address (IP address, serve port) that receives instruction be what etc.We are solved by following scheme:
For player, the port of our reserved special reception control command; After player is activated, player starts the service of this reception, if time player starts network monitoring with the port of acquiescence, cause with other port on the client machine of place and conflict, then player can attempt the services listen port that more renews, until find a port, as listening port;
Player is at live URL, and when obtaining data source, in step 1, the port numbers of the monitoring control command of player is advertised to streaming media server;
For each direct broadcast band that streaming media server is issued, the URL address that each direct broadcast band is corresponding unique, streaming media server is responsible for IP address and the listening port number of monitoring, collect, upgrade the player client of current each URL address;
Streaming media server is to each client ip, can judge whether the IP address of this terminal have passed fire compartment wall or network address translation (NAT to streaming media server, NetworkAddressTranslation), to these IP address lists through network address translation, mark to be provided separately;
Streaming media server is opened several demanding channel, the URL address that each correspondence of these demanding channels is different, play different video contents; User's players uses when switching channels;
Business background service monitors the live video picture of each court, in time finding that picture has abnormal, starts player channel switching instruction; Judge whether this court has the encoder of special live TV stream before sending instruction, if had, then directly switching command is sent to the audio frequency and video switching matrix in court, then the live picture of the broadcasting of client player has been refreshed at once as other video pictures;
If business backstage finds to need the court switched not have special encoder, then can only be switched by the mode of Background control player.Business backstage first obtains a list of this direct broadcast band URL beholder from streaming media server inquiry, comprise the port numbers of the server that the IP address of beholder and control command receive in this list, notice that this list does not comprise these users through network address translation; Need the URL address of the new object channel switched to send to streaming media server the terminal player of this channel of viewing simultaneously, have streaming media server to assist a part of channel switch to control;
Business backstage sends channel switching instruction, direct broadcast band address for subsequent use etc. to these IP addresses and port numbers get the service port number of address list and the reception control command that directly can promote the player terminal of switching command from streaming media server after successively;
After each terminal player receives this switching command and direct broadcast band address for subsequent use, stop the broadcasting of current live channel, other URL address that replacing play parameter is carried replays;
Streaming media server, by the Redirect method in RTSP agreement, is connected by TCP between streaming media server with player, new broadcasting URL address is pushed to the player that these are hidden in the live client after NAT; Why do not push the instruction of the channel switch of all users with streaming media server, mainly consider that these business datums of streaming media server process affect the data forwarding performance of streaming media server;
By said method, achieve the instruction player of all-network terminal being sent to switching channels.
To sum up, the flexible control of direct broadcast band provided by the invention and changing method can solve the problem that backstage directly cannot control live client player, also can guarantee the live client operated on public network and operate in after fire compartment wall, the direct broadcast band switching controls of the player client after NAT address transition, can reduce whole live client simultaneously and all be undertaken controlling and the impact of convection media server forwarding data performance by streaming media server.
Above-described specific embodiment; object of the present invention, technical scheme and beneficial effect are further described; be understood that; the foregoing is only specific embodiments of the invention; the protection range be not intended to limit the present invention; within the spirit and principles in the present invention all, any amendment made, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.