CN117376645A - Video preloading method, device, computer equipment and storage medium - Google Patents

Video preloading method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN117376645A
CN117376645A CN202311455968.9A CN202311455968A CN117376645A CN 117376645 A CN117376645 A CN 117376645A CN 202311455968 A CN202311455968 A CN 202311455968A CN 117376645 A CN117376645 A CN 117376645A
Authority
CN
China
Prior art keywords
video
code rate
played
target
preloading
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.)
Pending
Application number
CN202311455968.9A
Other languages
Chinese (zh)
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202311455968.9A priority Critical patent/CN117376645A/en
Publication of CN117376645A publication Critical patent/CN117376645A/en
Pending legal-status Critical Current

Links

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/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/442Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
    • H04N21/44209Monitoring of downstream path of the transmission network originating from a server, e.g. bandwidth variations of a wireless network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/24Monitoring of processes or resources, e.g. monitoring of server load, available bandwidth, upstream requests
    • H04N21/2402Monitoring of the downstream path of the transmission network, e.g. bandwidth available

Landscapes

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

Abstract

The present application relates to a method, apparatus, computer device, storage medium and computer program product for preloading video. The method can be applied to the fields of cloud technology, artificial intelligence, intelligent transportation, auxiliary driving and the like, such as video scene preloading when an intelligent terminal browses videos; the method comprises the following steps: acquiring network bandwidth in the process of preloading a first video to be played; determining the code rate level corresponding to the target video according to the network bandwidth; determining the quality fraction of a video file corresponding to the target video under the code rate level; adjusting the code rate level according to the quality fraction and the preloading state of the video to be played to obtain a target code rate level; and preloading the video file corresponding to the target video at the target code rate level. By adopting the method, the preloading efficiency can be improved, the fluency of video playing is ensured, and the balance between the fluency and the playing quality of the video is realized.

Description

