CN111405370B - Video playback method and device - Google Patents

Video playback method and device Download PDF

Info

Publication number
CN111405370B
CN111405370B CN201911107055.1A CN201911107055A CN111405370B CN 111405370 B CN111405370 B CN 111405370B CN 201911107055 A CN201911107055 A CN 201911107055A CN 111405370 B CN111405370 B CN 111405370B
Authority
CN
China
Prior art keywords
sending
playback rate
video data
rate
transmission
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
CN201911107055.1A
Other languages
Chinese (zh)
Other versions
CN111405370A (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.)
Hangzhou Hikvision System Technology Co Ltd
Original Assignee
Hangzhou Hikvision System 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 Hangzhou Hikvision System Technology Co Ltd filed Critical Hangzhou Hikvision System Technology Co Ltd
Priority to CN201911107055.1A priority Critical patent/CN111405370B/en
Publication of CN111405370A publication Critical patent/CN111405370A/en
Application granted granted Critical
Publication of CN111405370B publication Critical patent/CN111405370B/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/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/472End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
    • H04N21/47217End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content for controlling playback functions for recorded or on-demand content, e.g. using progress bars, mode or play-point indicators or bookmarks
    • 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/231Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion
    • 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/238Interfacing the downstream path of the transmission network, e.g. adapting the transmission rate of a video stream to network bandwidth; Processing of multiplex streams
    • H04N21/2387Stream processing in response to a playback request from an end-user, e.g. for trick-play
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440281Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by altering the temporal resolution, e.g. by frame skipping
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording
    • H04N5/91Television signal processing therefor
    • H04N5/93Regeneration of the television signal or of selected parts thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/18Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast

Landscapes

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

Abstract

The embodiment of the invention provides a video playback method and a video playback device, wherein the method comprises the following steps: receiving a video playback request sent by a client; determining a predicted playback rate based on the sending parameters and the speed doubling identifiers during the playback of the historical video; determining an ideal playback rate based on the current available network bandwidth and the speed multiplying identification; determining target sending parameters of the video data according to the size relation between the predicted playback rate and the ideal playback rate; and sending the video data to the client according to the target sending parameters so that the client plays back the received video data. The target sending parameters are determined according to the size relation between the predicted playback rate and the ideal playback rate, and the ideal playback rate is determined based on the current available network bandwidth, so that the influence of the current available network bandwidth can be fully considered, the client can play smooth video data, and the smoothness of video playback is improved.

Description

