Embodiment
For the purpose, technical scheme and the advantage that make the embodiment of the invention clearer, below in conjunction with the accompanying drawing in the embodiment of the invention, technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
The schematic flow sheet of the sending method of the Media Stream that Fig. 1 provides for the embodiment of the invention one, as shown in Figure 1, the sending method of the Media Stream of present embodiment can may further comprise the steps:
Step 101, know the bandwidth information of client and client user's user profile;
Step 102, according to above-mentioned bandwidth information and above-mentioned user profile, determine transmission code rate;
Step 103, send Media Stream to above-mentioned client with above-mentioned transmission code rate.
The sending method of the Media Stream that the embodiment of the invention provides goes for the scene of a client, can also be applicable to the scene of a plurality of clients, and the embodiment of the invention does not limit the quantity of client.
In the present embodiment, the distribution of media unit can be according to the bandwidth information of the client of knowing and client user's user profile, determine transmission code rate, thereby can send Media Stream to above-mentioned client with above-mentioned transmission code rate, improve the streaming media service quality of client, saved Internet resources.
The schematic flow sheet of the sending method of the Media Stream that Fig. 2 provides for the embodiment of the invention two, as shown in Figure 2, the sending method of the Media Stream of present embodiment can may further comprise the steps:
The bandwidth information of client and client user's user profile are known instep 201, distribution of media unit;
Wherein, the bandwidth information of above-mentioned client can comprise the information such as utilized bandwidth of access bandwidth, current code check, packet loss/frame loss rate and above-mentioned client place terminal equipment current network; Above-mentioned client user's user profile can comprise number of users and user gradation information.Need to prove: same user carries out streaming media service by two clients, and the number of users in the embodiment of the invention is 2.
Step 202, distribution of media unit obtain the expectation code check of clients corresponding according to above-mentioned bandwidth information;
Particularly, can obtain the expectation code check of client in the following way:
A, if packet loss/frame loss rate be less than or equal to predetermined threshold value, and the remaining bandwidth of above-mentioned client place terminal equipment current network (being the utilized bandwidth of access bandwidth-client place terminal equipment current network) is greater than the adjustment code check that sets in advance, and then the current code check with clients corresponding adds the expectation code check of above-mentioned adjustment code check as above-mentioned client;
B, if packet loss/frame loss rate be less than or equal to predetermined threshold value, and above-mentioned client place terminal equipment current network does not exist the remaining bandwidth (being the utilized bandwidth of access bandwidth-client place terminal equipment current network) of remaining bandwidth (being the utilized bandwidth of access bandwidth≤client place terminal equipment current network) or above-mentioned client place terminal equipment current network less than the adjustment code check that sets in advance, then with the current code check of the clients corresponding expectation code check as above-mentioned client;
C, if packet loss/frame loss rate, then deducts the current code check of clients corresponding the adjustment code check that the sets in advance expectation code check as above-mentioned client greater than predetermined threshold value.
For example: suppose that the current time headend equipment is 2Mbps to the bandwidth of distribution of media unit, the access bandwidth of certain client is 2Mbps, each adjustment code check of adjusting is 0.5Mbps, and the predetermined threshold value of packet loss/frame loss rate is 5%, and headend equipment is 2M to the bandwidth of medium retransmission unit.
Scene 1: the code check of current media stream is 1Mbps, and present packet loss/frame loss rate is 1%, and the utilized bandwidth of client place terminal equipment current network is 1.3Mbps.
By judging the magnitude relationship of present packet loss and predetermined threshold value, 1% less than threshold value 5%, can illustrate that current status transmission is very good.Access bandwidth according to client is 2Mbps, and the utilized bandwidth of client place terminal equipment current network is 1.3Mbps, can know the remaining bandwidth=2Mbps-1.3Mbps=0.7Mbps of client place terminal equipment current network.By judging remaining bandwidth and the magnitude relationship of adjusting code check, 0.7Mbps greater than adjusting code check 0.5Mbps, then current code check 1Mbps can be added the expectation code check of above-mentioned adjustment code check 0.5Mbps as above-mentioned client, i.e. the expectation code check=1Mbps+0.5Mbps=1.5Mbps of above-mentioned client.
Scene 2: the code check of current media stream is 1Mbps, and present packet loss/frame loss rate is 1%, and the utilized bandwidth of client place terminal equipment current network is 1.8Mbps.
By judging the magnitude relationship of present packet loss and predetermined threshold value, 1% less than threshold value 5%, can illustrate that current status transmission is better.Access bandwidth according to client is 2Mbps, and the utilized bandwidth of client place terminal equipment current network is 1.8Mbps, can know the remaining bandwidth=2Mbps-1.8Mbps=0.2Mbps of client place terminal equipment current network.By judging remaining bandwidth and the magnitude relationship of adjusting code check, 0.2Mbps then can not adjust current code check less than adjusting code check 0.5Mbps, can only be with the expectation code check of current code check 1Mbps as above-mentioned client.
Scene 3: the code check of current media stream is 1Mbps, and present packet loss/frame loss rate is 8%, and the utilized bandwidth of client place terminal equipment current network is 1.8Mbps.
By judging the magnitude relationship of present packet loss and predetermined threshold value, 8% greater than threshold value 5%, can illustrate that current status transmission is relatively poor, then current code check 1Mbps can be deducted the expectation code check of above-mentioned adjustment code check 0.5Mbps as above-mentioned client, i.e. the expectation code check=1Mbps-0.5Mbps=0.5Mbps of above-mentioned client.
Need to prove: above-mentioned expectation code check all needs to be subjected to the restriction of headend equipment to the bandwidth of medium retransmission unit, all be less than the bandwidth of headend equipment to the medium retransmission unit, if the expectation code check of the client that gets access to is greater than the bandwidth of headend equipment to the medium retransmission unit, then also be to adjust to current code check, can only be with the expectation code check of current code check as client.
Transmission code rate is determined according to above-mentioned expectation code check and above-mentioned expectation code check user information corresponding instep 203, distribution of media unit;
In this step, it is a variety of that the distribution of media unit determines that the mode of transmission code rate can have, wherein the most frequently used a kind of method that just is based on stock handset system.Particularly, the weights of number of users, user gradation and the above-mentioned user gradation correspondence of code check correspondence can be expected according to each that obtain in the above-mentionedsteps 202 respectively in the distribution of media unit, know the weighted value of each expectation code check, thereby expectation code check that can above-mentioned weighted value is the highest is as transmission code rate.For example: the expectation code check is that the user of 1Mbps has 10 lower-level users, the expectation code check is that the user of 1.5Mbps has 2 lower-level users, wherein, lower-level user's weights can be set to 1, higher-level user's weights can be set to 10, expect that so code check is the weighted value=10 * 1=10 of the code check of 1.5Mbps, the expectation code check is the weighted value=2 * 10=20 of the code check of 1.5Mbps, the distribution of media unit is by the weighted value of more above-mentioned two expectation code check correspondences, and expectation code check (1.5Mbps) that can weighted value is the highest is as transmission code rate.
Step 204, distribution of media unit send the Media Stream with above-mentioned transmission code rate to above-mentioned client.
Particularly, in this step, the distribution of media unit can come to send the Media Stream with above-mentioned transmission code rate to above-mentioned client by following several modes:
A, distribution of media unit forward end device request are adjusted the code check of Media Stream;
The distribution of media unit can send the adjustment request that comprises definite above-mentioned transmission code rate by forward end equipment, headend equipment is according to above-mentioned transmission code rate recompile, have the Media Stream of above-mentioned transmission code rate to the output of distribution of media unit, thereby realize that the distribution of media unit sends above-mentioned Media Stream with above-mentioned transmission code rate to above-mentioned client.
The code check of Media Stream is adjusted in B, distribution of media unit to the media transcoding units request.
The distribution of media unit can send Media Stream with current code check and the adjustment request that comprises definite above-mentioned transmission code rate to media transcoding units, media transcoding units is changed the Media Stream with current code check that receives according to above-mentioned transmission code rate, have the Media Stream of above-mentioned transmission code rate to the output of distribution of media unit, thereby realize that the distribution of media unit sends above-mentioned Media Stream with above-mentioned transmission code rate to above-mentioned client.
Because stream media technology has broken through the restriction of the network bandwidth to the multi-medium data flow transmission to a certain extent, therefore be widely used in field of video monitoring.In network video monitor and control system, under the situation of needs video recording, video recording equipment also can be used as a client to be treated, and its expectation code check and weights can be set in advance by the user.If when needing the preferential quality that guarantees video recording, weights that can correspondence are set to bigger numerical value.
In the present embodiment, the distribution of media unit can be according to the bandwidth information of knowing, obtain the expectation code check of clients corresponding, thereby can be according to above-mentioned expectation code check and above-mentioned expectation code check user information corresponding, determine transmission code rate, make the distribution of media unit to send Media Stream, improved the streaming media service quality of client, saved Internet resources to above-mentioned client with above-mentioned transmission code rate.
Need to prove: for aforesaid each method embodiment, for simple description, so it all is expressed as a series of combination of actions, but those skilled in the art should know, the present invention is not subjected to the restriction of described sequence of movement, because according to the present invention, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in the specification all belongs to preferred embodiment, and related action and module might not be that the present invention is necessary.
In the above-described embodiments, the description of each embodiment is all emphasized particularly on different fields, do not have the part that describes in detail among certain embodiment, can be referring to the associated description of other embodiment.
The structural representation of the dispensing device of the Media Stream that Fig. 3 provides for the embodiment of the invention three, as shown in Figure 3, the dispensing device of the Media Stream of present embodiment can comprise that information knowsmodule 31, codecheck determination module 32 and adjust sending module 33.Wherein, information knows thatmodule 31 knows the bandwidth information of client and the user profile of client, codecheck determination module 32 is known above-mentioned bandwidth information and the above-mentioned user profile thatmodule 31 is known according to information, determine transmission code rate, adjustsending module 33 and send Media Stream to above-mentioned client with above-mentioned transmission code rate that codecheck determination module 32 determines.
The dispensing device of the Media Stream that the function of distribution of media unit all can be provided by the embodiment of the invention in method, the embodiment of the invention two among the invention described above embodiment one realizes, the dispensing device of the Media Stream that the embodiment of the invention provides can be arranged in the embodiment of the invention two in the distribution of media unit.
In the present embodiment, the code check determination module can be known the bandwidth information of the client thatmodule 31 is known and client user's user profile according to information, determine transmission code rate, adjust sending module has Media Stream from above-mentioned transmission code rate to above-mentioned client transmission thereby can make, improve the streaming media service quality of client, saved Internet resources.
The structural representation of the dispensing device of the Media Stream that Fig. 4 provides for the embodiment of the invention four as shown in Figure 4, is compared with a last embodiment, and the codecheck determination module 32 in the present embodiment may further include code check and knowsunit 41 and code check determining unit 42.Wherein, code check knows thatunit 41 can be according to above-mentioned bandwidth information, obtain the expectation code check of clients corresponding, above-mentioned bandwidth information can comprise the utilized bandwidth of access bandwidth, current code check, packet loss/frame loss rate and above-mentioned client place terminal equipment current network, further, code check knows thatunit 41 specifically can know the expectation code check of clients corresponding in the following way:
A, if packet loss/frame loss rate be less than or equal to predetermined threshold value, and the remaining bandwidth of above-mentioned client place terminal equipment current network is greater than the adjustment code check that sets in advance, and code check knows that the 41 current code checks with clients corresponding in unit add the expectation code check of above-mentioned adjustment code check as above-mentioned client;
B, if packet loss/frame loss rate be less than or equal to predetermined threshold value, and above-mentioned client place terminal equipment current network does not exist the remaining bandwidth of remaining bandwidth or above-mentioned client place terminal equipment current network less than the adjustment code check that sets in advance, and code check knows that 41 of unit are with the current code check of the clients corresponding expectation code check as above-mentioned client;
C, if packet loss/frame loss rate greater than predetermined threshold value, code check knows that the 41 current code checks with clients corresponding in unit deduct the adjustment code check that the sets in advance expectation code check as above-mentioned client.
Codecheck determining unit 42 can be according to above-mentioned expectation code check and above-mentioned expectation code check user information corresponding, determine transmission code rate, above-mentioned user profile can comprise number of users and user gradation, further, codecheck determining unit 42 specifically can comprise and knows subelement 421 and definite subelement 422.Wherein, know the weights ofsubelement 421, know the weighted value of above-mentioned expectation code check, determine that thesubelement 422 expectation code check that above-mentioned weighted value is the highest is as transmission code rate according to number of users, user gradation and the above-mentioned user gradation correspondence of expectation code check correspondence.
In the present embodiment, know that by code check the unit is according to the bandwidth information of knowing, obtain the expectation code check of clients corresponding, and the code check determining unit is according to above-mentioned expectation code check and above-mentioned expectation code check user information corresponding, determine transmission code rate, make that adjusting sending module can send the Media Stream with above-mentioned transmission code rate to above-mentioned client, improved the streaming media service quality of client, saved Internet resources.
Further, client in the present embodiment can also comprise a video recording equipment, correspondingly, know thatsubelement 421 specifically can be used for number of users, user gradation, the weights of above-mentioned user gradation correspondence and the weights of video recording equipment correspondence according to expectation code check correspondence, knows the weighted value of above-mentioned expectation code check.
Further, above-mentionedadjustment sending module 33 among the invention described above embodiment three and four specifically can be used for forward end equipment and send the adjustment request that comprises above-mentioned transmission code rate, obtain the Media Stream with above-mentioned transmission code rate of above-mentioned headend equipment, send above-mentioned Media Stream to above-mentioned client according to above-mentioned transmission code rate recompile output; Perhaps can also be used for sending Media Stream with current code check and the adjustment request that comprises above-mentioned transmission code rate to media transcoding units, obtain the Media Stream with above-mentioned transmission code rate of above-mentioned media transcoding units, send above-mentioned Media Stream to above-mentioned client according to above-mentioned transmission code rate conversion output.
One of ordinary skill in the art will appreciate that: all or part of step that realizes said method embodiment can be finished by the relevant hardware of program command, aforesaid program can be stored in the computer read/write memory medium, this program is carried out the step that comprises said method embodiment when carrying out; And aforesaid storage medium comprises: various media that can be program code stored such as ROM, RAM, magnetic disc or CD.
It should be noted that at last: above embodiment only in order to technical scheme of the present invention to be described, is not intended to limit; Although with reference to previous embodiment the present invention is had been described in detail, those of ordinary skill in the art is to be understood that: it still can be made amendment to the technical scheme that aforementioned each embodiment put down in writing, and perhaps part technical characterictic wherein is equal to replacement; And these modifications or replacement do not make the essence of appropriate technical solution break away from the spirit and scope of various embodiments of the present invention technical scheme.