Summary of the invention
For above-mentioned technical problem, it is an object of the invention to provide a kind of on-demand coding system of analog video signal and method, under dispatch server and video matrix switcher control, only the analog video signal that video playing terminal needs is sent to video encoder to be encoded, decrease the quantity of monitoring system deployment video encoder, reduce system Construction cost.
For reaching this purpose, the present invention by the following technical solutions:
A kind of on-demand coding system of analog video signal, including streaming media server cluster, dispatch server, video matrix switcher and video encoder cluster;
Described streaming media server cluster includes at least one streaming media server, for when receiving video playing terminal to the order request signal of video data, code request signals is sent to dispatch server, and obtain video encoder to the digital video signal after described video data encoding, forward it to described video playing terminal, when receiving video playing terminal to the stopping program request request signal of video data, send to dispatch server and stop code request signals, and stop the digital video signal forwarding video encoder to send to described video playing terminal;
Described dispatch server is for when receiving described code request signals, an idle coding pass is selected from video encoder cluster, coding pass switching signal is sent to video matrix switcher, and the channel number of the coding pass of described free time and the address of affiliated video encoder thereof are sent to streaming media server, when receiving described stopping code request signals, the coding pass of described coding video data will be adjusted to idle condition;
Described video matrix switcher for when receiving described coding pass switching signal, switching to the analog video source exporting described video data by the input source of the coding pass of described free time;
Described video encoder cluster includes at least one video encoder, for utilizing the digital video signal that the described video data encoding of reception is video playing terminal desirable format by the coding pass of described free time.
Especially, described streaming media server is additionally operable to
When receiving video playing terminal to the order request signal of video data, judge whether video data described in other video playing terminal program request existing, if the determination result is YES, then the digital video signal after described video data encoding is transmitted directly to send the video playing terminal of order request signal by video encoder by storage, if judged result is no, then send code request signals to dispatch server.
Especially, described streaming media server is additionally operable to
When receiving video playing terminal to the stopping program request request signal of video data, judge whether video data described in also other video playing terminal program request, if the determination result is YES, then stop the digital video signal forwarding video encoder to send to the video playing terminal sending described stopping program request request signal, but do not send to dispatch server and stop code request signals, if judged result is no, then send to dispatch server and stop code request signals, stop obtaining described digital video signal from video encoder, and stop the digital video signal forwarding video encoder to send to the video playing terminal sending described stopping program request request signal.
Especially, described dispatch server is additionally operable to
When receiving the code request signals asked coding video data, judge whether that other streaming media server existing sends the request code request signals to described coding video data, if the determination result is YES, then the address of the channel number of the coding pass corresponding with described code request signals and affiliated video encoder thereof is sent to streaming media server, from video encoder cluster, no longer select new free code passage, if judged result is no, from video encoder cluster, then select an idle coding pass, coding pass switching signal is sent to video matrix switcher, and the channel number of the coding pass of described free time and the address of affiliated video encoder thereof are sent to streaming media server.
Especially, described dispatch server is additionally operable to
When receiving the described stopping code request signals asking that video data is stopped coding, judge whether that also other streaming media server needs described coding video data, if the determination result is YES, then do not process, if judged result is no, then the coding pass of described coding video data will be adjusted to idle condition.
The invention also discloses a kind of on-demand coded method of analog video signal, comprise the steps:
A, when receiving video playing terminal to the order request signal of video data, streaming media server sends code request signals to dispatch server, and obtain video encoder to the digital video signal after described video data encoding, forward it to described video playing terminal, when receiving video playing terminal to the stopping program request request signal of video data, streaming media server sends to dispatch server and stops code request signals, and stops the digital video signal forwarding video encoder to send to described video playing terminal;
B, when receiving described code request signals, dispatch server selects an idle coding pass from video encoder cluster, coding pass switching signal is sent to video matrix switcher, and the channel number of the coding pass of described free time and the address of affiliated video encoder thereof are sent to streaming media server, when receiving described stopping code request signals, the coding pass of described coding video data will be adjusted to idle condition by dispatch server;
C, when receiving described coding pass switching signal, the input source of the coding pass of described free time is switched to the analog video source exporting described video data by video matrix switcher;
D, video encoder utilize the digital video signal that the described video data encoding of reception is video playing terminal desirable format by the coding pass of described free time.
Especially, described step A also includes:
When receiving video playing terminal to the order request signal of video data, whether streaming media server judges has video data described in other video playing terminal program request, if the determination result is YES, then the digital video signal after described video data encoding is transmitted directly to send the video playing terminal of order request signal by video encoder by storage;If judged result is no, then send code request signals to dispatch server, judge that whether coding request is successful, if unsuccessful, then notice video playing terminal program request failure, if success, then obtain the channel number of the idle coding pass that dispatch server sends and the address of affiliated video encoder thereof, address according to described video encoder connects video encoder, it is thus achieved that video encoder is to the digital video signal after described video data encoding, and is transmitted to described video playing terminal.
Especially, described step A also includes:
When receiving video playing terminal to the stopping program request request signal of video data, whether streaming media server judges also has video data described in other video playing terminal program request, if the determination result is YES, then stop the digital video signal forwarding video encoder to send to the video playing terminal sending described stopping program request request signal, but do not send to dispatch server and stop code request signals, if judged result is no, then send to dispatch server and stop code request signals, stop obtaining described digital video signal from video encoder, and stop the digital video signal forwarding video encoder to send to the video playing terminal sending described stopping program request request signal.
Especially, described step B also includes:
nullWhen receiving the code request signals asked coding video data,Dispatch server judges whether that other streaming media server existing sends the request code request signals to described coding video data,If the determination result is YES,Then the address of the channel number of the coding pass corresponding with described code request signals and affiliated video encoder thereof is sent to streaming media server,From video encoder cluster, no longer select new free code passage,If judged result is no,Then judge the coding pass that whether there is the free time in video encoder cluster,If being absent from,Then this coding of notification streams media server is asked unsuccessfully,If existing,Then select an idle coding pass,Coding pass switching signal is sent to video matrix switcher,And the channel number of the coding pass of described free time and the address of affiliated video encoder thereof are sent to streaming media server.
Especially, described step B also includes:
When receiving the described stopping code request signals asking that video data is stopped coding, dispatch server judges whether that also other streaming media server needs described coding video data, if the determination result is YES, then do not process, if judged result is no, then the coding pass of described coding video data will be adjusted to idle condition.
In the present invention, the order request signal of video data is sent code request signals to dispatch server according to video playing terminal by streaming media server, after the code request signals that dispatch server receives, an idle coding pass is selected from video encoder cluster, coding pass switching signal is sent to video matrix switcher, by video matrix switcher, the input source of the coding pass of described free time is switched to the analog video source exporting described video data, thus the described coding video data that the video encoder at the coding pass place of described free time is to video playing terminal program request, and the coding video data other video source not exported.Present invention achieves the on-demand coding to analog video signal so that monitoring system only needs a small amount of video encoder apparatus namely can meet the program request demand of user when disposing, and effectively reduces construction cost and the operational overhead of system.
Detailed description of the invention
For making the object, technical solutions and advantages of the present invention clearly, below in conjunction with drawings and Examples, the invention will be further described.
Refer to shown in Fig. 1, the on-demand coding system block diagram of analog video signal that Fig. 1 provides for the embodiment of the present invention.
In the present embodiment, the on-demand coding system of analog video signal includes streaming media server cluster 101, dispatch server 102, video matrix switcher 103 and video encoder cluster 104.Wherein, streaming media server cluster 101 comprises M platform streaming media server 1011, video encoder cluster 104 comprises N platform video encoder 1041, apply the monitoring system of the on-demand coding system of this analog video signal and be provided with P platform analog video source 105 and Q platform video playing terminal 106, M, N, P and Q are positive integer.
Described streaming media server 1011 is for when receiving video playing terminal 106 to the order request signal of video data, code request signals is sent to dispatch server 102, and obtain video encoder 1041 to the digital video signal after described video data encoding, forward it to described video playing terminal 106, when receiving video playing terminal 106 to the stopping program request request signal of video data, send to dispatch server 102 and stop code request signals, and stop the digital video signal forwarding video encoder 1041 to send to described video playing terminal 106.
When streaming media server 1011 receives video playing terminal 106 to the request signal of video data, first determine whether that described request signal is order request signal or stops program request request signal.When described request signal is order request signal, streaming media server 1011 judges whether video data described in other video playing terminal 106 program request existing, if the determination result is YES, then just stored in described streaming media server 1011 have by video encoder 1041 digital video signal after described coding video data, now need not apply for again, to described coding video data, described digital video signal being directly sent to by wired or wireless network the video playing terminal 106 sending order request signal;If judged result is no, then send code request signals to dispatch server 102, and when receiving the address of the channel number of coding pass of the free time that dispatch server 102 sends and affiliated video encoder 1041 thereof, video encoder 1041 is connected according to this address, obtain video encoder 1041 to the digital video signal after described video data encoding, and forward it to described video playing terminal 106 by wired or wireless network, when not receiving the address of the channel number of coding pass of the free time that dispatch server 102 sends and affiliated video encoder 1041 thereof, notice video playing terminal 106 program request failure.
When described request signal is off order request signal, streaming media server 1011 judges whether video data described in also other video playing terminal 106 program request, if the determination result is YES, then stop the digital video signal forwarding video encoder 1041 to send to the video playing terminal 106 sending described stopping program request request signal, but do not send to dispatch server 102 and stop code request signals;If judged result is no, then send to dispatch server 102 and stop code request signals, stop obtaining described digital video signal from video encoder 1041, and stop the digital video signal forwarding video encoder 1041 to send to the video playing terminal 106 sending described stopping program request request signal.
Described dispatch server 102 is for when receiving described code request signals, an idle coding pass is selected from video encoder cluster 104, coding pass switching signal is sent to video matrix switcher 103, and the channel number of the coding pass of described free time and the address of affiliated video encoder 1041 thereof are sent to streaming media server 1011, when receiving described stopping code request signals, the coding pass of described coding video data will be adjusted to idle condition.It should be noted that dispatch server 102 can whether the service condition such as coding pass of the coding pass of all video encoders 1041 idle in monitor in real time video encoder cluster 104, coding pass with which analog video source 105 is connected etc..
When dispatch server 102 receives streaming media server 1011 to the request signal of video data, first determine whether that described request signal is that code request signals is also off code request signals.When described request signal is code request signals, dispatch server 102 judges whether that other streaming media server 1011 existing sends the request code request signals to described coding video data, if the determination result is YES, then illustrate that existing video encoder 1041 is to described coding video data, therefore new coding pass need not separately be sought again to perform described encoding tasks, directly the channel number of coding pass and the address of affiliated video encoder 1041 thereof that perform described encoding tasks are sent to streaming media server 1011, from video encoder cluster 104, no longer select new free code passage;If judged result is no, then judge the coding pass that whether there is the free time in video encoder cluster 104, if being absent from, then this coding of notification streams media server 1011 is asked unsuccessfully, if existing, then select an idle coding pass, send coding pass switching signal to video matrix switcher 103, and the channel number of the coding pass of described free time and the address of affiliated video encoder 1041 thereof are sent to streaming media server 1011.
When described request signal is off code request signals, dispatch server 102 judges whether that also other streaming media server 1011 needs described coding video data, if the determination result is YES, then illustrate still there is video data described in other video playing terminal 106 program request, described stopping code request signals not being processed, it is impossible to the coding pass of described coding video data will be adjusted to idle condition;If judged result is no, then the coding pass of described coding video data will be adjusted to idle condition.When dispatch server 102 is by when being adjusted to idle condition to the coding pass of described coding video data, when the request of upper once coding arrives, it is possible to be used for performing new Video coding task.
Described video matrix switcher 103 for when receiving described coding pass switching signal, switching to the analog video source 105 exporting described video data by the input source of the coding pass of described free time.
Described video encoder 1041 is for utilizing the digital video signal that the described video data encoding of reception is video playing terminal 106 desirable format by the coding pass of described free time.
After video encoder 1041 receives the video data of analog video source 105 output, utilize described free code passage that dispatch server 102 selects by described video data encoding be the MPEG-4 needed for video playing terminal 106, the digital video signal of the form such as H.264, then described digital video signal is sent to video playing terminal 106 by streaming media server 1011.
As in figure 2 it is shown, the on-demand coded method flow chart of analog video signal that Fig. 2 provides for the embodiment of the present invention.
In the present embodiment, the on-demand coded method of analog video signal comprises the steps:
Step S201, when receiving video playing terminal to the order request signal of video data, streaming media server sends code request signals to dispatch server, and obtain video encoder to the digital video signal after described video data encoding, forward it to described video playing terminal, when receiving video playing terminal to the stopping program request request signal of video data, streaming media server sends to dispatch server and stops code request signals, and stops the digital video signal forwarding video encoder to send to described video playing terminal.
Step S202, when receiving described code request signals, dispatch server selects an idle coding pass from video encoder cluster, coding pass switching signal is sent to video matrix switcher, and the channel number of the coding pass of described free time and the address of affiliated video encoder thereof are sent to streaming media server, when receiving described stopping code request signals, the coding pass of described coding video data will be adjusted to idle condition by dispatch server.
Step S203, when receiving described coding pass switching signal, the input source of the coding pass of described free time is switched to the analog video source exporting described video data by video matrix switcher.
Step S204, video encoder utilize the digital video signal that the described video data encoding of reception is video playing terminal desirable format by the coding pass of described free time.
After video encoder receives the video data of analog video source output, utilize described free code passage that dispatch server selects by described video data encoding be the MPEG-4 needed for video playing terminal, the digital video signal of the form such as H.264, then described digital video signal is sent to video playing terminal by streaming media server.
As it is shown on figure 3, described step S201 specifically includes:
Step S2011, judge video playing terminal to the request signal of video data be order request signal or stop program request request signal.If judged result is order request signal, then perform step S2012, if judged result is for stopping program request request signal, then perform step S2019.
Step S2012, judge whether video data described in other video playing terminal program request existing.If the determination result is YES, then perform step S2013, if judged result is no, then perform step S2014.
Step S2013, the digital video signal after described video data encoding is transmitted directly to send the video playing terminal of order request signal by video encoder by storage.
When there being video data described in other video playing terminal program request, just stored in streaming media server have by video encoder the digital video signal after described coding video data, now need not apply for again described coding video data, directly described digital video signal is sent to by wired or wireless network the video playing terminal sending order request signal.
Step S2014, to dispatch server send code request signals.
Step S2015, judge coding request whether success.If the determination result is YES, then perform step S2016, if judged result is no, then perform step S2018.
The channel number of the idle coding pass that step S2016, acquisition dispatch server send and the address of affiliated video encoder thereof.
Step S2017, connect video encoder according to the address of described encoder, it is thus achieved that video encoder is to the digital video signal after described video data encoding, and forwards it to described video playing terminal by wired or wireless network.
Step S2018, notice video playing terminal program request failure.
When not receiving the address of the channel number of coding pass of the free time that dispatch server sends and affiliated video encoder thereof, illustrate that coding is asked unsuccessfully, namely video playing terminal program request failure.
Step S2019, judge whether video data described in also other video playing terminal program request.If the determination result is YES, then perform step S2010, if judged result is no, then perform step S20111.
Step S20110, stopping forward the digital video signal of video encoder transmission to the video playing terminal sending described stopping program request request signal, but do not send stopping code request signals to dispatch server.
Step S20111, to dispatch server send stop code request signals.
Step S20112, stopping obtain described digital video signal from video encoder, and stop forwarding to the video playing terminal sending described stopping program request request signal the digital video signal of video encoder transmission.
As shown in Figure 4, described step S202 specifically includes:
Step S2021, judge that the request signal of video data is that code request signals is also off code request signals by streaming media server.If judged result is code request signals, then perform step S2022, if judged result is for stopping code request signals, then perform step S2029.
Step S2022, judge whether that other streaming media server existing sends the request code request signals to described coding video data.If judged result is, then perform step S2023, if judged result is no, then perform step S2024.
Step S2023, the channel number of coding pass that execution directly encodes described video data and the address of affiliated video encoder thereof are sent to streaming media server.
When dispatch server judges have other streaming media server to send the code request signals asked described coding video data, illustrate that existing video encoder is to described coding video data, therefore new coding pass need not separately be sought again to perform described encoding tasks, directly the channel number of coding pass and the address of affiliated video encoder thereof that perform described encoding tasks are sent to streaming media server, from video encoder cluster, no longer select new free code passage.
Step S2024, judge whether video encoder cluster exists the coding pass of free time.If existing, then performing step S2025, if being absent from, then performing step S2028.
Step S2025, select an idle coding pass.
Step S2026, to video matrix switcher send coding pass switching signal, make the input source of the coding pass of described free time switch to the analog video source exporting described video data.
Step S2027, the channel number of the coding pass of described free time and the address of affiliated video encoder thereof are sent to streaming media server.
This coding of step S2028, notification streams media server is asked unsuccessfully.
Step S2029, judge whether that also other streaming media server sends the request code request signals to described coding video data.If the determination result is YES, then this process terminates, if judged result is no, then performs step S20210.
When dispatch server judges also have other streaming media server to need described coding video data, illustrate still there is video data described in other video playing terminal program request, therefore the coding pass of described coding video data can't will be set to idle condition.When only judging there is no the request of other streaming media server to described coding video data, just can safety the coding pass of described coding video data will be set to idle condition.
Step S20210, the coding pass of described coding video data will be adjusted to idle condition.
When dispatch server is by when being adjusted to idle condition to the coding pass of described coding video data, when the request of upper once coding arrives, it is possible to be used for performing new Video coding task.
User is only encoded by the present invention by a certain road video data (i.e. analog video signal) of the video playing terminal such as program request such as mobile phone, palm PC, and the coding video data other video source not exported, it is truly realized the on-demand coding to analog video signal, make monitoring system only need a small amount of video encoder apparatus namely can meet the program request demand of user when disposing, effectively reduce construction cost and the operational overhead of system.
Above are only presently preferred embodiments of the present invention and institute's application technology principle, any those familiar with the art in the technical scope that the invention discloses, the change that can readily occur in or replacement, all should be encompassed in protection scope of the present invention.