Video playback method and device
Technical Field
The present invention relates to the field of video processing technologies, and in particular, to a video playback method and apparatus.
Background
The current video cloud storage system generally comprises a management server cluster and a storage server cluster. The management server cluster stores index information of data, wherein the index information comprises object identification, buckets, strip information of the data, addresses of storage nodes written in the data, disk identification and the like. The storage server stores specific object data, that is, video data.
The user can view the event of interest through video playback, which is often accompanied by multiple speed playback, such as 4-fold, 8-fold, 64-fold, and so on. The multi-speed playback generates a very large pressure on the network bandwidth of the cloud storage server, and taking 128 channels of 4-megabyte-stream video as an example, the data flow of 64-speed playback is 128 × 64 × 4/8 — 4096 megabytes per second theoretically, even for a server configured with ten-megabyte network cards, the bandwidth requirement is not sufficient.
In order to solve the problems, when the front-end monitoring equipment collects a video, the resolution, the code rate and the frame rate of the original video are reduced through an algorithm to obtain a sub-code stream of the video, and then the original video, namely the main code stream and the sub-code stream are written into a cloud storage system. Therefore, when the video is played back, the cloud storage system can selectively use the main code stream or the sub code stream for playback according to the multiple speed and the network condition required by the user. Therefore, on one hand, the original video with high resolution is reserved for being called, and on the other hand, the feasibility of narrow bandwidth transmission at multiple speed is also considered. However, the storage capacity of the cloud storage system is greatly increased by storing the main code stream and the sub code stream simultaneously, and the sub code stream needs to be obtained through a fixed algorithm, so that the method can only meet certain fixed playback requirements, cannot adapt to network bandwidth, and probably cannot meet the smoothness requirement of high-speed video playback.
Disclosure of Invention
The embodiment of the invention aims to provide a video playback method and a video playback device, so as to adapt to network bandwidth and improve the fluency of video playback. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a video playback method, where the method includes:
receiving a video playback request sent by a client, wherein the video playback request carries a speed doubling identifier;
determining a predicted playback rate based on the sending parameters and the speed doubling identification during the playback of the historical video;
determining an ideal playback rate based on the current available network bandwidth and the speed multiplying identification;
determining target sending parameters of the video data according to the magnitude relation between the predicted playback rate and the ideal playback rate;
and sending the video data to the client according to the target sending parameters so as to enable the client to play back the received video data.
Optionally, the step of determining target transmission parameters of the video data according to the magnitude relationship between the predicted playback rate and the ideal playback rate includes:
determining a magnitude relationship of the predicted playback rate to the ideal playback rate;
if the predicted playback rate is smaller than the ideal playback rate and the difference between the predicted playback rate and the ideal playback rate reaches a first threshold, adjusting the current transmission parameter to obtain a first target transmission parameter, wherein the first target transmission parameter is: a transmission parameter in which the amount of video data transmitted per unit time increases when the video data is transmitted according to the first target transmission parameter;
if the predicted playback rate is greater than the ideal playback rate and the difference between the predicted playback rate and the ideal playback rate reaches a second threshold, adjusting the current transmission parameter to obtain a second target transmission parameter, wherein the second target transmission parameter is: a transmission parameter in which the amount of video data transmitted per unit time is reduced when transmitting video data according to the second target transmission parameter;
and if the predicted playback rate is not greater than the first rate and not lower than a second rate, determining that the current transmission parameter is unchanged to obtain a third target transmission parameter, wherein the first rate is the sum of the ideal playback rate and the second threshold, and the second rate is the difference between the ideal playback rate and the first threshold.
Optionally, the first target sending parameter, the second target sending parameter, and the third target sending parameter all include a sending time interval, a number of I frames sent in each sending period, and a number of non-I frames;
the step of adjusting the current transmission parameter to obtain the first target transmission parameter includes:
it is determined whether the number of transmitted GOPs per unit time reaches a maximum number,
if the number of the sending GOPs in the unit time reaches the maximum number, shortening the current sending time interval, updating the predicted playback rate according to the adjusted sending parameters, and returning to the step of determining the size relationship between the predicted playback rate and the ideal playback rate;
if the number of the sending GOPs in the unit time does not reach the maximum number, increasing the number of I frames and the number of non-I frames sent in each current sending period, updating the predicted playback rate according to the adjusted sending parameters, and returning to the step of determining the size relationship between the predicted playback rate and the ideal playback rate;
the step of adjusting the current transmission parameter to obtain a second target transmission parameter includes:
judging whether the quantity of the sending GOPs in the unit time reaches the maximum quantity;
if the number of the sending GOPs in the unit time does not reach the maximum number, increasing the current sending time interval, updating the predicted playback rate according to the adjusted sending parameters, and returning to the step of determining the size relationship between the predicted playback rate and the ideal playback rate;
if the number of the sending GOPs in the unit time reaches the maximum number, reducing the number of the I frames and the number of the non-I frames sent in each current sending period, updating the predicted playback rate according to the adjusted sending parameters, and returning to the step of determining the size relation between the predicted playback rate and the ideal playback rate.
Optionally, the step of determining a predicted playback rate based on the transmission parameter and the double speed identifier during playback of the historical video includes:
acquiring sending parameters during historical video playback, wherein the sending parameters during historical video playback comprise the starting time, the ending time, the number of bytes and a historical sending time interval of sending video data;
calculating the time consumption of historical video data transmission according to the start time, the end time and the number of bytes of the video data transmission;
calculating a historical sending rate according to the time consumption of the historical video data sending, the historical sending time interval and the data volume of the historical video data sending;
and determining a predicted playback rate based on the double speed identification and the historical transmission rate.
Optionally, the step of calculating the time consumed for sending the video data historically according to the start time, the end time and the number of bytes of the sent video data includes:
according to the formula
Figure GDA0003390833490000041
Calculating the time consumption T of historical video data transmission;
wherein, KiIs a predetermined coefficient, n is a positive integer, tendIs the end time, tbeginAs the start time, DconstNumber of bytes transmitted ideally, DrealIs the actual number of bytes sent.
Optionally, the step of calculating a historical transmission rate according to the time consumed by the historical transmission of the video data, the historical transmission time interval, and the data amount of the historical transmission of the video data includes:
according to the formula
Figure GDA0003390833490000042
Calculating a historical transmission rate Rpred
Wherein, Δ T is the historical sending time interval, N is the number of I frames of the video data sent in the time length of T + Δ T, and M is the number of non-I frames and size of the video data sent in the time length of T + Δ TiframeFor the number of bytes per I frame, sizepframeThe number of bytes per non-I frame.
Optionally, the step of determining an ideal playback rate based on the current available network bandwidth and the multiple speed identifier includes:
according to the publicFormula (II)
Figure GDA0003390833490000043
Calculating ideal playback rate R'ideal
Wherein max _ band is the current available network bandwidth, and X is the multiple speed, size represented by the multiple speed identifieriframeFor the number of bytes per I frame, sizepframeThe number of bytes of each non-I frame is, t is the current sending time period, N 'is the number of I frames needing to send video data in the current sending time period, and M' is the number of non-I frames needing to send video data in the current sending time period.
In a second aspect, an embodiment of the present invention provides a video playback apparatus, including:
the video playback request receiving module is used for receiving a video playback request sent by a client, wherein the video playback request carries a speed doubling identifier;
the predicted playback rate determining module is used for determining the predicted playback rate based on the sending parameters and the speed doubling identifiers during the playback of the historical video;
the ideal playback rate determining module is used for determining an ideal playback rate based on the current available network bandwidth and the speed doubling identifier;
the target sending parameter determining module is used for determining target sending parameters of the video data according to the magnitude relation between the predicted playback rate and the ideal playback rate;
and the video data sending module is used for sending the video data to the client according to the target sending parameters so as to enable the client to play back the received video data.
Optionally, the target sending parameter determining module includes:
a magnitude relation determining unit configured to determine a magnitude relation between the predicted playback rate and the ideal playback rate;
a first target sending parameter determining unit, configured to adjust a current sending parameter to obtain a first target sending parameter if the predicted playback rate is smaller than the ideal playback rate and a difference between the predicted playback rate and the ideal playback rate reaches a first threshold, where the first target sending parameter is: a transmission parameter in which the amount of video data transmitted per unit time increases when the video data is transmitted according to the first target transmission parameter;
a second target sending parameter determining unit, configured to adjust a current sending parameter to obtain a second target sending parameter if the predicted playback rate is greater than the ideal playback rate and a difference between the predicted playback rate and the ideal playback rate reaches a second threshold, where the second target sending parameter is: a transmission parameter in which the amount of video data transmitted per unit time is reduced when transmitting video data according to the second target transmission parameter;
a third target transmission parameter determining unit, configured to determine that the current transmission parameter is unchanged if the predicted playback rate is not greater than a first rate and not lower than a second rate, so as to obtain a third target transmission parameter, where the first rate is a sum of the ideal playback rate and the second threshold, and the second rate is a difference between the ideal playback rate and the first threshold.
Optionally, the first target sending parameter, the second target sending parameter, and the third target sending parameter all include a sending time interval, a number of I frames sent in each sending period, and a number of non-I frames;
the first target transmission parameter determination unit includes:
a first judgment subunit operable to judge whether the number of the transmitted GOPs per unit time reaches a maximum number,
a time interval shortening subunit, configured to shorten a current transmission time interval if the number of the transmission GOPs in the unit time reaches a maximum number, update the predicted playback rate according to the adjusted transmission parameter, and trigger the size relationship determining unit;
a transmission number increasing subunit, configured to increase the number of I frames and the number of non-I frames transmitted in each current transmission period if the number of transmission GOPs in the unit time does not reach the maximum number, update the predicted playback rate according to the adjusted transmission parameter, and trigger the size relationship determining unit;
the second target transmission parameter determination unit includes:
a second judging subunit, configured to judge whether the number of sending GOPs in the unit time reaches a maximum number;
a time interval increasing subunit, configured to increase the current transmission time interval if the number of the transmission GOPs in the unit time does not reach the maximum number, update the predicted playback rate according to the adjusted transmission parameter, and trigger the size relationship determining unit;
and a transmission number reduction subunit, configured to reduce the number of I frames and the number of non-I frames transmitted in each current transmission period if the number of transmission GOPs in the unit time reaches the maximum number, update the predicted playback rate according to the adjusted transmission parameter, and trigger the size relationship determination unit.
Optionally, the predicted playback rate determining module includes:
the device comprises a sending parameter acquiring unit, a sending parameter acquiring unit and a sending parameter acquiring unit, wherein the sending parameter acquiring unit is used for acquiring sending parameters during historical video playback, and the sending parameters during historical video playback comprise the starting time, the ending time, the number of bytes and a historical sending time interval of sending video data;
the time consumption calculating unit is used for calculating the time consumption of historical video data transmission according to the start time, the end time and the number of bytes of the video data transmission;
the historical sending rate calculating unit is used for calculating the historical sending rate according to the time consumption of the historical sending video data, the historical sending time interval and the data volume of the historical sending video data;
and the predicted playback rate determining unit is used for determining the predicted playback rate based on the double-speed identification and the historical sending rate.
Optionally, the time-consuming calculating unit includes:
time-consuming calculation word unit for following formula
Figure GDA0003390833490000071
Calculating historical dataThe time taken to send video data T;
wherein, KiIs a predetermined coefficient, n is a positive integer, tendIs the end time, tbeginAs the start time, DconstNumber of bytes transmitted ideally, DrealIs the actual number of bytes sent.
Optionally, the historical sending rate calculating unit includes:
a historical transmission rate calculating subunit for calculating the historical transmission rate according to the formula
Figure GDA0003390833490000072
Calculating a historical transmission rate Rpred
Wherein, Δ T is the historical sending time interval, N is the number of I frames of the video data sent in the time length of T + Δ T, and M is the number of non-I frames and size of the video data sent in the time length of T + Δ TiframeFor the number of bytes per I frame, sizepframeThe number of bytes per non-I frame.
Optionally, the ideal playback rate determining module includes:
an ideal playback rate determining unit for determining the ideal playback rate according to the formula
Figure GDA0003390833490000073
Calculating ideal playback rate R'ideal
Wherein max _ band is the current available network bandwidth, and X is the multiple speed, size represented by the multiple speed identifieriframeFor the number of bytes per I frame, sizepframeThe number of bytes of each non-I frame is, t is the current sending time period, N 'is the number of I frames needing to send video data in the current sending time period, and M' is the number of non-I frames needing to send video data in the current sending time period.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor and the communication interface complete communication between the memory and the processor through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing any video playback method steps when the program stored in the memory is executed.
In a fourth aspect, the present invention provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements any of the above-mentioned video playback method steps.
In the scheme provided by the embodiment of the invention, the electronic equipment can firstly receive a video playback request sent by a client, wherein the video playback request carries a speed doubling identifier, a predicted playback rate is determined based on a sending parameter and the speed doubling identifier during historical video playback, an ideal playback rate is determined based on a current available network bandwidth and the speed doubling identifier, further, a target sending parameter of video data is determined according to the size relation between the predicted playback rate and the ideal playback rate, and the video data is sent to the client according to the target sending parameter so that the client plays back the received video data. The target sending parameters are determined according to the size relation between the predicted playback rate and the ideal playback rate, and the ideal playback rate is determined based on the current available network bandwidth, so that the influence of the current available network bandwidth can be fully considered, the target sending parameters can be adapted to the network bandwidth, the video data are sent to the client on the basis of the current available network bandwidth, the client can play smooth video data, and the fluency of video playback is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a video playback system based on a video cloud storage system according to an embodiment of the present invention;
fig. 2 is a flowchart of a video playback method according to an embodiment of the present invention;
FIG. 3 is a detailed flowchart of step S204 in the embodiment shown in FIG. 2;
FIG. 4 is another detailed flowchart of step S204 in the embodiment shown in FIG. 2;
FIG. 5 is a detailed flowchart of step S202 in the embodiment shown in FIG. 2;
fig. 6 is a schematic structural diagram of a video playback apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
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 only a part of the embodiments of the present invention, and not all of the embodiments. 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.
In order to adapt to network bandwidth and improve fluency of video playback, embodiments of the present invention provide a video playback method, an apparatus, an electronic device, and a computer-readable storage medium.
A video playback method according to an embodiment of the present invention is first described below.
The video playback method provided by the embodiment of the invention can be applied to storage nodes in a video cloud storage system, and also can be applied to other electronic equipment needing video playback, and for convenience of description, the method is hereinafter referred to as electronic equipment for short. In order to facilitate understanding of the video playback method provided by the embodiment of the present invention, first, a video playback system structure and a video playback process based on a video cloud storage system are described below.
As shown in fig. 1, the video playback system based on the video cloud storage system includes a video monitoring platform 110, a client 120, and a video cloud storage system 130. The video cloud storage system, in turn, includes a management server cluster 131 and a storage server cluster 132. The management server cluster 131 stores index information of video data, and the storage server cluster 132 stores video data.
For the video playback process, a user may send a video playback request through the video monitoring platform 110, and after receiving the video playback request, the video monitoring platform 110 may send the video playback request to the video cloud storage system 130, where the video playback request may include an encoder identifier, a start time, an end time, a playback mode, and the like of a playback video.
After the video cloud storage system 130 receives the video playback request, the management node in the management server cluster 131 may determine an optimal storage node, and then send the video playback request to the optimal storage node. After receiving the video playback request, the optimal storage node obtains index information stored by the management server cluster 131 according to information carried by the video playback request, then locates a storage server where the video data to be played back is located according to the index information, extracts the video data from the storage server, and then sends the video data to the client 120, and the client 120 can play back the video data to a user for viewing after decoding the video data.
In the video playback process, the storage node extracts video data from the storage server according to certain sending parameters and then sends the video data to the client, and the sending parameters determine the rate of sending the video data to the client by the storage node, so that the fluency of video playback is determined.
As shown in fig. 2, a video playback method, the method comprising:
s201, receiving a video playback request sent by a client;
wherein the video playback request carries a speed doubling identifier.
S202, determining a predicted playback rate based on the sending parameters and the speed doubling identifiers during the playback of the historical video;
s203, determining an ideal playback rate based on the current available network bandwidth and the speed doubling identifier;
s204, determining target sending parameters of the video data according to the magnitude relation between the predicted playback rate and the ideal playback rate;
s205, sending the video data to the client according to the target sending parameter so that the client can play back the received video data.
It can be seen that, in the scheme provided in the embodiment of the present invention, a video playback request sent by a client may be received, where the video playback request carries a speed doubling identifier, a predicted playback rate is determined based on a sending parameter and a speed doubling identifier during historical video playback, an ideal playback rate is determined based on a current available network bandwidth and a speed doubling identifier, and further, a target sending parameter of video data is determined according to a size relationship between the predicted playback rate and the ideal playback rate, and the video data is sent to the client according to the target sending parameter, so that the client plays back the received video data. The target sending parameters are determined according to the size relation between the predicted playback rate and the ideal playback rate, and the ideal playback rate is determined based on the current available network bandwidth, so that the influence of the current available network bandwidth can be fully considered, the target sending parameters can be adapted to the network bandwidth, the video data are sent to the client on the basis of the current available network bandwidth, the client can play smooth video data, and the fluency of video playback is improved.
In step S201, when the user performs video playback, the client may send a video playback request, and the electronic device may receive the video playback request sent by the client. For example, in a video playback system based on a video cloud storage system, a user may send a video playback request through a client of a video monitoring platform, and after receiving the video playback request, the client of the video monitoring platform may issue the video playback request to a storage node of the video cloud storage system.
The video playback request may carry a speed doubling identifier, where the speed doubling identifier is an identifier indicating a video playback speed required by the user, and may be a number, a letter, a character, or a combination thereof, and is not specifically limited herein. The video playback request may also carry an encoder identifier, a start time, an end time, a playback mode, and the like of the playback video, which is not specifically limited herein.
After obtaining the video playback request, in order to determine the video data transmission rate more suitable for the current network bandwidth, the electronic device may execute the step S202, that is, determine the predicted playback rate based on the transmission parameters during the historical video playback and the multiple speed identifier.
The sending parameter during the historical video playback is a parameter related to the video playback before the current time, and may include, for example, the data amount of the video playback, the time consumed by the video playback, and the like. The electronic equipment can determine the predicted playback rate according to the transmission parameters and the speed doubling identification during the historical video playback. The predicted playback rate is the transmission rate of the video data predicted when the electronic equipment transmits the video data according to the transmission parameters during the historical video playback and plays back the video according to the double speed represented by the double speed identifier.
To determine whether the predicted playback rate is adapted to the currently available network bandwidth, the electronic device may determine an ideal playback rate based on the currently available network bandwidth and the multiple speed identifier, i.e., execute step S203. The electronic device can determine an ideal playback rate according to the current available network bandwidth and the multiple speed identifier, wherein the ideal playback rate is the maximum transmission rate of the video data which can be achieved on the premise of the current available network bandwidth.
After the predicted playback rate and the ideal playback rate are determined, the electronic device may determine the target transmission parameter of the video data according to the magnitude relationship between the predicted playback rate and the ideal playback rate. If the predicted playback rate is less than the ideal playback rate, which indicates that the current available network bandwidth is not fully utilized when the video data is transmitted according to the current transmission parameters, the electronic device may adjust the current transmission parameters to increase the transmission rate of the video data.
Conversely, if the predicted playback rate is greater than the ideal playback rate, indicating that the currently available network bandwidth cannot meet the requirements for transmitting video data according to the current transmission parameters, the electronic device may adjust the current transmission parameters to decrease the transmission rate of the video data.
In step S205, the electronic device may send the video data to the client according to the determined target sending parameter, and after receiving the video data, the client may decode the video data, and play back the decoded video data according to the double speed indicated by the double speed identifier, so that the user may view the video played back at double speed.
It should be noted that, the execution order of the steps S202 and S203 is not limited, and it is reasonable to execute the step S202 first, the step S203 first, or both the step S202 and the step S203, and the embodiment of the present invention is not limited in this respect.
As an implementation manner of the embodiment of the present invention, as shown in fig. 3, the step of determining the target transmission parameter of the video data according to the magnitude relationship between the predicted playback rate and the ideal playback rate may include:
s301, determining the magnitude relation between the predicted playback rate and the ideal playback rate, and if the predicted playback rate is smaller than the ideal playback rate and the difference value between the predicted playback rate and the ideal playback rate reaches a first threshold value, executing the step S302; if the predicted playback rate is greater than the ideal playback rate and the difference between the predicted playback rate and the ideal playback rate reaches a second threshold, executing step S303; if the predicted playback rate is not greater than the first rate and not less than the second rate, executing step S304;
the electronic device may determine a magnitude relationship between the predicted playback rate and the ideal playback rate, and if the predicted playback rate is smaller than the ideal playback rate and a difference between the predicted playback rate and the ideal playback rate reaches a first threshold, which indicates that the predicted playback rate is smaller than the ideal playback rate and the difference is larger, the transmission rate of the video data may be increased, that is, the amount of the video data transmitted in unit time is increased, and then the electronic device may perform step S302.
If the predicted playback rate is greater than the ideal playback rate and the difference between the predicted playback rate and the ideal playback rate reaches the second threshold, which indicates that the predicted playback rate is greater than the ideal playback rate, and the difference is greater, which indicates that the currently available network bandwidth cannot provide the transmission speed that is the predicted playback rate, then the transmission rate of the video data needs to be decreased, that is, the amount of the video data transmitted per unit time needs to be decreased, and then the electronic device may perform step S303.
If the predicted playback rate is not greater than the first rate, which is the sum of the ideal playback rate and a second threshold, and not less than a second rate, which is the difference between the ideal playback rate and the first threshold. Indicating that the difference between the predicted playback rate and the ideal playback rate is not large, then the electronic device may perform step S304 without having to adjust the transmission rate.
The specific values of the first threshold and the second threshold may be determined according to factors such as a scene of actual video playback, a network bandwidth, and the like, and are not specifically limited herein.
S302, adjusting the current sending parameters to obtain first target sending parameters;
wherein, the first target sending parameter is: and a transmission parameter in which the amount of video data transmitted per unit time increases when the video data is transmitted according to the first target transmission parameter. If the predicted playback rate is less than the ideal playback rate and the difference between the predicted playback rate and the ideal playback rate reaches the first threshold, the transmission rate of the video data can be increased, that is, the amount of the video data transmitted in unit time is increased, so that the electronic equipment can adjust the current transmission parameter to obtain the first target transmission parameter, so that the amount of the video data transmitted in unit time is increased when the video data is transmitted according to the first target transmission parameter.
For example, the electronic device may increase the transmission cycle duration of the video data, the data amount of the transmitted video data in each cycle, and the like, so that the transmission rate of the video data may be increased to fully utilize the network bandwidth.
S303, adjusting the current sending parameter to obtain a second target sending parameter;
wherein the second target sending parameter is: and a transmission parameter for reducing the amount of video data transmitted per unit time when transmitting the video data according to the second target transmission parameter. If the predicted playback rate is greater than the ideal playback rate and the difference between the predicted playback rate and the ideal playback rate reaches the second threshold, the transmission rate of the video data needs to be reduced, that is, the amount of the video data transmitted in unit time is reduced, so that the electronic device can adjust the current transmission parameter to obtain a second target transmission parameter, so that the amount of the video data transmitted in unit time when the video data is transmitted according to the second target transmission parameter is reduced.
For example, the electronic device may reduce the duration of the transmission period of the video data, the data amount of the transmitted video data in each period, and the like, so that the transmission rate of the video data may be reduced to avoid the problem that the required network bandwidth exceeds the currently available network bandwidth, which causes data transmission congestion.
S304, determining that the current sending parameter is unchanged to obtain a third target sending parameter.
If the predicted playback rate is not greater than the first rate and not less than the second rate, which means that the difference between the predicted playback rate and the ideal playback rate is not large, then the transmission rate does not have to be adjusted, so the electronic device can determine that the current transmission parameter is not changed, and obtain the third target transmission parameter. That is, the electronic device may transmit video data to the client according to the current transmission parameters.
Therefore, in this embodiment, the electronic device may determine whether to adjust the current transmission parameter according to the size relationship between the predicted playback rate and the ideal playback rate, and determine how to adjust the current transmission parameter, so that the adjusted target transmission parameter is more adaptive to the current network bandwidth, and the fluency of video playback is improved.
As an implementation manner of the embodiment of the present invention, the first target transmission parameter to the third target transmission parameter may include a transmission time interval, a number of I frames transmitted in each transmission period, and a number of non-I frames.
The electronic equipment generally has a certain sending time interval for sending the video data to the client, the sending time interval can be adjusted according to actual needs, and the longer the sending time interval is, the longer the sending time period is; the shorter the transmission time interval, the shorter the transmission time period.
The video data generally consists of GOPs (group of pictures), each GOP includes an I frame and a non-I frame, so that the more the number of I frames and the number of non-I frames transmitted in each transmission period, the more the number of GOPs transmitted in each transmission period, the larger the data volume of the transmitted video data, and therefore, the transmission time interval, the number of I frames and the number of non-I frames transmitted in each transmission period can be used as target transmission parameters to measure the amount of the transmitted data volume and the speed of the transmission rate.
As an implementation manner of the embodiment of the present invention, when the first target transmission parameter to the third target transmission parameter each include a transmission time interval, a number of I frames transmitted in each transmission period, and a number of non-I frames, as shown in fig. 4, the step of determining the target transmission parameter of the video data according to a magnitude relationship between the predicted playback rate and the ideal playback rate may include:
s401, determining the magnitude relation between the predicted playback rate and the ideal playback rate, and if the predicted playback rate is smaller than the ideal playback rate and the difference value between the predicted playback rate and the ideal playback rate reaches a first threshold value, executing the step S402; if the predicted playback rate is greater than the ideal playback rate and the difference between the predicted playback rate and the ideal playback rate reaches a second threshold, executing step S403; if the predicted playback rate is not greater than the first rate and not less than the second rate, executing step S404;
since step S401 is the same as step S301, detailed description has already been made in the step S301, and will not be repeated herein.
S402, judging whether the quantity of the GOPs to be sent in unit time reaches the maximum quantity, and executing the step S405 if the quantity of the GOPs to be sent in unit time reaches the maximum quantity; if the number of the sending GOPs in the unit time does not reach the maximum number, executing step S406;
since the capability of the electronic device to extract GOPs per unit time is limited, when it is determined that the transmission rate needs to be increased, the electronic device may determine whether the number of the GOPs transmitted per unit time reaches the maximum number, and if the maximum number is reached, it indicates that the capability of the electronic device to extract GOPs per unit time has reached the upper limit, the transmission rate cannot be increased by increasing the number of I frames and the number of non-I frames currently transmitted per transmission period, and the electronic device may perform step S405.
If the number of the transmission GOPs in the unit time does not reach the maximum number, which indicates that the ability of the electronic device to extract GOPs in the unit time has not reached the upper limit, the transmission rate can be increased by increasing the number of the I frames and the number of the non-I frames currently transmitted in each transmission cycle, and the electronic device can execute step S406.
S405, shortening the current sending time interval, updating the predicted playback rate according to the adjusted sending parameters, and returning to the step S401;
since the transmission rate cannot be increased by increasing the number of I frames and the number of non-I frames currently transmitted per transmission period at this time, the electronic device can shorten the current transmission time interval, and thus, the transmission period is shortened, the data amount of video data transmitted per unit time is increased, and the transmission rate can be increased.
The electronic device may be according to the formula Δ T ═ Δ T-Tstep1To shorten the current transmission time interval, wherein Δ T' is the adjusted transmission time interval, Δ T is the current transmission time interval, Tstep1For adjusting the step length, Tstep1The specific value of (a) may be determined according to actual factors such as the difference between the predicted playback rate and the ideal playback rate, network conditions, and the like, and is not specifically limited herein.
In order to determine whether the adjusted transmission parameter is adapted to the current available network bandwidth, the electronic device may recalculate and update the predicted playback rate according to the adjusted transmission parameter, and then return to step S401, and continue to determine the size relationship between the predicted playback rate and the ideal playback rate until the predicted playback rate is not greater than the first rate and not less than the second rate, so as to obtain the third target transmission parameter.
S406, increasing the number of I frames and the number of non-I frames transmitted in each current transmission period, updating the predicted playback rate according to the adjusted transmission parameters, and returning to the step S401;
at this time, the capacity of the electronic device to extract GOPs in unit time does not reach the upper limit, so the electronic device can increase the number of I frames and the number of non-I frames currently transmitted in each transmission period, that is, increase the number of GOPs currently transmitted in each transmission period, and thus, the data volume of video data transmitted in unit time is increased, and the transmission rate can be increased.
The electronic device may increase the number of I frames and the number of non-I frames transmitted in each current transmission period according to formulas N '═ c1 × N and M' ═ c2 × M, where N 'is the number of I frames transmitted in each increased transmission period, N is the number of I frames transmitted in each current transmission period, M' is the number of non-I frames transmitted in each increased transmission period, M is the number of non-I frames transmitted in each current transmission period, c1 and c2 are preset adjustment coefficients, c1>1, c1 and c2 are determined according to actual factors such as the difference between the predicted playback rate and the ideal playback rate, the network condition, and the ratio between the sizes of the I frames and the non-I frames in each GOP, and are not specifically limited herein.
In order to determine whether the adjusted transmission parameter is adapted to the current available network bandwidth, the electronic device may recalculate and update the predicted playback rate according to the adjusted transmission parameter, and then return to step S401, and continue to determine the size relationship between the predicted playback rate and the ideal playback rate until the predicted playback rate is not greater than the first rate and not less than the second rate, so as to obtain the third target transmission parameter.
S403, judging whether the quantity of the GOPs to be transmitted in the unit time reaches the maximum quantity, and if the quantity of the GOPs to be transmitted in the unit time does not reach the maximum quantity, executing the step S407; if the number of the transmission GOPs in the unit time reaches the maximum number, the step S408 is performed;
when the predicted playback rate is greater than the ideal playback rate and the difference between the predicted playback rate and the ideal playback rate reaches the second threshold, the electronic device may also determine whether the number of the sending GOPs in the unit time reaches the maximum number, and if the number does not reach the maximum number, it indicates that the ability of the electronic device to extract the GOPs in the unit time does not reach the upper limit, but still exceeds the limit of the currently available network bandwidth, then the sending rate may be reduced by increasing the current sending time interval, and the electronic device may perform step S407.
If the number of transmission GOPs per unit time reaches the maximum number, indicating that the electronic device' S ability to extract GOPs per unit time has reached the upper limit, then the electronic device may perform step S408, indicating that the predicted playback rate is too large, possibly due to the number of I frames and the number of non-I frames currently transmitted per transmission cycle being too large.
S407, increasing the current sending time interval, updating the predicted playback rate according to the adjusted sending parameters, and returning to the step S401;
since the GOP extraction capacity per unit time does not reach the upper limit but still exceeds the limit of the currently available network bandwidth, it is preferable to increase the transmission cycle duration by increasing the current transmission time interval, so that the data amount of the video data transmitted per unit time is reduced, and the transmission rate can be reduced.
The electronic device may be according to the formula Δ T ═ Δ T + Tstep2To increase the current transmission time interval, wherein Δ T' is the adjusted transmission time interval, Δ T is the current transmission time interval, Tstep2For adjusting the step length, Tstep2The specific value of (a) may be determined according to actual factors such as the difference between the predicted playback rate and the ideal playback rate, network conditions, and the like, and is not specifically limited herein.
In order to determine whether the adjusted transmission parameter is adapted to the current available network bandwidth, the electronic device may recalculate and update the predicted playback rate according to the adjusted transmission parameter, and then return to step S401, and continue to determine the size relationship between the predicted playback rate and the ideal playback rate until the predicted playback rate is not greater than the first rate and not less than the second rate, so as to obtain the third target transmission parameter.
S408, reducing the number of I frames and the number of non-I frames transmitted in each current transmission period, updating the predicted playback rate according to the adjusted transmission parameters, and returning to the step S401;
if the number of the sent GOPs in the unit time reaches the maximum number and the capacity of the electronic equipment for extracting the GOPs in the unit time reaches the upper limit, the predicted playback rate is too large probably because the number of the I frames and the number of the non-I frames sent in each current sending period are too large, so that the electronic equipment can reduce the number of the I frames and the number of the non-I frames sent in each current sending period, and the data volume of the video data sent in the unit time is reduced, and the sending rate can be reduced.
The electronic device may increase the number of I frames and the number of non-I frames transmitted in each current transmission period according to formulas N '═ c3 × N and M' ═ c4 × M, where N 'is the number of I frames transmitted in each increased transmission period, N is the number of I frames transmitted in each current transmission period, M' is the number of non-I frames transmitted in each increased transmission period, M is the number of non-I frames transmitted in each current transmission period, c3 and c4 are preset adjustment coefficients, c3 < 1, and c3 and c4 are determined according to actual factors such as the difference between the predicted playback rate and the ideal playback rate, the network condition, and the ratio between the sizes of the I frames and the non-I frames in each GOP, and are not specifically limited herein.
If the obtained N' is less than 1, that is, the number of I frames transmitted in each transmission period is less than 1, it indicates that frame skipping processing is required, that is, a part of the I frames is selected to be transmitted, but not all of the I frames are transmitted.
In order to determine whether the adjusted transmission parameter is adapted to the current available network bandwidth, the electronic device may recalculate and update the predicted playback rate according to the adjusted transmission parameter, and then return to step S401, and continue to determine the size relationship between the predicted playback rate and the ideal playback rate until the predicted playback rate is not greater than the first rate and not less than the second rate, so as to obtain the third target transmission parameter.
S404, determining that the current sending parameter is unchanged to obtain a third target sending parameter.
Since step S404 is the same as step S304, detailed description has already been made in step S304, and thus, detailed description is omitted here.
It can be seen that, in this embodiment, the electronic device may determine how to adjust the current transmission time interval, the number of I frames and the number of non-I frames transmitted in each current transmission period according to a result of whether the number of the transmission GOPs in the unit time reaches the maximum number, so as to ensure that the obtained target parameters can adapt to the current available network bandwidth, avoid causing a waste of the network bandwidth, and ensure the smoothness of video playback.
As an implementation manner of the embodiment of the present invention, as shown in fig. 5, the step of determining the predicted playback rate based on the transmission parameter and the double speed flag during the historical video playback may include:
s501, acquiring sending parameters during historical video playback;
since the current transmission parameter is the transmission parameter used in the historical video playback, in order to determine the predicted playback rate, the electronic device may first obtain the transmission parameter used in the historical video playback. The sending parameters during the historical video playback may include the starting time, the ending time, the number of bytes, the historical sending time interval, and the like of sending the video data.
S502, calculating the time consumption of historical video data transmission according to the start time, the end time and the number of bytes of the video data transmission;
the starting time and the ending time of sending the video data are obtained, and the total time length of sending the video data can be determined. And then the time length used for sending each byte can be calculated according to the byte number of the sent video data and the total time length of the sent video data.
Furthermore, the electronic device may determine the duration of each transmission cycle, i.e., the time taken to transmit video data once, based on the duration taken to transmit each byte. In one embodiment, an average value of the time lengths of the transmission periods of the plurality of history transmission video data may be taken as the elapsed time of the history transmission video data.
S503, calculating a historical sending rate according to the time consumption of the historical sending video data, the historical sending time interval and the data volume of the historical sending video data;
after the time consumption for historically sending the video data is determined, the electronic device may determine the time length of the historical sending period according to the time consumption for historically sending the video data and the historical sending time interval, where the time length of the historical sending period is the sum of the time consumption for historically sending the video data and the historical sending time interval.
Furthermore, the electronic device may calculate a historical sending rate according to the data amount of the historical sending video data and the duration of the historical sending period, where the historical sending rate is a quotient of the data amount of the historical sending video data and the duration of the historical sending period.
S504, based on the speed doubling identification and the historical sending rate, a predicted playback rate is determined.
The electronic device may then determine the predicted playback rate. In one embodiment, the playback rate R 'is predicted'predCan be according to the formula
Figure GDA0003390833490000191
And (4) calculating. Wherein X2 is the multiple speed represented by the multiple speed mark, X1 is the multiple speed of the historical video playback, RpredThe historical transmission rate is as described above.
Therefore, in this embodiment, the electronic device may calculate the time consumed for historically sending the video data according to the sending parameters during historical video playback, then calculate the historical sending rate according to the time consumed for historically sending the video data, the historical sending time interval, and the data volume of historically sending the video data, and further determine the predicted playback rate based on the double-speed identifier and the historical sending rate. The predicted playback rate of the video data transmitted according to the current transmission parameters can be accurately estimated to ensure accurate determination of the target parameters.
As an implementation manner of the embodiment of the present invention, the step of calculating the time consumed for sending the video data in history according to the start time, the end time, and the number of bytes of the sent video data may include:
according to the formula
Figure GDA0003390833490000192
And calculating the time T consumed by historical video data transmission.
Wherein, KiIs a predetermined coefficient, n is a positive integer, tendTo end time, tbeginFor start time, D is the number of bytes.
In order to accurately determine the time consumed for historically sending the video data, the electronic equipment can acquire the sending parameters of the historically sent video data for multiple times, and then the sending parameters are determined according to Ti=(tend-tbegin)*Dconst/DrealCalculating the time consumption of historical video data transmission each time, wherein one time of historical video data transmission is a transmission period, and a common transmission period is the sum of the transmission time length of a GOP and the transmission time interval.
Wherein, tendIs a statistical end time, i.e. the end time of the above-mentioned transmission of video data, tbeginIs the statistical start time, i.e. the start time of the above-mentioned transmission of video data, then tend-tbeginComprising several transmission cycles, namely N x (T +. DELTA.T). DrealIs the actual number of bytes transmitted, i.e. the total number of bytes actually transmitted in the several transmission periods, DconstIt is a constant number of ideal transmission bytes, i.e. the number of bytes of data that can be transmitted in one transmission period T in an ideal case. The ideal situation is that the data is read from the disk, then the internal processing is completed, and finally the data is transmitted to the client, and the link has no pressure in the whole processing process.
Thus, TiI.e. an average unit sending period calculated under actual conditions, i.e. sending DconstThe sum of the transmission time length of one GOP and the transmission time interval is the time length required for such a lot of data. Thus, a plurality of transmission periods T of the history transmission video data can be calculated1-Tn
The electronic equipment can set a preset coefficient K for each time of historical video data transmissioniThe preset coefficient can be based on each historyThe degree of importance of the referential of the transmission parameters for transmitting the video data is determined, and the more important the corresponding preset coefficient may be, the larger the more important the coefficient is. And the preset sum is equal to 1, that is to say
Figure GDA0003390833490000201
Therefore, the time-consuming accuracy of the historical sending video data obtained through calculation can be guaranteed.
After determining the time consumption and the corresponding preset coefficient for each historical transmission of the video data, the electronic device may determine the time consumption and the corresponding preset coefficient according to the formula T ═ K1*T1+……+Kn*TnAnd calculating to obtain the time consumption T of historical video data transmission. That is to say, the time consumed for sending the video data historically each time is weighted and summed according to the corresponding preset coefficient, so as to obtain the time consumed for sending the video data historically.
Therefore, in this embodiment, the electronic device may calculate the time consumed for historically sending the video data according to the formula according to the time consumed for historically sending the video data for multiple times and the preset coefficient, so as to obtain more accurate time consumed for historically sending the video data.
As an implementation manner of the embodiment of the present invention, the step of calculating the historical transmission rate according to the time consumed by the historical transmission of the video data, the historical transmission time interval, and the data amount of the historical transmission video data may include:
according to the formula
Figure GDA0003390833490000202
Calculating a historical transmission rate Rpred
Wherein, Δ T is the historical sending time interval, N is the I frame number of the video data sent in the time length of T + Δ T, M is the non I frame number and size of the video data sent in the time length of T + Δ TiframeFor the number of bytes per I frame, sizepframeThe number of bytes per non-I frame.
N*sizeiframe+M*sizepframeThat is, the total number of bytes of the video data to be transmitted in the time length of T + Δ T, which is the time length of one transmission cycle. Then the duration of T + Δ T is transmitted as video dataThe ratio of the total number of bytes to T + Delta T is the sending rate of the video data, i.e. the historical sending rate Rpred
For example, a GOP of video data is composed of 1I frame and 24 non-I frames, the number of bytes per I frame is 500, the number of bytes per non-I frame is 400, the duration of one transmission cycle is 100 milliseconds, then,
Figure GDA0003390833490000211
bytes per millisecond.
Therefore, in this embodiment, the electronic device may accurately calculate and calculate the historical sending rate R according to the above formulapredAnd further, an accurate predicted playback rate can be obtained.
As an implementation manner of the embodiment of the present invention, the step of determining an ideal playback rate based on the currently available network bandwidth and the multiple speed identifier may include:
according to the formula
Figure GDA0003390833490000212
Calculating ideal playback rate R'ideal
Wherein max _ band is the current available network bandwidth, and X is the speed, size represented by the speed markiframeFor the number of bytes per I frame, sizepframeThe number of bytes of each non-I frame is t is the current sending time period, N 'is the number of I frames needing to send video data in the current sending time period, and M' is the number of non-I frames needing to send video data in the current sending time period.
The electronic device may calculate the desired rate and the limiting rate, and determine that the smaller of these is the ideal playback rate R'ideal. Desired rate RexpectI.e. the desired rate according to the current transmission period, can be formulated as
Figure GDA0003390833490000213
And (4) calculating.
Wherein, N'. sizeiframe+M′*sizepframeWhen it is currently transmittingThe total number of bytes of video data that need to be transmitted in the inter-period,
Figure GDA0003390833490000214
i.e. the transmission rate required when the video is played back at normal speed, then
Figure GDA0003390833490000215
I.e. the required sending rate for the video to be played back at the required multiple speed.
Limiting the rate RlimitI.e. the maximum rate that can be achieved under the current available network bandwidth limit, can be found by max _ band.
If the desired rate is not greater than the limit rate, then the electronic device may determine that the desired rate is an ideal playback rate R 'stating that the available bandwidth may meet the requirements of the desired rate'ideal. If the desired rate is greater than the limit rate, indicating that the network bandwidth cannot meet the desired rate, and the maximum achievable transmission rate is the limit rate, the electronic device may determine that the limit rate is the ideal playback rate R'ideal
That is, the electronic device may select a smaller one as the ideal playback rate R 'from the above-mentioned desired rate not greater than the limit rate'ideal. When the desired rate is equal to the limiting rate, any one of them may be selected as the desired playback rate R'ideal
It can be seen that in this embodiment, the electronic device can calculate the desired rate and the limiting rate and select the smaller one as the ideal playback rate R'idealSo that the determined ideal playback rate R 'can be secured'idealThe method is a maximum sending rate which can be achieved according to the double-speed playback requirement under the current available network bandwidth, so that the target sending parameters of the video data determined according to the size relation between the predicted playback rate and the ideal playback rate are ensured to be more adaptive to the current available network bandwidth.
Corresponding to the video playback method, the embodiment of the invention also provides a video playback device. A video playback apparatus according to an embodiment of the present invention is described below.
As shown in fig. 6, a video playback apparatus, the apparatus comprising:
a video playback request receiving module 610, configured to receive a video playback request sent by a client;
wherein the video playback request carries a speed doubling identifier.
A predicted playback rate determining module 620, configured to determine a predicted playback rate based on the sending parameter and the multiple speed identifier during playback of the historical video;
an ideal playback rate determining module 630, configured to determine an ideal playback rate based on the currently available network bandwidth and the multiple speed identifier;
a target sending parameter determining module 640, configured to determine a target sending parameter of the video data according to a size relationship between the predicted playback rate and the ideal playback rate;
the video data sending module 650 is configured to send video data to the client according to the target sending parameter, so that the client plays back the received video data.
It can be seen that, in the scheme provided in the embodiment of the present invention, a video playback request sent by a client may be received, where the video playback request carries a speed doubling identifier, a predicted playback rate is determined based on a sending parameter and a speed doubling identifier during historical video playback, an ideal playback rate is determined based on a current available network bandwidth and a speed doubling identifier, and further, a target sending parameter of video data is determined according to a size relationship between the predicted playback rate and the ideal playback rate, and the video data is sent to the client according to the target sending parameter, so that the client plays back the received video data. The target sending parameters are determined according to the size relation between the predicted playback rate and the ideal playback rate, and the ideal playback rate is determined based on the current available network bandwidth, so that the influence of the current available network bandwidth can be fully considered, the target sending parameters can be adapted to the network bandwidth, the video data are sent to the client on the basis of the current available network bandwidth, the client can play smooth video data, and the fluency of video playback is improved.
As an implementation manner of the embodiment of the present invention, the target sending parameter determining module 640 may include:
a magnitude relation determining unit (not shown in fig. 6) for determining a magnitude relation of the predicted playback rate to the ideal playback rate;
a first target transmission parameter determining unit (not shown in fig. 6), configured to adjust a current transmission parameter to obtain a first target transmission parameter if the predicted playback rate is smaller than the ideal playback rate and a difference between the predicted playback rate and the ideal playback rate reaches a first threshold;
wherein the first target sending parameter is: and a transmission parameter in which the amount of video data transmitted per unit time increases when the video data is transmitted according to the first target transmission parameter.
A second target transmission parameter determining unit (not shown in fig. 6), configured to adjust the current transmission parameter to obtain a second target transmission parameter if the predicted playback rate is greater than the ideal playback rate and a difference between the predicted playback rate and the ideal playback rate reaches a second threshold;
wherein the second target sending parameter is: and a transmission parameter for reducing the amount of video data transmitted per unit time when transmitting the video data according to the second target transmission parameter.
A third target transmission parameter determining unit (not shown in fig. 6), configured to determine that the current transmission parameter is not changed to obtain a third target transmission parameter if the predicted playback rate is not greater than the first rate and is not lower than the second rate.
Wherein the first rate is a sum of the ideal playback rate and the second threshold, and the second rate is a difference between the ideal playback rate and the first threshold.
As an implementation manner of the embodiment of the present invention, the first target transmission parameter, the second target transmission parameter, and the third target transmission parameter may each include a transmission time interval, a number of I frames transmitted in each transmission period, and a number of non-I frames;
the first target transmission parameter determining unit may include:
a first judgment subunit (not shown in fig. 6) for judging whether the number of transmission GOPs per unit time reaches the maximum number,
a time interval shortening subunit (not shown in fig. 6) configured to shorten a current transmission time interval if the number of the transmission GOPs in the unit time reaches a maximum number, update the predicted playback rate according to the adjusted transmission parameter, and trigger the size relationship determining unit;
a transmission number increasing subunit (not shown in fig. 6) configured to increase the number of I frames and the number of non-I frames transmitted in each current transmission cycle if the number of GOPs transmitted in the unit time does not reach the maximum number, update the predicted playback rate according to the adjusted transmission parameters, and trigger the size relationship determining unit;
the second target transmission parameter determining unit may include:
a second judgment subunit (not shown in fig. 6) for judging whether the number of transmission GOPs in the unit time reaches a maximum number;
a time interval increasing subunit (not shown in fig. 6) configured to increase the current transmission time interval if the number of the transmission GOPs in the unit time does not reach the maximum number, update the predicted playback rate according to the adjusted transmission parameter, and trigger the size relationship determining unit;
a transmission number reducing subunit (not shown in fig. 6) configured to reduce the number of I frames and the number of non-I frames transmitted in each current transmission period if the number of transmission GOPs in the unit time reaches the maximum number, update the predicted playback rate according to the adjusted transmission parameters, and trigger the size relationship determining unit.
As an implementation manner of the embodiment of the present invention, the predicted playback rate determining module 620 may include:
a transmission parameter acquisition unit (not shown in fig. 6) configured to acquire transmission parameters at the time of historical video playback, where the transmission parameters at the time of historical video playback include a transmission video data start time, an end time, a number of bytes, and a historical transmission time interval;
a time-consuming calculating unit (not shown in fig. 6) configured to calculate a time consumed for sending the video data in history according to the start time, the end time, and the number of bytes of the video data to be sent;
a historical transmission rate calculation unit (not shown in fig. 6) for calculating a historical transmission rate from the elapsed time of the historical transmission of the video data, the historical transmission time interval, and the data amount of the historical transmission of the video data;
a predicted playback rate determination unit (not shown in fig. 6) for determining a predicted playback rate based on the double speed flag and the history transmission rate.
As an implementation manner of the embodiment of the present invention, the time-consuming calculating unit may include:
time consuming calculating word unit (not shown in FIG. 6) for following formula
Figure GDA0003390833490000251
Calculating the time consumption T of historical video data transmission;
wherein, KiIs a predetermined coefficient, n is a positive integer, tendIs the end time, tbeginAs the start time, DconstNumber of bytes transmitted ideally, DrealIs the actual number of bytes sent.
As an implementation manner of the embodiment of the present invention, the history sending rate calculating unit may include:
a historical transmission rate calculation subunit (not shown in fig. 6) for calculating a transmission rate according to a formula
Figure GDA0003390833490000252
Figure GDA0003390833490000253
Calculating a historical transmission rate Rpred
Wherein, Δ T is the historical sending time interval, and N is the sending video data within the time length of T + Δ TM is the number of non-I-frames, size, of the transmitted video data within a time period of T + deltatiframeFor the number of bytes per I frame, sizepframeThe number of bytes per non-I frame.
As an implementation manner of the embodiment of the present invention, the ideal playback rate determining module 630 may include:
an ideal playback rate determining unit (not shown in fig. 6) for determining the ideal playback rate according to the formula
Figure GDA0003390833490000261
Calculating ideal playback rate R'ideal
Wherein max _ band is the current available network bandwidth, and X is the multiple speed, size represented by the multiple speed identifieriframeFor the number of bytes per I frame, sizepframeThe number of bytes of each non-I frame is, t is the current sending time period, N 'is the number of I frames needing to send video data in the current sending time period, and M' is the number of non-I frames needing to send video data in the current sending time period.
An embodiment of the present invention further provides an electronic device, as shown in fig. 7, the controller may include a processor 701, a communication interface 702, a memory 703 and a communication bus 704, where the processor 701, the communication interface 702, and the memory 703 complete mutual communication through the communication bus 704,
a memory 703 for storing a computer program;
the processor 701 is configured to implement the following steps when executing the program stored in the memory 703:
receiving a video playback request sent by a client;
wherein the video playback request carries a speed doubling identifier.
Determining a predicted playback rate based on the sending parameters and the speed doubling identification during the playback of the historical video;
determining an ideal playback rate based on the current available network bandwidth and the speed multiplying identification;
determining target sending parameters of the video data according to the magnitude relation between the predicted playback rate and the ideal playback rate;
and sending the video data to the client according to the target sending parameters so as to enable the client to play back the received video data.
It can be seen that in the scheme provided in the embodiment of the present invention, the electronic device may first receive a video playback request sent by the client, where the video playback request carries a speed doubling identifier, determine a predicted playback rate based on a sending parameter and a speed doubling identifier during historical video playback, determine an ideal playback rate based on a current available network bandwidth and a speed doubling identifier, further determine a target sending parameter of video data according to a size relationship between the predicted playback rate and the ideal playback rate, and send the video data to the client according to the target sending parameter, so that the client plays back the received video data. The target sending parameters are determined according to the size relation between the predicted playback rate and the ideal playback rate, and the ideal playback rate is determined based on the current available network bandwidth, so that the influence of the current available network bandwidth can be fully considered, the target sending parameters can be adapted to the network bandwidth, the video data are sent to the client on the basis of the current available network bandwidth, the client can play smooth video data, and the fluency of video playback is improved.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
The step of determining the target transmission parameter of the video data according to the magnitude relationship between the predicted playback rate and the ideal playback rate may include:
determining a magnitude relationship of the predicted playback rate to the ideal playback rate;
if the predicted playback rate is smaller than the ideal playback rate and the difference between the predicted playback rate and the ideal playback rate reaches a first threshold, adjusting the current transmission parameter to obtain a first target transmission parameter, wherein the first target transmission parameter is: a transmission parameter in which the amount of video data transmitted per unit time increases when the video data is transmitted according to the first target transmission parameter;
if the predicted playback rate is greater than the ideal playback rate and the difference between the predicted playback rate and the ideal playback rate reaches a second threshold, adjusting the current transmission parameter to obtain a second target transmission parameter, wherein the second target transmission parameter is: a transmission parameter in which the amount of video data transmitted per unit time is reduced when transmitting video data according to the second target transmission parameter;
and if the predicted playback rate is not greater than the first rate and not lower than a second rate, determining that the current transmission parameter is unchanged to obtain a third target transmission parameter, wherein the first rate is the sum of the ideal playback rate and the second threshold, and the second rate is the difference between the ideal playback rate and the first threshold.
The first target sending parameter, the second target sending parameter, and the third target sending parameter may each include a sending time interval, a number of I frames sent in each sending period, and a number of non-I frames;
the step of adjusting the current transmission parameter to obtain the first target transmission parameter may include:
it is determined whether the number of transmitted GOPs per unit time reaches a maximum number,
if the number of the sending GOPs in the unit time reaches the maximum number, shortening the current sending time interval, updating the predicted playback rate according to the adjusted sending parameters, and returning to the step of determining the size relationship between the predicted playback rate and the ideal playback rate;
if the number of the sending GOPs in the unit time does not reach the maximum number, increasing the number of I frames and the number of non-I frames sent in each current sending period, updating the predicted playback rate according to the adjusted sending parameters, and returning to the step of determining the size relationship between the predicted playback rate and the ideal playback rate;
the step of adjusting the current transmission parameter to obtain the second target transmission parameter may include:
judging whether the quantity of the sending GOPs in the unit time reaches the maximum quantity;
if the number of the sending GOPs in the unit time does not reach the maximum number, increasing the current sending time interval, updating the predicted playback rate according to the adjusted sending parameters, and returning to the step of determining the size relationship between the predicted playback rate and the ideal playback rate;
if the number of the sending GOPs in the unit time reaches the maximum number, reducing the number of the I frames and the number of the non-I frames sent in each current sending period, updating the predicted playback rate according to the adjusted sending parameters, and returning to the step of determining the size relation between the predicted playback rate and the ideal playback rate.
The step of determining a predicted playback rate based on the transmission parameter and the double speed identifier during the playback of the historical video may include:
acquiring sending parameters during historical video playback, wherein the sending parameters during historical video playback comprise the starting time, the ending time, the number of bytes and a historical sending time interval of sending video data;
calculating the time consumption of historical video data transmission according to the start time, the end time and the number of bytes of the video data transmission;
calculating a historical sending rate according to the time consumption of the historical video data sending, the historical sending time interval and the data volume of the historical video data sending;
and determining a predicted playback rate based on the double speed identification and the historical transmission rate.
The step of calculating the time consumed for sending the video data historically according to the start time, the end time and the number of bytes of the sent video data may include:
according to the formula
Figure GDA0003390833490000291
Calculating the time consumption T of historical video data transmission;
wherein, KiIs a predetermined coefficient, n is a positive integer, tendIs the end time, tbeginAs the start time, DconstNumber of bytes transmitted ideally, DrealIs the actual number of bytes sent.
The step of calculating the historical transmission rate according to the time consumed by the historical transmission of the video data, the historical transmission time interval and the data amount of the historical transmission of the video data may include:
according to the formula
Figure GDA0003390833490000292
Calculating a historical transmission rate Rpred
Wherein, Δ T is the historical sending time interval, N is the number of I frames of the video data sent in the time length of T + Δ T, and M is the number of non-I frames and size of the video data sent in the time length of T + Δ TiframeFor the number of bytes per I frame, sizepframeThe number of bytes per non-I frame.
The step of determining an ideal playback rate based on the current available network bandwidth and the multiple speed identifier may include:
according to the formula
Figure GDA0003390833490000301
Calculating ideal playback rate R'ideal
Wherein max _ band is the current available network bandwidth, and X is the multiple speed, size represented by the multiple speed identifieriframeFor the number of bytes per I frame, sizepframeThe number of bytes of each non-I frame is, t is the current sending time period, N 'is the number of I frames needing to send video data in the current sending time period, and M' is the number of non-I frames needing to send video data in the current sending time period.
The embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, and the computer program is executed by a processor to perform the steps of the video playback method according to any of the above embodiments.
It can be seen that, in the solution provided in the embodiment of the present invention, when being executed by a processor, a computer program may first receive a video playback request sent by a client, where the video playback request carries a speed doubling identifier, determine a predicted playback rate based on a sending parameter and a speed doubling identifier during historical video playback, determine an ideal playback rate based on a current available network bandwidth and the speed doubling identifier, further determine a target sending parameter of video data according to a size relationship between the predicted playback rate and the ideal playback rate, and send the video data to the client according to the target sending parameter, so that the client plays back the received video data. The target sending parameters are determined according to the size relation between the predicted playback rate and the ideal playback rate, and the ideal playback rate is determined based on the current available network bandwidth, so that the influence of the current available network bandwidth can be fully considered, the target sending parameters can be adapted to the network bandwidth, the video data are sent to the client on the basis of the current available network bandwidth, the client can play smooth video data, and the fluency of video playback is improved.
It should be noted that, for the above-mentioned apparatus, electronic device and computer-readable storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for the relevant points, reference may be made to the component descriptions of the method embodiments.
It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a relevant manner, and the same and similar components in all the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (8)

