CN106851340B - Video plug-streaming method and device - Google Patents

Video plug-streaming method and device Download PDF

Info

Publication number
CN106851340B
CN106851340B CN201710074361.4A CN201710074361A CN106851340B CN 106851340 B CN106851340 B CN 106851340B CN 201710074361 A CN201710074361 A CN 201710074361A CN 106851340 B CN106851340 B CN 106851340B
Authority
CN
China
Prior art keywords
video
pushing
moment
stream pushing
time
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710074361.4A
Other languages
Chinese (zh)
Other versions
CN106851340A (en
Inventor
马宇坚
于芝涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qingdao Hisense Media Network Technology Co Ltd
Original Assignee
Qingdao Hisense Media Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qingdao Hisense Media Network Technology Co Ltd filed Critical Qingdao Hisense Media Network Technology Co Ltd
Priority to CN201710074361.4A priority Critical patent/CN106851340B/en
Publication of CN106851340A publication Critical patent/CN106851340A/en
Application granted granted Critical
Publication of CN106851340B publication Critical patent/CN106851340B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/239Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests
    • H04N21/2393Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests involving handling client requests
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/24Monitoring of processes or resources, e.g. monitoring of server load, available bandwidth, upstream requests
    • H04N21/2402Monitoring of the downstream path of the transmission network, e.g. bandwidth available
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/262Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists
    • H04N21/26208Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists the scheduling operation being performed under constraints
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/262Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists
    • H04N21/26291Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists for providing content or additional data updates, e.g. updating software modules, stored at the client
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/266Channel or content management, e.g. generation and management of keys and entitlement messages in a conditional access system, merging a VOD unicast channel into a multicast channel
    • H04N21/2662Controlling the complexity of the video stream, e.g. by scaling the resolution or bitrate of the video stream based on the client capabilities

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The embodiment of the invention provides a video plug flow method and a device, wherein the method comprises the following steps: acquiring the initial plug flow time of a target video, a first video volume pushed between the initial plug flow time and the current time and the average plug flow code rate of the target video; determining a push delay time according to the initial push moment, the current moment, the first video volume and the average push code rate; if the delay time of the plug flow is less than a first threshold value, the plug flow is suspended in a preset time, and the first threshold value is less than or equal to zero; if the stream pushing delay time length is greater than or equal to the first threshold and less than or equal to a second threshold, pushing the video packet corresponding to the current moment to a client; and if the stream pushing delay time length is greater than a second threshold value, updating the initial stream pushing moment to the current moment, and pushing a video packet corresponding to the current moment to a client. For improving the stability of the video plug-flow.

Description

Video plug-streaming method and device
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a video plug flow method and a video plug flow device.
Background
The user can watch live webcast and network on-demand through the equipment such as the television and the like, the television cannot cache too many videos due to small cache of the equipment such as the television and the like, and meanwhile, in order to ensure that the user can watch smooth videos, the speed of pushing the stream to the client side at the video server needs to be within a preset range.
In the prior art, a video server typically pushes streams to a client through the following feasible implementations: the video server pushes streams to the client in units of system scheduling durations (generally greater than or equal to 1 second), and videos with preset sizes need to be sent to the client within each system scheduling duration. In a system scheduling time length, a video server determines a video needing to be pushed in the system scheduling time length and pushes the video to a client at the fastest speed, if the video server is idle currently, the video server finishes pushing the video needing to be pushed when the system scheduling time length is not finished, and the pushing flow is suspended in the remaining time of the system scheduling time length; if the video server is busy and green currently, the video server may not complete video pushing when the system scheduling duration is over, and the video server determines a new scheduling duration according to the video that is not completed in the system scheduling duration, wherein the new scheduling duration is smaller than the system scheduling duration, but the video with a preset size still needs to be sent in the new scheduling duration, and under the condition that video pushing lag is accumulated, the video server needs to send a large amount of videos in a short time period, so that the video server has large jitter.
As can be seen from the above, in the process of pushing streams by the video server, the code rate of the video server is very high in the previous period of the system scheduling duration, and the code rate of the video server is very low in the latter period of the system scheduling duration, so that the code rate fluctuation of the video server is large, and further, in the case of lag accumulation of video pushing, the video server may have large jitter, which results in poor stability of video pushing by the video server.
Disclosure of Invention
The embodiment of the invention provides a video plug flow method and device, which improve the stability of video plug flow.
In a first aspect, an embodiment of the present invention provides a video stream pushing method, including:
acquiring the initial plug flow time of a target video, a first video volume pushed between the initial plug flow time and the current time and the average plug flow code rate of the target video;
determining a push delay time according to the initial push moment, the current moment, the first video volume and the average push code rate;
if the delay time of the plug flow is less than a first threshold value, the plug flow is suspended in a preset time, and the first threshold value is less than or equal to zero;
if the stream pushing delay time length is greater than or equal to the first threshold and less than or equal to a second threshold, pushing the video packet corresponding to the current moment to a client;
and if the stream pushing delay time length is greater than a second threshold value, updating the initial stream pushing moment to the current moment, and pushing a video packet corresponding to the current moment to a client.
In a possible implementation manner, obtaining the average push stream bitrate of the target video includes:
acquiring the file size of the target video and the playing time length of the target video;
and determining the average plug flow code rate of the target video according to the file size of the target video and the playing time length of the target video.
In another possible implementation manner, determining a push delay duration according to the initial push timing, the current timing, the first video amount, and the average push bitrate includes:
determining the push flow lag time T according to the following formula Idelay
Figure BDA0001223796470000021
Wherein, T isnowFor the current time, the TbeginAnd at the initial stream pushing moment, n is the first video volume, and b is the average stream pushing code rate.
In another possible implementation manner, the pushing the video packet corresponding to the current time includes:
determining a non-pushed video in the target video;
and determining the video with the earliest preset size in the un-pushed videos as the video packet corresponding to the current moment, and sending the video packet corresponding to the current moment to the client.
In another possible embodiment, the preset time period is greater than 0 and less than 10 milliseconds; and/or the second threshold is greater than 30 milliseconds and less than 2 seconds.
In a second aspect, an embodiment of the present invention provides a video stream pushing apparatus, including an obtaining module, a determining module, a suspending module, a pushing module, and an updating module,
the acquisition module is used for acquiring the initial plug flow time of a target video, the first video volume pushed between the initial plug flow time and the current time and the average plug flow code rate of the target video;
the determining module is used for determining the delay time of the stream pushing according to the initial stream pushing moment, the current moment, the first video volume and the average stream pushing code rate;
the pause module is used for pausing the plug flow within a preset time length when the plug flow lag time length is smaller than a first threshold value, wherein the first threshold value is smaller than or equal to zero;
the pushing module is used for pushing the video packet corresponding to the current moment to a client when the stream pushing delay time length is greater than or equal to the first threshold and less than or equal to a second threshold;
the updating module is used for updating the initial flow pushing moment to the current moment when the flow pushing lag time is greater than a second threshold; correspondingly, the pushing module is further configured to push the video packet corresponding to the current moment to the client.
In a possible implementation manner, the obtaining module is specifically configured to:
acquiring the file size of the target video and the playing time length of the target video;
and determining the average plug flow code rate of the target video according to the file size of the target video and the playing time length of the target video.
In another possible implementation manner, the determining module is specifically configured to:
determining the push flow lag time T according to the following formula Idelay
Figure BDA0001223796470000031
Wherein, T isnowFor the current time, the TbeginFor the initial plug flow time, n is the first video volume, and b is the averageThe stream code rate is pushed.
In another possible implementation manner, the pushing module is specifically configured to:
determining a non-pushed video in the target video;
and determining the video with the earliest preset size in the un-pushed videos as the video packet corresponding to the current moment, and sending the video packet corresponding to the current moment to the client.
In another possible embodiment, the preset time period is greater than 0 and less than 10 milliseconds; and/or the second threshold is greater than 30 milliseconds and less than 2 seconds.
In the process of pushing a target video to a client by a video server, at a current moment, the video server determines a push stream lag time according to an initial push stream moment of the target video, the current moment, a first video amount pushed between the initial push stream moment and the current moment, and an average push stream code rate of the target video, if the push stream lag time is less than a first threshold, it indicates that the push stream code rate between the initial push stream moment and the current moment is too fast, the push stream is suspended within a preset time, if the push stream lag time is greater than or equal to the first threshold and less than or equal to a second threshold, it indicates that the push stream code rate between the initial push stream moment and the current moment is slow, but within a receivable range, a video packet corresponding to the current moment is pushed, if the push stream lag time is greater than the second threshold, it indicates that the push stream code rate between the initial push stream moment and the current moment is too slow, and if the current time exceeds the receivable range, updating the initial stream pushing moment to the current moment so that the video server monitors the stream pushing code rate again from the current moment to avoid the video server from generating overlarge jitter. In the process, the code rate of pushing the stream to the client side can be ensured to be within a normal range, the stream can be pushed to the client side by the video server at a stable code rate, and the working stability of the video server is further improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic view of an application scenario of a video stream pushing method according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a video stream pushing method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a plug flow process provided by an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a video stream pushing apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a schematic view of an application scenario of a video stream pushing method according to an embodiment of the present invention. Referring to fig. 1, a client 101 and a video server 102 are included. In the present application, the client 101 is generally a terminal device such as a television with a small cache. In the actual application process, after the client 101 sends a video request to the video server 102, the video server 102 continues to push the stream to the client 102.
In the present application, the video server 102 generally performs stream pushing to the client 101 in the form of a video packet, before the video server 102 sends a video packet to the client 101, the video server 102 determines whether the speed of the stream pushing meets a preset condition from the start of stream pushing to the current time, when the speed of the stream pushing is too high, the stream pushing is suspended within a preset time duration, and if the speed of the stream pushing is too low, the video packet is sent immediately, so that the video server 102 dynamically adjusts the time of sending the data packet to the client 101, which not only can ensure that the speed of the stream pushing to the client is within a normal range, but also can ensure that the video server pushes the stream to the client with a stable code rate, thereby improving the stability of the video server in operation.
The technical means shown in the present application will be described in detail below with reference to specific examples. It should be noted that the following specific embodiments may be combined with each other, and the same or similar contents are not described in detail in different embodiments.
Fig. 2 is a flowchart illustrating a video stream pushing method according to an embodiment of the present invention. Referring to fig. 2, the method may include:
s201, obtaining the initial stream pushing time of the target video, the first video volume pushed between the initial stream pushing time and the current time, and the average stream pushing code rate of the target video.
The execution subject of the embodiment of the present invention may be a video plug flow device, and the video plug flow device may be disposed in a video server. Alternatively, the video plug-streaming apparatus may be implemented by software and/or hardware.
In the embodiment of the present invention, in the process of pushing the target video to the client by the video server, the video stream pushing device performs stream pushing in units of video packets, for example, when the target video is in a TS format, the size of the video packets is 1316 bytes. Each time the video server sends a video packet to the client, the video server may execute the method shown in the embodiment of fig. 2 to implement sending the video packet to the client.
Initially, the initial streaming pushing time of the target video is a time when the video server first sends a video packet to the client, for example, assuming that the video server sends the first video packet of the target video to the client at 3 points, the initial streaming pushing time of the target video is 3 points. In practical applications, when the streaming delay time of the video server is too long, the start streaming time of the target video may be updated, and the updating of the start streaming time is specifically described in detail in S206. Optionally, the video server may store the initial push streaming time of the target video in a preset file, and update and maintain the initial push streaming time according to the actual push streaming situation, so that when the video server needs to acquire the initial push streaming time, the initial push streaming time is directly acquired in the preset file, and the efficiency of acquiring the initial push streaming time of the target video is further improved.
The first video volume is the video volume sent to the client by the video server between the initial stream pushing time and the current time. Alternatively, the video server may record a position P1 of the video packet in the video file sent to the client at the initial streaming time and a position P2 of the video packet in the video file sent to the client by the video server last time, and determine the size of the first video amount according to the positions P1 and P2.
The average push stream bitrate is consistent with the play rate of the target video, and optionally, the average push stream bitrate of the target video may be determined through the following feasible implementation manners: the file size of the target video and the playing time of the target video are obtained, the average plug flow code rate of the target video is determined according to the file size of the target video and the playing time of the target video, and the ratio of the file size of the target video to the playing time of the video can be determined as the average plug flow code rate. It should be noted that, because the average plug flow rate of the target video is a fixed value, the video server may calculate the average plug flow rate only once and cache the average plug flow rate, and when the video server needs to use the average plug flow rate, the average plug flow rate is directly obtained in the cache.
S202, determining the delay time of the stream pushing according to the initial stream pushing moment, the current moment, the first video amount and the average stream pushing code rate.
Alternatively, the push delay duration T may be determined according to the following formuladelay
Figure BDA0001223796470000061
Wherein, TnowIs the current time, TbeginAt the initial push stream time, n is the first video amount, and b is the average push stream code rate.
In the first formula, if the unit of the first video amount n and the unit of the average push stream code rate b are not the same, the unit of the average push stream code rate b of the first video amount n needs to be unified first. For example, if the unit of the first video amount n is byte and the unit of the average push stream coding rate b is bit/s, the unit of the first video amount n needs to be replaced by bit.
If the stream pushing delay time length is equal to zero, it indicates that the speed of pushing the stream to the client by the video server is equal to the average stream pushing code rate between the initial stream pushing time and the current time.
If the delay time of the stream pushing is greater than zero, it indicates that the code rate of the stream pushing from the video server to the client is smaller than the average stream pushing code rate between the initial stream pushing time and the current time.
If the delay time of the stream pushing is less than zero, it indicates that the code rate of the stream pushing from the video server to the client is greater than the average stream pushing code rate between the initial stream pushing time and the current time.
S203, judging whether the push flow lag time is smaller than a first preset threshold value.
If yes, go to step S204. If not, go to S205.
The first threshold is less than or equal to zero, optionally, the first threshold may be related to a preset duration of the suspension of the push stream in S204, and if the preset duration is t, the first threshold may be-t.
S204, the plug flow is paused within a preset time length, and the first threshold value is smaller than or equal to zero.
In the embodiment of the present invention, the preset time period is usually small, and optionally, the preset time period may be greater than 0 and less than 10 milliseconds, for example, the preset time period may be 4 milliseconds. It should be noted that, in the actual application process, the preset time period may be set according to actual needs, and this is not specifically limited in the embodiment of the present invention.
When the delay time of the stream pushing is smaller than the first threshold, it is indicated that the code rate of the stream pushing from the video server to the client is too fast between the initial stream pushing time and the current time, and in order to avoid that the video data cached at the client is too large, the stream pushing is suspended within the preset time.
After S204, S201 is executed.
And S205, judging whether the push flow delay time length is greater than a second preset threshold value.
The second threshold is a maximum threshold that needs to correct the initial push-streaming time, and optionally, the second threshold may be greater than 30 milliseconds and less than 2 seconds. Of course, in an actual application process, the second threshold may be set according to actual needs, and this is not specifically limited in the embodiment of the present invention.
If yes, go to S206. If not, go to S207.
And S206, updating the initial stream pushing moment to the current moment, and pushing the video packet corresponding to the current moment to the client.
When the delay time of the stream pushing is greater than the second threshold, it is indicated that the rate of the stream pushing from the video server to the client is too slow between the initial stream pushing time and the current time, and the slow degree exceeds the acceptable range of the user, so that the stream pushing cannot be recovered to be normal through rate compensation. In order to avoid jitter (the code rate of the video server in a short period is suddenly too high) caused by the fact that the video server continuously sends video packets to the client, the video server updates the initial stream pushing moment to the current moment, so that the video server can monitor the stream pushing code rate again from the current moment, and the phenomenon that the video server has too large jitter is avoided.
After S206, S208 is executed.
And S207, pushing the video packet corresponding to the current moment to the client.
When the delay duration of the stream pushing is greater than or equal to the first threshold and less than or equal to the second threshold, it is indicated that the rate of pushing the stream to the client by the video server is slower between the initial stream pushing time and the current time, but the slower degree is within the user acceptable range, and the stream pushing can be recovered to be normal through rate compensation. In order to perform code rate compensation, the video server immediately determines a video packet corresponding to the current moment in the target video and sends the video packet corresponding to the current moment to the client.
Optionally, the video server may determine a non-pushed video in the target video, and determine a video with a preset size and an earliest playing time in the non-pushed video as the video packet corresponding to the current time. Alternatively, when the format of the target video is TS video, the preset size may be 1316 bytes. It should be noted that, if the size of the video that is not pushed is smaller than the preset size, the video packet corresponding to the pushed video is determined as the video packet corresponding to the current time.
After S207, S208 is executed.
And S208, judging whether the target video is pushed or not.
If yes, S209 is performed.
If not, S201 is executed.
And S209, ending.
In the video stream pushing method provided by the embodiment of the invention, in the process of pushing a target video to a client by a video server, at the current time, the video server determines a stream pushing delay time according to the initial stream pushing time of the target video, the current time, a first video amount pushed between the initial stream pushing time and the current time, and an average stream pushing code rate of the target video, if the stream pushing delay time is less than a first threshold, the stream pushing code rate between the initial stream pushing time and the current time is too fast, the stream pushing is suspended in a preset time, if the stream pushing delay time is greater than or equal to the first threshold and less than or equal to a second threshold, the stream pushing code rate between the initial stream pushing time and the current time is slow, but within a receivable range, a video packet corresponding to the current time is pushed, if the stream pushing delay time is greater than the second threshold, the stream pushing code rate between the initial stream pushing time and the current time is too slow, and if the current time exceeds the receivable range, updating the initial stream pushing moment to the current moment so that the video server monitors the stream pushing code rate again from the current moment to avoid the video server from generating overlarge jitter. In the process, the code rate of pushing the stream to the client side can be ensured to be within a normal range, the stream can be pushed to the client side by the video server at a stable code rate, and the working stability of the video server is further improved.
The method shown in the embodiment of fig. 2 is described in detail below by way of specific examples with reference to fig. 3.
Fig. 3 is a schematic diagram of a plug flow process according to an embodiment of the present invention. Referring to fig. 3, assuming that the target video is in a TS format, the size of each video packet sent by the video server may be 1316 bytes, and assuming that the target video may be divided into M video packets, which are denoted as video packet 1-video packet M. The sizes of the first video packet to the M-1 video packet are 1316 bytes, and the size of the M video packet is 940 bytes. The method comprises the steps that a plurality of stream pushing periods (for example, t1-t2, t2-t3, t4-t5, t5-t6 and the like) and pause periods (for example, t3-t4) are included on a coordinate axis of a stream pushing moment, and in each stream pushing period, a video packet is pushed to a client by a video server, wherein when busy states of the video server are different, time lengths used for the video server to send the video packet 1 and the video packet 2 may be different, for example, the time lengths between t1-t2, the time lengths between t2-t3, the time lengths between t4-t5 and the like.
Suppose that the video server starts streaming to the client at time t0, at which point the start streaming time is t 0. Assuming that the playing time length of the target video is T, the average plug flow code rate of the target video is T
Figure BDA0001223796470000091
During the time period t0-t1, the video server sends video package 1 to the client.
At the time t1, the video server determines the stream pushing delay time t-delay1 according to the initial stream pushing time t0, the current time t1, the first video amount (the size of the video packet 1), and the average stream pushing code rate b.
Assuming that the video server determines that the stream push lag time period t-delay1 is between the first threshold and the second threshold, the video server transmits the video packet 2 to the client during the period t1-t 2.
At the time t2, the video server determines the stream delay time t-delay2 according to the initial stream pushing time t0, the current time t2, the first video amount (the size of the video packets 1-2), and the average stream pushing code rate b.
Assuming that the video server determines that the stream push lag time period t-delay2 is between the first threshold and the second threshold, the video server transmits the video packet 3 to the client during the period t2-t 3.
At the time t3, the video server determines the stream delay time t-delay3 according to the initial stream pushing time t0, the current time t3, the first video amount (the size of the video packets 1-3), and the average stream pushing code rate b.
Assuming that the video server judges that the stream pushing delay time length t-delay3 is less than the first threshold, the video server suspends pushing the video to the client within a time period t3-t 4.
Assuming that at the time points t4, t5 and t6, the video server determines that the obtained stream pushing lag time lengths are all between the first threshold and the second threshold, pushing the corresponding video packets to the client in the corresponding time periods.
At the time t7, the video server determines the stream delay time t-delay7 according to the initial stream pushing time t0, the current time t7, the first video amount (the size of the video packets 1-6), and the average stream pushing code rate b.
Assuming that the video server judges that the stream pushing delay time length t-delay7 is greater than the second threshold, at time t7, the starting stream pushing time is updated to t7, and in time t7-t8, the video server sends the video packet 7 to the client.
And repeating the process until the video server pushes the target video to the client.
Fig. 4 is a schematic structural diagram of a video stream pushing apparatus according to an embodiment of the present invention. The video plug-flow device can be arranged in a video server. Referring to fig. 4, the video streaming apparatus includes an obtaining module 11, a determining module 12, a pausing module 13, a pushing module 14, and an updating module 15, wherein,
the obtaining module 11 is configured to obtain an initial stream pushing time of a target video, a first video amount pushed between the initial stream pushing time and a current time, and an average stream pushing code rate of the target video;
the determining module 12 is configured to determine a push delay duration according to the initial push moment, the current moment, the first video amount, and the average push bitrate;
the pause module 13 is configured to pause the push flow within a preset time length when the push flow delay time length is smaller than a first threshold value, where the first threshold value is smaller than or equal to zero;
the pushing module 14 is configured to, when the push stream delay time length is greater than or equal to the first threshold and less than or equal to a second threshold, push the video packet corresponding to the current time to the client;
the updating module 15 is configured to update the initial push flow time to the current time when the push flow delay duration is greater than a second threshold; correspondingly, the pushing module 14 is further configured to push the video packet corresponding to the current time to the client.
The video stream pushing apparatus provided in the embodiment of the present invention may implement the technical solutions shown in the above method embodiments, and the implementation principles and beneficial effects thereof are similar, and are not described herein again.
In a possible implementation manner, the obtaining module is specifically configured to:
acquiring the file size of the target video and the playing time length of the target video;
and determining the average plug flow code rate of the target video according to the file size of the target video and the playing time length of the target video.
In another possible implementation manner, the determining module is specifically configured to:
determining the push flow lag time T according to the following formula Idelay
Figure BDA0001223796470000101
Wherein, T isnowFor the current time, the TbeginAnd at the initial stream pushing moment, n is the first video volume, and b is the average stream pushing code rate.
In another possible implementation manner, the pushing module is specifically configured to:
determining a non-pushed video in the target video;
and determining the video with the earliest preset size in the un-pushed videos as the video packet corresponding to the current moment, and sending the video packet corresponding to the current moment to the client.
In another possible embodiment, the preset time period is greater than 0 and less than 10 milliseconds; and/or the second threshold is greater than 30 milliseconds and less than 2 seconds.
The video stream pushing apparatus provided in the embodiment of the present invention may implement the technical solutions shown in the above method embodiments, and the implementation principles and beneficial effects thereof are similar, and are not described herein again.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the embodiments of the present invention, and are not limited thereto; although embodiments of the present invention have been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the embodiments of the present invention.

Claims (10)

1. A video streaming method, comprising:
the method comprises the steps of obtaining an initial stream pushing moment of a target video, a first video volume pushed between the initial stream pushing moment and the current moment and an average stream pushing code rate of the target video, wherein the initial stream pushing moment of the target video is the moment when a video server sends a video packet to a client for the first time at the beginning;
determining a push delay time according to the initial push moment, the current moment, the first video volume and the average push code rate;
if the delay time of the plug flow is less than a first threshold value, the plug flow is suspended in a preset time, and the first threshold value is less than or equal to zero;
if the stream pushing delay time length is greater than or equal to the first threshold and less than or equal to a second threshold, pushing the video packet corresponding to the current moment to a client;
and if the stream pushing delay time length is greater than a second threshold value, updating the initial stream pushing moment to the current moment, and pushing a video packet corresponding to the current moment to a client.
2. The method of claim 1, wherein obtaining the average plug flow rate of the target video comprises:
acquiring the file size of the target video and the playing time length of the target video;
and determining the average plug flow code rate of the target video according to the file size of the target video and the playing time length of the target video.
3. The method of claim 1 or 2, wherein determining a push delay duration according to the start push timing, the current timing, the first video amount, and the average push bitrate comprises:
determining the push flow lag time T according to the following formula Idelay
Figure FDA0002179620120000011
Wherein, T isnowFor the current time, the TbeginAnd at the initial stream pushing moment, n is the first video volume, and b is the average stream pushing code rate.
4. The method according to claim 1 or 2, wherein pushing the video packet corresponding to the current time comprises:
determining a non-pushed video in the target video;
and determining the video with the earliest preset size in the un-pushed videos as the video packet corresponding to the current moment, and sending the video packet corresponding to the current moment to the client.
5. The method according to claim 1 or 2,
the preset time length is more than 0 and less than 10 milliseconds; and/or the second threshold is greater than 30 milliseconds and less than 2 seconds.
6. A video stream pushing device is characterized by comprising an acquisition module, a determination module, a pause module, a pushing module and an updating module, wherein,
the acquisition module is used for acquiring the initial stream pushing moment of the target video, the first video volume pushed between the initial stream pushing moment and the current moment and the average stream pushing code rate of the target video, wherein the initial stream pushing moment of the target video is the moment when the video server sends a video packet to the client for the first time at the initial moment;
the determining module is used for determining the delay time of the stream pushing according to the initial stream pushing moment, the current moment, the first video volume and the average stream pushing code rate;
the pause module is used for pausing the plug flow within a preset time length when the plug flow lag time length is smaller than a first threshold value, wherein the first threshold value is smaller than or equal to zero;
the pushing module is used for pushing the video packet corresponding to the current moment to a client when the stream pushing delay time length is greater than or equal to the first threshold and less than or equal to a second threshold;
the updating module is used for updating the initial flow pushing moment to the current moment when the flow pushing lag time is greater than a second threshold; correspondingly, the pushing module is further configured to push the video packet corresponding to the current moment to the client.
7. The apparatus of claim 6, wherein the obtaining module is specifically configured to:
acquiring the file size of the target video and the playing time length of the target video;
and determining the average plug flow code rate of the target video according to the file size of the target video and the playing time length of the target video.
8. The apparatus according to claim 6 or 7, wherein the determining module is specifically configured to:
determining the push flow lag time T according to the following formula Idelay
Figure FDA0002179620120000021
Wherein, T isnowFor the current time, the TbeginAnd at the initial stream pushing moment, n is the first video volume, and b is the average stream pushing code rate.
9. The apparatus according to claim 6 or 7, wherein the push module is specifically configured to:
determining a non-pushed video in the target video;
and determining the video with the earliest preset size in the un-pushed videos as the video packet corresponding to the current moment, and sending the video packet corresponding to the current moment to the client.
10. The apparatus according to claim 6 or 7,
the preset time length is more than 0 and less than 10 milliseconds; and/or the second threshold is greater than 30 milliseconds and less than 2 seconds.
CN201710074361.4A 2017-02-10 2017-02-10 Video plug-streaming method and device Active CN106851340B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710074361.4A CN106851340B (en) 2017-02-10 2017-02-10 Video plug-streaming method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710074361.4A CN106851340B (en) 2017-02-10 2017-02-10 Video plug-streaming method and device

Publications (2)

Publication Number Publication Date
CN106851340A CN106851340A (en) 2017-06-13
CN106851340B true CN106851340B (en) 2020-05-05

Family

ID=59127372

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710074361.4A Active CN106851340B (en) 2017-02-10 2017-02-10 Video plug-streaming method and device

Country Status (1)

Country Link
CN (1) CN106851340B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103024446A (en) * 2012-12-31 2013-04-03 传聚互动(北京)科技有限公司 Loading and buffering method and system for online video
CN103546540A (en) * 2013-09-26 2014-01-29 传线网络科技(上海)有限公司 Method and system for realizing control of cache data on CDN (content delivery network)
CN105915967A (en) * 2016-05-09 2016-08-31 乐视控股(北京)有限公司 Method and system of correcting video time-delay

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120183276A1 (en) * 2011-01-19 2012-07-19 Rovi Technologies Corporation Method and Apparatus for Transmission of Data or Flags Indicative of Actual Program Recording Times or Durations
CN104079955B (en) * 2013-03-26 2017-12-15 华为技术有限公司 More push up OTT live method, apparatus and system
CN104244033B (en) * 2014-09-03 2017-12-08 乐视致新电子科技(天津)有限公司 Video broadcasting method and device, intelligent terminal

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103024446A (en) * 2012-12-31 2013-04-03 传聚互动(北京)科技有限公司 Loading and buffering method and system for online video
CN103546540A (en) * 2013-09-26 2014-01-29 传线网络科技(上海)有限公司 Method and system for realizing control of cache data on CDN (content delivery network)
CN105915967A (en) * 2016-05-09 2016-08-31 乐视控股(北京)有限公司 Method and system of correcting video time-delay

Also Published As

Publication number Publication date
CN106851340A (en) 2017-06-13

Similar Documents

Publication Publication Date Title
CN111135569B (en) Cloud game processing method and device, storage medium and electronic equipment
US11838599B1 (en) Media streaming with latency minimization
CN111586479B (en) Machine-implemented method executed by client device and readable medium
CN106686438B (en) method, device and system for synchronously playing audio images across equipment
KR101500892B1 (en) Variable bit video streams for adaptive streaming
US10645447B2 (en) Fast channel change method and server, and IPTV system
KR101513119B1 (en) Variable bit video streams for adaptive streaming
US9621613B1 (en) Bitrate adaptation transitioning using key frames
CA2758763C (en) Method and device for fast pushing unicast stream in fast channel change
WO2019062050A1 (en) Live broadcast control method, apparatus, and electronic device
CN110913245A (en) Method and device for controlling video transcoding code rate
US20120281965A1 (en) L-cut stream startup
JP2015520964A (en) Integrated controller-based pacing for HTTP pseudo-streaming
CN106851337B (en) Video buffering control method and device
CN113242436B (en) Live broadcast data processing method and device and electronic equipment
US20150095447A1 (en) Serving method of cache server, cache server, and system
CN111886875A (en) Congestion response for timely media delivery
CN105578201A (en) System and method for implementing dynamic adjustment of HLS live bit rate number
CN104581340A (en) Client-side, streaming media data receiving method and streaming media data transmission system
KR101795537B1 (en) System and method for providing of cloud streaming service which is adapting to network environment
CN106851340B (en) Video plug-streaming method and device
KR20200018493A (en) Methods and apparatuses for streaming data
JP6099715B2 (en) Streaming media playback apparatus, streaming media playback method, and program
TWI523511B (en) Variable bit rate video panning method
WO2016203870A1 (en) Transmission apparatus, transmission method, and communication system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant