A kind of video adjusting method and device
Technical field
The present invention relates to technical field of network video, more particularly to a kind of video adjusting method and device.
Background technology
With the development of Internet technology, the mode of propagation and species of Internet video are also increasingly abundanter.Also, due to regarding
The difference of frequency application environment, the requirement to video image quality it is also proposed higher and higher requirement.Such as when live class video system
When applying inside large-size enterprise group, remote interview choosing can be carried out by the way of net cast during selection of talented people
Pull out, but requirement of the live class system when enterprises operate to network bandwidth is higher, but most enterprises group is each
Do not have CDN (Content Delivery Network, content distributing network) in the internal network of company to accelerate, and super large
Networking situation between each unit of type conglomerate also has larger gap, and this allows for go out during video-see
Existing interim card, reduce the Experience Degree of user.
The content of the invention
Be directed to above mentioned problem, the present invention provides a kind of video adjusting method and device, solve network it is poor in the case of
The problem of video-see interim card.
To achieve these goals, according to the first aspect of the invention, there is provided a kind of video adjusting method, this method bag
Include:
In predetermined period, statistics sends the video data received to the video data volume of client and the client
Amount;
According to described the video data volume for sending and being received to the video data volume of client and the client, calculate
To transmission of video packet loss;
Judge whether the transmission of video packet loss meets predetermined threshold value, if it is not, then the video that current video is transmitted
Frame carries out drop framing control, the frame of video after being adjusted;
Video is transmitted under frame of video after the adjustment, and recalculates transmission of video packet loss, is adjusted when default
When transmission of video packet loss can not meet predetermined threshold value in whole scope, it will be prompted to instruction and send to the client, and according to visitor
The instruction that family end returns, is adjusted to the frame of video.
Preferably, this method also includes:
The acquisition video flowing request that client is sent is received, establishes the connection with the client, will be with the video flowing
The corresponding video of request is sent to the client.
Preferably, it is described according to the video counts for sending and being received to the video data volume of client and the client
According to amount, transmission of video packet loss is calculated, including:
Obtain described send to the video data volume RS1 of client;
Obtain the video data volume RS2 that the client receives;
According to formula S=(RS1-RS2)/RS1*100%, transmission of video packet loss S is calculated.
Preferably, video is transmitted under the frame of video after the adjustment, and recalculates transmission of video packet loss,
When transmission of video packet loss can not meet predetermined threshold value in default adjusting range, it will be prompted to instruction and send to the client
End, and the instruction returned according to client, are adjusted to the frame of video, including:
Video is transmitted under frame of video after the adjustment, and transmission of video packet loss is recalculated in predetermined period
Rate;
Whether the packet loss for judging to recalculate to obtain meets predetermined threshold value, if it is, according to regarding after the adjustment
Frequency frame carries out transmission of video;If it is not, then drop framing control is carried out to the frame of video after the adjustment;
The adjusting range for when frame of video drop framing control meets default adjusting range and the video packet loss is unsatisfactory for
During predetermined threshold value, then hint instructions are sent to the client;
The feedback information that the client is carried out according to the hint instructions is received, parses the feedback information, judgement is
It is no that drop framing control is carried out to frame of video, if it is, drop framing control is carried out to current video frame, if it is not, then stopping to video
The adjustment of frame.
Preferably, this method also includes:
Judge whether the frame of video after drop framing control is less than default minimum frame of video, if it is, stopping regarding to described
The adjustment of frequency frame.
According to the second aspect of the invention, there is provided a kind of video adjusting means, the device include:
Statistical module, in predetermined period, statistics to send to the video data volume of client and the client and terminated
The video data volume received;
Computing module, for sending the video received to the video data volume of client and the client according to described
Data volume, transmission of video packet loss is calculated;
Judge module, for judging whether the transmission of video packet loss meets predetermined threshold value, if it is not, then forward sight will be worked as
Keep pouring in defeated frame of video and carry out drop framing control, the frame of video after being adjusted;
Adjusting module, for being transmitted under frame of video after the adjustment to video, and recalculate transmission of video packet loss
Rate, when transmission of video packet loss can not meet predetermined threshold value in default adjusting range, it will be prompted to instruction and send to the visitor
Family end, and the instruction returned according to client, are adjusted to the frame of video.
Preferably, the device also includes:
Module is established, for receiving the acquisition video flowing request of client transmission, establishes the connection with the client, will
Sent with the corresponding video of video flowing request to the client.
Preferably, the computing module includes:
First acquisition unit, for obtaining described send to the video data volume RS1 of client;
Second acquisition unit, the video data volume RS2 received for obtaining the client;
First computing unit, for according to formula S=(RS1-RS2)/RS1*100%, transmission of video packet loss to be calculated
Rate S.
Preferably, the adjusting module includes:
Second computing unit, for being transmitted under frame of video after the adjustment to video, and in predetermined period again
Calculate transmission of video packet loss;
First judging unit, whether the packet loss for judging to recalculate to obtain meets predetermined threshold value, if it is, pressing
Transmission of video is carried out according to the frame of video after the adjustment;If it is not, then drop framing control is carried out to the frame of video after the adjustment;
Transmitting element, the adjusting range for when frame of video drop framing control meet default adjusting range and the video
When packet loss is unsatisfactory for predetermined threshold value, then hint instructions are sent to the client;
Second judging unit, the feedback information carried out for receiving the client according to the hint instructions, parse institute
Feedback information is stated, judges whether to carry out drop framing control to frame of video, if it is, carrying out drop framing control to current video frame, such as
Fruit is no, then stops the adjustment to frame of video.
Preferably, the adjusting module also includes:
3rd judging unit, for judging whether the frame of video after drop framing control is less than default minimum frame of video, if
It is then to stop the adjustment to the frame of video.
Compared to prior art, the present invention sends what is received to the video data volume and client of client by counting
The video data volume, transmission of video packet loss is then calculated, enters Mobile state adjustment to frame of video according to transmission of video packet loss,
Namely enter Mobile state adjustment to frame of video according to the network quality of real-time Transmission, can be carried out dropping frame tune automatically according to packet loss
It is whole, when frame of video is dropped in certain limit, client can be carried out asking whether continuing to drop frame, according to the feedback of client after
Continuous follow-up adjustment.By reducing frame of video, enable each frame that there is preferable spatial domain quality, make user in relatively low speed bar
Under part, preferable picture quality still can be obtained.And then solves the problems, such as video-see interim card under network crossing instances.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are only this
The embodiment of invention, for those of ordinary skill in the art, on the premise of not paying creative work, can also basis
The accompanying drawing of offer obtains other accompanying drawings.
Fig. 1 is a kind of schematic flow sheet for video adjusting method that the embodiment of the present invention one provides;
Fig. 2 is a kind of structural representation for video adjusting means that the embodiment of the present invention three provides.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, rather than whole embodiments.It is based on
Embodiment in the present invention, those of ordinary skill in the art are obtained every other under the premise of creative work is not made
Embodiment, belong to the scope of protection of the invention.
Term " first " and " second " in description and claims of this specification and above-mentioned accompanying drawing etc. are to be used for area
Not different objects, rather than for describing specific order.In addition term " comprising " and " having " and their any deformations,
It is intended to cover non-exclusive include.Such as contain the process of series of steps or unit, method, system, product or set
It is standby not to be set in the step of having listed or unit, but the step of may include not list or unit.
Embodiment one
It is a kind of video adjusting method that the embodiment of the present invention one provides referring to Fig. 1, this method comprises the following steps:
S11, in predetermined period, statistics sends the video that is received to the video data volume of client and the client
Data volume;
S12, the video data volume received according to the transmission to the video data volume of client and the client, meter
Calculation obtains transmission of video packet loss;
It should be noted that what video was all made up of static picture, these static pictures are referred to as frame, during unit
Interior frame number is bigger, and video file is also bigger.Frame of video is changeless generally in video transmitting procedure, but certain
The application environment of a little transmission of video, video in the case of fixed frame of video, can be made due to the limitation of own net bandwidth
Caton phenomenon occurs for transmission, that is, video pictures stagnation behavior occurs, and carrying out expansion to transmission network to solve this phenomenon changes
It is unpractical to make, so proposing by dynamic adjustment frame of video to solve this problem, first has to calculate acquisition packet loss.
Packet loss, refer to that lost data packet number in test accounts for the ratio of transmitted data packet group, general calculating side
Method is:Packet loss=(incoming message-outgoing message)/incoming message * 100%, and packet loss and data packet length and transmission
Frequency is relevant.Then judge the relation between packet loss and predetermined threshold value, that is, perform step S13.
S13, judge whether the transmission of video packet loss meets predetermined threshold value, if it is not, then performing step S14;
Specifically, after the packet loss of transmission of video is got, then whether the packet loss for judging to get meets default threshold
Value, the packet loss threshold value can flexibly be set according to being actually needed.If the packet loss got meets default packet loss threshold
Value, then it can determine that current transmission of video interference is smaller, video cardton phenomenon will not occur, thus any processing need not be made;If
Predetermined threshold value is unsatisfactory for, then proves that the broadcasting to video can have an impact, that is, performs step S14.
S14, by current video transmit frame of video carry out drop framing control, the frame of video after being adjusted, be then back to and hold
Row S11;
When circulation is performed in said process, when packet loss meets predetermined threshold value, then stop adjustment, when packet loss is discontented with
During sufficient predetermined threshold value, then drop framing control is carried out, but in order to meet the balance of the Experience Degree of user and regulated efficiency and time, no
Drop framing control infinitely can be carried out to frame of video, that is, needs to perform step S15;
S15, judge whether frame of video adjusting range has reached default scope, if it is, performing step S16;
S16, instruction transmission is will be prompted to the client, and the instruction returned according to client, the frame of video is entered
Row adjustment.
It should be noted that next successive step is carried out according to the feedback of user, i.e., after frame of video is adjusted to certain limit,
The adjustment of frame of video is carried out according to the feedback of user, the viewing experience effect for combining user improves the Experience Degree of user.
By technical scheme disclosed in the embodiment of the present invention one, statistics first sends the video data volume to client and visitor
The video data volume that family termination receives, is then calculated transmission of video packet loss, according to transmission of video packet loss to frame of video
Enter Mobile state adjustment, that is, Mobile state adjustment is entered to frame of video according to the network quality of real-time Transmission, can be according to packet loss
Automatically drop framing control is carried out, when frame of video is dropped in certain limit, client can be carried out to ask whether to continue to drop frame, according to
The feedback of client continues follow-up adjustment.By reducing frame of video, enable each frame that there is preferable spatial domain quality, make user
Under relatively low rate conditions, preferable picture quality still can be obtained.And then solves video observing under network crossing instances
The problem of seeing interim card.
Embodiment two
With reference to the detailed process of S11 to the S15 steps described in the embodiment of the present invention one and Fig. 1, in present invention implementation
A kind of video adjusting method will be specifically described in example two.
In the embodiment of the present invention two, with reference to specific application scenarios, by a kind of video adjusting method provided by the invention
Apply on streaming media server, when a client for receiving video be present, the client is entered with streaming media server
Row communication connection.The client can send to streaming media server and receive video flowing request, after asking successfully, streaming media server
Can record the state of this client, at the same this client can according to predetermined period, i.e., every predetermined period when
Between section just send information to streaming media server, to feed back the state of itself to streaming media server, the state is primarily referred to as connecing
Receive the state of video stream signal.
It is to be appreciated that when client is first connected to streaming media server, streaming media server can be newly-built one
Thread is to respond the demand of this client video flowing, should if client is not first connected to streaming media server certainly
Link information before streaming media server meeting basis, finds thread corresponding with the client to respond the client video
The demand of stream.After the video flowing for receiving client is asked, video frame number can be sent to client by streaming media server, this
When be defaulted as 25 frames.
When client and streaming media server successful connection, streaming media server start recording sends regarding for client to
Frequency data volume R1, while the video data stream R2 that client start recording receives, when reaching predetermined period, client will can tire out
The video data volume that meter receives is sent to streaming media server, when streaming media server receives the data, variable be present
In RS2, while streaming media server has the data volume of accumulative transmission in RS1, i.e., referring to the step S11 in Fig. 1, default
In cycle, statistics sends the video data volume received to the video data volume of client and the client.It is, send
The video data volume to client is present in RS1, R1 summation, as RS1 as in predetermined period;What client received
The video data volume is present in RS2, and R2 synthesis, as RS2 as in predetermined period, predetermined period therein can flexibly be entered
Row calculates, preferably 10 seconds in the present embodiment;
Then, streaming media server calculates transmission of video packet loss according to RS1 and RS2, i.e. step S12 in Fig. 1, the step
The calculation formula used for:S=(RS1-RS2)/RS1*100%, wherein, S is transmission of video packet loss.
Then packet loss of the packet loss namely in the case of 25 frames is transmitted according to current video, judges that the packet loss is
It is no to meet predetermined threshold value.Assuming that in the present embodiment, packet loss threshold value is arranged to 98%, if packet loss is less than 98%,
Illustrate that packet loss is higher, be bound to have an impact the broadcasting of video, now streaming media server can be adjusted to this client
Video frame number, that is, step S14 and S15 in Fig. 1 are performed, original video frame number is subjected to drop framing control, often in the present embodiment
The scope of secondary drop framing control is that original video frame number subtracts 1, i.e., current video frame number is 25, after the first drop framing control, this
When video frame number be 24, then video frame number be 24 in the case of again statistics send to client the video data volume and
The video data volume that the client receives, into next predetermined period, transmission of video packet loss is calculated, if the video
Transmission then continues to carry out drop framing control to video frame number, will be 23 frames, then proceed to calculating and lose with being still unsatisfactory for predetermined threshold value
Bag rate, when packet loss meets predetermined threshold value, stop adjustment, if packet loss is unsatisfactory for predetermined threshold value always, persistently dropped
Framing control, i.e., the processing that frame of video in the present embodiment subtracts one;
When frame of video drop reaches default adjusting range, if packet loss now can not still meet predetermined threshold value, first
Stop the drop framing control to frame of video, i.e., still have higher packet loss, then if when frame of video drops to 12 in the present embodiment
Streaming media server sends hint instructions to client, that is, prompts the user whether that drop framing control is further continued to be carried out, if client
The message that end is fed back then terminates the video regulation process of ability, if the message of client feedback is to continue to adjust to stop adjusting
It is whole, then frame of video is continued on this basis to drop and continued on the basis of framing control, that is, 12 frames in the present embodiment
Frame drops.It is understood that frame of video reduces, the data volume of network transmission is just few, although image quality and unaffected,
It is more serious in order to avoid the coherent degree decline of picture but the coherent degree of picture can decline, so frame of video is not
Drop framing control can be infinitely carried out, i.e., when frame of video has reached default minimum frame of video, no matter now the instruction of client is
What, also no matter whether packet loss now meets predetermined threshold value, will all stop the drop framing control to frame of video.
Technical scheme disclosed according to embodiments of the present invention two, count to issue in current network conditions and deliver to client and be somebody's turn to do
The video data volume that client receives, is then calculated packet loss, according to packet loss and predetermined threshold value according to the video data volume
Comparison can dynamically adjust frame of video, that is, adjust the transmission of frame of video, ensure the image quality in the case of low network band width, and
And solve the problems, such as the Consumer's Experience in some application scenarios, for example need that image quality is higher and bandwidth can not also internal
During support, the problem of can not meeting user's request of appearance, it can so cause in enterprise's large-scale use, without to network
Expansion transformation is carried out, has saved railway information infrastructure construction cost.Due to having carried out drop framing control, frame of video drop to frame of video
Low, the data volume of transmitted per unit time just reduces, and when network condition is poor, solves showing for video-see interim card
As.
Embodiment three
It is corresponding with the video adjusting method disclosed in the embodiment of the present invention one and embodiment two, embodiments of the invention three
A kind of video adjusting means is additionally provided, referring to Fig. 2, the device includes:
Statistical module 1, in predetermined period, statistics to send to the video data volume of client and the client and terminated
The video data volume received;
Computing module 2, for being regarded according to the transmission to what the video data volume of client and the client received
Frequency data volume, transmission of video packet loss is calculated;
Judge module 3, for judging whether the transmission of video packet loss meets predetermined threshold value, if it is not, then will be current
The frame of video of transmission of video carries out drop framing control, the frame of video after being adjusted;
Adjusting module 4, for being transmitted under frame of video after the adjustment to video, and recalculate transmission of video packet loss
Rate, when transmission of video packet loss can not meet predetermined threshold value in default adjusting range, it will be prompted to instruction and send to the visitor
Family end, and the instruction returned according to client, are adjusted to the frame of video.
Corresponding, the device also includes:
Module 5 is established, for receiving the acquisition video flowing request of client transmission, establishes the connection with the client,
It will be sent with the corresponding video of video flowing request to the client.
Specifically, the computing module 2 includes:
First acquisition unit 21, for obtaining described send to the video data volume RS1 of client;
Second acquisition unit 22, the video data volume RS2 received for obtaining the client;
First computing unit 23, for according to formula S=(RS1-RS2)/RS1*100%, transmission of video being calculated and loses
Bag rate S.
Accordingly, the adjusting module 4 includes:
Second computing unit 41, for being transmitted under frame of video after the adjustment to video, and the weight in predetermined period
It is new to calculate transmission of video packet loss;
Whether the first judging unit 42, the packet loss for judging to recalculate to obtain meet predetermined threshold value, if it is,
Transmission of video is carried out according to the frame of video after the adjustment;If it is not, then drop framing control is carried out to the frame of video after the adjustment;
Transmitting element 43, the adjusting range for when frame of video drop framing control meet default adjusting range and described regarded
When frequency packet loss is unsatisfactory for predetermined threshold value, then hint instructions are sent to the client;
Second judging unit 44, the feedback information carried out for receiving the client according to the hint instructions, parsing
The feedback information, judge whether to carry out drop framing control to frame of video, if it is, drop framing control is carried out to current video frame,
If it is not, then stop the adjustment to frame of video.
Corresponding, the adjusting module 4 also includes:
3rd judging unit 45, for judging whether the frame of video after drop framing control is less than default minimum frame of video, such as
Fruit is then to stop the adjustment to the frame of video.
In embodiments of the invention three, sent by statistical module counts to the video data volume of client and client
The video data volume received, transmission of video packet loss is then calculated in computing module, according to transmission of video packet loss
Enter Mobile state adjustment to frame of video, that is, Mobile state adjustment is entered to frame of video according to the network quality of real-time Transmission, adjusting
Drop framing control can be carried out automatically according to packet loss in module, when frame of video is dropped in certain limit, client can be carried out
Ask whether to continue to drop frame, follow-up adjustment is continued according to the feedback of client.By reducing frame of video, each frame is set to have
Preferable spatial domain quality, makes user still can obtain preferable picture quality under relatively low rate conditions.And then solve
Under network crossing instances the problem of video-see interim card.
Each embodiment is described by the way of progressive in this specification, what each embodiment stressed be and other
The difference of embodiment, between each embodiment identical similar portion mutually referring to.For device disclosed in embodiment
For, because it is corresponded to the method disclosed in Example, so description is fairly simple, related part is said referring to method part
It is bright.
The foregoing description of the disclosed embodiments, professional and technical personnel in the field are enable to realize or using the present invention.
A variety of modifications to these embodiments will be apparent for those skilled in the art, as defined herein
General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, it is of the invention
The embodiments shown herein is not intended to be limited to, and is to fit to and principles disclosed herein and features of novelty phase one
The most wide scope caused.