1. A method of video playback, the method comprising:
receiving a video playback request sent by a client, wherein the video playback request carries a speed doubling identifier;
determining a predicted playback rate based on the sending parameters and the speed doubling identification during the playback of the historical video;
determining an ideal playback rate based on the current available network bandwidth and the speed multiplying identification;
determining target sending parameters of the video data according to the magnitude relation between the predicted playback rate and the ideal playback rate;
sending video data to a client according to the target sending parameters so that the client plays back the received video data;
the step of determining a predicted playback rate based on the transmission parameters and the double speed identifier during the playback of the historical video comprises the following steps:
acquiring sending parameters during historical video playback, wherein the sending parameters during historical video playback comprise the starting time, the ending time, the number of bytes and a historical sending time interval of sending video data;
calculating the time consumption of historical video data transmission according to the start time, the end time and the number of bytes of the video data transmission;
calculating a historical sending rate according to the time consumption of the historical video data sending, the historical sending time interval and the data volume of the historical video data sending;
determining a predicted playback rate based on the multiple speed identification and the historical transmission rate;
the step of determining an ideal playback rate based on the current available network bandwidth and the multiple speed identifier includes:
according to the formula
Figure FDA0003390833480000011
Calculating ideal playback rate R'ideal
Wherein max _ band is the current available network bandwidth, and X is the multiple speed, size represented by the multiple speed identifieriframeFor the number of bytes per I frame, sizepframeThe number of bytes of each non-I frame, t is the current sending time period, N 'is the number of I frames needing to send video data in the current sending time period, and M' is the non-I frame needing to send video data in the current sending time periodThe number of I frames.
2. The method of claim 1, wherein the step of determining target transmission parameters for video data based on the magnitude relationship between the predicted playback rate and the ideal playback rate comprises:
determining a magnitude relationship of the predicted playback rate to the ideal playback rate;
if the predicted playback rate is smaller than the ideal playback rate and the difference between the predicted playback rate and the ideal playback rate reaches a first threshold, adjusting the current transmission parameter to obtain a first target transmission parameter, wherein the first target transmission parameter is: a transmission parameter in which the amount of video data transmitted per unit time increases when the video data is transmitted according to the first target transmission parameter;
if the predicted playback rate is greater than the ideal playback rate and the difference between the predicted playback rate and the ideal playback rate reaches a second threshold, adjusting the current transmission parameter to obtain a second target transmission parameter, wherein the second target transmission parameter is: a transmission parameter in which the amount of video data transmitted per unit time is reduced when transmitting video data according to the second target transmission parameter;
and if the predicted playback rate is not greater than the first rate and not lower than a second rate, determining that the current transmission parameter is unchanged to obtain a third target transmission parameter, wherein the first rate is the sum of the ideal playback rate and the second threshold, and the second rate is the difference between the ideal playback rate and the first threshold.
3. The method of claim 2, wherein the first target transmission parameter, the second target transmission parameter, and the third target transmission parameter each include a transmission time interval, a number of I-frames transmitted per transmission period, and a number of non-I-frames;
the step of adjusting the current transmission parameter to obtain the first target transmission parameter includes:
judging whether the quantity of the GOPs sent in unit time reaches the maximum quantity or not;
if the number of the sending GOPs in the unit time reaches the maximum number, shortening the current sending time interval, updating the predicted playback rate according to the adjusted sending parameters, and returning to the step of determining the size relationship between the predicted playback rate and the ideal playback rate;
if the number of the sending GOPs in the unit time does not reach the maximum number, increasing the number of I frames and the number of non-I frames sent in each current sending period, updating the predicted playback rate according to the adjusted sending parameters, and returning to the step of determining the size relationship between the predicted playback rate and the ideal playback rate;
the step of adjusting the current transmission parameter to obtain a second target transmission parameter includes:
judging whether the quantity of the sending GOPs in the unit time reaches the maximum quantity;
if the number of the sending GOPs in the unit time does not reach the maximum number, increasing the current sending time interval, updating the predicted playback rate according to the adjusted sending parameters, and returning to the step of determining the size relationship between the predicted playback rate and the ideal playback rate;
if the number of the sending GOPs in the unit time reaches the maximum number, reducing the number of the I frames and the number of the non-I frames sent in each current sending period, updating the predicted playback rate according to the adjusted sending parameters, and returning to the step of determining the size relation between the predicted playback rate and the ideal playback rate.
4. The method of claim 1, wherein said step of calculating a historical elapsed time to transmit video data based on a start time, an end time, and a number of bytes of said transmitted video data comprises:
according to the formula
Figure FDA0003390833480000031
Calculating the time consumption T of historical video data transmission;
wherein, KiIn order to set the coefficients to a predetermined value,n is a positive integer, tendIs the end time, tbeginAs the start time, DconstNumber of bytes transmitted ideally, DrealIs the actual number of bytes sent.
5. The method of claim 1, wherein the step of calculating a historical transmission rate based on the elapsed time of the historical transmission of video data, the historical transmission time interval, and the amount of historical video data transmitted comprises:
according to the formula
Figure FDA0003390833480000032
Calculating a historical transmission rate Rpred
Wherein, Δ T is the historical sending time interval, N is the number of I frames of the video data sent in the time length of T + Δ T, and M is the number of non-I frames and size of the video data sent in the time length of T + Δ TiframeFor the number of bytes per I frame, sizepframeThe number of bytes per non-I frame.
6. A video playback apparatus, characterized in that the apparatus comprises:
the video playback request receiving module is used for receiving a video playback request sent by a client, wherein the video playback request carries a speed doubling identifier;
the predicted playback rate determining module is used for determining the predicted playback rate based on the sending parameters and the speed doubling identifiers during the playback of the historical video;
the ideal playback rate determining module is used for determining an ideal playback rate based on the current available network bandwidth and the speed doubling identifier;
the target sending parameter determining module is used for determining target sending parameters of the video data according to the magnitude relation between the predicted playback rate and the ideal playback rate;
the video data sending module is used for sending the video data to the client according to the target sending parameters so as to enable the client to play back the received video data;
the predicted playback rate determining module is specifically configured to obtain sending parameters during playback of a historical video, where the sending parameters during playback of the historical video include a start time, an end time, a number of bytes of sent video data, and a historical sending time interval;
calculating the time consumption of historical video data transmission according to the start time, the end time and the number of bytes of the video data transmission;
calculating a historical sending rate according to the time consumption of the historical video data sending, the historical sending time interval and the data volume of the historical video data sending;
determining a predicted playback rate based on the multiple speed identification and the historical transmission rate;
the ideal playback rate determining module is specifically used for determining the ideal playback rate according to a formula
Figure FDA0003390833480000041
Calculating ideal playback rate R'ideal
Wherein max _ band is the current available network bandwidth, and X is the multiple speed, size represented by the multiple speed identifieriframeFor the number of bytes per I frame, sizepframeThe number of bytes of each non-I frame is, t is the current sending time period, N 'is the number of I frames needing to send video data in the current sending time period, and M' is the number of non-I frames needing to send video data in the current sending time period.
7. The apparatus of claim 6, wherein the target transmission parameter determination module comprises:
a magnitude relation determining unit configured to determine a magnitude relation between the predicted playback rate and the ideal playback rate;
a first target sending parameter determining unit, configured to adjust a current sending parameter to obtain a first target sending parameter if the predicted playback rate is smaller than the ideal playback rate and a difference between the predicted playback rate and the ideal playback rate reaches a first threshold, where the first target sending parameter is: a transmission parameter in which the amount of video data transmitted per unit time increases when the video data is transmitted according to the first target transmission parameter;
a second target sending parameter determining unit, configured to adjust a current sending parameter to obtain a second target sending parameter if the predicted playback rate is greater than the ideal playback rate and a difference between the predicted playback rate and the ideal playback rate reaches a second threshold, where the second target sending parameter is: a transmission parameter in which the amount of video data transmitted per unit time is reduced when transmitting video data according to the second target transmission parameter;
a third target transmission parameter determining unit, configured to determine that the current transmission parameter is unchanged if the predicted playback rate is not greater than a first rate and not lower than a second rate, so as to obtain a third target transmission parameter, where the first rate is a sum of the ideal playback rate and the second threshold, and the second rate is a difference between the ideal playback rate and the first threshold.
8. The apparatus of claim 7, wherein the first target transmission parameter, the second target transmission parameter, and the third target transmission parameter each comprise a transmission time interval, a number of I-frames transmitted per transmission period, and a number of non-I-frames;
the first target transmission parameter determination unit includes:
a first judgment subunit operable to judge whether the number of the transmitted GOPs per unit time reaches a maximum number,
a time interval shortening subunit, configured to shorten a current transmission time interval if the number of the transmission GOPs in the unit time reaches a maximum number, update the predicted playback rate according to the adjusted transmission parameter, and trigger the size relationship determining unit;
a transmission number increasing subunit, configured to increase the number of I frames and the number of non-I frames transmitted in each current transmission period if the number of transmission GOPs in the unit time does not reach the maximum number, update the predicted playback rate according to the adjusted transmission parameter, and trigger the size relationship determining unit;
the second target transmission parameter determination unit includes:
a second judging subunit, configured to judge whether the number of sending GOPs in the unit time reaches a maximum number;
a time interval increasing subunit, configured to increase the current transmission time interval if the number of the transmission GOPs in the unit time does not reach the maximum number, update the predicted playback rate according to the adjusted transmission parameter, and trigger the size relationship determining unit;
and a transmission number reduction subunit, configured to reduce the number of I frames and the number of non-I frames transmitted in each current transmission period if the number of transmission GOPs in the unit time reaches the maximum number, update the predicted playback rate according to the adjusted transmission parameter, and trigger the size relationship determination unit.
CN201911107055.1A 2019-11-13 2019-11-13 Video playback method and device Active CN111405370B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911107055.1A CN111405370B (en) 2019-11-13 2019-11-13 Video playback method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911107055.1A CN111405370B (en) 2019-11-13 2019-11-13 Video playback method and device