Video preloading method, device, computer equipment and storage medium
Technical Field
The present invention relates to the field of video processing technology, and in particular, to a video preloading method, apparatus, computer device, storage medium, and computer program product.
Background
With the development of internet technology, video browsing is an important media interaction mode. In the process of playing the video, other videos are preloaded, so that when the currently played video is switched, the next video can be played in time, and the smoothness of video switching is guaranteed.
In the related technology, the bandwidth of the next video can be predicted according to the bandwidth of the currently loaded video, the code rate level of the next video is determined according to the predicted bandwidth, and the next video corresponding to the code rate level is loaded, but because the network environment is complex and changeable, the bandwidth prediction has larger errors, and the determined code rate level is inaccurate, excessive network resources can be occupied due to the fact that the code rate level is higher, and the smoothness of video switching is affected.
Disclosure of Invention
Based on this, it is necessary to provide a method, an apparatus, a computer device, a computer readable storage medium and a computer program product for preloading a video, which can improve preloading efficiency, ensure fluency of video playing, and achieve balance between fluency and playing quality of the video.
In a first aspect, the present application provides a method for preloading video. The method comprises the following steps:
Acquiring network bandwidth in the process of preloading a first video to be played; determining the code rate level corresponding to the target video according to the network bandwidth; the target video is a video after the first video to be played in the preloading sequence; determining the quality fraction of a video file corresponding to the target video under the code rate level; adjusting the code rate level according to the quality fraction and the preloading state of the video to be played to obtain a target code rate level; the video to be played comprises a first video to be played and a second video to be played, wherein the second video to be played is a video with a preloading sequence before the first video to be played; and preloading the video file corresponding to the target video at the target code rate level.
In a second aspect, the present application further provides a video preloading device. The device comprises:
the network bandwidth acquisition module is used for acquiring network bandwidth in the process of preloading the first video to be played;
the code rate grade determining module is used for determining the code rate grade corresponding to the target video according to the network bandwidth; the target video is a video after the first video to be played in the preloading sequence;
the quality score determining module is used for determining the quality score of the video file corresponding to the target video under the code rate level;
The code rate level adjustment module is used for adjusting the code rate level according to the mass fraction and the preloading state of the video to be played to obtain a target code rate level; the video to be played comprises a first video to be played and a second video to be played, wherein the second video to be played is a video with a preloading sequence before the first video to be played;
and the preloading module is used for preloading the video file corresponding to the target video at the target code rate level.
In some embodiments, the code rate level determining module is further configured to obtain a code rate of the target video at each preset code rate level respectively; selecting a target code rate from the code rates under each preset code rate level according to the network bandwidth; and taking the preset code rate grade corresponding to the target code rate as the code rate grade corresponding to the target video.
In some embodiments, the code rate level determining module is further configured to select, from code rates at preset code rate levels, a code rate that is smaller than the network bandwidth and that is adjacent to the network bandwidth; and taking the selected code rate as a target code rate.
In some embodiments, the quality score determining module is further configured to determine a similarity parameter of the target video according to a video file corresponding to the target video at the code rate level and a video file corresponding to the target video at the original code rate level; when the similarity parameters meet the similarity conditions, acquiring the resolution of a video file corresponding to the target video at the code rate level; and determining the quality fraction of the video file corresponding to the target video under the code rate level according to the resolution and the similarity parameters.
In some embodiments, the quality score determination module is further configured to determine the first quality score based on the resolution and the resolution parameter; determining a second quality score according to the similarity parameter and the similarity threshold; and determining the quality score of the video file corresponding to the target video under the code rate level according to the first quality score and the second quality score.
In some embodiments, the quality score determining module is further configured to determine a similarity parameter of the target video according to a video file corresponding to the target video at the code rate level and a video file corresponding to the target video at the original code rate level; and when the similarity parameters do not meet the similarity conditions, taking the preset quality score as the quality score of the video file corresponding to the target video under the code rate level.
In some embodiments, the video preloading device further comprises: the preloading state determining module is used for acquiring preloading parameters of the video to be played; determining a preloading state of the video to be played according to the preloading parameters; the preloaded state is a complete state or an incomplete state.
In some embodiments, the preload parameters include a preload duration or a preload data size; the pre-loading state determining module is further configured to determine that the pre-loading state of the video to be played is a complete state when the pre-loading time length meets a first loading condition or the pre-loading data amount meets a second loading condition; and when the preloading duration does not meet the first loading condition and the preloading data quantity does not meet the second loading condition, determining that the preloading state of the video to be played is an unfinished state.
In some embodiments, the code rate level adjustment module is configured to reduce the code rate level when it is determined that the target video meets the code rate level down-regulation condition according to the quality score and the pre-loading state of the video to be played, so as to obtain the target code rate level; and when the target video is determined to meet the code rate level up-regulation condition according to the mass fraction and the pre-loading state of the video to be played, the code rate level is improved, and the target code rate level is obtained.
In some embodiments, the code rate level adjustment module is further configured to reduce the code rate level when the quality score belongs to a first quality score interval and the number of the completed states in the preloaded state of the video to be played belongs to a preset interval, so as to obtain a target code rate level; and when the quality score belongs to the second quality score interval and the number of the completion states in the preloading state of the video to be played does not belong to the preset interval, increasing the code rate level to obtain the target code rate level.
In some embodiments, the code rate level adjustment module is further configured to, when it is determined that the target video does not meet the code rate level down-regulation condition and does not meet the code rate level up-regulation condition according to the quality score and the pre-loading state of the video to be played, take the code rate level as the target code rate level.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor which when executing the computer program performs the steps of:
acquiring network bandwidth in the process of preloading a first video to be played; determining the code rate level corresponding to the target video according to the network bandwidth; the target video is a video after the first video to be played in the preloading sequence; determining the quality fraction of a video file corresponding to the target video under the code rate level; adjusting the code rate level according to the quality fraction and the preloading state of the video to be played to obtain a target code rate level; the video to be played comprises a first video to be played and a second video to be played, wherein the second video to be played is a video with a preloading sequence before the first video to be played; and preloading the video file corresponding to the target video at the target code rate level.
In a fourth aspect, the present application also provides a computer-readable storage medium. The computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
Acquiring network bandwidth in the process of preloading a first video to be played; determining the code rate level corresponding to the target video according to the network bandwidth; the target video is a video after the first video to be played in the preloading sequence; determining the quality fraction of a video file corresponding to the target video under the code rate level; adjusting the code rate level according to the quality fraction and the preloading state of the video to be played to obtain a target code rate level; the video to be played comprises a first video to be played and a second video to be played, wherein the second video to be played is a video with a preloading sequence before the first video to be played; and preloading the video file corresponding to the target video at the target code rate level.
In a fifth aspect, the present application also provides a computer program product. The computer program product comprises a computer program which, when executed by a processor, implements the steps of:
acquiring network bandwidth in the process of preloading a first video to be played; determining the code rate level corresponding to the target video according to the network bandwidth; the target video is a video after the first video to be played in the preloading sequence; determining the quality fraction of a video file corresponding to the target video under the code rate level; adjusting the code rate level according to the quality fraction and the preloading state of the video to be played to obtain a target code rate level; the video to be played comprises a first video to be played and a second video to be played, wherein the second video to be played is a video with a preloading sequence before the first video to be played; and preloading the video file corresponding to the target video at the target code rate level.
The video preloading method, the video preloading device, the computer equipment, the storage medium and the computer program product acquire network bandwidth in the process of preloading the first video to be played, determine the code rate grade corresponding to the target video according to the network bandwidth, and then adjust the code rate grade according to the quality fraction of the video file corresponding to the target video under the code rate grade and the preloading state of the video to be played to obtain the target code rate grade; the network bandwidth, the quality fraction and the preloading state of the video to be played are combined to determine the target code rate level, so that the playing quality of the target video is ensured, meanwhile, in the process of preloading the video file of the target video under the target code rate level, the network bandwidth resource can be better utilized, the preloading efficiency is improved, the fluency of video switching playing is ensured, the balance between fluent video playing and playing quality is realized, and the experience of a user for browsing the video is improved.
Drawings
FIG. 1 is an application environment diagram of a method of preloading video in one embodiment;
FIG. 2 is a flow diagram of a method of preloading video in one embodiment;
FIG. 3 is a schematic diagram of a preloaded video to be played in one embodiment;
FIG. 4 is a flow chart illustrating determining a code rate level of a target video according to one embodiment;
FIG. 5 is a schematic diagram of determining a target bitrate and a bitrate level of a target video according to one embodiment;
FIG. 6 is a flowchart illustrating a method for determining a quality score of a video file corresponding to a target video at a bitrate level according to an embodiment;
FIG. 7 is a flowchart illustrating a method for determining a quality score of a video file corresponding to a target video at a bitrate level according to another embodiment;
FIG. 8 is a flowchart illustrating a method for determining a quality score of a video file corresponding to a target video at a bitrate level according to another embodiment;
FIG. 9 is a flowchart illustrating a method for determining a preload status of a video to be played in one embodiment;
FIG. 10 is a flowchart illustrating a method for determining a pre-load status of a video to be played according to another embodiment;
FIG. 11 is a flow chart illustrating the adjustment of the code rate level in one embodiment;
FIG. 12 is a schematic diagram of a video preloading method applied to a short video preloading scene in one embodiment;
FIG. 13 is a flow chart of a method of preloading video in another embodiment;
FIG. 14 is a block diagram of a video preloading device in one embodiment;
Fig. 15 is an internal structural view of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The video preloading method provided by the embodiment of the application relates to the computer vision technology; computer Vision (CV) is a science of how to "look" a machine, and more specifically, to replace a camera and a Computer to perform machine Vision such as recognition and measurement on a target, and further perform graphic processing, so that the Computer is processed into an image more suitable for the human eye to observe or transmit to an instrument to detect. As a scientific discipline, computer vision research-related theory and technology has attempted to build artificial intelligence systems that can acquire information from images or multidimensional data. Computer vision techniques typically include image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content/behavior recognition, three-dimensional object reconstruction, 3D techniques, virtual reality, augmented reality, synchronous positioning, and map construction, among others, as well as common biometric recognition techniques such as face recognition, fingerprint recognition, and others.
The video preloading method provided by the embodiment of the application can be applied to an application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The data storage system may store data that the server 104 needs to process. The data storage system may be integrated on the server 104, or may be placed on a cloud or other network server; the video preloading method may be performed by the terminal 102 or the server 104, or may be performed in conjunction with the terminal 102 and the server 104.
Taking the video preloading method as an example through the server 104, the server 104 can acquire the network bandwidth in the process of preloading the first video to be played; the server 104 can determine the code rate level corresponding to the target video according to the network bandwidth; the target video is a video after the first video to be played in the preloading sequence; the server 104 can determine the quality score of the video file corresponding to the target video at the code rate level; the server 104 can adjust the code rate level according to the quality fraction and the preloading state of the video to be played to obtain a target code rate level; the video to be played comprises a first video to be played and a second video to be played, wherein the second video to be played is a video with a preloading sequence before the first video to be played; server 104 may preload a video file corresponding to the target video at the target bitrate level.
The terminal 102 may be a smart phone, a tablet computer, a notebook computer, a desktop computer, an intelligent sound box, a smart watch, an internet of things device, a portable wearable device, an intelligent voice interaction device and an aircraft, and the internet of things device may be an intelligent sound box, an intelligent television, an intelligent air conditioner, an intelligent vehicle-mounted device and the like. The portable wearable device may be a smart watch, smart bracelet, headset, or the like.
The server 104 may be a separate physical server or may be a service node in a blockchain system, where a peer-to-peer network is formed between the service nodes.
The server 104 may be a server cluster formed by a plurality of physical servers, and may be a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms.
The terminal 102 and the server 104 may be connected by a communication connection manner such as bluetooth, USB (Universal Serial Bus ) or a network, which is not limited herein.
In some embodiments, as shown in fig. 2, a method for preloading video is provided, where the method is performed by a server or a terminal in fig. 1, and may also be performed by the server and the terminal in fig. 1 cooperatively, where the method is performed by a computer device, which may be the server or the terminal in fig. 1, and includes the following steps:
step 202, obtaining network bandwidth in the process of preloading the first video to be played.
Where preloading refers to preloading data that may be used locally so that the data may be obtained directly from the local when needed. Different from the video being played, the video to be played refers to the video which is not played yet, and the video to be played can be a short video, a medium video or a long video on demand, and can be particularly a video of a movie and television series, a game video, a conference video or a sports video and the like; the first video to be played is a preloaded video to be played, for example, the first video to be played may be a preloaded first short video to be played, a first video to be played in a middle video or a long video, and the first video to be played may be a part of a video segment which is not yet played in the middle video or the long video being played.
The first video to be played is preloaded, so that the flow of video switching can be improved; by taking the example that the computer device is a terminal as an example, when the terminal is playing the video, the first video to be played is preloaded to the local terminal, and when the terminal switches the currently played video and the preloading of the first video to be played is completed, the first video to be played can be directly obtained from the local terminal and played, without waiting for the terminal to load the first video to be played from the server, so that the smoothness of video switching is improved.
The network bandwidth is the amount of data transmitted by the network environment in a unit time, and can represent the data transmission rate in the network environment, and the unit of the network bandwidth can be bits per second, reflecting the amount of data transmitted per second in the network environment.
The network bandwidth may be a result of predicting a network environment of a future period, for example, in a process of preloading the first video to be played, the network bandwidth of the network environment of the future period may be predicted according to the network bandwidth of the network environment of the previous period.
In one possible implementation manner, in the process of preloading the first video to be played, the computer device obtains an average network bandwidth of the network environment in a preset measurement time period before the current moment, and uses the average network bandwidth as a network bandwidth of the predicted network environment in a future period; the preset measurement duration may be set according to actual requirements, which is not limited in the embodiment of the present application.
For example, the preset measurement duration may be 1 second, the computer device may obtain a total transmission data amount of the network environment within 1 second before the current time, and obtain an average network bandwidth of the network environment within 1 second before the current time according to the total transmission data amount and the preset measurement duration, and use the average network bandwidth as a predicted network bandwidth of the network environment in a future period of time.
In another possible implementation manner, the computer device may measure a plurality of network speeds within a preset measurement duration, and an average value of the plurality of network speeds is used as an average network bandwidth within the preset measurement duration, and the average network bandwidth is used as a network bandwidth of a predicted network environment in a future period of time.
For example, the preset measurement duration may be 1 second, and the computer device measures N network speeds of the network environment within 1 second before the current time, and averages the N network speeds to obtain the network bandwidth, for example, V avg =(∑V i ) N, where V avg Is the network bandwidth, V i Is the i-th network speed and N is the total number of network speeds measured by the network environment within 1 second before the current time.
For another example, in the process of preloading the first video to be played, the current real-time network bandwidth can be used as the network bandwidth of the predicted network environment in a future period of time; for example, in the process of preloading the first video to be played, the current network bandwidth of the network environment is obtained.
It should be noted that, the network bandwidth is a predicted network bandwidth of a future period, and since the video file of the target video is preloaded in the future period, the network bandwidth is related to the video file of the target video, and the video file of the target video is determined based on the network bandwidth, so that the video file of the target video is preloaded in a manner that meets the bandwidth requirement of the network environment.
In some embodiments, the number of first videos to be played may be one, that is, the computer device may preload the videos to be played one by one, for example, after executing the preloading of one video to be played, the preloading of the next video to be played is continued.
After the computer equipment performs preloading of the first video to be played, acquiring network bandwidth to realize that the network bandwidth is acquired in the process of preloading the first video to be played, wherein the network bandwidth is used for preloading the next video to be played.
In some embodiments, the number of first videos to be played may be at least two, i.e. the computer device may perform the preloading of the videos to be played in batches, such as after performing the preloading of at least two videos to be played in one batch, continuing to perform the preloading of at least two videos to be played in the next batch.
The method for preloading the video can be applied to preloading the short video, specifically, the first short video to be played is the first short video to be played, when the terminal plays the current short video, a preloading request is sent to the server, the server issues a video file of the short video to be played according to the preloading request, and when the server issues the first short video to be played, the network bandwidth is obtained.
The video preloading method can be applied to video segment preloading, specifically, the first video to be played is the first video segment to be played; in the process of playing a medium video or a long video, when a current video segment is played, a preloading request can be sent to a server to preload a subsequent video segment, and when a first video segment to be played is preloaded, network bandwidth is acquired; the medium video or the long video can be video of film and television drama, game video, conference video or sports video and the like.
Step 204, determining the code rate level corresponding to the target video according to the network bandwidth; the target video is a video whose preload order is after the first video to be played.
The code rate level can be used for reflecting the size of the code rate, and the higher the code rate level is, the larger the code rate is, and the lower the code rate level is, the smaller the code rate is.
Code rate is an important index affecting video definition, and refers to data traffic used by video in unit time, also called code flow rate; the larger the code rate is, the more data amount used by the video in unit time is, the higher the definition of the video is, the smaller the code rate is, the lower the data amount used by the video in unit time is, and the lower the definition of the video is.
The preloading order of the target video is next to the first video to be played, that is, after the preloading of the first video to be played is performed, the preloading of the target video is continued.
In some embodiments, the computer device is a server, and before the network bandwidth is acquired in the process of preloading the first video to be played, the video preloading method further includes: the method comprises the steps that a video file of a target video under an original code rate is obtained, and for the video file under the original code rate, a server carries out transcoding on the video file under the original code rate for a plurality of times according to a plurality of preset code rate levels, so that the video file under the plurality of preset code rate levels is obtained.
It should be noted that, compared with a video file, a target video may be understood as an abstract concept, the target video may have a video file with a different preset code rate level, and the video file may be understood as video data required for playing the target video. In practical applications, the target video may be a name, and the video file of the target video is video data corresponding to the name.
After the computer equipment acquires the network bandwidth, acquiring video files of the target video at different preset code rate levels, and acquiring respective corresponding code rates of the video files at different preset code rate levels, and determining the code rate level of the target video according to the network bandwidth and the code rates of the video files of the target video at different preset code rate levels; and the determined code rate level of the target video is matched with the network bandwidth.
It should be noted that, the code rate level of the target video is matched with the network bandwidth, which means that the code rate of the video file corresponding to the target video under the code rate level is smaller than the gap between the code rate of the video file corresponding to the target video and the network bandwidth, and the video file of the target video under the code rate level is preloaded, so that the network bandwidth resource can be better utilized.
Specifically, the computer device determines the code rate level of the target video according to the network bandwidth and the code rates of the video files of the target video under different preset code rate levels, which may be the code rate of the video files under different preset code rate levels, determines the code rate with the smallest gap with the network bandwidth, and then uses the preset code rate level corresponding to the code rate as the code rate level of the target video.
The video preloading method may be applied to preloading short videos, specifically, the server determines the code rate level of the (m+1) th short video to be played (i.e. the target video) according to the network bandwidth obtained when the (M) th short video to be played (i.e. the first video to be played) is preloaded. In addition, the video preloading method can also be used for preloading video segments, and the specific method for determining the code rate level can refer to the steps.
Step 206, determining the quality score of the video file corresponding to the target video at the code rate level.
The quality score is used for reflecting the definition degree of the target video when being played, and the higher the quality score is, the higher the definition degree of the target video when being played is, the lower the quality score is, and the lower the definition degree of the target video when being played is.
From another angle, the quality fraction can reflect the difference between the video file corresponding to the target video at the code rate level and the video file corresponding to the target video at the original code rate level, and the video file corresponding to the target video at the original code rate level is the video file with the highest definition of the target video; the higher the quality fraction is, the smaller the difference between the video file corresponding to the target video at the code rate level and the video file corresponding to the target video at the original code rate level is; the lower the quality score is, the larger the difference between the video file corresponding to the target video at the code rate level and the video file corresponding to the target video at the original code rate level is.
In some embodiments, the computer device obtains a video file corresponding to the target video at the code rate level, obtains a video file corresponding to the target video at the original code rate level, and determines a quality score of the video file corresponding to the target video at the code rate level according to the video file corresponding to the target video at the code rate level and the video file corresponding to the target video at the original code rate level.
Illustratively, the code rate level corresponding to the target video is determined to be q1 according to the network bandwidth, the computer device obtains the original code rate level of the target video to be q0, and the quality fraction of the video file f1 is determined according to the video file f1 of the target video at the code rate level q1 and the video file f0 of the target video at the original code rate level q 0.
The video preloading method can be applied to the preloading of short videos, specifically, when the code rate level q1 of the (m+1) th short video to be played (i.e. target video) is preloaded, determining the quality fraction of the video file of the (m+1) th short video to be played at the code rate level q 1; in addition, the video preloading method can also be used for preloading video segments, and the specific method for determining the code rate level can refer to the steps.
In some embodiments, the computer device obtains a video file corresponding to the target video at the code rate level, obtains a resolution of the video file corresponding to the target video at the code rate level, obtains a resolution parameter, and determines a quality score of the video file corresponding to the target video at the code rate level according to the resolution parameter and the resolution of the video file corresponding to the target video at the code rate level. The resolution parameter may be set according to an actual requirement, for example, may be a resolution that is clearly displayed when the video is played.
According to the resolution parameters and the resolution of the video file corresponding to the target video at the code rate level, determining the quality score of the video file corresponding to the target video at the code rate level can be to calculate the ratio between the resolution of the video file corresponding to the target video at the code rate level and the resolution parameters, and taking the ratio as the quality score.
Step 208, adjusting the code rate level according to the quality fraction and the preloading state of the video to be played to obtain a target code rate level; the video to be played comprises a first video to be played and a second video to be played, wherein the second video to be played is a video with a preloading sequence before the first video to be played.
The second video to be played is preloaded video to be played.
In practical application, taking a computer device as an example of a terminal, when the terminal is playing a video, preloading a plurality of videos to be played, and the order of preloading the plurality of videos to be played may be: and executing the second video to be played in a preloading mode, and executing the first video to be played in a preloading mode.
For example, the terminal is used for preloading videos to be played one by one, the number of the second videos to be played can be at least two, and the number of the first videos to be played can be at least two; as shown in fig. 3, at least two second videos to be played are a second video to be played h1, a second video to be played h2 and a second video to be played h3, respectively, and at least two first videos to be played are a first video to be played h4 and a first video to be played h5, respectively; the preloading sequence of the target video is positioned at the next position of the first video h5 to be played; when the terminal is playing the video h0, the second video h1 to be played, the second video h2 to be played, the second video h3 to be played, the first video h4 to be played and the first video h5 to be played are sequentially executed, and the terminal can acquire network bandwidth after executing the first video h4 to be played or the first video h5 to be played in a preloading mode, so that the terminal can continue to preload the target video.
The pre-loading state is used for reflecting the completion degree of pre-loading, and specifically may reflect that the completion degree of pre-loading is higher or the completion degree of pre-loading is lower.
For example, when the data amount of the preloaded video file reaches the data amount threshold, it may be determined that the degree of completion of the preloading is high, and when the data amount of the preloaded video file does not reach the data amount threshold, it may be determined that the degree of completion of the preloading is low.
For another example, when the duration of preloading the video file reaches the duration threshold, it may be determined that the degree of completion of the preloading is higher, and when the duration of preloading the video file reaches the duration threshold, it may be determined that the degree of completion of the preloading is lower.
As another example, when the pre-load video file has been completed, it may be determined that the degree of completion of the pre-load is higher, and when the pre-load video file has not been completed, it may be determined that the degree of completion of the pre-load is lower.
In some embodiments, the computer device determines whether the code rate level can be adjusted up or down based on the quality score; for example, when the quality score is higher, if the code rate level of the target video is adjusted down, the influence on the definition of the target video during playing is possibly smaller, and the code rate level has an adjustment down space; when the quality score is low, in order to ensure the definition of the target video when playing, the code rate level may need to be adjusted upwards, and then the code rate level has an up-adjustment space.
The computer device determines whether the code rate level can be adjusted up or down according to the pre-loading state of the video to be played, for example, when the pre-loading state of the video to be played indicates that the pre-loading is completed to a higher degree, the network bandwidth can accommodate more data transmission, so that the code rate level of the target video can be adjusted up, and when the pre-loading state of the video to be played indicates that the pre-loading is completed to a lower degree, the network bandwidth can accommodate less data transmission, so that the code rate level of the target video can be adjusted down.
And the computer equipment combines the quality fraction and the preloading state of the video to be played, determines the up-regulation or down-regulation code rate level, and obtains the target code rate level of the target video. For example, when the code rate level can be adjusted upwards according to the quality score and the code rate level can be adjusted upwards according to the preloading state of the video to be played, the code rate level can be adjusted upwards to obtain the target code rate level of the target video; when the code rate level can be adjusted down according to the quality score and the code rate level can be adjusted down according to the preloading state of the video to be played, the code rate level can be adjusted down to obtain the target code rate level of the target video.
It should be noted that, the adjustment amounts of the down-regulation code rate level and the down-regulation code rate level may be set according to actual requirements, for example, the adjustment amount may be 1, that is, the down-regulation code rate level, so that the target code rate level is lower than the code rate level by 1 level, and the up-regulation code rate level, so that the target code rate level is higher than the code rate level by 1 level.
In some embodiments, the computer device may also determine not to adjust the bitrate level by combining the quality score with the pre-load status of the video to be played, for example, when it is determined that the bitrate level may be adjusted up according to the quality score and when it is determined that the bitrate level may be adjusted down according to the pre-load status of the video to be played, or when it is determined that the bitrate level may be adjusted down according to the quality score and when it is determined that the bitrate level may be adjusted up according to the pre-load status of the video to be played, it may be determined that the bitrate level may not be adjusted, and directly shift the bitrate level of the target video by the target bitrate level.
For example, the video preloading method may be applied to the preloading of short videos; for example, according to the quality fraction of the video file of the m+1st short video to be played under the code rate level k and the pre-loading state of the 1 st to M short videos to be played, the code rate level k is adjusted to obtain the target code rate level of the m+1st short video to be played. In addition, the video preloading method can also be used for preloading video segments, and specific processes can refer to the steps.
Step 210, preloading the video file corresponding to the target video at the target code rate level.
In some embodiments, after determining the target bitrate level of the target video, the computer device preloads a video file corresponding to the target video at the target bitrate level.
When the computer equipment is a server, the server sends a video file corresponding to the target video at the target code rate level to the terminal, so that the terminal preloads the video file corresponding to the target video at the target code rate level.
When the computer equipment is a terminal, the terminal sends a preloading request according to the target code rate level, and the server sends a video file corresponding to the target video under the target code rate level to the terminal according to the preloading request, so that the terminal preloads the video file corresponding to the target video under the target code rate level.
The computer device is a terminal, the terminal can obtain the current network bandwidth according to the current network speed in the process of preloading the first video r1 to be played, the terminal determines the code rate level of the target video r2 according to the network bandwidth, determines the quality fraction of the video file corresponding to the target video r2 under the code rate level q1, adjusts the code rate level q1 according to the quality fraction and the preloading state of the video to be played (including the first video to be played and the second video to be played) to obtain the code rate level q2, and the terminal sends a preloading request to the server according to the code rate level q2, so that the terminal preloads the video file of the target video r2 under the code rate level q 2.
The computer device is a server, the server obtains a current network bandwidth in the preloading process of the first video r1 to be played, the server determines the code rate grade of the target video r2 according to the network bandwidth, determines the quality score of a video file corresponding to the target video r2 under the code rate grade q1, adjusts the code rate grade q1 according to the quality score and the preloading state of the video to be played (including the first video to be played and the second video to be played) preloaded by the terminal to obtain the code rate grade q2, and sends the video file of the target video r2 under the code rate grade q2 to the terminal to enable the terminal to preload the video file of the target video r2 under the code rate grade q 2.
Illustratively, the pre-loading method of the video is applied to the pre-loading of the short video; the method comprises the steps that a server obtains current network bandwidth in the preloading process of an Mth short video r1 to be played (a first short video to be played), the server determines the code rate grade q1 of the Mth+1st short video r2 to be played (a target video) according to the network bandwidth, determines the quality score of a video file corresponding to the Mth+1st short video r2 to be played under the code rate grade q1, and adjusts the code rate grade q1 according to the quality score and the preloading state of the terminal preloading the Mth short video to be played 1 to the Mth short video to be played to obtain the code rate grade q2, and the server sends the video file of the Mth+1st short video r2 to be played under the code rate grade q2 to the terminal so that the terminal preloads the video file of the Mth+1st short video r2 to be played under the code rate grade q 2.
In the video preloading method, in the process of preloading the first video to be played, acquiring network bandwidth, determining a code rate grade corresponding to the target video according to the network bandwidth, and adjusting the code rate grade according to the quality fraction of the video file corresponding to the target video under the code rate grade and the preloading state of the video to be played to obtain the target code rate grade; the network bandwidth, the quality fraction and the preloading state of the video to be played are combined to determine the target code rate level, so that the playing quality of the target video is ensured, meanwhile, in the process of preloading the video file of the target video under the target code rate level, the network bandwidth resource can be better utilized, the preloading efficiency is improved, the fluency of video switching playing is ensured, the balance between fluent video playing and playing quality is realized, and the experience of a user for browsing the video is improved.
In some embodiments, as shown in fig. 4, determining the code rate level corresponding to the target video according to the network bandwidth includes: step 401, respectively obtaining code rates of a target video under each preset code rate level; step 402, selecting a target code rate from code rates at each preset code rate level according to the network bandwidth; and 403, taking the preset code rate level corresponding to the target code rate as the code rate level corresponding to the target video.
Wherein the preset code rate level is a preset code rate level; in practical application, the server acquires the video file of the target video at the original code rate level, and converts the video file of the target video at the original code rate level into video files at each preset code rate level according to the preset code rate level so as to load the video files by the terminal.
The code rate of the target video under each preset code rate level is the code rate of the video file of the target video under each preset code rate level; the code rate level is one of the preset code rate levels, and the target code rate is the code rate of the video file of the target video at the code rate level.
In some embodiments, the computer device obtains video files of the target video at each preset code rate level, obtains code rates corresponding to the video files, and obtains code rates of the target video at each preset code rate level.
The computer equipment can select each code rate smaller than the network bandwidth from the code rates at each preset code rate level, and randomly select one code rate from the code rates as a target code rate; the computer equipment can also select the code rate closest to the network bandwidth and smaller than the network bandwidth from the code rates under each preset code rate level as the target code rate.
It should be noted that, the code rate is the data amount used by the video in unit time, and the network bandwidth is the data amount transmitted by the network environment in unit time, so that the code rate and the unit of the network bandwidth are the same, for example, the code rate and the unit of the network bandwidth can be bits per second, and the code rate and the size of the network bandwidth can be compared, so as to realize that the target code rate is selected from the code rates under each preset level.
The computer equipment obtains a preset code rate grade corresponding to the target code rate, and takes the preset code rate grade as the code rate grade of the target video.
Illustratively, each preset code rate level includes: a preset code rate level q1, a preset code rate level q2 and a preset code rate level q3; the computer device obtains a code rate m1 of the video file of the target video at a preset code rate level q1, a code rate m2 of the video file of the target video at a preset code rate level q2, and a code rate m3 of the video file of the target video at a preset code rate level q3, in this example, the computer device determines that the code rate m2 is the target code rate according to the network bandwidth, and further can determine that the preset code rate level q2 corresponding to the code rate m2 is the code rate level of the target video.
In the above embodiment, according to the network bandwidth, the target code rate is selected from the code rates under each preset code rate level, and the preset code rate level corresponding to the target code rate is used as the code rate level corresponding to the target video, so that the mode of preloading the video file of the target video meets the bandwidth requirement of the network environment, no network jamming is caused, the preloading efficiency is improved, and the smoothness of video switching is improved.
In some embodiments, selecting the target code rate from the code rates at each preset code rate level according to the network bandwidth includes: selecting a code rate which is smaller than the network bandwidth and adjacent to the network bandwidth from the code rates under each preset code rate level; and taking the selected code rate as a target code rate.
In some embodiments, after the computer device obtains the code rate at each preset code rate level, selecting each candidate code rate smaller than the network bandwidth from the obtained code rates, and respectively calculating the difference between each candidate code rate and the network bandwidth, wherein the candidate code rate with the smallest difference is the code rate smaller than the network bandwidth and adjacent to the network bandwidth, and taking the candidate code rate with the smallest difference as the target code rate.
Illustratively, as shown in fig. 5, each preset code rate level includes: a preset code rate level q1, a preset code rate level q2 and a preset code rate level q3; the computer equipment obtains the code rate under each preset code rate level, and the code rates are respectively: code rate m1, code rate m2, code rate m3, wherein code rate m1 and code rate m2 are less than the network bandwidth, and the computer equipment obtains the difference between code rate m1 and code rate m2 and the network bandwidth respectively, and in this example, if the difference between code rate m2 and the network bandwidth is minimum, code rate m2 is regarded as the target code rate.
In some embodiments, the computer device arranges the code rate and the network bandwidth under each preset code rate level in order from small to large to obtain a code rate selection queue, and selects the code rate located in the previous bit of the network bandwidth in the code rate selection queue to obtain the target code rate.
In the above embodiment, the code rate smaller than the network bandwidth and adjacent to the network bandwidth in the code rates at each preset code rate level is used as the target code rate, so that the network bandwidth can be utilized to the greatest extent, and the playing quality of the target video can be improved under the conditions of not causing network blocking and guaranteeing smooth playing of the video.
In some embodiments, as shown in fig. 6, determining the quality score of the video file corresponding to the target video at the code rate level includes: step 601, determining similarity parameters of a target video according to a video file corresponding to the target video at a code rate level and a video file corresponding to the target video at an original code rate level; step 602, when the similarity parameter meets the similarity condition, obtaining the resolution of the video file corresponding to the target video at the code rate level; step 603, determining the quality score of the video file corresponding to the target video at the code rate level according to the resolution and the similarity parameters.
For convenience of explanation, a video file corresponding to the target video at the original code rate level is referred to as an original video file of the target video, and a video file corresponding to the target video at the code rate level is referred to as a candidate video file.
The original video file is a video file when the target video is uploaded, and the candidate video file is a video file obtained by converting the original video file according to the code rate level.
The code rate level is one of preset code rate levels, the original code rate level can also be one of preset code rate levels, the original code rate can be larger than or equal to the code rate level, and then the code rate of the original video file is larger than or equal to the code rate of the video file of the target video under the code rate level.
The similarity parameter is used for reflecting the similarity degree of the candidate video file and the original video file, when the difference between the code rate level and the original code rate level is smaller, the similarity degree of the candidate video file and the original video file is higher, the similarity parameter is larger, and when the difference between the code rate level and the original code rate level is larger, the similarity degree of the candidate video file and the original video file is lower, and the similarity parameter is smaller.
The similarity condition may be that the similarity parameter belongs to a preset similarity interval, and the similarity parameter belonging to the preset similarity interval is greater than the similarity parameter not belonging to the preset similarity interval. For example, the similarity condition may be that the similarity parameter is greater than a similarity threshold.
The similarity threshold is a threshold for displaying clarity when the video is played, when the similarity parameter is greater than or equal to the similarity threshold, the similarity parameter can be considered to be larger, the similarity degree of the candidate video file and the original video file is higher, and then the candidate video file can be displayed clarity when being played. The similarity threshold may be set according to actual requirements, and the specific value of the similarity threshold is not limited in the embodiment of the present application.
In some embodiments, the computer device calculates a similarity between a video file corresponding to the target video at the code rate level and a video file corresponding to the target video at the original code rate level to obtain a similarity parameter, and when the similarity parameter belongs to a preset similarity interval, determines that the similarity parameter meets a similarity condition, thereby obtaining a resolution of the video file corresponding to the target video at the code rate level.
The quality score of the video file corresponding to the target video under the code rate level can be determined according to the resolution and the similarity parameters, the ratio between the resolution and the resolution parameters is determined, the resolution ratio is obtained, and the larger or smaller one is obtained from the resolution ratio and the similarity parameters to be used as the quality score.
And determining the quality score of the video file corresponding to the target video under the code rate level according to the resolution and the similarity parameters, or carrying out weighted summation on the resolution ratio and the similarity parameters to obtain the quality score.
And determining the quality score of the video file corresponding to the target video under the code rate level according to the resolution and the similarity parameter, or calculating the product between the resolution ratio and the similarity parameter to obtain the quality score.
In the above embodiment, according to the video file corresponding to the target video at the code rate level and the video file corresponding to the target video at the original code rate level, the similarity parameter of the target video is determined, and the quality score is determined by combining the similarity parameter and the resolution of the video file corresponding to the target video at the code rate level, so that the quality score is more accurate.
In some embodiments, as shown in fig. 7, determining the quality score of the video file corresponding to the target video at the code rate level according to the resolution and the similarity parameters includes: step 701, determining a first quality fraction according to the resolution and the resolution parameter; step 702, determining a second quality score according to the similarity parameter and the similarity threshold; in step 703, the quality score of the video file corresponding to the target video at the code rate level is determined according to the first quality score and the second quality score.
The resolution parameter may be a reference resolution, which may be set according to actual requirements, for example, may be a resolution that is clearly displayed when the video is played, and in the embodiment of the present application, the specific value of the resolution parameter is not limited; the first quality score may be a ratio between the resolution and the resolution parameter.
In some embodiments, the resolution comprises a width and a height of the resolution, the resolution parameter comprises a width and a height of the reference resolution, the computer device calculates a first product between the width and the height of the resolution, and a second product between the width and the height of the resolution score, and calculates a ratio between the first product and the second product to obtain the first quality score.
The computer equipment calculates a first difference value between the similarity score and the similarity threshold value, calculates a second difference value between 1 and the similarity threshold value, and calculates a ratio between the first difference value and the second difference value to obtain a second quality score.
The computer device may calculate a product between the first mass fraction and the second mass fraction to obtain a mass fraction; since the first mass fraction and the second mass fraction are both values before 0 to 1, after calculating the product between the first mass fraction and the second mass fraction, the product can also be converted into a value of 100 between 0 by a preset parameter, that is, the product is amplified by the calculated preset parameter, so as to obtain the mass fraction.
In the above embodiment, the quality score of the video file corresponding to the target video at the code rate level is determined according to the resolution, the resolution parameter, the similarity parameter and the similarity threshold, and the quality score is determined by combining the resolution and the similarity parameter, so that the accuracy of the quality score is improved.
In some embodiments, determining a quality score of a video file corresponding to the target video at the code rate level includes: determining similarity parameters of the target video according to the video file corresponding to the target video at the code rate level and the video file corresponding to the target video at the original code rate level; and when the similarity parameters do not meet the similarity conditions, taking the preset quality score as the quality score of the video file corresponding to the target video under the code rate level.
In some embodiments, the computer device calculates a similarity between a video file corresponding to the target video at the code rate level and a video file corresponding to the target video at the original code rate level to obtain a similarity parameter, and determines that the similarity parameter does not satisfy a similarity condition when the similarity parameter does not belong to a preset similarity interval.
When the similarity parameter does not meet the similarity condition, the similarity degree of the candidate video file and the original video file is lower, and the definition of the candidate video is lower; when the similarity parameter does not satisfy the similarity condition, the preset quality score is taken as the quality score of the video file corresponding to the target video at the code rate level, and the preset quality score may be 0, for example.
As shown in fig. 8, the computer device determines a similarity parameter of the target video according to the video file corresponding to the target video at the code rate level and the video file corresponding to the target video at the original code rate level, determines whether the similarity parameter meets a similarity condition, if so, obtains the resolution of the video file corresponding to the target video at the code rate level, and determines the quality score of the video file corresponding to the target video at the code rate level according to the resolution and the similarity parameter; if not, taking the preset quality score as the quality score of the video file corresponding to the target video under the code rate level.
For example, the quality score may be determined according to equation (1).
Wherein W is k And H k Width and height of resolution, respectively, a and B are width and height of resolution parameters, respectively, SSIM k Is a video file corresponding to the target video under the code rate level k y Similarity parameter of k, T is similarity threshold, 0 is pre-determinedSet mass fraction, quality k Is the video file y corresponding to the target video under the code rate level k k Is added to the mass fraction of (c),is a first mass fraction, ">Is a second mass fraction, α is a preset parameter, and the product between the first mass fraction and the second mass fraction can be converted into a value of 100 between 0.
In some embodiments, it may not be determined whether the similarity parameter satisfies the similarity condition, but directly determine, according to the resolution and the similarity parameter, a quality score of a video file corresponding to the target video at the code rate level, that is, determining the quality score of the video file corresponding to the target video at the code rate level includes: determining similarity parameters of the target video according to the video file corresponding to the target video at the code rate level and the video file corresponding to the target video at the original code rate level, and acquiring the resolution of the video file corresponding to the target video at the code rate level; and determining the quality fraction of the video file corresponding to the target video under the code rate level according to the resolution and the similarity parameters.
In the above embodiment, when the similarity parameter does not meet the similarity condition, the preset quality score is used as the quality score of the video file corresponding to the target video at the code rate level, so that the process of calculating the quality score is simplified, and the efficiency of calculating the quality score is improved; in addition, the preset quality score is used as the quality score of the video file corresponding to the target video under the code rate level, and when the code rate level is adjusted subsequently, the preset quality score can be rapidly judged to meet the code rate level up-regulation condition, so that the efficiency of adjusting the code rate level is improved.
In some embodiments, adjusting the code rate level according to the quality score and the preloading state of the video to be played, before obtaining the target code rate level, further includes: the method comprises the steps of obtaining a preloading parameter of a video to be played; determining a preloading state of the video to be played according to the preloading parameters; the preloaded state is a complete state or an incomplete state.
In some embodiments, the preload state is used to reflect the degree of completion of the preload, and may specifically reflect a higher degree of completion of the preload, or a lower degree of completion of the preload; when the completion degree is higher, the pre-loading state of the video to be played can be determined to be a completion state, and when the completion degree is lower, the pre-loading state of the video to be played can be determined to be an unfinished state.
In some embodiments, the preload parameter may comprise an amount of preload data; for each video to be played, the computer device obtains the total data amount and the preloaded data amount of the video to be played, when the difference value between the preloaded data amount and the total data amount is smaller than a preset difference value, the preloaded state of the video to be played can be determined to be a finished state, and when the difference value between the preloaded data amount and the total data amount is larger than or equal to the preset difference value, the preloaded state of the video to be played can be determined to be an unfinished state.
In some embodiments, the preload parameter may comprise an amount of preload data; for each video to be played, the computer equipment acquires the total data amount and the preloaded data amount of the video to be played, when the preloaded data amount is equal to the total data amount, the preloaded state of the video to be played is determined to be a finished state, and when the preloaded data amount is smaller than the total data amount, the preloaded state of the video to be played is determined to be an unfinished state.
In some embodiments, the preloading parameters may include a preloading duration, for each video to be played, the preloading duration of the video to be played by the computer device, when the preloading duration is longer than a preset duration, the preloading state of the video to be played may be determined to be a completed state, and when the preloading duration is less than or equal to the preloading duration, the preloading state of the video to be played may be determined to be an unfinished state; the preset time length can be set according to actual requirements, and specific values of the preset time length are not limited in the embodiment of the application.
In the above embodiment, the pre-loading state of the video to be played may be used to reflect the completion degree of pre-loading, and since the pre-loading of the video to be played also needs to occupy the network bandwidth, the pre-loading state of the video to be played may reflect the idle degree of the network environment, so as to adjust the code rate level according to the pre-loading state, so that the target code rate level obtained by adjustment accords with the network environment, and improve the pre-loading efficiency.
In some embodiments, as shown in fig. 9, the preload parameters include a preload duration or a preload data amount; determining the preloading state of the video to be played according to the preloading parameters comprises the following steps: step 901, determining that the pre-loading state of the video to be played is a completion state when the pre-loading time length meets a first loading condition or the pre-loading data amount meets a second loading condition; in step 902, when the pre-loading duration does not meet the first loading condition and the pre-loading data amount does not meet the second loading condition, it is determined that the pre-loading state of the video to be played is an unfinished state.
The first loading condition may be that the pre-loading time period is longer than a preset time period; when the pre-loading time is longer than the preset time, the pre-loading time can be considered longer, and the pre-loading is finished to a higher degree; the second loading condition may be that the preloaded data size is greater than a data size threshold; when the pre-load data amount is larger than the data amount threshold, the pre-load data amount can be considered to be more, and the pre-load is finished to a higher degree.
In some embodiments, the computer device determines whether the preload duration is greater than a preset duration to determine whether the preload duration satisfies a first load condition, and determines whether the preload data size is greater than a data size threshold to determine whether the preload data size satisfies a second load condition.
When the preloading duration meets the first loading condition and the preloading data quantity meets at least one condition of the second loading condition, determining that the preloading state of the video to be played is a completion state; when the pre-loading time length meets the first loading condition and the pre-loading data amount meets neither of the second loading conditions, the pre-loading state of the video to be played can be determined to be an unfinished state.
In some embodiments, the preloaded state of the video to be played may be represented by a state value, such as a complete state by a first state value and an incomplete state by a second state value. Illustratively, the first state value may be 1 and the second state value may be 0.
Illustratively, as shown in fig. 10, determining the preload state of the video to be played includes: for each video to be played, acquiring a preloading time length t1 and a preloading data quantity s1 of the video to be played, judging whether t1 is greater than a preset time length Ttime during preloading, if yes, determining that the preloading state of the video to be played is a completion state, if not, continuously judging whether the preloading data quantity s1 is greater than a data quantity threshold value Tsize, if yes, determining that the preloading state of the video to be played is the completion state, and if not, determining that the preloading state of the video to be played is an unfinished state.
Illustratively, the preloaded state of the video to be played may be determined by equation (2).
Wherein S is i Is the state value of the ith video to be played and Time download Is the preloading duration of the ith video to be played, size Download Is the preloaded data amount of the ith video to be played, T time Is a preset time length, T size Is the data amount threshold.
In the embodiment, the pre-loading state of the video to be played is determined together according to the pre-loading time length and the pre-loading data amount of the video to be played, pre-loading parameters affecting the pre-loading state are fully considered, and the accuracy of the parameters of the pre-loading state is improved.
In some embodiments, as shown in fig. 11, adjusting the code rate level according to the quality score and the preloading state of the video to be played, to obtain the target code rate level includes: step 1101, when it is determined that the target video meets the code rate level down-regulation condition according to the mass fraction and the pre-loading state of the video to be played, the code rate level is reduced, and the target code rate level is obtained; in step 1102, when it is determined that the target video meets the code rate level up-regulation condition according to the quality fraction and the pre-loading state of the video to be played, the code rate level is increased, and the target code rate level is obtained.
The number of videos to be played is a plurality of videos, namely the preloaded state of the videos to be played is the preloaded state of each of the videos to be played.
The code rate level down-regulating condition may be that the quality score is greater than a preset quality score, or that the number of the completion states in the preloaded states of the plurality of videos to be played is greater than at least one of the preset number, and the code rate level up-regulating condition may be that the quality score is not greater than the preset quality score, and that the number of the completion states in the preloaded states of the plurality of videos to be played is not greater than the preset number.
In some embodiments, when the quality is higher according to the quality score, or the network is more congested according to the pre-loading state of the video to be played, the code rate level can be reduced; or when the quality is higher according to the quality score, and the network is more congested according to the preloading state of the video to be played, the code rate level can be reduced.
It should be noted that, when the quality is higher, if the code rate level of the target video is adjusted down, the influence on the definition of the target video during playing is possibly smaller, the code rate level has an adjusting down space, so that the code rate level can be reduced; when the network is congested, the code rate level of the target video is adjusted downwards, so that the network congestion condition can be improved, and the preloading efficiency is improved.
When the quality is lower according to the quality score or the network is idle according to the preloading state of the video to be played, the code rate level can be improved; or when the quality is determined to be lower according to the quality score and the network is idle according to the preloading state of the video to be played, the code rate level can be improved.
When the quality is low, the code rate level of the target video can be adjusted upwards, and the definition of the target video during playing is improved; when the network is congested, the code rate level of the target video is adjusted downwards, so that the network congestion condition can be improved, and the preloading efficiency is improved.
In some embodiments, the mass fraction may be determined to be higher or lower based on a preset mass fraction, such as when the mass fraction is greater than the preset mass fraction, and lower when the mass fraction is less than or equal to the preset mass fraction; the preset mass fraction can be set according to actual requirements, and the value of the preset mass fraction is not limited in the embodiment of the application.
Whether the network is congested can be determined according to the number of the completion states in the preloaded states of the plurality of videos to be played, for example, if the number of the completion states is smaller than a preset number, the network is determined to be congested, and if the number of the completion states is not smaller than the preset number, the network is determined to be idle. The preset number may be smaller than or equal to the number of videos to be played, and the preset number may be set according to actual requirements.
In the above embodiment, according to the quality fraction and the pre-loading state of the video to be played, it is determined that the target video meets the condition of adjusting the code rate level downwards or the condition of adjusting the code rate level upwards, so that the target code rate level obtained by improving or reducing the code rate level can meet the definition requirement of playing, network bandwidth resources can be better utilized, the pre-loading efficiency is improved, the fluency of video switching playing is ensured, the balance between fluency playing and playing quality of the video is realized, and the experience of users for browsing the video is improved.
In some embodiments, when determining that the target video satisfies the code rate level down-regulation condition according to the quality score and the pre-loading state of the video to be played, reducing the code rate level to obtain the target code rate level includes: when the quality score belongs to a first quality score interval and the number of the completion states in the preloading state of the video to be played belongs to a preset interval, reducing the code rate level to obtain a target code rate level; when determining that the target video meets the code rate level up-regulation condition according to the mass fraction and the pre-loading state of the video to be played, increasing the code rate level to obtain the target code rate level, including: and when the quality score belongs to the second quality score interval and the number of the completion states in the preloading state of the video to be played does not belong to the preset interval, increasing the code rate level to obtain the target code rate level.
Wherein the mass fraction belonging to the first mass fraction interval is greater than the mass fraction belonging to the second mass fraction interval; the mass fraction belongs to the first mass fraction interval, and can be represented as higher mass fraction; the mass fraction belonging to the second mass fraction interval may represent a lower mass fraction.
Specifically, the first quality score interval may be an interval greater than a first preset score, and the second quality score interval may be an interval less than a second preset score, wherein the first preset score is greater than the second preset score; it should be noted that, the mass fraction is greater than the first preset fraction, which may indicate that the mass fraction is higher, and the mass fraction is smaller than the second preset fraction, which may indicate that the mass fraction is lower.
The preset interval may be an interval greater than a preset number, which may be equal to or less than the number of the plurality of videos to be played; when the number of the completion states in the preloading states of the videos to be played is larger than the preset number, the fact that the preloading degree of most of the videos to be played in the videos to be played is higher is indicated, and the network is idle; and when the number of the completion states in the preloading states of the videos to be played is not greater than the preset number, the method indicates that the preloading degree of most of the videos to be played in the videos to be played is low, and the network is relatively congested.
In some embodiments, when the mass fraction is greater than a first preset fraction and the number of completed states in the preloaded state of the video to be played is greater than the first preset fraction, reducing the code rate level according to the adjustment amount to obtain a target code rate level; and when the mass fraction is smaller than the second preset fraction and the number of the completion states in the preloaded state of the video to be played is not larger than the first preset fraction, the code rate level is improved according to the adjustment amount, and the target code rate level is obtained.
Illustratively, as shown in equation (3).
Wherein the target video is the M+1st video to be played, I M+1 Is the code rate information of the target video at the target code rate level, the code rate information comprises the code rate and the resolution of the target video at the target code rate level, in the example, the target code rate level is k+1 or k-1,1 is the adjustment quantity for increasing or decreasing the code rate level, k is the code rate level of the target video, br k-1 Is the code rate of the target video at the target code rate level k-1, W k-1 ,H k-1 Is the width and height of the resolution of the target video at the target code rate level k-1, br k+1 Is the code rate of the target video at the target code rate level k+1, W k+1 ,H k+1 Is the width and height of the resolution of the target video at the target code rate level k+1, quality k Is the quality fraction of the target video at the code rate level, Q Up Is a first preset fraction, Q Down Is a second predetermined fraction, S i The number of the completion states in the pre-loading state of the videos to be played is M, wherein M is a preset number which is equal to the number of the videos to be played.
It should be noted that, the status value indicates a preloaded state of the video to be played, for example, a completed state is indicated by a first status value, and an unfinished state is indicated by a second status value. Illustratively, the first state value may be 1 and the second state value may be 0, and further, S i Can be 0 or 1, thus Σs i Is the number of completed states in the preloaded state of the video to be played.
In the above embodiment, according to the mass fraction and the number of the completion states of the preloading states in the videos to be played, the code rate level of the target video is determined to be improved or reduced, the target code rate level of the target video is obtained, the video file under the target code rate level of the target video is preloaded, the playing definition requirement can be met, the network bandwidth resource can be better utilized, the preloading efficiency is improved, the fluency of video switching playing is ensured, the balance between fluent video playing and playing quality is realized, and the experience of users in browsing videos is improved.
In some embodiments, adjusting the code rate level according to the quality score and the preloading state of the video to be played to obtain the target code rate level includes: and when the target video is determined to not meet the code rate level down-regulation condition and the code rate level up-regulation condition according to the quality fraction and the preloading state of the video to be played, taking the code rate level as the target code rate level.
According to the quality scores and the preloading states of the videos to be played, it is determined that the target videos do not meet the code rate level down-regulation condition and do not meet the code rate level up-regulation condition, wherein the quality scores belong to a first quality score interval, the number of the completion states in the preloading states of the videos to be played is not larger than a preset number, the quality scores belong to a second quality score interval, the number of the completion states in the preloading states of the videos to be played is larger than a preset number, and the quality scores do not belong to the first quality score interval and do not belong to the second quality score interval.
When the quality score belongs to the first quality score interval and the number of the completion states in the preloading states of the videos to be played is larger than the preset number, the quality score is higher, the code rate level can be adjusted downwards, the playing quality of the target video is not affected after the code rate level is adjusted downwards, but when the number of the completion states in the preloading states of the videos to be played is larger than the preset number, namely when the network is idle, the video file with higher preloading quality score can not cause network congestion, and in order to ensure the high quality of video playing, the code rate level can not be adjusted.
When the quality score belongs to the second quality score interval and the number of the completion states in the preloading states of the videos to be played is larger than the preset number, the quality score is lower, the code rate grade can be improved, so that the playing quality of the target video is improved, but when the number of the completion states in the preloading states of the videos to be played is not larger than the preset number, that is, when the network is more congested, if the code rate grade is improved, the network congestion can be caused, and in order to ensure the fluency of video playing, the code rate grade can be not adjusted.
When the quality score does not belong to the first quality score interval or the second quality score interval, that is, when the quality score is smaller than or equal to the first preset score and larger than or equal to the second preset score, the quality score is indicated to be medium, accordingly, the data volume of the video file corresponding to the quality score is also medium, the video file corresponding to the quality score is preloaded, so that the quality of video playing is ensured, the fluency of video playing is not influenced, and the code rate level can not be adjusted.
Illustratively, as shown in equation (4).
I M+1 ={I(Br k ,W k ,H k ),
if(Q Down ≤Quality k ≤Q Up ),OR(Quality k >Q Up And Sigma S i =M),OR(Quality k <Q Down And Sigma S i <M) (4)
Wherein the target video is the M+1st video to be played, I M+1 Is the rate information of the target video at the target rate level, which includes the rate and resolution of the target video at the target rate level, in this example, the target rate level is k, which is also the rate level of the target video, br k Is the code rate of the target video under the condition that the target code rate level is k, W k ,H k Is the width and height of the resolution of the target video at the target code rate level k, quality k Is the quality fraction of the target video at the code rate level, Q Up Is a first preset fraction, Q Down Is a second predetermined fraction, S i The number of the completion states in the pre-loading state of the videos to be played is M, wherein M is a preset number which is equal to the number of the videos to be played.
In the above embodiment, when it is determined that the target video does not meet the condition of adjusting the code rate level down and does not meet the condition of adjusting the code rate level up according to the quality fraction and the pre-loading state of the video to be played, the code rate level is not adjusted, not only the definition requirement of playing can be met, but also the network bandwidth resource can be better utilized, the pre-loading efficiency is improved, the smoothness of video switching playing is ensured, the balance between the smooth video playing and the playing quality is realized, and the experience of users for browsing videos is improved.
In some embodiments, the video preloading method may be applied to a short video preloading scene, and as shown in fig. 12, a method in which a terminal and a server cooperatively execute video preloading is taken as an example for explanation.
When the terminal plays the current short video, the terminal sends a preloading request to the server, and the server sends a video file of the short video to be played according to the preloading request.
When the server issues the video file of the Mth short video to be played (i.e. the terminal preloads the video file of the Mth short video to be played), network bandwidth is obtained, the server obtains the code rate of the target video (the Mth+1th short video to be played) under each preset code rate level, and according to the network bandwidth and the code rate of the Mth+1th short video to be played under each preset code rate level, the target code rate of the Mth+1th short video to be played is determined, and then the preset code rate level corresponding to the target code rate is used as the code rate level k of the Mth+1th short video to be played.
The server determines the quality fraction Q of the video files of the M+1st short video to be played at the code rate level k, and obtains the respective preloading states of the video files of the 1 st to M short videos to be played.
In this example, according to the quality score Q and the respective preloading states of the video files of the 1 st to M short videos to be played, determining that the rate up-regulation condition is met, determining that the target rate level of the m+1st short video to be played is k+1, and further, the server issues the video file of the m+1st short video to be played at the target rate level k+1, so that the terminal preloads the video file of the m+1st short video to be played at the target rate level k+1.
It should be noted that, when determining that the code rate down-regulation condition is satisfied according to the quality score Q and the respective preloading states of the video files of the 1 st to M short videos to be played, determining that the target code rate level of the m+1st short video to be played is k-1, and further the server issues the video file of the m+1st short video to be played at the target code rate level k-1, so that the terminal preloads the video file of the m+1st short video to be played at the target code rate level k-1.
When the condition that the code rate up-regulation is not met or the condition that the code rate down-regulation is not met is determined according to the quality fraction Q and the respective preloading states of the video files of the 1 st to M short videos to be played, the code rate grade is not adjusted, and the server transmits the video file of the M+1st short video to be played at the code rate grade k, so that the terminal preloads the video file of the M+1st short video to be played at the code rate grade 1.
In some embodiments, as shown in fig. 13, the method of preloading video includes:
step 1301, acquiring a network bandwidth in the process of preloading a first video to be played;
step 1302, obtaining code rates of a target video under each preset code rate level respectively; selecting a code rate which is smaller than the network bandwidth and adjacent to the network bandwidth from the code rates under each preset code rate level; taking the selected code rate as a target code rate; taking the preset code rate level corresponding to the target code rate as the code rate level corresponding to the target video; the target video is a video after the first video to be played in the preloading sequence;
Step 1303, determining similarity parameters of the target video according to the video file corresponding to the target video at the code rate level and the video file corresponding to the target video at the original code rate level;
step 1304A, when the similarity parameter meets the similarity condition, obtaining the resolution of the video file corresponding to the target video at the code rate level, and determining a first quality fraction according to the resolution and the resolution parameter; determining a second quality score according to the similarity parameter and the similarity threshold; determining the quality score of the video file corresponding to the target video under the code rate level according to the first quality score and the second quality score;
step 1304B, when the similarity parameter does not meet the similarity condition, taking the preset quality score as the quality score of the video file corresponding to the target video under the code rate level;
step 1305, obtaining a preloading parameter of a video to be played; the preloading parameters comprise preloading time length or preloading data quantity; when the preloading duration meets the first loading condition or the preloading data quantity meets the second loading condition, determining that the preloading state of the video to be played is a completion state; when the preloading duration does not meet the first loading condition and the preloading data quantity does not meet the second loading condition, determining that the preloading state of the video to be played is an unfinished state;
Step 1306A, when the quality score belongs to a first quality score interval and the number of the completion states in the preloading state of the video to be played belongs to a preset interval, reducing the code rate level to obtain a target code rate level; the video to be played comprises a first video to be played and a second video to be played, wherein the second video to be played is a video with a preloading sequence before the first video to be played;
step 1306B, when the quality score belongs to a second quality score interval and the number of the completion states in the preloading state of the video to be played does not belong to a preset interval, increasing the code rate level to obtain a target code rate level;
step 1306C, when the target video is determined to not meet the code rate level down-regulation condition and not meet the code rate level up-regulation condition according to the quality fraction and the preloading state of the video to be played, taking the code rate level as the target code rate level;
step 1307, preloading the video file corresponding to the target video at the target code rate level.
In the video preloading method, in the process of preloading the first video to be played, acquiring network bandwidth, determining a code rate grade corresponding to the target video according to the network bandwidth, and adjusting the code rate grade according to the quality fraction of the video file corresponding to the target video under the code rate grade and the preloading state of the video to be played to obtain the target code rate grade; the network bandwidth, the quality fraction and the preloading state of the video to be played are combined to determine the target code rate level, so that the playing quality of the target video is ensured, meanwhile, in the process of preloading the video file of the target video under the target code rate level, the network bandwidth resource can be better utilized, the preloading efficiency is improved, the fluency of video switching playing is ensured, the balance between fluent video playing and playing quality is realized, and the experience of a user for browsing the video is improved.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a video preloading device for realizing the video preloading method. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation in the embodiments of the preloading device for one or more videos provided below may refer to the limitation of the preloading method for videos described above, and will not be repeated here.
In some embodiments, as shown in fig. 14, there is provided a video preloading device, comprising: a network bandwidth acquisition module 1401, a code rate level determination module 1402, a quality score determination module 1403, a code rate level adjustment module 1404, and a preload module 1405, wherein:
a network bandwidth obtaining module 1401, configured to obtain a network bandwidth in a process of preloading a first video to be played;
a code rate level determining module 1402, configured to determine a code rate level corresponding to the target video according to the network bandwidth; the target video is a video after the first video to be played in the preloading sequence;
a quality score determining module 1403, configured to determine a quality score of a video file corresponding to the target video at the code rate level;
the code rate level adjustment module 1404 is configured to adjust the code rate level according to the mass fraction and the pre-loading state of the video to be played, so as to obtain a target code rate level; the video to be played comprises a first video to be played and a second video to be played, wherein the second video to be played is a video with a preloading sequence before the first video to be played;
the preloading module 1405 is configured to preload a video file corresponding to the target video at the target bitrate level.
In some embodiments, the code rate level determining module 1402 is further configured to obtain code rates of the target video at preset code rate levels, respectively; selecting a target code rate from the code rates under each preset code rate level according to the network bandwidth; and taking the preset code rate grade corresponding to the target code rate as the code rate grade corresponding to the target video.
In some embodiments, the code rate level determining module 1402 is further configured to select, from code rates at preset code rate levels, a code rate that is less than the network bandwidth and that is adjacent to the network bandwidth; and taking the selected code rate as a target code rate.
In some embodiments, the quality score determining module 1403 is further configured to determine a similarity parameter of the target video according to the video file corresponding to the target video at the code rate level and the video file corresponding to the target video at the original code rate level; when the similarity parameters meet the similarity conditions, acquiring the resolution of a video file corresponding to the target video at the code rate level; and determining the quality fraction of the video file corresponding to the target video under the code rate level according to the resolution and the similarity parameters.
In some embodiments, the quality score determination module 1403 is further configured to determine a first quality score according to the resolution and the resolution parameter; determining a second quality score according to the similarity parameter and the similarity threshold; and determining the quality score of the video file corresponding to the target video under the code rate level according to the first quality score and the second quality score.
In some embodiments, the quality score determining module 1403 is further configured to determine a similarity parameter of the target video according to the video file corresponding to the target video at the code rate level and the video file corresponding to the target video at the original code rate level; and when the similarity parameters do not meet the similarity conditions, taking the preset quality score as the quality score of the video file corresponding to the target video under the code rate level.
In some embodiments, the video preloading device further comprises: the preloading state determining module is used for acquiring preloading parameters of the video to be played; determining a preloading state of the video to be played according to the preloading parameters; the preloaded state is a complete state or an incomplete state.
In some embodiments, the preload parameters include a preload duration or a preload data size; the pre-loading state determining module is further configured to determine that the pre-loading state of the video to be played is a complete state when the pre-loading time length meets a first loading condition or the pre-loading data amount meets a second loading condition; and when the preloading duration does not meet the first loading condition and the preloading data quantity does not meet the second loading condition, determining that the preloading state of the video to be played is an unfinished state.
In some embodiments, the code rate level adjustment module 1404 is configured to reduce the code rate level to obtain a target code rate level when it is determined that the target video meets the code rate level down-adjustment condition according to the quality score and the pre-load state of the video to be played; and when the target video is determined to meet the code rate level up-regulation condition according to the mass fraction and the pre-loading state of the video to be played, the code rate level is improved, and the target code rate level is obtained.
In some embodiments, the code rate level adjustment module 1404 is further configured to reduce the code rate level when the quality score belongs to a first quality score interval and the number of completed states in the preloaded state of the video to be played belongs to a preset interval, so as to obtain a target code rate level; and when the quality score belongs to the second quality score interval and the number of the completion states in the preloading state of the video to be played does not belong to the preset interval, increasing the code rate level to obtain the target code rate level.
In some embodiments, the code rate level adjustment module 1404 is further configured to, when it is determined that the target video does not satisfy the code rate level down-adjustment condition and does not satisfy the code rate level up-adjustment condition according to the quality score and the pre-load state of the video to be played, take the code rate level as the target code rate level.
The various modules in the video preloading device described above may be implemented in whole or in part in software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
The video preloading device obtains the network bandwidth in the process of preloading the first video to be played, determines the code rate grade corresponding to the target video according to the network bandwidth, and adjusts the code rate grade according to the quality fraction of the video file corresponding to the target video under the code rate grade and the preloading state of the video to be played to obtain the target code rate grade; the network bandwidth, the quality fraction and the preloading state of the video to be played are combined to determine the target code rate level, so that the playing quality of the target video is ensured, meanwhile, in the process of preloading the video file of the target video under the target code rate level, the network bandwidth resource can be better utilized, the preloading efficiency is improved, the fluency of video switching playing is ensured, the balance between fluent video playing and playing quality is realized, and the experience of a user for browsing the video is improved.
In some embodiments, a computer device is provided, which may be a terminal or a server, and the internal structure of which may be as shown in fig. 15. The computer device includes a processor, a memory, an Input/Output interface (I/O) and a communication interface. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface is connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used for storing data related to the preloading method of the video. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of preloading video.
It will be appreciated by those skilled in the art that the structure shown in fig. 15 is merely a block diagram of a portion of the structure associated with the present application and is not limiting of the computer device to which the present application is applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In some embodiments, a computer device is provided comprising a memory and a processor, the memory having stored therein a computer program, the processor when executing the computer program performing the steps of:
acquiring network bandwidth in the process of preloading a first video to be played; determining the code rate level corresponding to the target video according to the network bandwidth; the target video is a video after the first video to be played in the preloading sequence; determining the quality fraction of a video file corresponding to the target video under the code rate level; adjusting the code rate level according to the quality fraction and the preloading state of the video to be played to obtain a target code rate level; the video to be played comprises a first video to be played and a second video to be played, wherein the second video to be played is a video with a preloading sequence before the first video to be played; and preloading the video file corresponding to the target video at the target code rate level.
In some embodiments, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring network bandwidth in the process of preloading a first video to be played; determining the code rate level corresponding to the target video according to the network bandwidth; the target video is a video after the first video to be played in the preloading sequence; determining the quality fraction of a video file corresponding to the target video under the code rate level; adjusting the code rate level according to the quality fraction and the preloading state of the video to be played to obtain a target code rate level; the video to be played comprises a first video to be played and a second video to be played, wherein the second video to be played is a video with a preloading sequence before the first video to be played; and preloading the video file corresponding to the target video at the target code rate level.
In some embodiments, a computer program product is provided comprising a computer program which, when executed by a processor, performs the steps of:
acquiring network bandwidth in the process of preloading a first video to be played; determining the code rate level corresponding to the target video according to the network bandwidth; the target video is a video after the first video to be played in the preloading sequence; determining the quality fraction of a video file corresponding to the target video under the code rate level; adjusting the code rate level according to the quality fraction and the preloading state of the video to be played to obtain a target code rate level; the video to be played comprises a first video to be played and a second video to be played, wherein the second video to be played is a video with a preloading sequence before the first video to be played; and preloading the video file corresponding to the target video at the target code rate level.
It should be noted that, the user information (including, but not limited to, user equipment information, user personal information, etc.) and the data (including, but not limited to, data for analysis, stored data, presented data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party, and the collection, use, and processing of the related data are required to meet the related regulations.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the various embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the various embodiments provided herein may include at least one of relational databases and non-relational databases. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic units, quantum computing-based data processing logic units, etc., without being limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples only represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the present application. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application shall be subject to the appended claims.

Claims (15)

1. A method of preloading video, the method comprising:
acquiring network bandwidth in the process of preloading a first video to be played;
determining the code rate grade corresponding to the target video according to the network bandwidth; the target video is a video with a preloading sequence after the first video to be played;
determining the quality fraction of a video file corresponding to the target video at the code rate level;
Adjusting the code rate level according to the quality fraction and the preloading state of the video to be played to obtain a target code rate level; the video to be played comprises the first video to be played and a second video to be played, wherein the second video to be played is a video with a preloading sequence before the first video to be played;
and preloading a video file corresponding to the target video at the target code rate level.
2. The method according to claim 1, wherein determining the code rate level corresponding to the target video according to the network bandwidth comprises:
the code rate of the target video under each preset code rate level is respectively obtained;
selecting a target code rate from the code rates at each preset code rate level according to the network bandwidth;
and taking the preset code rate grade corresponding to the target code rate as the code rate grade corresponding to the target video.
3. The method according to claim 2, wherein selecting a target code rate from the code rates at each of the preset code rate levels according to the network bandwidth comprises:
selecting a code rate which is smaller than the network bandwidth and adjacent to the network bandwidth from the code rates at the preset code rate levels;
And taking the selected code rate as a target code rate.
4. The method of claim 1, wherein determining the quality score of the video file to which the target video corresponds at the bitrate level comprises:
determining similarity parameters of the target video according to the video file corresponding to the target video at the code rate level and the video file corresponding to the target video at the original code rate level;
when the similarity parameters meet the similarity conditions, obtaining the resolution of the video file corresponding to the target video at the code rate level;
and determining the quality fraction of the video file corresponding to the target video under the code rate level according to the resolution and the similarity parameter.
5. The method of claim 4, wherein determining the quality score of the video file corresponding to the target video at the bitrate level according to the resolution and the similarity parameter comprises:
determining a first mass fraction according to the resolution and the resolution parameter;
determining a second quality score according to the similarity parameter and a similarity threshold;
And determining the quality fraction of the video file corresponding to the target video under the code rate level according to the first quality fraction and the second quality fraction.
6. The method of claim 1, wherein determining the quality score of the video file to which the target video corresponds at the bitrate level comprises:
determining similarity parameters of the target video according to the video file corresponding to the target video at the code rate level and the video file corresponding to the target video at the original code rate level;
and when the similarity parameters do not meet the similarity conditions, taking the preset quality score as the quality score of the video file corresponding to the target video under the code rate level.
7. The method of claim 1, wherein adjusting the bitrate according to the quality score and the pre-load status of the video to be played, before obtaining the target bitrate, further comprises:
acquiring the preloading parameters of the video to be played;
determining the preloading state of the video to be played according to the preloading parameters; the preloaded state is a complete state or an incomplete state.
8. The method of claim 7, wherein the preload parameter comprises a preload duration or a preload data size; the determining the pre-loading state of the video to be played according to the pre-loading parameters includes:
when the preloading time length meets a first loading condition or the preloading data quantity meets a second loading condition, determining that the preloading state of the video to be played is the completion state;
and when the preloading duration does not meet the first loading condition and the preloading data amount does not meet the second loading condition, determining that the preloading state of the video to be played is the unfinished state.
9. The method according to any one of claims 1 to 8, wherein said adjusting the bitrate level according to the quality score and the preloaded state of the video to be played, to obtain a target bitrate level, comprises:
when the target video is determined to meet the code rate level down-regulation condition according to the quality fraction and the preloading state of the video to be played, the code rate level is reduced, and the target code rate level is obtained;
and when the target video is determined to meet the code rate level up-regulation condition according to the quality fraction and the preloading state of the video to be played, the code rate level is improved, and the target code rate level is obtained.
10. The method according to claim 9, wherein when the target video is determined to satisfy a bitrate level down condition according to the quality score and the pre-load state of the video to be played, reducing the bitrate level to obtain a target bitrate level includes:
when the quality score belongs to a first quality score interval and the number of the completion states in the preloading state of the video to be played belongs to a preset interval, reducing the code rate level to obtain a target code rate level;
when the target video is determined to meet the code rate level up-regulation condition according to the quality fraction and the pre-loading state of the video to be played, the code rate level is raised to obtain the target code rate level, which comprises the following steps:
and when the quality score belongs to a second quality score interval and the number of the completion states in the preloading state of the video to be played does not belong to the preset interval, the code rate grade is improved, and the target code rate grade is obtained.
11. The method according to any one of claims 1 to 8, wherein said adjusting the bitrate level according to the quality score and the preloaded state of the video to be played, to obtain a target bitrate level, comprises:
And when the target video does not meet the code rate level down-regulation condition and does not meet the code rate level up-regulation condition according to the quality fraction and the preloading state of the video to be played, taking the code rate level as a target code rate level.
12. A video preloading device, said device comprising:
the network bandwidth acquisition module is used for acquiring network bandwidth in the process of preloading the first video to be played;
the code rate grade determining module is used for determining the code rate grade corresponding to the target video according to the network bandwidth; the target video is a video with a preloading sequence after the first video to be played;
the quality score determining module is used for determining the quality score of the video file corresponding to the target video under the code rate level;
the code rate level adjustment module is used for adjusting the code rate level according to the mass fraction and the preloading state of the video to be played to obtain a target code rate level; the video to be played comprises the first video to be played and a second video to be played, wherein the second video to be played is a video with a preloading sequence before the first video to be played;
And the preloading module is used for preloading the video file corresponding to the target video at the target code rate level.
13. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any one of claims 1 to 11 when the computer program is executed.
14. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 11.
15. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any one of claims 1 to 11.
CN202311455968.9A 2023-11-02 2023-11-02 Video preloading method, device, computer equipment and storage medium Pending CN117376645A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311455968.9A CN117376645A (en) 2023-11-02 2023-11-02 Video preloading method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311455968.9A CN117376645A (en) 2023-11-02 2023-11-02 Video preloading method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117376645A true CN117376645A (en) 2024-01-09

Family

ID=89394579

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311455968.9A Pending CN117376645A (en) 2023-11-02 2023-11-02 Video preloading method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117376645A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117560525A (en) * 2024-01-11 2024-02-13 腾讯科技(深圳)有限公司 Data processing method, device, equipment and readable storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117560525A (en) * 2024-01-11 2024-02-13 腾讯科技(深圳)有限公司 Data processing method, device, equipment and readable storage medium
CN117560525B (en) * 2024-01-11 2024-04-19 腾讯科技(深圳)有限公司 Data processing method, device, equipment and readable storage medium

Similar Documents

Publication Publication Date Title
US11983850B2 (en) Image processing method and apparatus, device, and storage medium
EP4156017A1 (en) Action recognition method and apparatus, and device and storage medium
EP3815042B1 (en) Image display with selective depiction of motion
JP2023523029A (en) Image recognition model generation method, apparatus, computer equipment and storage medium
US20220053195A1 (en) Learning-based image compression setting
CN110689599A (en) 3D visual saliency prediction method for generating countermeasure network based on non-local enhancement
CN117376645A (en) Video preloading method, device, computer equipment and storage medium
CN112330684B (en) Object segmentation method and device, computer equipment and storage medium
CN110489574B (en) Multimedia information recommendation method and device and related equipment
WO2023103576A1 (en) Video processing method and apparatus, and computer device and storage medium
CN113966247A (en) Predictive data preloading
CN110210558B (en) Method and device for evaluating performance of neural network
CN114339362B (en) Video bullet screen matching method, device, computer equipment and storage medium
US20240126810A1 (en) Using interpolation to generate a video from static images
CN113011210B (en) Video processing method and device
CN111080746A (en) Image processing method, image processing device, electronic equipment and storage medium
CN112307243B (en) Method and apparatus for retrieving images
CN113868523A (en) Recommendation model training method, electronic device and storage medium
CN111652073B (en) Video classification method, device, system, server and storage medium
CN111159450A (en) Picture classification method and device, computer equipment and storage medium
CN116258923A (en) Image recognition model training method, device, computer equipment and storage medium
CN113505247B (en) Content-based high-duration video pornography content detection method
WO2023218413A1 (en) Method and electronic device for generating a segment of a video
CN117915088A (en) Video processing method, video processing device, electronic equipment and computer readable storage medium
CN117540076A (en) Sequence recommendation coarse ranking method and device based on feature enhancement

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication