Embodiment
For the bandwidth of saving Internet video interview system is used; Make the number of users of Internet video interview system not receive the restriction of server bandwidth etc.; The embodiment of the invention provides a kind of multi-medium data method for pushing, in this method, receive the multi-medium data bag that a plurality of multi-medium data collecting devices send after; Data in the multi-medium data bag that transmitting time is consistent are synthesized, and send to live live client behind the multi-medium data compressed encoding after will synthesizing.
Referring to Fig. 1, the multi-medium data method for pushing that the embodiment of the invention provides specifically may further comprise the steps:
Step 10: at least two multi-medium data collecting devices are packed the multi-medium data that collects, and number be encapsulated in corresponding order in the multi-medium data bag after the packing and this multi-medium data bag is sent to the virtual studio server according to the packing order;
Step 11: the serial number in the multi-medium data bag that the adjustment of virtual studio server receives, the serial number that the identical multi-medium data bag of transmitting time of adjustment back multi-medium data collecting device is comprised is identical; The adjusted multi-medium data bag of serial number is sent to live direct broadcast server;
Step 12: live direct broadcast server synthesizes the data in the multi-medium data bag of the serial number unanimity that receives;
Step 13: send to live live client behind the multi-medium data compressed encoding after live direct broadcast server will synthesize.
In the step 10, when multi-medium data comprised voice data and video data, the mode that the multi-medium data that collects is packed was: with the coding video data that collects, coded data is encapsulated in the video packets of data; The voice data that collects, playing duration is identical with the playing duration of said video data is encoded, coded data is encapsulated in the packets of audio data.Concrete: the mode to the audio, video data coding can be following:
Will be according to video acquisition frame per second fr
vThe M that a collects frame of video is encoded, and M is not less than 1 integer; With the current byte number that collects do
Voice data encode, wherein, fr
aBe audio sample rate, i.e. the per second hits; N is a channel number, the channel number of promptly sampling; Bps is a sampling resolution, i.e. each sampled point figure place.
After adopting aforesaid way to the audio, video data coding; The playing duration of the original video data before the video data encoder corresponding codes in the video packets of data is the playing duration of M frame of video, and the playing duration of the original audio data before the coded audio data corresponding codes in the packets of audio data is identical with the playing duration of M frame of video.Wherein, the value of M can be 1.
Can pack to collecting video data and voice data in two steps:
The first step; The original audio data that collects is split into the data segment of size for
; Utilize audio compress standard to encode (like coding standard G.729) again, obtain the coded data of a packets of audio data.Simultaneously, according to the video acquisition frame per second, utilize video compression standard (like coding standard H.264), to obtain the coded data of a video packets of data to every frame coding video data;
In second step, application data section such as the serial number (Index) that the current video data bag is corresponding, ID and video data encoder are encapsulated in the video packets of data, obtain the complete video packet.Same, application data section such as the serial number (Index) that current packets of audio data is corresponding, ID and coded audio data are encapsulated in the packets of audio data, obtain complete packets of audio data.The Index of first packet is 0, and the Index of follow-up data bag can increase by 1 successively.
Data packet format such as following table:
With the M frame of video is that base unit comes video and voice data packing, is in order to make in the unit interval number-of-packet of video and audio frequency identical, and its serial number Index has corresponding relationship in time, operates to carry out time synchronized after convenient.
In the step 11, the serial number in the multi-medium data bag that the adjustment of virtual studio server receives, its concrete implementation is following:
At first, choose a multi-medium data collecting device at least two multi-medium data collecting devices as time reference equipment;
Then; For other each the multi-medium data collecting devices except that time reference equipment, confirm that this multi-medium data collecting device begins to begin to send to the virtual studio server time migration of multi-medium data bag to virtual studio server transmission multi-medium data bag and time reference equipment;
At last, according to the multi-medium data collecting device time corresponding skew of confirming, adjust the serial number of the multi-medium data bag of this multi-medium data collecting device transmission.
Above-mentioned definite time migration specifically can may further comprise the steps:
Step S01: confirm the corresponding video frame number of propagation delay time (first propagation delay time) between multi-medium data collecting device and virtual studio server according to following formula: Δ 1=t1/T1; Wherein t1 is first propagation delay time, and T1 is the playing duration of the multi-medium data bag of this multi-medium data collecting device transmission;
Step S02: confirm the corresponding video frame number of propagation delay time (second propagation delay time) between time reference equipment and virtual studio server according to following formula: Δ 2=t2/T2; Wherein t2 is second propagation delay time, and F2 is the playing duration of the multi-medium data bag of time reference equipment transmission;
Step S03: when confirming that the virtual studio server receives first multi-medium data bag of multi-medium data collecting device, receive the serial number I that the multi-medium data bag of time reference equipment is comprised recently;
Step S04: confirm that according to following formula time migration is: Δ=I-| Δ 1-Δ 2|.
If the video packets of data that the multi-medium data collecting device sends comprises according to video acquisition frame per second fr
V1The data of the M that a collects frame of video, then T1 equals M/fr
V1
If the video packets of data that time reference equipment sends comprises according to video acquisition frame per second fr
V2The data of the M that a collects frame of video, then T2 equals M/fr
V2Wherein, M is not less than 1 integer.Fr
V1With fr
V2Can equate.Less than the distance threshold value that is provided with in advance, when promptly the time reference device very closely can be ignored apart from the virtual studio server, Δ 2 values were 0 in the distance of time reference equipment and virtual studio server.
Definite mode of first propagation delay time is: before the multi-medium data collecting device is ready for sending first video or packets of audio data, at first send a handshake packet to the virtual studio server, and record local zone time P
1, after the virtual studio server is received handshake packet, returning at once and confirm to wrap, the multi-medium data collecting device receives that the local zone time of confirming bag is P
2, obtain one way first propagation delay time thus:
And first propagation delay time that will obtain is notified to the virtual studio server; The virtual studio server confirms that according to first propagation delay time corresponding video frame number is:
Definite mode of second propagation delay time is identical with definite mode of first propagation delay time, repeats no more here.
According to aforesaid way, the serial number of the multi-medium data bag that adjustment multi-medium data collecting device sends is specially: with the serial number of this multi-medium data bag with calculate this multi-medium data collecting device time corresponding skew and superpose.For example, if time migration Δ=5, then the serial number with the multi-medium data bag adds 5, if time migration Δ=-5, then the serial number with the multi-medium data bag subtracts 5.
The data that the virtual studio server is transmitted to live direct broadcast server are based on that ICP/IP protocol transmits, like this to ensure the order of live direct broadcast server end data bag.
In the step 12, live direct broadcast server synthesizes the data in the multi-medium data bag of the serial number unanimity that receives, and its concrete implementation is following:
The multi-medium data bag that receives is put into the corresponding synthetic buffer unit of multi-medium data collecting device that sends this multi-medium data bag;
According to first polling time interval of setting, from each synthetic buffer unit, read current serial number the earliest and identical multi-medium data bag;
The multi-medium data that the multi-medium data bag that reads is carried synthesizes.
As shown in Figure 2; Live direct broadcast server is corresponding to each multi-medium data collecting device; Have two synthetic buffer units; One of them synthetic buffer unit (V) is used to store the video packets of data that corresponding multi-medium data collecting device sends, and another synthetic buffer unit (A) is used to store the packets of audio data that corresponding multi-medium data collecting device sends, certainly; If the multi-medium data collecting device also sends the packet of other types, then live direct broadcast server can also have the synthetic buffer unit of the packet that is used to store these other types corresponding to this multi-medium data collecting device.The serial number Index of the packet of the numeral storage among Fig. 2.
Synthetic buffer unit can adopt the formation mode of data first in first out, and the serial number of the same memory cell cached data packet of individual queue is identical.For each formation is provided with synthetic pointer, be used in reference to memory cell, first memory cell of synthetic pointer initial directional formation to the synthetic packet of the current needs of storage.
Synthetic method specifically can for: adopt a poll thread control synthetic at interval; Make that polling time interval is Δ t; Whether the data that each poll thread detects when triggering in all synthetic buffer units of current synthetic pointed are here, if do not have herely, wait for that then poll triggers next time; If it is here that 3 polls still do not have, the packet that then uses and not synthesizing to the previous packet of packet; If here, then the audio frequency of looking in the packet of current synthetic pointed synthesized, and current synthetic pointer is moved down the position of a memory cell.
Video data uses length and width to change and the mode of combination is synthesized, and is as shown in Figure 3.Voice data synthesizes audio mixing through simple arithmetic average, as shown in the formula:
Wherein, A
iThe voice data of representing i synthetic buffer unit, Mix is the voice data after synthetic.
In the step 13, with sending to live live client behind the multi-medium data compressed encoding after synthetic, its concrete implementation is following:
Multi-medium data after synthetic is put into the broadcast buffer unit;
According to second polling time interval of setting, from play buffer unit, read current serial number multi-medium data the earliest, the serial number of multi-medium data is meant the serial number in the synthetic employed multi-medium data bag of this multi-medium data;
With sending to live live client through point-to-point (P2P) network behind the multi-medium data compressed encoding that reads.
Still referring to Fig. 2; Live direct broadcast server also has two and plays buffer unit; One of them is play buffer unit (V) and is used to store the video data after synthesizing, and another is play buffer unit (A) and is used to store the voice data after synthesizing, certainly; If the multi-medium data collecting device also sends the packet of other types, then live direct broadcast server can also have the broadcast buffer unit that is used to store these other types data after synthesizing.
Play the formation mode that buffer unit can adopt the data first in first out, the serial number of the multi-medium data of the same memory cell buffer memory of individual queue is identical.For this formation is provided with playing pointer, be used in reference to the current memory cell that needs the data of broadcast of storage, first memory cell of playing pointer initial directional formation.
The data live broadcasting method specifically can for: adopt a poll thread to come controls playing at interval; Make that polling time interval is Δ t; When each poll thread triggers; Send to each live live client through the P2P network behind the multi-medium data compressed encoding in all packets that current playing pointer is pointed to, and current playing pointer is moved down the position of a memory cell.
In order to make live signal more steady; The data that the tolerance network jitter causes arrive uneven; Start when live; Must surpass 50% at the degree of filling of playing buffer unit and just begin to carry out, initial polling time interval is the inverse of video acquisition frame per second, i.e.
Use following strategy to come self adaptation adjustment to play the capacity of buffer unit: when the degree of filling θ of play unit less than 25%, or surpass at 75% o'clock, the polling time interval linearity reduces or increases, to adjust aggregate velocity:
In order to prevent underflow on the buffer cell,, then suspend live degree of filling and surpass 50% up to the broadcast buffer unit if the memory cell that current playing pointer points to does not have data.If do not have after current synthetic pointer moves down idlely must play buffer unit, then suspend and syntheticly surpass 50% up to the degree of filling of playing buffer unit.
Referring to Fig. 4, the embodiment of the invention also provides a kind of multi-medium data supplying system, and this system comprises:
At least two multi-medium data collecting devices 40; Said multi-medium data collecting device is used for the multi-medium data that collects is packed, and number is encapsulated in corresponding order in the multi-medium data bag after the packing and this multi-medium data bag is sent to the virtual studio server according to the packing order;
Virtual studio server 41 is used for adjusting the serial number of the multi-medium data bag that receives, and the serial number that the identical multi-medium data bag of adjustment back transmitting time is comprised is identical; The adjusted multi-medium data bag of serial number is sent to live direct broadcast server;
Live direct broadcast server 42, the data that are used for the multi-medium data bag that the serial number that receives is consistent are synthesized, and send to live live client through the P2P network behind the multi-medium data compressed encoding after will synthesizing;
Live live client 43 is used to receive said multi-medium data.
Said multi-medium data collecting device 40 is used for:
With the coding video data that collects, coded data is encapsulated in the video packets of data; The voice data that collects, playing duration is identical with the playing duration of said video data is encoded, coded data is encapsulated in the packets of audio data.
Said multi-medium data collecting device 40 is used for:
Will be according to video acquisition frame per second fr
vThe M that a collects frame of video is encoded, and M is not less than 1 integer; With the current byte number that collects do
Voice data encode said fr
aBe audio sample rate, said N is a channel number, and said bps is the sampled point figure place.
Said virtual studio server 41 is used for:
Choose a multi-medium data collecting device in said at least two multi-medium data collecting devices as time reference equipment; For other each the multi-medium data collecting devices except that said time reference equipment, confirm that this multi-medium data collecting device begins to begin to send to said virtual studio server the time migration of multi-medium data bag to said virtual studio server transmission multi-medium data bag and said time reference equipment; According to the multi-medium data collecting device time corresponding skew of confirming, adjust the serial number of the multi-medium data bag of this multi-medium data collecting device transmission.
Said virtual studio server 41 is used for:
Confirm the corresponding video frame number of first propagation delay time between this multi-medium data collecting device and said virtual studio server according to following formula: Δ 1=t1/T1; Wherein t1 is first propagation delay time, and T1 is the playing duration of the multi-medium data bag of this multi-medium data collecting device transmission; Confirm the corresponding video frame number of second propagation delay time between said time reference equipment and said virtual studio server according to following formula: Δ 2=t2/T2, wherein t2 is second propagation delay time, F2 is the video acquisition frame per second of said time reference equipment; When confirming to receive first multi-medium data bag of this multi-medium data collecting device, receive the serial number I that the multi-medium data bag of said time reference equipment is comprised recently; Confirm that according to following formula said time migration is: Δ=I-| Δ 1-Δ 2|; Serial number and said time migration that said multi-medium data bag is comprised superpose.
If the video packets of data that this multi-medium data collecting device sends comprises according to video acquisition frame per second fr
V1The data of the M that a collects frame of video, then T1 equals M/fr
V1If the video packets of data that said time reference equipment sends comprises according to video acquisition frame per second fr
V2The data of the M that a collects frame of video, then T2 equals M/fr
V2Said M is not less than 1 integer.
Said multi-medium data collecting device is virtual studio client or virtual studio acquisition server; Said virtual studio client is used for, and gathers the multi-medium data of looking the mutual user of audio frequency with said virtual studio server in real time; Said virtual studio acquisition server is used for, and gathers the multi-medium data of performing in a radio or TV programme the hall.
Said virtual studio server 41 is used for:
As time reference equipment, and said Δ 2 is 0 with said virtual studio acquisition server.
Said live direct broadcast server 42 comprises:
At least two synthetic buffer units are used to store the multi-medium data bag; Each synthetic buffer unit is corresponding with a multi-medium data collecting device in said at least two multi-medium data collecting devices, and the corresponding multi-medium data collecting device of different synthetic buffer unit is different;
Synthesis unit is used for the multi-medium data bag that receives is put into the corresponding synthetic buffer unit of multi-medium data collecting device that sends this multi-medium data bag; According to the polling time interval of setting, from each synthetic buffer unit, read current serial number the earliest and identical multi-medium data bag, the multi-medium data that the multi-medium data bag that reads is carried synthesizes;
Broadcast unit is used for the multi-medium data after synthetic is put into the broadcast buffer unit; Polling time interval according to setting reads current serial number multi-medium data the earliest from said broadcast buffer unit, the serial number of multi-medium data is meant the serial number in the synthetic employed multi-medium data bag of this multi-medium data; With sending to live live client behind the multi-medium data compressed encoding that reads;
Play buffer unit, be used for the buffer memory multi-medium data.
Native system can also comprise:
Web server 44 and database server 45, being used to the interactive client of literal provides literal interactive function;
The interactive client 46 of literal is used for carrying out the literal interaction with Web server;
Long-distance Control server 47, being used to administrative staff provides each server and real-time remote monitoring function.
Referring to Fig. 5, the embodiment of the invention also provides a kind of multi-medium data collecting device, and this equipment comprises:
Data acquisition unit 50 is used to gather multi-medium data;
Packing data unit 51 is used for the multi-medium data that said data acquisition unit collects is packed, and according to the packing order corresponding order number is encapsulated in the multi-medium data bag after the packing;
Data transmission unit 52 is used for the multi-medium data bag after the packing of said packing data unit is sent to the virtual studio server.
Said packing data unit 50 comprises:
Video packing unit is used for the coding video data that collects is encapsulated in coded data in the video packets of data;
Audio frequency packing unit is used for the voice data that collects, playing duration is identical with the playing duration of said video data is encoded, and coded data is encapsulated in the packets of audio data.
Said video packing unit is used for:
Will be according to video acquisition frame per second fr
vThe M that a collects frame of video is encoded, and M is not less than 1 integer;
Said audio frequency packing unit is used for:
With the current byte number that collects do
Voice data encode said fr
aBe audio sample rate, said N is a channel number, and said bps is the sampled point figure place.
Referring to Fig. 6, the embodiment of the invention also provides a kind of said virtual studio server, and this server comprises:
Packet receiving element 60 is used for the multi-medium data bag that the receiving multimedia data collecting device is sent;
Packet lock unit 61 is used for adjusting the serial number of the multi-medium data bag that said packet receiving element receives, and the serial number that the adjustment back is comprised by the identical multi-medium data bag of multi-medium data collecting device transmitting time is identical;
Packet retransmission unit 62 is used for the adjusted multi-medium data bag of serial number is sent to live direct broadcast server.
Said packet lock unit 61 comprises:
Reference device is chosen the unit, and a multi-medium data collecting device that is used for choosing said at least two multi-medium data collecting devices is as time reference equipment;
The unit is confirmed in time migration; Be used for for other each the multi-medium data collecting devices except that said time reference equipment, confirm that this multi-medium data collecting device begins to begin to send to said virtual studio server the time migration of multi-medium data bag to said virtual studio server transmission multi-medium data bag and said time reference equipment;
The serial number adjustment unit is used for adjusting the serial number of the multi-medium data bag of this multi-medium data collecting device transmission according to the multi-medium data collecting device time corresponding skew of confirming.
Said time migration confirms that the unit is used for:
Confirm the corresponding video frame number of first propagation delay time between this multi-medium data collecting device and said virtual studio server according to following formula: Δ 1=t1/T1; Wherein t1 is first propagation delay time, and T1 is the playing duration of the multi-medium data bag of this multi-medium data collecting device transmission;
Confirm the corresponding video frame number of second propagation delay time between said time reference equipment and said virtual studio server according to following formula: Δ 2=t2/T2; Wherein t2 is second propagation delay time, and T2 is the playing duration of the multi-medium data bag of said time reference equipment transmission;
When confirming to receive first multi-medium data bag of this multi-medium data collecting device, receive the serial number I that the multi-medium data bag of said time reference equipment is comprised recently; Confirm that according to following formula said time migration is: Δ=I-| Δ 1-Δ 2|;
Said serial number adjustment unit is used for, and serial number and said time migration that said multi-medium data bag is comprised superpose.
If the video packets of data that this multi-medium data collecting device sends comprises according to video acquisition frame per second fr
V1The data of the M that a collects frame of video, then T1 equals M/fr
V1If the video packets of data that said time reference equipment sends comprises according to video acquisition frame per second fr
V2The data of the M that a collects frame of video, then T2 equals M/fr
V2Said M is not less than 1 integer.Said Δ 2 can be 0.
Referring to Fig. 7, the embodiment of the invention also provides a kind of live direct broadcast server, and this server comprises:
Packet receiving element 70 is used to receive the multi-medium data bag that comprises serial number that the virtual studio server is sent;
Multimedia synthesis unit 71, the data of the multi-medium data bag that the serial number that is used for said packet receiving element is received is consistent are synthesized;
The live unit 72 of multimedia is used for said multimedia synthesis unit sending to live live client behind the multimedia compressed encoding after synthetic.
This server also comprises:
At least two synthetic buffer units 73 are used for buffer memory multi-medium data bag;
Said multimedia synthesis unit 71 is used for, and the multi-medium data bag that said packet receiving element receives is put into the corresponding synthetic buffer unit of multi-medium data collecting device that sends this multi-medium data bag; According to the polling time interval of setting, from each synthetic buffer unit, read current serial number the earliest and identical multi-medium data bag, the multi-medium data that the multi-medium data bag that reads is carried synthesizes.
This server also comprises:
Play buffer unit 74, be used for the buffer memory multi-medium data;
The live unit 72 of said multimedia is used for, and the multi-medium data after said multimedia synthesis unit is synthesized is put into the broadcast buffer unit; Polling time interval according to setting reads current serial number multi-medium data the earliest from said broadcast buffer unit, the serial number of multi-medium data is meant the serial number in the synthetic employed multi-medium data bag of this multi-medium data; With sending to live live client behind the multi-medium data compressed encoding that reads.The initial value of said polling time interval
Fr wherein
vBe the video acquisition frame per second.
Said multimedia synthesis unit 71 also is used for:
Adopt following formula that said polling time interval is adjusted:
wherein θ is the degree of filling of said broadcast buffer unit.
To sum up, beneficial effect of the present invention comprises:
In the scheme that the embodiment of the invention provides; At least two multi-medium data collecting devices are packed the multi-medium data that collects, and number be encapsulated in corresponding order in the multi-medium data bag after the packing and this multi-medium data bag is sent to the virtual studio server according to the packing order; Serial number in the multi-medium data bag that the adjustment of virtual studio server receives, the serial number that the identical multi-medium data bag of adjustment back transmitting time is comprised is identical, and the adjusted multi-medium data bag of serial number is sent to live direct broadcast server; Live direct broadcast server synthesizes the data in the multi-medium data bag of the serial number unanimity that receives, and sends to live live client behind the multi-medium data compressed encoding after will synthesizing.Make that the virtual studio server synthesizes the data in a plurality of multi-medium data bags of the transmitting time unanimity that receives, compress and the back unification of encoding sends to live live client; And need all not send once for each live live client a plurality of multi-medium data bags, effectively saved system bandwidth.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, belong within the scope of claim of the present invention and equivalent technologies thereof if of the present invention these are revised with modification, then the present invention also is intended to comprise these changes and modification interior.