Video code rate determination method, electronic equipment and computer readable storage medium
By determining the video stream and audio stream of the encrypted video in the dual-stream transmission mode, and using audio data to calculate the video duration and finally determine the video code rate, the problem of difficulty in accurately evaluating the encrypted video video code rate in the prior art is solved, and a more accurate video code rate evaluation is achieved.
Patent Information
- Application Number
- CN202311343151.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-16
- Publication Date
- 2025-04-18
AI Technical Summary
The prior art is difficult to accurately determine the video code rate of encrypted video in dual-stream transmission mode.
By determining the video stream and audio stream when downloading encrypted video in dual-stream transmission mode, the video duration is calculated based on the total audio data download volume of the audio stream and the preset audio code rate, and the video code rate is determined based on the total data download volume of the video stream and the audio stream and the video duration.
The accurate determination of the video code rate of encrypted video in dual-stream transmission mode is achieved, and the accuracy of video code rate evaluation is improved.
Smart Images

Figure CN119854512A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of video processing technology, and in particular to a method for determining a video bit rate, an electronic device, and a computer-readable storage medium. Background Art
[0002] For online videos, the quality of their network playback is an important indicator of user experience. Generally, when evaluating the quality of online video playback, you can first obtain the video bit rate of the online video, determine the playback smoothness of the online video based on the video bit rate, and then evaluate the online video playback quality based on the playback smoothness. Among them, if the online video network playback quality is poor, the online video can be optimized accordingly to improve the user experience.
[0003] In the related art, when obtaining the video bitrate of an online video, the Deep Packet Inspection (DPI) technology can usually be used to obtain it from the media description of the video stream transmission header file. However, when the video is transmitted using an encrypted protocol, the Deep Packet Inspection technology will not be able to obtain the video bitrate from the media description. Therefore, it is necessary to obtain the video bitrate of the encrypted video through other means. At present, the transmission mode of encrypted video can be divided into two categories: single-stream transmission mode (that is, audio and video are transmitted using the same data stream) and dual-stream transmission mode (that is, audio and video are transmitted using different data streams). For encrypted video in the dual-stream transmission mode, there is currently a lack of an effective technical solution that can more accurately obtain its video bitrate. Summary of the invention
[0004] The present application provides a method for determining a video bit rate, an electronic device, and a computer-readable storage medium, which are used to solve the problem of how to determine the video bit rate for encrypted video in a dual-stream transmission mode.
[0005] To solve the above technical problems, this application is implemented as follows:
[0006] In a first aspect, a method for determining a video bit rate is provided, comprising:
[0007] In dual-stream transmission mode, determine the video stream and audio stream obtained when downloading the encrypted video;
[0008] Determining a first duration according to a total amount of audio data downloaded corresponding to the audio stream and a preset audio bit rate;
[0009] The video bit rate of the encrypted video is determined according to the total amount of video data downloaded corresponding to the video stream, the total amount of audio data downloaded, and the first duration.
[0010] In a second aspect, an electronic device is provided, including:
[0011] processor;
[0012] a memory for storing instructions executable by the processor;
[0013] The processor is configured to execute the instructions to implement the method as described in the first aspect.
[0014] According to a third aspect, a computer-readable storage medium is provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method according to the first aspect.
[0015] In an embodiment of the present application, when determining the video bit rate of an encrypted video in a dual-stream transmission mode, the video stream and audio stream obtained when the encrypted video is downloaded can be determined first, and then the first duration can be determined according to the total amount of audio data downloaded corresponding to the audio stream and the preset audio bit rate, and finally the video bit rate of the encrypted video can be determined according to the total amount of audio data downloaded corresponding to the audio stream, the total amount of video data downloaded corresponding to the video stream, and the first duration. Since the audio bit rate of the encrypted video in the dual-stream transmission mode is relatively fixed, a relatively accurate video duration (i.e., the first duration) can be obtained based on the audio bit rate of the encrypted video and the total amount of audio data downloaded obtained when the encrypted video is downloaded, and a relatively accurate video bit rate can be obtained based on the video duration and the total amount of audio and video data downloaded obtained when the encrypted video is downloaded. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the present application or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0017] FIG1( a ) is a schematic diagram of a video stream in which an encrypted video is smoothly played in a dual-stream transmission mode;
[0018] FIG1( b ) is a schematic diagram of an audio stream for smooth playback of encrypted video in dual-stream transmission mode;
[0019] FIG2( a ) is a schematic diagram of a video stream in which an encrypted video is played back in a stuttering manner in a dual-stream transmission mode;
[0020] FIG2( b ) is a schematic diagram of an audio stream of an encrypted video with a stuck playback in dual-stream transmission mode;
[0021] Figure 3 It is a flowchart of a method for determining a video bit rate according to an embodiment of the present application;
[0022] Figure 4is a schematic diagram of the structure of an electronic device according to an embodiment of the present application;
[0023] Figure 5 It is a structural diagram of a device for determining a video bit rate according to an embodiment of the present application. DETAILED DESCRIPTION
[0024] When determining the video bitrate, for non-encrypted videos, the DPI technology can be used to obtain it from the media description of the video stream transmission header file. However, for encrypted videos, since they are transmitted using an encryption protocol, the DPI technology cannot be used to obtain the video bitrate. Generally, encrypted videos can be transmitted in a single-stream transmission mode or a dual-stream transmission mode. In the relevant technology, for encrypted videos in a single-stream transmission mode, there are relatively mature solutions to determine their video bitrates, but for encrypted videos in a dual-stream transmission mode, it is currently impossible to effectively obtain their video bitrates.
[0025] In order to obtain the video bit rate of the encrypted video in the dual-stream transmission mode, the applicant analyzed the audio stream and video stream of the encrypted video in the two playback scenarios of smooth playback and stuttering playback, and obtained the analysis results shown in Figures 1 and 2. In Figures 1 and 2, each rectangular column represents a data block, the top edge time of the column is the download start timestamp of the data block, the bottom edge time of the column is the download completion timestamp of the data block, the column height is the data size of the data block, the horizontal axis represents time (in seconds), and the vertical axis represents the download amount of the data block (in B).
[0026] Figure 1(a) is a schematic diagram of the video stream of the encrypted video in the dual-stream transmission mode, and Figure 1(b) is a schematic diagram of the audio stream of the encrypted video in the dual-stream transmission mode. Among them, the data stream transmission fragment size of port 41909 is uncertain, which is the video stream, and the data stream transmission fragment size of port 40200 is about 12.5kB, which is the audio stream.
[0027] Figure 2(a) is a schematic diagram of the video stream of the encrypted video with stuttering in the dual-stream transmission mode, and Figure 2(b) is a schematic diagram of the audio stream of the encrypted video with stuttering in the dual-stream transmission mode. Among them, a few data blocks in the audio stream 38722 are too large, and the stuttering causes some data blocks to overlap, while the download data volume of most other data blocks is similar.
[0028] It can be seen from Figures 1 and 2 that no matter whether the encrypted video is played in a stuttering or smooth manner in the dual-stream transmission mode, the data blocks of the audio stream are smaller than the data blocks of the video stream, and the sizes of most data blocks of the audio stream are within a certain range.
[0029] Based on the above analysis results, combined with the fact that the audio bit rate of encrypted video in dual-stream transmission mode is relatively fixed, the applicant has proposed a technical solution for determining the video bit rate of encrypted video. When determining the video bit rate of encrypted video in dual-stream transmission mode, the technical solution can first determine the video stream and audio stream obtained when downloading the encrypted video, and then determine the first duration according to the total amount of audio data downloaded corresponding to the audio stream and the preset audio bit rate, and finally determine the video bit rate of the encrypted video according to the total amount of audio data downloaded corresponding to the audio stream, the total amount of video data downloaded corresponding to the video stream, and the first duration. In this way, the video bit rate of the encrypted video can be effectively obtained.
[0030] In order to enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in this application will be described clearly and completely below in conjunction with the drawings in one or more embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0031] The terms "first", "second", etc. in the present application and claims are used to distinguish similar objects, and are not used to describe a particular order or precedence. It should be understood that the data used in this way can be interchanged where appropriate so that the present application can be implemented in an order other than those illustrated or described herein. In addition, "and / or" in the present application and claims means at least one of the connected objects, and the character " / " generally means that the objects associated with each other are in an "or" relationship.
[0032] In order to facilitate understanding of the technical solutions provided by the embodiments of the present application, the terms involved in the embodiments of the present application will be explained below.
[0033] Video bit rate / audio bit rate: the number of data bits transmitted per unit time during data transmission, which can be expressed in kbps (kilobits per second).
[0034] Data stream: is a set of ordered data sequences of bytes with a start point and an end point. For encrypted video, in dual-stream transmission mode, the video data and audio data of the encrypted video are transmitted using different data streams. The video data of the encrypted video is transmitted using a video stream, and the audio data is transmitted using an audio stream. Here, both the video stream and the audio stream are data streams. In addition, the encrypted video may also include other data streams, such as a heartbeat stream, etc. In dual-stream transmission mode, these data streams can be transmitted in parallel with the audio stream and video stream of the encrypted video.
[0035] Data packet: The smallest unit of encrypted video transmission statistics is the data packet, which is usually only a few kB.
[0036] Data block: When downloading a video, for each video stream, the download process includes: A. Sending a download request uplink (i.e., an uplink Request request); B. Transmitting video data downlink; C. Sending a download request uplink to request downloading the next video clip. Among them, two uplink download requests represent a complete data block download, and accordingly, the downlink data downloaded between the two uplink download requests corresponds to a complete data block. Among them, each data stream of the encrypted video (the above-mentioned audio stream, video stream, heartbeat stream, etc.) can include multiple data blocks, each data block can include multiple data packets, and each data block can include at least the following information:
[0037] (1) The starting timestamp, i.e., the time when the uplink request is sent;
[0038] (2) Download completion timestamp, i.e. the time when the download is completed;
[0039] (3) The next request start timestamp, that is, the time when the next request is sent;
[0040] (4) Download data size (bytes), that is, the size of the data block.
[0041] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0042] Figure 3 FIG. 1 is a flow chart of a method for determining a video bit rate according to an embodiment of the present application. The method for determining a video bit rate is as follows.
[0043] S302: In the dual-stream transmission mode, determine the video stream and audio stream obtained when downloading the encrypted video.
[0044] When determining the video bitrate of an encrypted video in a dual-stream transmission mode, the encrypted video can be downloaded from a server that provides the encrypted video (such as a server corresponding to a certain video APP). In the dual-stream transmission mode, when downloading an encrypted video, the video data and audio data of the encrypted video are transmitted in parallel in different data streams (i.e., video stream and audio stream). In addition, the encrypted video may also include other data streams during transmission, such as a heartbeat stream, etc. These data streams will be transmitted in parallel with the audio stream and video stream of the encrypted video. In this way, after downloading the encrypted video, multiple data streams can be obtained. After obtaining multiple data streams, it is possible to determine which is the audio stream and which is the video stream from the multiple data streams, so that the video bitrate of the encrypted video can be determined based on the audio stream and the video stream.
[0045] Optionally, in some implementations, determining the audio stream and the video stream obtained when downloading the encrypted video may include the following steps:
[0046] In the dual-stream transmission mode, multiple data streams obtained when downloading the encrypted video are determined, each data stream including multiple data blocks;
[0047] A video stream and an audio stream are determined from the plurality of data streams based on the plurality of data blocks respectively included in the plurality of data streams.
[0048] Since the encrypted video may include multiple data streams (audio stream, video stream, heartbeat stream, etc.) when transmitted in dual-stream transmission mode, when determining the video stream and audio stream, it is first necessary to download multiple data streams of the encrypted video, that is, extract multiple data streams of the encrypted video, and then further identify which data stream is the audio stream and which data stream is the video stream from the multiple data streams. When downloading multiple data streams, each data stream can correspond to multiple data blocks, and one data block can correspond to the downlink data downloaded between two uplink download requests.
[0049] Optionally, in some implementations, for each data stream, multiple data blocks in the data stream may be determined in the following manner:
[0050] In the process of downloading the data stream, determining a plurality of download requests from a plurality of uplink requests;
[0051] The data downloaded between each two adjacent download requests in the multiple download requests are determined as a data block, thereby obtaining multiple data blocks.
[0052] For any data stream of the encrypted video, when downloading the data stream, multiple uplink requests can be sent to the server, and each uplink request can correspond to an uplink data packet. In addition to the download request data packet, the uplink data packet can also include other data packets, such as heartbeat packets, etc. Therefore, when extracting data blocks, it is necessary to identify which data packets are download request data packets from these uplink data packets, that is, to determine which requests are download requests from multiple uplink requests, so as to ensure the accurate extraction of data blocks and avoid missing statistics or over-statistics.
[0053] Since download request data packets are usually large and other uplink data packets are usually small, when determining the download request from the uplink request, it is possible to determine for each uplink request whether the data packet size of the uplink request is greater than the preset threshold. If it is, it can be considered that the uplink request may be a download request, and the uplink request can be used as the first download request. If it is not, it can be considered that the uplink request is other uplink data packets, and the uplink request can be ignored. The preset threshold can be set according to the specific download situation of the video. For example, for a video in a video APP, when downloading the video, the download request data packet is generally around 600-700B, and other uplink data packets are generally around tens of B, so the preset threshold can be set to 255B.
[0054] After screening multiple uplink requests based on the preset threshold, multiple first download requests can be obtained. Considering that there may be invalid download requests among the multiple first download requests, in order to ensure accurate extraction of data blocks and avoid missing statistics or over-statistics, after obtaining multiple first download requests, the multiple first download requests can also be screened to obtain valid download requests and filter out invalid download requests.
[0055] When screening multiple first download requests, optionally, in some implementations, for each two adjacent first download requests in time, it can be determined whether the time interval between the sending times of the two first download requests is greater than a preset time length. If so, the two first download requests can be considered valid download requests. If not, it can be considered that there is an invalid download request in the two first download requests. At this time, the latter of the two first download requests can be considered as an invalid download request, and the invalid download request can be filtered out. In this way, by performing the aforementioned analysis and judgment on each two adjacent first download requests in the multiple first download requests, multiple valid first download requests can be finally obtained, and the multiple valid first download requests are the multiple download requests determined from the multiple uplink requests.
[0056] It should be noted that the reason why the preset duration is used as the basis for judging whether the download request is valid is that the downlink data downloaded between two download requests corresponds to a complete data block, and the data block is generally large and usually takes a certain amount of time to download. If the time interval between the two download requests is short, a complete data block cannot be successfully downloaded, or it can be considered that the downloaded data is unavailable. Therefore, one of the download requests needs to be ignored. In an embodiment of the present application, the latter of the two download requests can be regarded as an invalid download request and ignored. Of course, the former download request can also be regarded as an invalid download request, which is not specifically limited here. Among them, the preset duration can be less than the download duration corresponding to a data block, which can be determined based on the actual download situation of the video, such as 0.2s, etc., which is not specifically limited here.
[0057] Of course, in other possible implementations, other methods may be used to determine whether a download request is valid. For example, after obtaining multiple first download requests, the size of the data downloaded between each two adjacent first download requests may be determined. If the downloaded data is less than a preset value, the downloaded data may be considered invalid, and the previous or next download request of the two first download requests may be determined as an invalid download request. If the downloaded data is greater than or equal to the preset value, the two first download requests may be considered valid download requests.
[0058] After determining multiple download requests from multiple uplink requests, data downloaded between two temporally adjacent download requests in the multiple download requests may be taken as a data block, thereby obtaining multiple data blocks corresponding to one data stream.
[0059] After a data stream is downloaded based on the above method, multiple data streams may be downloaded based on the same method, each data stream including multiple data blocks.
[0060] After the multiple data streams are downloaded and obtained, the video stream and the audio stream can be determined from the multiple data streams according to the multiple data blocks respectively included in the multiple data streams.
[0061] Optionally, in some implementations, determining the video stream and the audio stream from the multiple data streams according to the multiple data blocks respectively included in the multiple data streams may include the following S3021 to S3023:
[0062] S3021: For each data stream, determine an average downloaded data volume of multiple data blocks included in the data stream.
[0063] For each data stream, an average download amount of the multiple data blocks may be equal to a ratio between a total download amount of the multiple data blocks and the number of the multiple data blocks.
[0064] S3022: Determine a first data stream and a second data stream from the multiple data streams according to the average downloaded data volume, wherein the average downloaded data volume of the first data stream and the second data stream is greater than the average downloaded data volume of the remaining data streams in the multiple data streams.
[0065] For multiple data streams of encrypted video, since the video stream and the audio stream are the main transmission data, the average download amount is usually larger than that of other data streams. Therefore, after obtaining the average download amount of each of the multiple data streams, two data streams with the largest average download amount can be screened out from the multiple data streams according to the average download amount. For easy distinction, the two data streams can be represented as a first data stream and a second data stream. The first data stream and the second data stream are possible audio streams and video streams.
[0066] Optionally, after obtaining the average download amount of each of the multiple data streams, the multiple data streams can also be screened according to the preset download amount, that is, at least two data streams whose average download amount is greater than the preset download amount are determined from the multiple data streams, and then two data streams with the largest average download amount are further screened from the at least two data streams, and the two data streams with the largest average download amount are possible audio streams and video streams.
[0067] S3023: Determine a video stream and an audio stream according to the first data stream and the second data stream.
[0068] After obtaining the first data stream and the second data stream, since it is uncertain which data stream is the audio stream and which data stream is the video stream, the first data stream and the second data stream need to be further identified to determine which is the audio stream and which is the video stream.
[0069] Optionally, in some implementations, when determining the video stream and the audio stream according to the first data stream and the second data stream, the following steps may be included:
[0070] Determine an intersection of download times of the first data stream and the second data stream;
[0071] In the intersection of the downloading times, a data stream with a large amount of downloaded data is determined as a video stream, and a data stream with a small amount of downloaded data is determined as an audio stream.
[0072] Since the first data stream and the second data stream are transmitted and downloaded in parallel in the dual-stream transmission mode, the download time intersection of the first data stream and the second data stream can be obtained according to the respective download times of the first data stream and the second data stream. Since the total amount of downloaded data (or average downloaded amount) of the video stream is usually greater than the total amount of downloaded data (or average downloaded amount) of the audio stream in the same download time, after determining the download time intersection, it can be determined which data stream has a larger total amount of downloaded data (or average downloaded amount) in the download time intersection, and the data stream with a larger total amount of downloaded data (or average downloaded amount) is the video stream, and the other data stream is the audio stream. For example, in the download time intersection, if the total amount of downloaded data (or average downloaded amount) of the first data stream is greater than the second data stream, the first data stream can be determined as the video stream and the second data stream can be determined as the audio stream, or, if the total amount of downloaded data (or average downloaded amount) of the first data stream is less than the second data stream, the second data stream can be determined as the video stream and the first data stream can be determined as the audio stream.
[0073] The above records the method of identifying the video stream and the audio stream by the total amount of downloaded data (or average downloaded amount) of the first data stream and the second data stream in the intersection of the download time. In other possible implementations, the video stream and the audio stream can also be identified by other methods. For example, it can be judged according to the download duration and the number of download request transmissions of the first data stream and the second data stream respectively. The data stream with a longer download duration is the video stream, the data stream with a shorter download duration is the audio stream, the data stream with more download request transmissions is the video stream, and the data stream with fewer download request transmissions is the audio stream. Alternatively, it can also be judged according to at least two of the factors of the total amount of downloaded data (or average downloaded amount) in the intersection of the download time, the download duration, and the number of download request transmissions. For example, the data stream that meets at least two of the three conditions of the total amount of downloaded data (or average downloaded amount) in the intersection of the download time, the longer download duration, and the more download request transmissions in the first data stream and the second data stream can be regarded as the video stream, and the other data stream is determined as the audio stream. Here, the identification method of the video stream and the audio stream is not illustrated one by one.
[0074] S304: Determine a first duration according to the total amount of audio data downloaded corresponding to the audio stream and a preset audio bit rate.
[0075] In order to obtain the video bit rate of the encrypted video, it is necessary to determine the video duration first. In the embodiment of the present application, considering that the different clarity of the video will cause the size of the video block bit rate to differ greatly, but usually the audio bit rate difference is not large, therefore, the video duration can be calculated by the characteristics that the size of the audio block and the audio bit rate are not large, that is, the first duration is determined according to the total amount of audio data downloaded corresponding to the audio stream and the preset audio bit rate. Among them, the preset audio bit rate is the audio bit rate of the encrypted video, which can be obtained by analyzing the encrypted video (the specific analysis method can refer to the specific implementation in the related art, which is not described in detail here). After the audio bit rate of the encrypted video is obtained by analysis, it can be used as the preset audio bit rate for the calculation of the video duration (i.e., the first duration) of the encrypted video.
[0076] In the embodiment of the present application, the downloaded audio stream includes multiple audio data blocks, which can be extracted by the method described in S302 and will not be described in detail here. When determining the first duration according to the total amount of audio data downloaded corresponding to the audio stream and the preset audio bit rate, optionally, in some implementations, the following steps may be included:
[0077] Filtering out a valid audio data block from multiple audio data blocks;
[0078] The first duration is determined according to the total amount of audio data downloaded corresponding to the valid audio data block and a preset audio bit rate.
[0079] In actual application scenarios, when downloading the audio stream of an encrypted video, some invalid audio data blocks may be obtained. The invalid audio data blocks here can be understood as audio data blocks that are different from most other audio data blocks. These invalid audio data blocks will affect the accuracy of the determination result when determining the first time length. Therefore, in order to ensure the accuracy of the first time length, it is necessary to filter out these invalid audio data blocks and screen out valid audio data blocks.
[0080] When screening valid audio data blocks, optionally, in some implementations, screening can be performed based on the size of the audio data blocks. Specifically, for each audio data block in the audio stream, it can be determined whether the size of the audio data block is within a preset size range. If so, the audio data block can be considered to be a valid audio data block. If not, the audio data block can be considered to be an invalid audio data block. In this way, by determining the size of each audio data block in the audio stream, multiple valid audio data blocks can be screened out in the end. Among them, the preset size range can be set according to actual conditions and is not specifically limited here.
[0081] In addition, in other possible implementations, valid audio data blocks may be screened out according to other methods. For example, the audio data blocks may be screened out according to the download duration corresponding to the audio data blocks, and audio data blocks whose download duration is within a specified duration range may be determined as valid audio data blocks, and audio data blocks whose download duration is not within the specified duration range may be determined as invalid audio data blocks, etc. Other possible implementations will not be described one by one here.
[0082] After the valid audio data blocks are screened out, when determining the first duration, the first duration can be determined according to the total amount of audio data downloaded corresponding to the valid audio data blocks and the preset audio bit rate. Specifically, the total amount of audio data downloaded corresponding to the valid audio data blocks can be determined according to the respective audio data downloaded amounts of each valid audio data block, and then the ratio of the total amount of audio data downloaded to the preset audio bit rate is calculated, and the ratio is the first duration.
[0083] It should be noted that, when determining the first duration, the valid audio data blocks in the audio stream are screened. In other possible implementations, within the allowable range of error or precision, the valid audio data blocks may not be screened, that is, the default audio data blocks are all valid audio data blocks, and the ratio of the total amount of audio data downloaded corresponding to each audio data block in the audio stream to the preset audio bit rate is directly determined as the first duration. In practical applications, whether to screen the valid audio data blocks in the audio stream can be determined according to actual needs, and no specific limitation is made here.
[0084] S306: Determine the video bit rate of the encrypted video according to the total amount of video data downloaded, the total amount of audio data downloaded, and the first duration corresponding to the video stream.
[0085] When determining the video bit rate of the encrypted video, optionally, in some implementations, when the first duration is determined according to the total amount of audio data downloaded corresponding to the valid audio data block and the preset audio bit rate, the following steps may be included:
[0086] Determine the download time corresponding to the valid audio data block;
[0087] Determine the total download amount of the total download amount of the video data corresponding to the video stream and the total download amount of the audio data corresponding to the audio stream within the download time;
[0088] The ratio of the total download amount to the first duration is determined as the video bit rate of the encrypted video.
[0089] The valid audio data block can be obtained by screening the audio data blocks of the audio stream by the method described in S304 above, which will not be described in detail here. The download time corresponding to the valid audio data block is a time range, which can specifically be the request time range of the valid audio, that is, the time range between the request time of the download request corresponding to the first data block in the valid audio data block (specifically, it can be the first download request of the two download requests corresponding to the data block) and the request time of the download request corresponding to the last data block (specifically, it can be the second download request of the two download requests corresponding to the data block), and the time range can be determined when downloading the audio stream.
[0090] After obtaining the download time corresponding to the valid audio data block, the total video data download amount corresponding to the video stream downloaded within the time and the total audio data download amount corresponding to the audio stream can be determined based on the download time and the video stream and audio stream downloaded in S302. Then, these two total download amounts are summed to obtain the total audio and video download amount within the download time. The ratio of the total download amount to the first duration is the video bit rate of the encrypted video.
[0091] Optionally, in other possible implementations, the video bit rate of the encrypted video can also be determined by other methods. For example, if the first duration is determined based on the total amount of audio data downloaded corresponding to the audio stream and the preset audio bit rate, that is, the valid audio data blocks in the audio stream are not screened, then when determining the video bit rate of the encrypted video, it can include: first, determining the download time corresponding to the audio data block in the audio stream, the download time is also a time range, specifically, it can be the time range between the request time of the download request corresponding to the first audio data block in the audio stream and the request time of the download request corresponding to the last audio data block; secondly, determining the total download amount of the total amount of video data downloaded corresponding to the video stream and the total amount of audio data downloaded corresponding to the audio stream within the download time; finally, the ratio of the total download amount to the first duration is determined as the video bit rate of the encrypted video. Other possible implementations are no longer given examples one by one here.
[0092] Based on the method recorded above, when determining the video bit rate of the encrypted video in the dual-stream transmission mode, since the audio bit rate of the encrypted video in the dual-stream transmission mode is relatively fixed, the video duration (i.e., the first duration) is first determined, and then the video bit rate of the encrypted video is determined based on the first duration. Therefore, a more accurate video bit rate can be obtained.
[0093] In order to facilitate understanding of the method for determining the video bit rate provided in the embodiment of the present application, a more specific implementation method will be used as an example for explanation below.
[0094] Step 1: Preset relevant parameters.
[0095] Before determining the video bit rate of the encrypted video in the dual-stream transmission mode, several related parameters shown in Table 1 may be set.
[0096] Table 1
[0097]
[0098]
[0099] In Table 1, the parameter ul_reuqest is used to extract data blocks to ensure that the data blocks are extracted accurately without missing or over-counting. Generally, the size of the download request data packet of the audio stream and the size of the download request data packet of the video stream are quite different from the sizes of other non-download request data packets. Setting a threshold value can filter out other non-download request data packets.
[0100] The parameter request_interval is also used to extract data blocks to ensure accurate extraction of valid data blocks. If the time difference between two download requests is less than the configured minimum interval, the data downloaded between the two download requests will be considered invalid data and the latter download request needs to be ignored. This is done to distinguish truly invalid data.
[0101] The parameters min_audio_length and max_audio_length are used to identify valid audio and video streams, and to filter valid audio blocks. For each downloaded data stream, if the average amount of data downloaded by the data stream is greater than min_audio_length, the data block may be an audio or video stream. For audio streams, the size range of its valid audio data blocks needs to be within [min_audio_length, max_audio_length]. Audio data blocks that are too large or too small may be due to download anomalies caused by abnormal factors such as retransmission. To improve accuracy, these audio data blocks need to be filtered out.
[0102] The parameter audio_bitrate indicates the audio bitrate of the encrypted video, which can be obtained by analyzing the encrypted video and used to calculate the video duration after extracting the total effective audio traffic.
[0103] It should be noted that, in actual applications, for different video APPs, when determining the video bit rate of their encrypted videos, the encrypted videos can be sampled and analyzed, and different parameters can be preset according to the above configuration parameters based on the sampling and analysis results.
[0104] Step 2: Download the encrypted video, extract the data blocks and obtain multiple data streams.
[0105] When the encrypted video is transmitted in the dual-stream transmission mode, multiple data streams can be transmitted in parallel, and the multiple data streams include audio streams, video streams and other data streams. For each data stream, when extracting data blocks, a complete request interval can be determined based on the fact that the size of the uplink data packet is greater than ul_request and the time interval between two adjacent download requests is greater than request_interval, and all downlink data within the entire interval is a complete data block. The specific implementation method can refer to the corresponding content recorded in the above S302, which will not be described in detail here.
[0106] Step 3: Identify audio streams and video streams from the multiple data streams downloaded.
[0107] In dual-stream transmission mode, the transmission of encrypted video may have many data streams, but the main transmission data usually has only two, namely, video stream and audio stream. These two streams usually last for a long time, the number of download requests sent is large, and the amount of downloaded data is large. Based on the differences between audio streams and video streams and other data streams, when identifying audio streams and video streams, first, possible video streams and audio streams can be screened out from many data streams. The method used is to calculate the average download data volume of each data stream based on the data blocks extracted in the second step above. The average download data volume is greater than min_audio_length, which is a possible audio and video stream. Then, continue to screen audio streams and video streams from possible audio and video streams. The method used is to take the two data streams with the largest average download data volume and take their time intersection. The data stream with less download data volume in the time intersection is the audio stream, and the remaining data stream with the largest data volume is the video stream.
[0108] Step 4: Calculate the video length.
[0109] For the audio stream determined in the third step, valid audio data blocks whose sizes are within the threshold range [min_audio_length, max_audio_length] can be screened from multiple audio data blocks in the audio stream, and the time intersection in the third step is updated to the download time range corresponding to the valid audio data blocks.
[0110] When calculating the video duration, it is assumed that the total amount of data downloaded for the valid audio data block is l audio , the audio bit rate is k = audio_bitrate, then the video duration video_duration is:
[0111] video_duration=1 audio / k.
[0112] Step 5: Calculate the video bit rate.
[0113] Assume that the total amount of data downloaded for the audio and video streams in the time intersection is l all , then the video bit rate R is:
[0114] R=l all / video_duration.
[0115] Thus, the video bit rate of the encrypted video in the dual-stream transmission mode can be obtained.
[0116] Optionally, in some implementations, after obtaining the video bit rate of the encrypted video, the network playback quality of the encrypted video online playback can be further determined according to the video bit rate to determine whether to optimize the encrypted video. Specifically, the following steps may be included:
[0117] Determine the smoothness of the encrypted video according to the video bit rate of the encrypted video;
[0118] Evaluate the quality of encrypted video playback on the Internet based on fluency;
[0119] When the network playback quality of the encrypted video does not meet the preset quality, the encrypted video is optimized.
[0120] Generally, the larger the video bit rate, the better the fluency of the online video playback. After obtaining the video bit rate of the encrypted video, the fluency of the online encrypted video playback can be determined based on the video bit rate. Fluency is an important factor in determining the quality of video network playback. Generally, the better the fluency, the better the network playback quality of the video. After obtaining the fluency of the online encrypted video playback, the network playback quality of the online encrypted video playback can be further determined based on the fluency. If the network playback quality meets the preset quality, it can be said that the user's online video viewing experience is better, and there is no need to optimize the encrypted video. On the contrary, if the network playback quality does not meet the preset quality, it can be said that the user's online video viewing experience is poor, and the encrypted video needs to be optimized to improve the user experience. Among them, the specific optimization method for the encrypted video can refer to the specific implementation in the relevant technology, which will not be described in detail here.
[0121] Based on the technical solution provided by the embodiment of the present application, when determining the video bit rate of the encrypted video in the dual-stream transmission mode, the video stream and audio stream obtained when downloading the encrypted video can be determined first, and then the first duration is determined according to the total amount of audio data downloaded corresponding to the audio stream and the preset audio bit rate, and finally the video bit rate of the encrypted video is determined according to the total amount of audio data downloaded corresponding to the audio stream, the total amount of video data downloaded corresponding to the video stream, and the first duration. Since the audio bit rate of the encrypted video in the dual-stream transmission mode is relatively fixed, a relatively accurate video duration (i.e., the first duration) can be obtained based on the audio bit rate of the encrypted video and the total amount of audio data downloaded when downloading the encrypted video, and a relatively accurate video bit rate can be obtained based on the video duration and the total amount of audio and video data downloaded when downloading the encrypted video.
[0122] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0123] Figure 4 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. Figure 4 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. The memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. Of course, the electronic device may also include hardware required for other services.
[0124] The processor, network interface and memory can be interconnected through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0125] The memory is used to store the program. Specifically, the program may include a program code, and the program code includes a computer operation instruction. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.
[0126] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a video bit rate determination device at the logical level. The processor executes the program stored in the memory and is specifically used to perform the following operations:
[0127] In dual-stream transmission mode, determine the video stream and audio stream obtained when downloading the encrypted video;
[0128] Determining a first duration according to a total amount of audio data downloaded corresponding to the audio stream and a preset audio bit rate;
[0129] The video bit rate of the encrypted video is determined according to the total amount of video data downloaded corresponding to the video stream, the total amount of audio data downloaded, and the first duration.
[0130] The above application Figure 4The method performed by the video bit rate determination device disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in this application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in this application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0131] The electronic device may also perform Figure 3 The method and the device for determining the video bit rate are implemented in Figure 3 The functions in the illustrated embodiments will not be described in detail in this application.
[0132] Of course, in addition to software implementation methods, the electronic device of the present application does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0133] The present application also proposes a computer-readable storage medium, which stores one or more programs, wherein the one or more programs include instructions, which, when executed by a portable electronic device including a plurality of application programs, enable the portable electronic device to execute Figure 3 The method of the embodiment shown is specifically used to perform the following operations:
[0134] In dual-stream transmission mode, determine the video stream and audio stream obtained when downloading the encrypted video;
[0135] Determining a first duration according to a total amount of audio data downloaded corresponding to the audio stream and a preset audio bit rate;
[0136] The video bit rate of the encrypted video is determined according to the total amount of video data downloaded corresponding to the video stream, the total amount of audio data downloaded, and the first duration.
[0137] Figure 5 FIG. 5 is a schematic diagram of a structure of a video bit rate determination device 50 according to an embodiment of the present application. Figure 5 In a software implementation, the video bit rate determination device 50 may include: a first determination module 51, a second determination module 52 and a third determination module 53, wherein:
[0138] A first determination module 51, in a dual-stream transmission mode, determines a video stream and an audio stream obtained when downloading an encrypted video;
[0139] A second determining module 52 determines a first duration according to a total amount of audio data downloaded corresponding to the audio stream and a preset audio bit rate;
[0140] The third determination module 53 determines the video bit rate of the encrypted video according to the total amount of video data downloaded corresponding to the video stream, the total amount of audio data downloaded, and the first duration.
[0141] Optionally, in some implementations, the first determining module 51 determines, in the dual-stream transmission mode, a video stream and an audio stream obtained when downloading an encrypted video, including:
[0142] In the dual-stream transmission mode, determining multiple data streams obtained when downloading the encrypted video, each data stream including multiple data blocks;
[0143] The video stream and the audio stream are determined from the plurality of data streams according to a plurality of data blocks respectively included in the plurality of data streams.
[0144] Optionally, in some implementations, for each data stream, the first determining module 51 determines a plurality of data blocks included in the data stream by:
[0145] In the process of downloading the data stream, determining a plurality of download requests from a plurality of uplink requests;
[0146] The data downloaded between each two adjacent download requests in the multiple download requests are determined as a data block to obtain multiple data blocks.
[0147] Optionally, in some implementations, the first determining module 51 determines multiple download requests from multiple uplink requests, including:
[0148] For each uplink request, determining whether the size of a data packet of the uplink request is greater than a preset threshold;
[0149] In a case where the size of the data packet of the uplink request is greater than the preset threshold, determining the uplink request as a first download request;
[0150] After obtaining a plurality of first download requests, determining, for each two adjacent first download requests, whether a time interval between the two first download requests is greater than a preset time length;
[0151] In a case where the time interval between the two first download requests is greater than the preset time length, determining the two first download requests as valid download requests;
[0152] When the time interval between the two first download requests is not greater than the preset time length, determining the latter first download request as an invalid download request;
[0153] Wherein, the multiple download requests are valid download requests.
[0154] Optionally, in some implementations, the first determining module 51 determines the video stream and the audio stream from the multiple data streams according to the multiple data blocks respectively included in the multiple data streams, including:
[0155] For each data stream, determining an average downloaded data volume of a plurality of data blocks included in the data stream;
[0156] Determine a first data stream and a second data stream from the multiple data streams according to the average downloaded data volume, wherein the average downloaded data volume of the first data stream and the second data stream is greater than the average downloaded data volume of the remaining data streams in the multiple data streams;
[0157] The video stream and the audio stream are determined according to the first data stream and the second data stream.
[0158] Optionally, in some implementations, the first determining module 51 determines the video stream and the audio stream according to the first data stream and the second data stream, including:
[0159] Determine an intersection of download times of the first data stream and the second data stream;
[0160] In the intersection of the downloading times, a data stream with a large amount of downloaded data is determined as the video stream, and a data stream with a small amount of downloaded data is determined as the audio stream.
[0161] Optionally, in some implementations, the audio stream includes a plurality of audio data blocks;
[0162] The second determining module 52 determines the first duration according to the total amount of audio data downloaded corresponding to the audio stream and the preset audio bit rate, including:
[0163] Filtering out valid audio data blocks from the multiple audio data blocks;
[0164] The first duration is determined according to the total amount of audio data downloaded corresponding to the valid audio data block and the preset audio bit rate.
[0165] Optionally, in some implementations, the second determining module 52 selects a valid audio data block from the multiple audio data blocks, including:
[0166] For each audio data block of the plurality of audio data blocks, determining whether a size of the audio data block is within a preset size range;
[0167] When the size of the audio data block is within the preset size range, the audio data block is determined as a valid audio data block.
[0168] Optionally, in some implementations, the second determining module 52 determines the first duration according to the total amount of audio data downloaded corresponding to the valid audio data block and the preset audio bit rate, including:
[0169] The first duration is determined as a ratio of a total amount of audio data downloaded corresponding to the valid audio data block to the preset audio bit rate.
[0170] Optionally, in some implementations, the third determination module 53 determines the video bit rate of the encrypted video according to the total amount of video data downloaded corresponding to the video stream, the total amount of audio data downloaded, and the first duration, including:
[0171] Determine the download time corresponding to the valid audio data block;
[0172] Determine the total download amount of the total download amount of the video data corresponding to the video stream and the total download amount of the audio data corresponding to the audio stream within the download time;
[0173] The ratio of the total download amount to the first duration is determined as the video bit rate of the encrypted video.
[0174] Optionally, in some implementations, the video bit rate determination device 50 further includes an optimization processing module ( Figure 5 Not shown), after the third determination module 53 determines the video bit rate of the encrypted video, the optimization processing module includes:
[0175] Determining the fluency of the encrypted video according to the video bit rate of the encrypted video;
[0176] Evaluate the network playback quality of the encrypted video according to the fluency;
[0177] When the network playback quality of the encrypted video does not meet the preset quality, the encrypted video is optimized.
[0178] The video bit rate determination device 50 provided in the present application can also execute Figure 3 The method and the device 50 for determining the video bit rate are implemented in Figure 3 The functions of the illustrated embodiments will not be described in detail in this application.
[0179] In short, the above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
[0180] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0181] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0182] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0183] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
Claims
1. A method for determining a video bit rate, comprising: In dual-stream transmission mode, determine the video stream and audio stream obtained when downloading the encrypted video; Determining a first duration according to a total amount of audio data downloaded corresponding to the audio stream and a preset audio bit rate; The video bit rate of the encrypted video is determined according to the total amount of video data downloaded corresponding to the video stream, the total amount of audio data downloaded, and the first duration.
2. The method according to claim 1, wherein in the dual-stream transmission mode, determining the video stream and the audio stream obtained when downloading the encrypted video comprises: In the dual-stream transmission mode, determining multiple data streams obtained when downloading the encrypted video, each data stream including multiple data blocks; The video stream and the audio stream are determined from the plurality of data streams according to a plurality of data blocks respectively included in the plurality of data streams.
3. The method according to claim 2, wherein for each data stream, a plurality of data blocks included in the data stream are determined by: In the process of downloading the data stream, determining a plurality of download requests from a plurality of uplink requests; The data downloaded between each two adjacent download requests in the multiple download requests are determined as a data block to obtain multiple data blocks.
4. The method of claim 3, wherein determining a plurality of download requests from a plurality of uplink requests comprises: For each uplink request, determining whether the size of a data packet of the uplink request is greater than a preset threshold; In a case where the size of the data packet of the uplink request is greater than the preset threshold, determining the uplink request as a first download request; After obtaining a plurality of first download requests, determining, for each two adjacent first download requests, whether a time interval between the two first download requests is greater than a preset time length; In a case where the time interval between the two first download requests is greater than the preset time length, determining the two first download requests as valid download requests; When the time interval between the two first download requests is not greater than the preset time length, determining the latter first download request as an invalid download request; Wherein, the multiple download requests are valid download requests.
5. The method according to claim 2, wherein determining the video stream and the audio stream from the plurality of data streams according to the plurality of data blocks respectively included in the plurality of data streams comprises: For each data stream, determining an average downloaded data volume of a plurality of data blocks included in the data stream; Determine a first data stream and a second data stream from the multiple data streams according to the average downloaded data volume, wherein the average downloaded data volume of the first data stream and the second data stream is greater than the average downloaded data volume of the remaining data streams in the multiple data streams; The video stream and the audio stream are determined according to the first data stream and the second data stream.
6. The method according to claim 5, wherein determining the video stream and the audio stream according to the first data stream and the second data stream comprises: Determine an intersection of download times of the first data stream and the second data stream; In the intersection of the downloading times, a data stream with a large amount of downloaded data is determined as the video stream, and a data stream with a small amount of downloaded data is determined as the audio stream.
7. The method of claim 1, wherein the audio stream comprises a plurality of audio data blocks; The determining the first duration according to the total amount of audio data downloaded corresponding to the audio stream and a preset audio bit rate includes: Filtering out valid audio data blocks from the multiple audio data blocks; The first duration is determined according to the total amount of audio data downloaded corresponding to the valid audio data block and the preset audio bit rate.
8. The method according to claim 7, wherein the step of selecting a valid audio data block from the plurality of audio data blocks comprises: For each audio data block of the plurality of audio data blocks, determining whether a size of the audio data block is within a preset size range; When the size of the audio data block is within the preset size range, the audio data block is determined as a valid audio data block.
9. The method according to claim 7, wherein determining the first duration according to the total amount of audio data downloaded corresponding to the valid audio data block and the preset audio bit rate comprises: The first duration is determined as a ratio of a total amount of audio data downloaded corresponding to the valid audio data block to the preset audio bit rate.
10. The method according to any one of claims 7 to 9, wherein determining the video bit rate of the encrypted video according to the total amount of video data downloaded corresponding to the video stream, the total amount of audio data downloaded, and the first duration comprises: Determine the download time corresponding to the valid audio data block; Determine the total download amount of the total download amount of the video data corresponding to the video stream and the total download amount of the audio data corresponding to the audio stream within the download time; The ratio of the total download amount to the first duration is determined as the video bit rate of the encrypted video.
11. An electronic device, comprising: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method according to any one of claims 1 to 10.
12. A computer-readable storage medium, when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method according to any one of claims 1 to 10.