Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, below in conjunction with embodiment and accompanying drawing, the present invention is further detailed explanation.
In each link of the channel time delay that handoff procedure occurs of IPTV, I frame time delay is main and crucial time delay.
Mpeg encoded is divided into three kinds of I frames, P frame, B frame with picture (being frame), and wherein, I is an intra-coded frame, and P is a forward predicted frame, and B is two-way interpolation frame.Say that simply the I frame is a complete picture, the I frame comprises the most comprehensive information in the tableaux, can be independently generates picture by decoder decode, and its encoding and decoding are fully by self decision, and does not need to rely on other frame; P frame and B frame recording be variation with respect to the I frame, the P frame will rely on the I frame of front just can finish encoding and decoding; And will depending on current I frame, the B frame just can finish encoding and decoding with relevant P frame.Therefore, the I frame is very important in the encoding and decoding of Media Stream, and decoder must receive that the I frame could begin decoding.So, reduce the time delay of waiting for the I frame, very obvious to the speed effect that improves the channel switching.
As shown in Figure 1, be a kind of IPTV system architecture diagram of the embodiment of the invention, as shown in Figure 1, this IPTV system comprises head end 20, media server 21, access device 22, terminal 23, EPG server 24, application server 25.
Wherein, head end 20 is used for converting the programme content of non-IPTV network to the form that the IPTV network transmits that is adapted at for the source equipment of programme content is provided.In reality, for saving bandwidth, after head end 20 can receive the programme televised live content of transmitting via satellite based on the MPEG-2 coded format, be transcoded into based on the programme content of coded format H.264, again the programme televised live content that regenerates is viewed and admired for the user according to being input in the IPTV network of IP multicast mode, for example pass to the media server 21 in the IPTV network.
Media server 21 is used to terminal 23 that VOD (Videoon Demand, video request program) is provided business generally in local store program content, is based on the fast channel switching that media server 21 is accelerated live broadcast service in the embodiment of the invention.
When program was disposed, head end 20 was pushed to media server 21 with programme televised live, and the GOP sequence of up-to-date transmission is carried out buffer memory in 21 pairs of live video streams of media server.It is media server 21 adds the multicast message of coming from head end 20 when program is disposed multicast group, receive the programme content of direct broadcast band, and be kept in the circular buffer after GOP sequence up-to-date in the message that receives being removed the encapsulation of IP layer, the buffer memory degree of depth need be greater than the I frame period cycle of this programme televised live.A GOP sequence is exactly one group of continuous picture.What preserve in the buffer memory of media server 21 is up-to-date GOP sequence, when media server 21 is received the pairing message of I frame from multicast message, the pairing message of newly receiving of I frame is put into circular buffer, and I frame P frame and the pairing message of B frame subsequently also is placed into circular buffer.
For example, suppose that the frame sequence that media server 21 receives from head end 20 is as follows:
I1?P2?B3?P4?B5?P6?B7?P8?B9?P10?B11?I12?P13?B14?P15?B16?P17?B18?P19?B20?P21?B22?I23
The pairing message of I1 frame that to newly receive when media server 21 is received the pairing message of I1 frame from multicast message is put into buffer memory, and I1 frame P frame and the pairing message of B frame subsequently also is placed into buffer memory.The content of buffer memory was when for example, media server 21 was received P10: I1 P2 B3 P4 B5 P6 B7 P8 B9 P10.After receiving P15 frame message, media server 21 reaches the capacity of circular buffer, start anew to fill buffer memory behind the new message of then receiving, the content of buffer memory was when for example media server was received P17: B16 P17 B3 P4B5 P6 B7 P8 B9 P10 B11 I12 P13 B14 P15.
In order to reduce the time delay that multicast adds, when program is disposed, head end 20 has been pushed to the programme televised live content on the access device 22 equally, be that access device 22 also adds multicast group receiving group message, access device 22 more common in the reality can be IP Digital Subscriber Line Access Multiplexer (IP-Digital SubscriberLine Access Multiplexer, IP-DSLAM) or gigabit ethernet passive optical network (Gigabit EthernetPassive Optical Networks, GEPON) access device.Like this, just can receive on the access device 22 that head end 20 passes the multicast data flow of coming, when terminal 23 inserted, access device 22 just can be issued multicast packet terminal 23.
In actual networking, also can receive the programme televised live content and afterwards the programme televised live content is pushed to access device 22 by media server 21.
Necessary authentication is carried out alternately with application server 25 in terminal 23 start backs.After terminal 23 authentications are passed through, by with the mutual acquisition direct broadcast band list information of EPG (Electronic Program Guide, electric program menu) server 24.
In this direct broadcast band list information except the multicast ip address that can comprise normal programme televised live and the codec parameters information that is used for the programme televised live audio-video code stream is decoded, also being included as terminal 23 provides the IP address and the port number information of the media server 21 of fast channel switching, when terminal 23 is being carried out fast channel when switching, the media server 21 of the IP address of the media server 21 that switches by described fast channel and port numbers and the switching of described fast channel carries out alternately.
For example, following is the example that provides certain channel parameter information in the direct broadcast band tabulation according to SDP (Session Description Protocol, Session Description Protocol) form:
V=0 // protocol version
0=-2890844526 2890842807IN IP4192.16.24.202 // session identification
S=SDP Session // session name
A=control:sdp: //ts.example.com/twister/cctv1 // control URL
M=video 7722MP2T/AVP 33 // definition 33 is the corresponding PT type of MPEG-2TS stream in RFC3551
The multicast ip address of c=IN IP4224.2.1.183 // program
A=rtcp:3021IN IP4126.16.64.4 // media server 21 receives the IP address and the port numbers of RTCP request message.
Terminal 23 receives the programme content that access devices 22 send, if terminal 23 needs switching channels, switches to target channel according to the mode of normal switching channels, promptly adds the pairing multicast group of target channel by IGMP message.After access device 22 is finished the IGMP Message Processing, the multicast message of described ownership goal channel is transmitted to terminal 23.
For example, with reference to aforesaid SDP,, then add the multicast group 224.2.1.183 of this target channel correspondence if add a certain target channel.
Terminal 23 adds the pairing multicast group of target channel according to the multicast ip address of the programme televised live in the described direct broadcast band list information that obtains by IGMP message.
After access device 22 is finished the IGMP Message Processing, the multicast message of described target channel is transmitted to terminal 23.
23 pairs at terminal receives that first multicast RTP bag checks that if find that present frame is not the I frame, then send the request message of transmission I frames to media server 21, requiring media server 21 to send with the I frame is the Media Stream of start frame.
For example, the content of the target channel of media server 21 current cache is:
I1?P2?B3?P4?B5?P6?B7?P8?B9?P10
After supposing that terminal 23 switches to target channel, the frame of current reception is the P6 frame, because the P frame can not decode the major part of image, just beginning to decode when receiving next I frame by the time to show the time-delay of transmission.So, for improving image quality, making terminal 23 switch to the picture that decodes after the target channel is the most comprehensive information in the tableaux, and then the performance of minimizing time delay, then terminal 23 is judged when the frame of current reception is not the I frame, just send the request message of transmission I frame to media server 21, requiring media server 21 to send with the I frame is the Media Stream of start frame.
For example, terminal 23 can be by sending RTCP (Real-timeTransport Control Protocol, the RTCP Real-time Transport Control Protocol) request message of expansion to media server 21, and requiring media server 21 to send with the I frame is the Media Stream of start frame.
Comprise the RTP packet number of the terminal 23 current target channel of receiving in the RTCP request message of described expansion and may further include line bandwidth, terminal 23 buffer size information, the IP address of terminal 23 reception messages and the udp port information that terminal 23 receives messages that terminal 23 inserts.
The message format of the RTCP request message of described expansion can have multiple make, as long as comprise the RTP packet number of the target channel that above-mentioned current terminal 23 receives or further comprise line bandwidth, the terminal 23 buffer size information that terminal 23 inserts, terminal 23 receives the IP address of messages and udp port information that terminal 23 receives messages gets final product.For example, can be according to the practical application needs, the RTCP message of expanded application definition (Application-Defined RTCP Packet, APP), the APP message format is as follows:
0 1 2 3
0?1?2?3?4?5?6?7?8?9?0?1?2?3?4?5?6?7?8?9?0?1?2?3?4?5?6?7?8?9?0?1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|V=2|P|subtype| PT=APP=204| length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| SSRC/CSRC |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| name(ASCII) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| application-dependent?data ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Bag type (the packet type of APP message, PT) be fixed as 204bits, subtype subtype (5 bits) can expand according to practical application, the APP message mainly is to utilize application-dependent data application-dependent data cell to transmit the RTP packet number of the target channel of receiving, terminal 23 receives the udp port number that retransmits messages, terminal 23 receives the IP address that retransmits message, relevant informations such as line bandwidth that terminal 23 inserts and terminal 23 buffer size, in the present embodiment, it is as follows to define application-dependent data cell part:
After media server 21 was received the request message of described transmission I frame, sending with the I frame to terminal 22 was the Media Stream of start frame.
So, after terminal 23 switches to target channel, when the present frame that receives is non-I frame, because asking media server 21 transmission again is the Media Stream of start frame with the I frame, so the image that terminal 23 decodes is the most comprehensive information in the tableaux, so the image that terminal 23 demonstrates embodies the time delay of not coming out, image quality is than higher.
For example, the content of supposing the target channel that media server 21 need receive from head end 20 is:
I1?P2?B3?P4?B5?P6?B7?P8?B9?P10?B11?I12?P13?B14?P15
The content of the target channel of media server 21 current cache is:
I1?P2?B3?P4?B5?P6?B7?P8?B9?P10
After supposing that terminal 23 switches to target channel, the present frame that media server 21 sends is the P8 frame, after media server 21 receives the request message of the transmission I frame that terminal 23 sends, when terminal 23 transmissions are the Media Stream of start frame with the I frame, described Media Stream comprises the nearest I frame before the present frame, and the content between present frame and the nearest I frame.
For example, media server 21 sends to terminal 23: nearest I1 frame before the current P8 frame, and the Media Stream after this I1 frame, i.e. I1 P2 B3 P4 B5 P6 B7.Perhaps, 21 of media servers are nearest I1 frames before terminal 23 sends current P8 frame, i.e. I1 only sends out the I1 frame and allows terminal based on the I1 frame P8 frame be decoded and can cause picture quality to descend to some extent, but at this moment can show new channel, reduce handover delay based on I1 frame fast decoding.
Because after terminal 23 switches to target channel, the Media Stream that receiving media server 21 sends always is the Media Stream of start frame with the I frame, so the image that terminal 23 decodes is the most comprehensive information in the tableaux, so the image that terminal 23 demonstrates embodies the time delay of not coming out, image quality is than higher.
In addition, media server can also wrap the time with respect to nearest before I frame according to the RTP that the caching situation of oneself comes computing terminal to receive, and calculate the wait time delay that terminal is received next I frame according to the I frame period, whether retransmit according to certain strategy decision again, as judging whether that to the requirement of switching time needs retransmit according to I frame period cycle of the current message of receiving of terminal, program and system:
If terminal is received the wait time delay of next I frame less than predetermined threshold value, then media server can be left intact, and wherein threshold value can be set the requirement of switching time according to system;
If terminal is received the wait time delay of next I frame greater than predetermined threshold value, then can with before nearest I frame and I frame resend to terminal to the message between the present frame.
In addition, for further improving the quality of picture, after media server 21 is received the RTCP request message of the expansion that terminal 23 sends, can know that current terminal 23 received that RTP bag according to the RTCP request message of described expansion, and can know the access bandwidth and the buffer size of this terminal 23.
So, in order to fill the buffering area of terminal 23 fast, thereby reduce the buffering time delay, media server 21 is when sending the message of I1 frame between present frame P8, send the transmission rate of the transmission rate of this message greater than normal message, the transmission rate of described normal message is that head end sends the speed of message or the speed of the message that media server receives, so also can reduce with multicast message in the conflicting of I frame on the horizon.
Terminal 23 just can begin decoding output after receiving I1 frame message, afterwards according to the multicast message continuous decoding of receiving.
Further, if find based on line bandwidth that the terminal in the RTCP request message of described expansion 23 is inserted and terminal 23 buffering area Buffer information analyses, it is less than normal that line bandwidth that terminal 23 inserts or terminal slow 23 are dashed district Buffer, consider that the B frame in the video flowing mainly is to be used for increasing frame frequency, do not influence the main picture of video, when so media server 21 sends at message, I1 frame to the pairing RTP bag of the B frame in the message of present frame P8 can be abandoned, promptly do not send the I1 frame to the B frame between the present frame P3 to terminal 23, thereby reduce to send message to the line bandwidth of terminal 23 accesses and the pressure of terminal 23 buffering area Buffer, to reduce time delay.
For example, the content of the target channel of media server 21 current cache is:
I1?P2?B3?P4?B5?P6?B7?P8?B9?P10
After supposing that terminal switches to target channel, after the P8 frame that detection at first receives is not the I frame, to media server request I frame, media server sends to terminal after receiving the request message of the transmission I frame that terminal sends: I1 frame, P2P4 and P6 frame (the non-B frame between I1 frame and the P8 frame).What at this moment media server sent is I1P2P4 and P6 frame, does not send the I1 frame to the pairing RTP bag of the B frame between the present frame P8.
In addition, because the relative P frame of data volume of I frame is big in the reality, in order to reduce retransmitting the requirement of bandwidth, media server 21 can also be done the processing that degrades to the I1 frame of needs transmission, and the relative original I 1 frame data quantitative change of I1 frame that degrades after handling is little.
Like this, buffer memory on the media server 21 be to degrade after the I1 frame, after media server 21 was received the request message of the transmission I frame that terminal 23 sends, the I1 frame that just will degrade sent to terminal 23.
Degrading of I1 frame handled can adopt first decoding, and then according to the mode of lower coding parameter recompile, to reduce retransmitting the requirement of bandwidth.Also can carry out at parameter field, the processing mode that degrades for example comparatively commonly used is: the quantification word length that reduces motion vector, and the DCT coefficient of high frequency is changed to 0 or carry out re-quantization, carry out re-quantization as DCT parameter to image encoding, to reduce quantified precision, thereby reduce to retransmit message to the line bandwidth of terminal 23 accesses and the pressure of terminal 23 buffering area Buffer, to reduce time delay.
According to a further embodiment of the invention, if having the real time codec transfer capability on the media server 21, can also utilize media server 21 to generate in real time that the I frames further reduce time delay and to the requirement of the bandwidth of terminal 23 accesses.
For example, the frame sequence of supposing certain target channel that media server 21 is received from head end 20 is:
I1?P2?B3?P4?B5?P6?B7?P8?B9?P10?B11?I12?P13?B14?P15?...,
Media server 21 receives that whenever a frame image signal just decodes to it, recovers original image O1 O2O3 O4 O5 O6 O7 O8 O9 O10....
After terminal 23 switched to the ownership goal channel, if first RTP bag of receiving is the data of B7 frame, then terminal 23 was transmitted the I frames by the RTCP request message of expansion to media server 21 requests.
Media server 21 is received the request message of this transmission I frame, knows that terminal 23 receives the data of B7 frame.This moment can be according to the frame before the B7, and as P6 or B5 or P4 or B3 or P2, recompile is I frame coded data I
O6Or I
O5Or I
O4Or I
O3Or I
O2With with before the present frame B7 recently P6 frame recompile be I frame coded data I
O6Be example, media server 21 removes decoding P6 frame and obtains corresponding two field picture O6, also present frame (being B7) nearest two field picture (being O6) is before generated corresponding I frame coded data I according to I frame pattern recompile
O6, again with the data I of recompile
O6Send to terminal 23.As long as terminal 23 is received I like this
O6The back just can begin to decode, and media server 21 need not send I1 frame and I1 to the data between the P6 frame.Be media server 21 transmission be that two field picture O6 nearest before the current frame image B7 is by the I of recompile
O6
The message received of terminal 23 is as follows like this: B7 I
O6P8 B9 P10 B11 I12 P13 B14 P15....
In addition, media server 21 can also be according to certain frame period I frame of encoding.For example still top frame sequence, media server 21 can be encoded P4, P8 and P10 again according to the I frame pattern, if terminal 23 data that to switch to first RTP bag of receiving behind this channel be the B7 frame and terminal 23 are when media server 21 request transmission I frames like this, present frame B7 nearest and frame that be recoded to the I frame before is P4, so the I that media server 21 sends according to I frame pattern recompile
O4Frame and I
O4Frame data B5P6 after the frame, and do not need to transmit the I1 frame to the frame data between the B3.
In addition, because the relative P frame of data volume of I frame is big in the reality, in order to reduce retransmitting the requirement of bandwidth, media server 21 can be done the processing that degrades to the I frame according to I frame pattern recompile of needs transmission.Like this, media server 21 receives that the I frame that just will degrade behind the request message of the transmission I frame that terminal 23 sends sends to terminal 23, thereby reduces message to the line bandwidth of terminal 23 accesses and the pressure of terminal 23 buffering area Buffer, to reduce time delay.
In addition, consider from the angle that reduces network cost, the coding/decoding capability of media server 21 can be placed on the media server of highest level, its coded I frame message is transferred near on the media server of terminal 23 by independent multicast channel, buffer memory gets off receive the I frame message of multicast near the media server of terminal 23 after, when the RTCP of the expansion of receiving terminal 23 request message, again the I frame message of described buffer memory is issued terminal 23 near user's media server.
According to another embodiment provided by the invention, as shown in Figure 2, the schematic flow sheet of a kind of channel switching method of carrying for a preferred embodiment of the present invention, the concrete implementation step of this channel switching method can be as follows.
Step 101, head end are pushed to media server with programme televised live, and media server carries out buffer memory to the GOP sequence of up-to-date transmission in the live video stream.
Head end provides the source equipment of programme content, is used for converting the programme content of non-IPTV network to the form that the IPTV network transmits that is adapted at.
Media server is used to the user that VOD (Video onDemand, video request program) is provided business generally in local store program content, is based on the fast channel switching that media server is accelerated live broadcast service in the embodiment of the invention.
When program is disposed, head end is pushed to media server with programme televised live, it is media server adds the multicast message of coming from head end when program is disposed multicast group, receive the programme content of direct broadcast band, and be kept in the circular buffer after GOP sequence up-to-date in the message that receives being removed the encapsulation of IP layer, the buffer memory degree of depth need be greater than the I frame period cycle of this programme televised live.A GOP sequence is exactly one group of continuous picture.What preserve in the buffer memory of media server 21 is up-to-date GOP sequence, when media server 21 is received the pairing message of I frame from multicast message, the pairing message of newly receiving of I frame is put into buffer memory, and I frame P frame and the pairing message of B frame subsequently also is placed into circular buffer.
For example, suppose that the frame sequence that media server 21 receives from head end 20 is as follows:
I1?P2?B3?P4?B5?P6?B7?P8?B9?P10?B11?I12?P13?B14?P15?B16?P17?B18?P19?B20P21?B22?I23
The pairing message of I1 frame that to newly receive when media server 21 is received the pairing message of I1 frame from multicast message is put into buffer memory, and I1 frame P frame and the pairing message of B frame subsequently also is placed into buffer memory.The content of buffer memory was when for example, media server 21 was received P10: I1 P2 B3 P4 B5 P6 B7 P8 B9 P10.After receiving P15 frame message, media server 21 reaches the capacity of circular buffer, start anew to fill buffer memory behind the new message of then receiving, the content of buffer memory was when for example media server was received P17: P16 P17 B3 P4B5 P6 B7 P8 B9 P10 B11 I12 P13 B14 P15.
Step 102, head end are pushed to access device with the programme televised live content.
For reducing the time delay that multicast adds, when program is disposed, head end has been pushed to the programme televised live content on the access device equally, be that access device also adds multicast group receiving group message, more common access device comprises IP Digital Subscriber Line Access Multiplexer and gigabit ethernet passive optical network access device in the reality.Like this, just can receive on the access device that head end passes the multicast data flow of coming, when the user inserted, access device just can be issued the user with multicast packet.
In this step, in actual networking, also can receive the programme televised live content and afterwards the programme televised live content is pushed to access device by media server.
Carry out necessary authentication alternately with application server behind step 103, the starting up of terminal.
After step 104, terminal authentication pass through, by with the mutual acquisition direct broadcast band list information of EPG server.
After terminal authentication passes through, by with the mutual acquisition direct broadcast band list information of EPG server.In this direct broadcast band list information except the multicast ip address that comprises normal programme televised live and the codec parameters information that is used for the programme televised live audio-video code stream is decoded, also being included as terminal provides the IP address and the port number information of the media server of fast channel switching, when terminal is being carried out fast channel when switching, the media server of the IP address of the media server that switches by described fast channel and port numbers and the switching of described fast channel carries out alternately.
For example, following is the example that provides certain channel parameter information in the direct broadcast band tabulation according to SDP (Session Description Protocol, Session Description Protocol) form:
V=0 // protocol version
0=-2890844526 2890842807IN IP4192.16.24.202 // session identification
S=SDP Session // session name
A=control:sdp: //ts.example.com/twister/cctv1 // control URL
M=video 7722MP2T/AVP 33 // definition 33 is the corresponding PT type of MPEG-2TS stream in RFC3551
The multicast ip address of c=IN IP4224.2.1.183 // program
A=rtcp:3021IN IP4126.16.64.4 // media server receives the IP address and the port numbers of RTCP request message.
Step 105, terminal receive the programme content that access device sends, if terminal needs switching channels, switch to target channel according to the mode of normal switching channels, promptly add the pairing multicast group of target channel by IGMP message.
For example, with reference to the description of step 104,, then add the multicast group 224.2.1.183 of this target channel correspondence if add a certain target channel.
Terminal adds the pairing multicast group of target channel according to the multicast ip address of the programme televised live in the described direct broadcast band list information that obtains by IGMP message.
After step 106, access device are finished the IGMP Message Processing, the multicast message of described ownership goal channel is transmitted to terminal.
Step 107, terminal are checked receiving first multicast RTP bag, if find present frame right and wrong I frame, then send the request message of transmission I frame to media server, and requiring media server to send with the I frame is the Media Stream of start frame.
For example, the content of the target channel of media server current cache is:
I1?P2?B3?P4?B5?P6?B7?P8?B9?P10
After supposing that terminal switches to target channel, the frame of current reception is the P6 frame, because the P frame can not decode the major part of image, when receiving next I frame by the time, just begin to decode and to show the time-delay of transmission, so, for improving image quality, make that the picture that decodes when terminal switches to target channel is the most comprehensive information in the tableaux, and then the performance of minimizing time delay, then the frame of the current reception of terminal judges is not the I frame, just send the request message of transmission I frame to media server, requiring media server to send with the I frame is the Media Stream of start frame.
For example, terminal can require media server to send nearest I frame by send the RTCP request message of expansion to media server.Comprise the RTP packet number of the target channel that current terminal is received in the RTCP request message of described expansion and may further include line bandwidth, terminal buffer size information, the IP address of terminal reception message and the udp port information that terminal receives message that terminal inserts.
The message format of the RTCP request message of described expansion can have multiple make, as long as comprise the RTP packet number of the target channel that above-mentioned current terminal receives or further comprise line bandwidth, the terminal buffer size information that terminal inserts, terminal receives the IP address of message and udp port information that terminal receives message gets final product.For example, can be according to the practical application needs, the RTCP message of expanded application definition (Application-Defined RTCP Packet, APP), the APP message format is as follows:
0 1 2 3
0?1?2?3?4?5?6?7?8?9?0?1?2?3?4?5?6?7?8?9?0?1?2?3?4?5?6?7?8?9?0?1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|V=2|P|subtype| PT=APP=204 | length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| SSRC/CSRC |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| name(ASCII) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| application-dependent?data ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Bag type (the packet type of APP message, PT) be fixed as 204bits, subtype subtype (5bits) can expand according to practical application, the APP message mainly is that the udp port that utilizes RTP packet number, terminal that application-dependent data application-dependent data cell transmits the target channel of receiving to receive to retransmit message number, terminal receive relevant informations such as the IP address that retransmits message, line bandwidth that terminal inserts and terminal buffer size, in the present embodiment, it is as follows to define application-dependent data cell part:
After step 108, media server were received the request message of described transmission I frame, sending with the I frame to terminal was the Media Stream of start frame.
So, after terminal switches to target channel, when the present frame that receives is non-I frame, because asking the media server transmission again is the Media Stream of start frame with the I frame, so the image that decoding terminals goes out is the most comprehensive information in the tableaux, so the image that terminal demonstrates embodies the time delay of not coming out, image quality is than higher.
For example, the content of the target channel of termination receipts is to suppose to need from the beginning by media server:
I1?P2?B3?P4?B5?P6?B7?P8?B9?P10?B11?I12?P13?B14?P15
The content of the target channel of media server current cache is:
I1?P2?B3?P4?B5?P6?B7?P8?B9?P10
After supposing that terminal switches to target channel, the present frame that media server sends is the P8 frame, after media server receives the request message of the transmission I frame that terminal sends, when the terminal transmission is the Media Stream of start frame with the I frame, Media Stream comprises the nearest I frame before the present frame, and the content between present frame and the nearest I frame.
For example, media server 21 sends to terminal 23: nearest I1 frame before the current P3 frame, and the Media Stream after this I1 frame, i.e. I1 P2 B3 P4 B5 P6 B7.Perhaps, 21 of media servers are nearest I1 frames before terminal 23 sends current P8 frame, i.e. I1 only sends out the I1 frame and allows terminal based on the I1 frame P8 frame be decoded and can cause picture quality to descend to some extent, but at this moment can show new channel, reduce handover delay based on I1 frame fast decoding.
Because after terminal switches to target channel, the Media Stream of receiving media Server Transport always is the Media Stream of start frame with the I frame, so the image that decoding terminals goes out is the most comprehensive information in the tableaux, so the image that terminal demonstrates embodies the time delay of not coming out, image quality is than higher.
Media server can also wrap the time with respect to nearest before I frame according to the RTP that the caching situation of oneself comes computing terminal to receive, and calculate the wait time delay that terminal is received next I frame according to the I frame period, whether retransmit according to certain strategy decision again, as judging whether that to the requirement of switching time needs retransmit according to I frame period cycle of the current message of receiving of terminal, program and system:
If terminal is received the wait time delay of next I frame less than predetermined threshold value, then media server is left intact, and wherein threshold value can be set the requirement of switching time according to system;
If terminal is received the wait time delay of next I frame greater than predetermined threshold value, then nearest I frame and I frame resends to terminal to the message between the present frame before.
In addition, for further improving the quality of picture, after media server is received the RTCP request message of this expansion, can know that current terminal received that RTP bag according to the RTCP request message of described expansion, and can know the access bandwidth and the buffer size of this terminal.
So, thereby reduce the buffering time delay in order to fill terminal buffer fast, media server is when sending the message of I1 frame between present frame P8, send the transmission rate of the transmission rate of this message greater than normal message, the transmission rate of described normal message is that head end sends the speed of message or the speed of the message that media server receives, so also can reduce with multicast message in the conflicting of I frame on the horizon.
Terminal just can begin decoding output after receiving I1 frame message, afterwards according to the multicast message continuous decoding of receiving.
Further, if find based on line bandwidth that the terminal in the RTCP request message of described expansion is inserted and terminal buffer Buffer information analysis, line bandwidth or terminal buffer Buffer that terminal inserts are less than normal, consider that the B frame in the video flowing mainly is to be used for increasing frame frequency, do not influence the main picture of video, when so media server sends at message, I1 frame to the pairing RTP bag of the B frame in the message of present frame P3 can be abandoned, promptly do not send the I1 frame to the B frame between the present frame P3 to terminal, thereby reduce to send message to the line bandwidth of terminal access and the pressure of terminal buffer Buffer, to reduce time delay.
For example, the content of the target channel of media server current cache is:
I1?P2?B3?P4?B5?P6?B7?P8?B9?P10
After supposing that terminal switches to target channel, detecting the P8 frame that at first receives is not to media server request I frame behind the I frame, media server sends to terminal after receiving the request message of the transmission I frame that terminal sends: I1 frame, P2 P4 and P6 frame (the non-B frame between I1 frame and the P8 frame).What at this moment media server sent is I1 P2 P4 and P6 frame, does not send the I1 frame to the pairing RTP bag of the B frame between the present frame P8.
In addition, because the relative P frame of data volume of I frame is big in the reality, in order to reduce retransmitting the requirement of bandwidth, media server can also be done the processing that degrades to the I1 frame of needs transmission, and the relative original I 1 frame data quantitative change of I1 frame that degrades after handling is little.
Like this, buffer memory on the media server be to degrade after the I1 frame, after media server was received the request message of the transmission I frame that terminal sends, the I1 frame that just will degrade sent to terminal.
Degrading of I1 frame handled can adopt first decoding, and then according to the mode of lower coding parameter recompile, to reduce retransmitting the requirement of bandwidth.Also can carry out at parameter field, the processing mode that degrades for example comparatively commonly used is: the quantification word length that reduces motion vector, and the DCT coefficient of high frequency is changed to 0 or carry out re-quantization, carry out re-quantization as DCT parameter to image encoding, to reduce quantified precision, thereby reduce to retransmit message to the line bandwidth of terminal access and the pressure of terminal buffer Buffer, to reduce time delay.
Another embodiment provided by the invention, as shown in Figure 3, schematic flow sheet for a kind of channel switching method, the channel switching method that provides among this channel switching method and first embodiment is similar substantially, difference is that media server generates the I frame in real time and sends to terminal in step 108, and concrete implementation step is as follows.
Step 201, head end is pushed to media server with programme televised live, and media server carries out buffer memory to the GOP sequence of up-to-date transmission in the live video stream.
Step 202, head end are pushed to access device with the programme televised live content.
Carry out necessary authentication alternately with application server behind step 203, the starting up of terminal.
After step 204, terminal authentication pass through, by with the mutual acquisition direct broadcast band list information of EPG server.
Step 205, terminal receive the programme content that access device sends, if terminal needs switching channels, switch to target channel according to the mode of normal switching channels, promptly add the pairing multicast group of target channel by IGMP message.
After step 206, access device are finished the IGMP Message Processing, the multicast message of described ownership goal channel is transmitted to terminal.
Step 207, terminal are checked receiving first multicast RTP bag, if find it is not the I frame, then send the request message of transmission I frame to media server.
After step 208, media server are received the request message of this transmission I frame, generate the I frame in real time and send to terminal.
For reducing to the line bandwidth of terminal access and the pressure of terminal suspending Buffer size, if have the real time codec transfer capability on the media server, can also utilize media server to generate in real time that the I frame further reduces time delay and the requirement of bandwidth that terminal is inserted.
For example, the frame sequence of supposing certain target channel that media server is received from head end is:
I1?P2?B3?P4?B5?P6?B7?P8?B9?P10?B11?I12?P13?B14?P15?...,
Media server receives that whenever a frame image signal just decodes to it, recovers original image O1 O2 O3O4 O5 O6 O7 O8 O9 O10 ....For example, after terminal switches to the ownership goal channel, first RTP bag of receiving is the data of B7 frame, then terminal is when media server transmits the I frame by the RTCP request message requests of expansion, media server knows that terminal received the data of B7 frame, this moment can be according to the frame before the B7, and as P6 or B5 or P4 or B3 or P2, recompile is I frame coded data I
O6Or I
O5Or I
O4Or I
O3Or I
O2With with before the present frame B7 recently P6 frame recompile be I frame coded data I
O6Be example, media server removes decoding P6 frame and obtains corresponding two field picture O6, also present frame (being B7) nearest two field picture (being O6) is before generated corresponding I frame coded data I according to I frame pattern recompile
O6, again with the data I of recompile
O6Send to terminal.As long as terminal is received I like this
O6The back just can begin to decode, and media server need not send I1 frame and I1 to the data between the P6 frame.Be media server transmission be the I that nearest two field picture O6 is generated by recompile before the present frame
O6
The message received of terminal is as follows like this: B7 I
O6P8 B9 P10 B11 I12 P13 B14 P15....
In addition, media server can also be according to certain frame period I frame of encoding.For example still top frame sequence, media server can be encoded P4, P8 and P10 again according to the I frame pattern, if terminal data that to switch to first RTP bag of receiving behind this channel be the B7 frame and terminal are when media server request transmission I frame like this, present frame B7 nearest and frame that be recoded to the I frame before is P4, so the media server transmission is according to the I of I frame pattern recompile
O4Frame and I
O4Frame data B5 P6 after the frame, and do not need to transmit the I1 frame to the frame data between the B3.
In addition, because the relative P frame of data volume of I frame is big in the reality, in order to reduce retransmitting the requirement of bandwidth, media server can be done the processing that degrades to the I frame according to I frame pattern recompile of needs transmission.Like this, media server receives that the I frame that just will degrade behind the request message of the transmission I frame that terminal sends sends to terminal, thereby reduces message to the line bandwidth of terminal access and the pressure of terminal buffer Buffer, to reduce time delay.
In addition, consider from the angle that reduces network cost, the coding/decoding capability of media server can be placed on the media server of highest level, its coded I frame message is transferred near on user's the media server by independent multicast channel, buffer memory gets off receive the I frame message of multicast near user's media server after, when the RTCP of the expansion of receiving terminal request message, again the I frame message of described buffer memory is issued terminal near user's media server.
According to another embodiment of the invention, the logical construction of corresponding described media server 21 of embodiment of Fig. 1 and terminal 23 further can be with reference to figure 4, as shown in Figure 4, media server 21 may further include: receiving element 401, the I frame is chosen unit 403, transmitting element 405, buffer unit 407.Terminal 23 may further include receiving element 402, detecting unit 404, processing unit 406.
To the detailed process in described media server 21 and terminal 23 handoff procedures, can be with reference to the description of 1 corresponding system embodiment of figure, when only just switching below, the course of work of described media server 21 and terminal 23 is described.
When terminal 23 received the programme content of access devices 22, receiving element 402 received the programme content that access devices 22 send, if terminal 23 needs switching channels, switched to target channel according to the mode of normal switching channels.
Switch in the generating process, first multicast RTP bag of 404 pairs of target channel of receiving of detecting unit is checked, if find present frame right and wrong I frame, with result notification processing unit 406, processing unit 406 sends the request message that transmits the I frame to media server 21, and requiring media server 21 to send with the I frame is the Media Stream of start frame.The request message of described transmission I frame can send by expansion RTCP request message, specifically can be with reference to the description of 1 corresponding system embodiment of figure.
For example, the content of supposing the target channel that media server 21 need receive from head end 20 is:
I1?P2?B3?P4?B5?P6?B7?P8?B9?P10?B11?I12?P13?B14?P15
The content of the target channel of buffer unit 407 current cache of media server 21 is:
I1?P2?B3?P4?B5?P6?B7?P8?B9?P10
After supposing that terminal 23 switches to target channel, the present frame that transmitting element 405 sends is the P8 frame, then detecting unit 404 can judge that present frame is non-I frame, processing unit 406 sends the request message that transmits the I frame to media server 21, and requiring media server 21 to send with the I frame is the Media Stream of start frame.
After receiving element 401 was received the request message of described transmission I frame, the I frame was chosen unit 403 and is carried out the I frame and choose.
It can be present frame nearest I frame before that the I frame is chosen the I frame of choosing unit 403.According to another embodiment of the invention, described media server 21 can also comprise judging unit 409, be used to judge that terminal receives that whether the wait time delay of next I frame is less than predetermined threshold value, when judging unit 409 judges that wait time delay that terminals receive next I frame is less than predetermined threshold value, then media server is left intact, can directly abandon the request message of the transmission I frame of terminal this moment, and wherein threshold value can be set the requirement of switching time according to system; When judging unit 409 judges that wait time delay that terminals receive next I frame is greater than predetermined threshold value, the request message of the transmission I frame that sends according to terminal then will be that the Media Stream of start frame sends to terminal with the I frame.
According to another embodiment of the invention, the I frame is chosen unit 403 can also whenever receive a frame image signal, just it is decoded, and recovers original image, and the I frame is chosen unit 403 and chosen the before nearest and I frame that carried out I frame pattern coding again of present frame.
If the I frame is chosen the nearest I frame before the present frame that is that unit 403 chooses, then to send with the I frame to terminal 23 be that the Media Stream of start frame can comprise to transmitting element 405: nearest I frame before the present frame and the content after this nearest I frame, for example: I1 P2 B3 P4 B5 P6 B7.Perhaps include only present frame nearest I frame before, for example: I1.
In another embodiment of the present invention, when the I frame was chosen unit 403 and chosen before the present frame nearest and I frame that carried out I frame pattern coding again, it specifically can be as described below.
Receiving element 401 receives the request message of described transmission I frame, knows that the present frame that terminal 23 is received is non-I frame, and at this moment the I frame is chosen unit 403 and chosen the before nearest and I frame that carry out I frame pattern coding again of present frame.Transmitting element 405 sends to terminal 23 with the I frame of this recompile, as long as terminal 23 just can begin decoding after receiving the I frame of this recompile like this.
It is the Media Stream of start frame that transmitting element 405 sends with the I frame to terminal 23.
For example, the frame sequence of supposing certain target channel that media server 21 is received from head end 20 is:
I1?P2?B3?P4?B5?P6?B7?P8?B9?P10?B11?I12?P13?B14?P15?...,
Media server 21 is whenever received a frame image signal, and the I frame is chosen unit 403 and just it decoded, and recovers original image O1 O2 O3 O4 O5 O6 O7 O8 O9 O10....For example, after terminal 23 switched to the ownership goal channel, first RTP bag that receiving element 402 is received was the data of B7 frame, and detecting unit 404 detects and is non-I frame, and then processing unit 406 is to the RTCP request message requests transmission I frame of media server 21 by expansion.
Receiving element 401 receives the request message of described transmission I frame, know that terminal 23 receives the data of B7 frame, nearest and frame that carry out I frame pattern coding again is the P6 frame before the present frame B7, at this moment the I frame is chosen unit 403 except that the corresponding original image O6 of decoding P6 frame acquisition, also original image O6 is generated corresponding I frame coded data I according to I frame pattern recompile
O6, the I frame is chosen unit 403 and is chosen present frame (being the B7 frame) nearest before and I frame that carry out I frame pattern coding, i.e. I
O6Transmitting element 405 is with the data I of recompile
O6Send to terminal 23, as long as terminal 23 is received I like this
O6The back just can begin to decode, and transmitting element 405 need not send I1 frame and I1 to the data between the P6 frame.
The message received of receiving element 402 is as follows like this: B7 I
O6P8 B9 P10 B11 I12 P13 B14P15....
So, after terminal 23 switches to target channel, when the present frame that receives is non-I frame, because asking media server 21 transmission again is the Media Stream of start frame with the I frame, so the image that terminal 23 decodes is the most comprehensive information in the tableaux, so the image that terminal 23 demonstrates embodies the time delay of not coming out, image quality is than higher.
In addition, the I frame choose unit 403 can also be according to certain frame period I frame of encoding.For example still top frame sequence, the I frame is chosen unit 403 and P4, P8 and P11 can be encoded according to the I frame pattern again, if terminal 23 data that to switch to first RTP bag of receiving after this target channel be the B7 frame and processing unit 406 are when media server 21 request transmission I frames like this, present frame B7 nearest and frame that be recoded to the I frame before is P4, so the I frame is chosen unit 403 and is chosen present frame (being the B7 frame) nearest before and I frame that carry out I frame pattern coding, i.e. I
O4The I that transmitting element 405 sends according to I frame pattern recompile
O4Frame and I
O4Frame data B5 P6 after the frame, and do not need to transmit the I1 frame to the frame data between the B3.
So, after terminal 23 switches to target channel, when the present frame that receives is non-I frame, because asking media server 21 transmission again is the Media Stream of start frame with the I frame, so the image that terminal 23 decodes is the most comprehensive information in the tableaux, so the image that terminal 23 demonstrates embodies the time delay of not coming out, image quality is than higher.
According to another embodiment of the invention, the logical construction of above-mentioned media server 21 and terminal 23 can also be with reference to figure 5, and as shown in Figure 5, the I frame is chosen unit 403 and be may further include coding unit 501, selected cell 502.
Receiving element 401 receives the request message of described transmission I frame, knows that the present frame that terminal 23 is received is non-I frame, and nearest two field picture carries out I frame pattern coding again before 501 pairs of present frames of coding unit.It is the start frame of Media Stream that selected cell 502 is selected this I frame that carries out I frame pattern coding again.Transmitting element 405 sends to terminal 23 with the I frame of this recompile, as long as terminal 23 just can begin decoding after receiving the I frame of this recompile like this.
It is the Media Stream of start frame that transmitting element 405 sends with the I frame to terminal 23.
For example, the frame sequence of supposing certain target channel that media server 21 is received from head end 20 is:
I1?P2?B3?P4?B5?P6?B7?P8?B9?P10?B11?I12?P13?B14?P15...,
Media server 21 is whenever received a frame image signal, and coding unit 501 is just decoded to it, recovers original image O1 O2 O3 O4 O5 O6 O7 O8 O9 O10....For example, after terminal 23 switched to the ownership goal channel, first RTP bag that receiving element 402 is received was the data of B7 frame, and detecting unit 404 detects and is non-I frame, and then processing unit 406 is to the RTCP request message requests transmission I frame of media server 21 by expansion.
Receiving element 401 receives the request message of described transmission I frame, knows that terminal 23 receives the data of B7 frame, and two field picture O6 nearest before 501 couples of present frame B7 of coding unit generates corresponding I frame coded data I according to I frame pattern recompile
O6, selected cell 502 is chosen present frame (being the B7 frame) nearest before and I frame that carry out I frame pattern coding, i.e. I
O6Transmitting element 405 is with the data I of recompile
O6Send to terminal 23, as long as terminal 23 is received I like this
O6The back just can begin to decode, and transmitting element 405 need not send I1 frame and I1 to the data between the P6 frame.
The message received of receiving element 402 is as follows like this: B7 I
O6P8 B9 P10 B11 I12 P13 B14P15....
In addition, coding unit 501 can also be according to certain frame period I frame of encoding.For example still top frame sequence, coding unit 501 can be encoded P4, P8 and P11 again according to the I frame pattern, if terminal 23 data that to switch to first RTP bag of receiving after this target channel be the B7 frame and processing unit 406 are when media server 21 request transmission I frames like this, present frame B7 nearest and frame that be recoded to the I frame before is P4, so selected cell 502 is chosen present frame (being the B7 frame) nearest before and I frame that carry out I frame pattern coding, i.e. I
O4The I that transmitting element 405 sends according to I frame pattern recompile
O4Frame and I
O4Frame data B5P6 after the frame, and do not need to transmit the I1 frame to the frame data between the B3.
So, after terminal 23 switches to target channel, when the present frame that receives is non-I frame, because asking media server 21 transmission again is the Media Stream of start frame with the I frame, so the image that terminal 23 decodes is the most comprehensive information in the tableaux, so the image that terminal 23 demonstrates embodies the time delay of not coming out, image quality is than higher.
One of ordinary skill in the art will appreciate that all or part of step that realizes any embodiment in the foregoing description is to instruct relevant hardware to finish by program, described program can be stored in the storage medium of an embodied on computer readable, described storage medium, as: ROM/RAM, magnetic disc, CD etc.
In sum, in the embodiment of the invention, by on media server to GOP (the Group Of Pictures of up-to-date transmission in the live video stream, set of pictures) sequence is carried out buffer memory, after terminal switches to target channel, if find that first message of receiving is not the I frame, just send RTCP (Real-time TransportControl Protocol, RTCP Real-time Transport Control Protocol) amplifying message, it is just to decode and export behind the message of start frame that terminal receives with the I frame, it is not obvious that thereby time delay embodies, and improves the channel switch speed, improves user's business experience quality.
But above-mentioned only is better embodiment of the present invention; be not to be used to limit protection scope of the present invention; any those skilled in the art of being familiar with will be appreciated that; all within the spirit and principles in the present invention scope; any modification of being done, equivalence replacement, improvement etc. all should be included within the scope of the present invention.