Publications (2)

Publication Number Publication Date
CN111405370A CN111405370A (en) 2020-07-10
CN111405370B true CN111405370B (en) 2022-04-05

Family

ID=71413150

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911107055.1A Active CN111405370B (en) 2019-11-13 2019-11-13 Video playback method and device

Country Status (1)

Country Link
CN (1) CN111405370B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113286111A (en) * 2020-10-23 2021-08-20 常熟友乐智能科技有限公司 Video conference content presentation method, device and system
CN114945080A (en) * 2022-04-11 2022-08-26 深圳市爱为物联科技有限公司 Method for playing video based on complex scenes such as adaptive network
CN117579875B (en) * 2024-01-15 2024-05-07 深圳市易甲文技术有限公司 Video high-speed playback method, device, server and computer readable storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103916367A (en) * 2012-12-31 2014-07-09 北京新媒传信科技有限公司 Method and apparatus for transmission of multimedia data
CN105191291A (en) * 2013-03-13 2015-12-23 株式会社理光 Information processing apparatus, program, and video output system
CN105430506A (en) * 2015-11-06 2016-03-23 浙江宇视科技有限公司 Method and device for preventing message from being lost in video playback
CN105451075A (en) * 2014-08-27 2016-03-30 北京大学 Video quality control method and video quality control device
CN105723720A (en) * 2012-03-13 2016-06-29 谷歌公司 Adaptive trick play streaming
CN107493482A (en) * 2016-06-12 2017-12-19 杭州海康威视数字技术股份有限公司 A kind of video playback method and device
CN107623851A (en) * 2017-09-01 2018-01-23 苏州科达科技股份有限公司 Video code flow transmission control unit and control method
CN110247815A (en) * 2019-05-09 2019-09-17 深圳市迅雷网络技术有限公司 A kind of data transmission method, device, system and computer readable storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10419815B2 (en) * 2015-09-23 2019-09-17 Comcast Cable Communications, Llc Bandwidth limited dynamic frame rate video trick play

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105723720A (en) * 2012-03-13 2016-06-29 谷歌公司 Adaptive trick play streaming
CN103916367A (en) * 2012-12-31 2014-07-09 北京新媒传信科技有限公司 Method and apparatus for transmission of multimedia data
CN105191291A (en) * 2013-03-13 2015-12-23 株式会社理光 Information processing apparatus, program, and video output system
CN105451075A (en) * 2014-08-27 2016-03-30 北京大学 Video quality control method and video quality control device
CN105430506A (en) * 2015-11-06 2016-03-23 浙江宇视科技有限公司 Method and device for preventing message from being lost in video playback
CN107493482A (en) * 2016-06-12 2017-12-19 杭州海康威视数字技术股份有限公司 A kind of video playback method and device
CN107623851A (en) * 2017-09-01 2018-01-23 苏州科达科技股份有限公司 Video code flow transmission control unit and control method
CN110247815A (en) * 2019-05-09 2019-09-17 深圳市迅雷网络技术有限公司 A kind of data transmission method, device, system and computer readable storage medium

Also Published As

Publication number Publication date
CN111405370A (en) 2020-07-10

Similar Documents

Publication Publication Date Title
CN111405370B (en) Video playback method and device
EP4082174B1 (en) System and method for estimation of quality of experience (qoe) for video streaming
TWI473478B (en) Network communication control method and system
CN106911927B (en) Method and device for evaluating experience quality of network video user and DPI equipment
EP2775673B1 (en) Content reproduction information estimating device, method and program
WO2020238065A1 (en) Media file downloading method and apparatus, and terminal and medium
KR20110044257A (en) Flow-rate adaptation for a connection of time-varying capacity
US9686554B2 (en) Encoder adaptation
KR20200020896A (en) Method and system and apparatus for video transmission
CN111049756B (en) Request response method and device, electronic equipment and computer readable storage medium
WO2014090075A1 (en) System and method for estimating an effective bandwidth
US20170054648A1 (en) Data transfer apparatus, data transfer controlling method and data stream
CN112492646B (en) Congestion control method and device based on congestion cause identification
CN111510777B (en) Method and device for measuring network speed, computer equipment and readable storage medium
JP2007194893A (en) Image quality evaluation apparatus and method
CN113079062B (en) Resource adjusting method and device, computer equipment and storage medium
WO2017169948A1 (en) Communication system, available-bandwidth estimation apparatus, available-bandwidth estimation method, and recording medium having available-bandwidth estimation program stored thereon
CN109787922B (en) Method and device for acquiring queue length and computer readable storage medium
US20180150432A1 (en) Method and apparatus for measuring time samp unit of remote device
CN110868373A (en) Multimedia data transmission method, device and computer readable storage medium
WO2021213781A1 (en) A method for estimating bandwidth between a video server and a video client
CN114629826A (en) Network maximum bandwidth estimation method and device, electronic equipment and storage medium
CN112948031A (en) Dynamic window adjusting method and device
CN108512711B (en) Method, device and equipment for obtaining instantaneous interface access statistic
CN111970206A (en) FC network flow control method, device and related components

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