Video transcoding parameter determination method and device, computer equipment and medium
By calculating the video popularity threshold and constraint model, the number of video transcoding is automatically determined, which solves the problems of large consumption and low efficiency of video transcoding resources, and realizes efficient video transcoding.
Patent Information
- Application Number
- CN202310706157.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-14
- Publication Date
- 2024-12-17
AI Technical Summary
During the video transcoding process, it is difficult for the prior art to effectively determine the number of videos that need to be transcoded, resulting in high resource consumption, low efficiency, and the inability to quickly meet the video playback coverage requirements.
By obtaining the video playback information, calculating the video popularity threshold, and automatically determining the number of videos that need to be transcoded under preset playback coverage conditions using the constraint model, reducing repeated trials, saving resources, and improving transcoding efficiency.
It realizes the minimum video transcoding as much as possible while meeting the video playback coverage rate, reduces resource consumption, improves the transcoding efficiency, and simplifies the test process.
Smart Images

Figure CN119155510A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of video data processing, and in particular to a method, device, computer equipment and medium for determining parameters of video transcoding. Background Art
[0002] After the user shoots a video, the platform needs to convert the original video format from one format to another in order to adapt to different network bandwidths, different terminal processing capabilities and different user viewing needs. This process is called video transcoding.
[0003] Whether a video is popular with users after transcoding can be determined by the playback coverage. The higher the playback coverage, the more suitable the format after transcoding is for users to watch. However, due to the huge volume of videos, such as tens of millions or hundreds of millions of videos, it is unrealistic to transcode all videos into a certain format (or gear). Therefore, one way is to select a part of the videos for video transcoding. In this way, it is necessary to transcode as few videos as possible while satisfying the playback coverage of this transcoding parameter, so as to avoid occupying or consuming large resources. Summary of the invention
[0004] In view of this, the present invention provides a method, device, computer equipment and medium for determining parameters of video transcoding, which are used to automatically determine transcoding conditions, namely, video popularity thresholds, according to experimental constraints, so as to solve constrained planning problems, improve video transcoding efficiency, save transcoding resources, and speed up the experimental process.
[0005] In a first aspect, the present invention provides a method for determining parameters of video transcoding, the method comprising:
[0006] Obtaining playback information of multiple videos played on the platform within a preset time period, wherein the playback information of each video includes: the ID of the video and the trend feature of the video, and the trend feature of the video is used to describe the number of times the current video will be played in the future;
[0007] According to the ID of each video and the trend characteristics of the video, the target threshold of video transcoding is calculated under the condition of meeting the preset video playback coverage;
[0008] Based on the target threshold, determine the number of videos that need to be transcoded under the preset video playback coverage.
[0009] In combination with the first aspect, in an optional implementation, the number of the multiple videos is N, N≥2, and according to the ID of each video and the trend feature of the video, a target threshold for video transcoding under the condition of satisfying a preset video playback coverage is calculated, including: setting at least one threshold and a first condition under each threshold, the first condition being that a score corresponding to the trend feature of the video is greater than or equal to a current threshold;
[0010] According to the first condition under each threshold and the preset video playback coverage, the playback information of N videos is screened to obtain M video playback information corresponding to each threshold, and at least one video quantity corresponding to at least one threshold is determined according to the M video playback information;
[0011] The target threshold is determined to be a threshold corresponding to a smallest video quantity among the at least one video quantity.
[0012] In combination with the first aspect, in another optional implementation, the method further includes: if the multiple videos being played are uploaded from different regions, then the region ID for uploading each video and the playback region ID for each video are also obtained from the playback information of each video.
[0013] Calculate the target threshold of video transcoding under the condition of meeting the preset video playback coverage, including: according to the ID of each video, the trend characteristics of each video, the area ID of each video upload and the playback area ID of each video, obtain the target threshold through the first constraint model operation.
[0014] In combination with the first aspect, in another optional implementation, the first constraint model constrains: the playback area ID of the current video belongs to the current area j, and the score corresponding to the trend feature of the current video is greater than or equal to a threshold, j is the area identifier, and the threshold is the threshold corresponding to the current area j.
[0015] In combination with the first aspect, in yet another optional implementation, if the preset time period includes multiple sub-time periods, the acquired video playback information further includes: a timestamp of video playback in each sub-time period;
[0016] Calculate the target threshold of video transcoding under the condition of satisfying a preset video playback coverage, including: calculating the sub-threshold of video transcoding in each sub-time period under the video playback coverage of the current sub-time period according to the timestamp through the second constraint model; and calculating the number of videos that need to be transcoded under each sub-threshold; count the number of videos that need to be transcoded under all sub-thresholds to obtain the total number of videos that need to be transcoded.
[0017] In combination with the first aspect, in another optional implementation, the second constraint model operation constraint is: the timestamp of the current video playback is within a sub-time period, and the score corresponding to the trend feature of the current video is greater than or equal to a threshold, and the threshold is the threshold corresponding to the current sub-time period.
[0018] In combination with the first aspect, in another optional implementation, after determining the number of videos that need to be transcoded, it also includes: detecting whether the number of videos that need to be transcoded meets the requirements; if not, adjusting the parameters of the preset video playback coverage rate, and recalculating the number of videos to be transcoded.
[0019] In a second aspect, the present invention provides a device for determining parameters of video transcoding, the device comprising:
[0020] An acquisition module is used to acquire the playback information of multiple videos played on the platform within a preset time period, wherein each playback information includes: a video ID and a trend feature of the video, wherein the trend feature of the video is used to describe the number of times the current video is played in a future period of time;
[0021] A calculation module, used to calculate a target threshold for video transcoding under the condition of satisfying a preset video playback coverage rate according to the ID of each video and the trend characteristics of the video;
[0022] The determination module is used to determine the number of videos that need to be transcoded under a preset video playback coverage rate according to the target threshold.
[0023] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the parameter determination method for video transcoding of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0024] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for determining parameters of video transcoding according to the first aspect or any corresponding embodiment thereof.
[0025] The method, apparatus and equipment provided in this embodiment calculate the target threshold of video transcoding under the condition of satisfying a preset video playback coverage rate according to the ID of each video in the playback information and the trend characteristics of the video, and determine the number of videos that need to be transcoded by the target threshold, thereby automatically solving the number of videos to be transcoded under the preset video playback coverage rate, and the number of videos that need to be transcoded is the minimum. This method can avoid gradually adjusting and testing the number of videos that need to be transcoded and the video coverage rate from high to low according to different thresholds, thereby speeding up the test efficiency and maximizing the video transcoding efficiency with low transcoding resource consumption.
[0026] In addition, this method solves and establishes the correspondence between the video transcoding target threshold and the video playback coverage by counting and obtaining the constraint environment of the preset time period. Based on the correspondence, the target threshold for video transcoding can be automatically output by inputting the playback information of all videos in the preset time period, thereby avoiding repeated experiments, saving transcoding resources and improving transcoding efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0028] Figure 1 is a flow chart of a method for determining parameters of video transcoding provided by an embodiment of the present invention;
[0029] Figure 2 is a flowchart of another method for determining parameters of video transcoding provided by an embodiment of the present invention;
[0030] Figure 3 is a flow chart of a method for determining video transcoding parameters based on regional dimension constraints provided by an embodiment of the present invention;
[0031] Figure 4 is a flow chart of a method for determining video transcoding parameters based on time dimension constraints provided by an embodiment of the present invention;
[0032] Figure 5 is a flowchart of another method for determining parameters of video transcoding provided by an embodiment of the present invention;
[0033] Figure 6 It is a structural block diagram of a device for determining parameters of video transcoding provided by an embodiment of the present invention;
[0034] Figure 7It is a schematic diagram of the hardware structure of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments.
[0036] The technical solution of the embodiment of the present invention is applicable to various scenarios where videos need to be transcoded and published.
[0037] The method and apparatus in the embodiment of the present invention can be implemented in various terminal devices, servers, network devices, etc., which are not specifically limited here. In addition, the method provided in this embodiment can also be applied to a video transcoding system, which includes at least one terminal device, server, database, etc., which is not limited in this embodiment.
[0038] The video transcoding process requires converting videos posted by users from one format to one or more other formats to increase the playback coverage of videos watched by users. The selection of videos for transcoding can be based on the popularity of the videos. Whether the converted format is appropriate is determined by statistically analyzing the viewing experience of users.
[0039] It should be noted that the format may also be referred to as a "level", including but not limited to 480p, 720p, 1080p, etc.
[0040] In order to reduce the number of videos to be transcoded, save resources, and achieve the same effect, it is considered to transcode only some videos. In this way, it is necessary to meet this transcoding parameter and transcode as few videos as possible under a certain video playback coverage. One implementation method is to predict the trend characteristics of a video through a video popularity model. The higher the trend characteristics, the more times the video will be played after transcoding.
[0041] The current experimental transcoding format is to first set a higher threshold. When the score corresponding to the trend feature of the video exceeds this threshold, the video can be transcoded; otherwise, no transcoding is performed. Then, based on the current threshold and the number of video transcodings, observe whether the online video playback coverage meets the requirements. If it does not meet the requirements, the threshold is lowered and the transcoding data is re-evaluated until the video playback coverage requirements are met. This method slows down the progress of the experiment, is inefficient, and consumes a lot of resources.
[0042] In order to solve the above problems, the embodiment of the present invention automatically determines the transcoding conditions (i.e., the video popularity threshold) mainly based on the constraints of the experiment. Specifically, by constructing a playback environment for a time period, the constrained planning problem is solved, thereby adjusting the video transcoding conditions more quickly, accelerating the experimental process, and improving the video transcoding efficiency.
[0043] According to an embodiment of the present invention, an embodiment of a method for determining parameters of video transcoding is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0044] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0045] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0046] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0047] It should be understood that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0048] In addition, it should be noted that the data involved in each embodiment of the present technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0049] Embodiment 1
[0050] In this embodiment, a method for determining parameters of video transcoding is provided, which can be executed by network devices such as servers, server clusters, and data centers. Figure 1 FIG. 1 is a flow chart of a method for determining parameters of video transcoding provided by an embodiment of the present invention, and the flow chart includes:
[0051] Step S101, obtaining playback information of multiple videos played on the platform within a preset time period.
[0052] The preset time period may be in hours, such as 24 hours, 12 hours, etc. Taking 24 hours a day as an example, the playback information of the video playback obtained and counted may be the playback records of all videos played on the platform within 24 hours a day. Optionally, the preset time period may also be customizable.
[0053] The playback information of each of the multiple videos includes: a video ID and a video trend feature. The video ID is used to identify each played video, and the video trend feature is used to describe the number of times the current video will be played in the future. Furthermore, the video trend feature can predict the number of times the current video will be played on the platform in the next 24 hours through an algorithm model.
[0054] The algorithm model can be an intermediate algorithm model, such as LightGBM (Light Gradient Boosting Machine), which is a framework for implementing the GBDT (Gradient Boosting Decision Tree) algorithm, which supports efficient parallel training, and has the advantages of faster training speed, lower memory consumption, better accuracy, support for distributed and rapid processing of massive data, etc. It should be noted that the prediction of video trend features can also use other algorithm models or prediction models, which is not limited in this embodiment.
[0055] One way to obtain video trend features is to use the resolution, type setting and relevant features of a video author, such as the author score, the number of videos posted by the author in the past, the number of times the video has been viewed, the amount of playback, and other information as input parameters, input them into the algorithm model LIGHTGbm for processing, and output the trend features of the current video.
[0056] In addition, the above-mentioned playback information also includes: the ID of the video playback record, the video upload area ID, the video playback area ID, and the video playback timestamp, etc., which are not limited in this embodiment.
[0057] Optionally, in step S101, the videos uploaded / published by each terminal device and the playback information of each video can be stored in a network database through online data, such as in a Hive (a data warehouse tool based on Hadoop) module, and then the server or controller periodically obtains the playback information of the above multiple videos from the Hive module.
[0058] Step S102, based on the ID of each video and the trend feature of each video, calculate the target threshold of video transcoding under the condition of satisfying the preset video playback coverage.
[0059] The video play coverage rate refers to the ratio of the number of video plays in a certain gear or format to the total number of video plays, and the formula is:
[0060] Video playback coverage of a certain gear = the number of times the gear is used when playing the video / the total number of video playbacks
[0061] The total number of video playbacks defaults to the sum of the number of times the video is played in all gears. For example, video 1 includes three gears, namely gear A1, A2 and A3. The video playback coverage of video 1 in gear A1 is equal to the ratio of the number of times video 1 is played in gear A1 to the sum of the number of times video 1 is played in gears A1, A2 and A3.
[0062] In addition, the preset video play coverage can be customized by the system, for example, the preset video play coverage is ≥20%. If the calculated video play coverage is not less than 20%, the threshold value of the video needs to be transcoded. In this embodiment, the threshold value is called the target threshold value. The target threshold value is used to compare with the score corresponding to the trend feature of the video. If the score corresponding to the video trend feature of the current video exceeds the target threshold value, the current video is transcoded, for example, the video format / gear is converted from A1 to A2.
[0063] Step S103, determining the number of videos that need to be transcoded under a preset video playback coverage rate according to the target threshold.
[0064] Among them, the number of videos that need to be transcoded is one of the parameters of video transcoding. Based on the target threshold determined in step S102, and through certain constraints or preset algorithms, the number of videos that currently need to be transcoded can be calculated or derived, and a better one can be determined from multiple video numbers.
[0065] Furthermore, if Figure 2 As shown, an implementation of the above step S102 includes:
[0066] Step S1021: setting at least one threshold value and a first condition under each threshold value, wherein the first condition is that the score corresponding to the trend feature of the video is greater than or equal to the current threshold value.
[0067] For example, at least one threshold (score1, score2, score3, etc.) satisfies a first condition under each threshold score. The first condition can be expressed as S i ≥score,S i Represents the score corresponding to the trend feature of the i-th video.
[0068] Step S1022: According to the first condition under each threshold and the preset video playback coverage, the playback information of N videos is screened to obtain M video playback information corresponding to each threshold, and the number of at least one video corresponding to the at least one threshold is determined based on the M video playback information.
[0069] Assuming that there are 1000 video playback information, N is 1000, then these 1000 video playback information are screened through the first condition of a certain threshold score and the preset video coverage, and M video playback information is filtered out, for example, M=10, and the 10 video playback information corresponds to the number of videos of a certain threshold score, for example, 10 video playback information corresponds to y videos, y≤10. At this time, a threshold score is established to correspond to a first condition and a number of video transcodings, and M video playback information is obtained after N video playback information is screened, and the M video playback information corresponds to y videos, y≤M, and y, M, and N are all positive integers.
[0070] Step S1023: Determine the target threshold as a threshold corresponding to the smallest video quantity among the at least one video quantity.
[0071] For example, a threshold score corresponds to a first condition, and multiple scores correspond to multiple first conditions; multiple first conditions correspond to multiple (y videos), such as y1 / y2 / y3..., and a first condition with the smallest y value is selected, corresponding to a score, which is the target threshold.
[0072] The minimum number is selected from the at least one video transcoding number in the above step S1022, and the score corresponding to the minimum video transcoding number is determined as the target threshold.
[0073] Optionally, the above steps S1021 to S1023 are expressed by the following algorithm model of equations (1) and (2):
[0074]
[0075]
[0076] Among them, S i represents the score corresponding to the trend feature of the i-th video, N is the number of video playback records, score is the threshold, G i Indicates the current i-th video, i is a constant; Null means nothing or empty; min scoreIndicates the threshold score corresponding to the minimum number of videos among all at least one video number, that is, the target threshold; cover indicates the preset video playback coverage rate. distinctCount indicates the number of deduplicated videos.
[0077] In a specific example, assume that a total of 8 video playback records are obtained within a preset time period, and there are 3 users / authors involved in publishing the videos. The specific playback record data is shown in Table 1.
[0078] Table 1: Playback information of 8 videos
[0079]
[0080] In addition, assuming that the preset video playback coverage is 45%, the threshold corresponding to the least number of videos to be transcoded is solved according to the algorithm model of the above relationship (1) and (2), and the target threshold score is 0.5 after calculation. Then, the score corresponding to the trend feature of each of the 8 videos is compared with the target threshold 0.5. After comparison, only the score S3 corresponding to the trend feature of video ID3 (G3) is ≥ 0.5. Therefore, it is determined that when the video playback coverage exceeds 45%, only video ID3 can be transcoded, and the number of transcoded videos is 1.
[0081] The method provided in this embodiment calculates the target threshold of video transcoding under the condition of satisfying a preset video playback coverage rate according to the ID of each video in the playback information and the trend characteristics of the video, and determines the number of videos that need to be transcoded by the target threshold, thereby automatically solving the number of videos to be transcoded under the preset video playback coverage rate, and the number of videos that need to be transcoded is the minimum. This method can avoid gradually adjusting and testing the number of videos that need to be transcoded and the video coverage rate from high to low according to different thresholds, thereby speeding up the experimental efficiency and maximizing the video transcoding efficiency with low transcoding resource consumption.
[0082] In addition, this method solves and establishes the correspondence between the video transcoding target threshold and the video playback coverage by counting and obtaining the constraint environment of the preset time period. Based on the correspondence, the target threshold for video transcoding can be automatically output by inputting the playback information of all videos in the preset time period, thereby avoiding repeated experiments, saving transcoding resources and improving transcoding efficiency.
[0083] Embodiment 2
[0084] Based on the first embodiment, the present embodiment adds dimension information of the video upload area and the video playback area. The difference from the first embodiment is that all the playback videos counted in the first embodiment are uploaded by users from the same region, while the present embodiment does not limit the uploads by users from the same region, and the videos can be uploaded by users from two or more regions.
[0085] Specifically, if the multiple videos played in the above step S101 are uploaded from different regions, the region ID of each video upload and the playback region ID of each video are also obtained from the playback information of each video. The video playback region ID is recorded in the record of each video played on the platform, and the region from which the video was uploaded is recorded when the author or user uploads the video, for example, the region ID indicating the upload is carried when the video is uploaded to the platform.
[0086] The region described in this embodiment may refer to a certain region, such as a certain city, a certain province or state, or even a larger region, and the present invention does not limit this. In this embodiment, the different regions may be divided into some provinces in China, or the North China, Central China, South China, East China and other regions may be used to represent different regions where videos are uploaded.
[0087] Depending on the upload area and playback area of the video played within the preset time period, such as Figure 3 As shown, the above step S102: calculating the target threshold of video transcoding under the condition of satisfying the preset video playback coverage, specifically includes:
[0088] Step S102': according to the ID of each video, the trend feature of each video, the ID of the area where each video is uploaded and the ID of the area where each video is played, the target threshold is obtained by calculating the first constraint model.
[0089] The first constraint model constraints: the playback area ID of the current video belongs to the current area j, and the score corresponding to the trend feature of the current video is greater than or equal to the threshold of area j, j is the area identifier, and the threshold represents the threshold corresponding to the area identifier j.
[0090] Optionally, the first constraint model can be expressed by the following equations (3) and (4):
[0091]
[0092]
[0093] The first constraint model is similar to the above equations (2) and (3). Specifically, Pi represents the ID of region i, i is the region number, and score Pi represents the target threshold on the region Pi, I represents the ID of the playback record, G irepresents the current i-th video, Ui represents the video playback area ID, S i represents the score corresponding to the trend feature of the i-th video, and the score corresponding to the video trend feature S i The value range of cover is 0 to 1; j Represents the video playback coverage in area j; the symbol “==” indicates that the playback area Ui of the ith video belongs to area j. If so, the value is 1; if not, the value is 0; the symbol “&&” indicates that the conditions in the first bracket () and the conditions in the second bracket () are met at the same time, and the intersection is taken; the output result is 1. If one or more conditions in the bracket () are not met, the output result is 0.
[0094] The above relationship (3) indicates that when the first condition is met: S i ≥ the target threshold corresponding to region Pi, the target threshold score in N regions is the smallest one. Relation (4) means that when (U i = =j) and S i ≥score Pi Under the two conditions, and after removing the duplicate video area IDs, the ratio is greater than the video playback coverage j .
[0095] In a specific example, the sampled data obtained includes: the playback information of 10 videos recorded in a preset time period, and assuming that these 10 videos are uploaded by 4 authors, and the 4 authors are from three different areas, that is, the video upload area ID is a / b / c, the number of video playback areas is 2, and the corresponding video playback area IDs are a and d.
[0096] A specific playback record data is shown in Table 2 below, where each row represents a piece of data, which respectively represents the playback record ID, video ID, video upload country, video playback country and the score corresponding to the trend feature of the video.
[0097] Table 2: Playback information of 10 videos
[0098]
[0099] First, input the parameters and constrain the playback information of the 10 videos in Table 2 through the first constraint model. The first constraint model calculates the threshold value of the minimum number of transcoded videos in region a under the condition that the video playback coverage (vv) is greater than or equal to 40%; by solving, we can get:
[0100] If the threshold for transcoding region a is set to 1, the scores S corresponding to the trend features of all videos i are all less than score = 1, which does not meet the first condition Si ≥score, there is no need to transcode the video in area a because none of them meet the requirement of coverage greater than 40%.
[0101] Similarly, if the threshold for transcoding region b is set to 1, the score S corresponding to the trend feature of all videos is i are also less than score = 1, which does not meet the first condition S i ≥score, then there is no need to transcode the video in area b. If the threshold for transcoding in area c is set to 0.5, then in the playback information of all videos, the scores corresponding to the trend characteristics of some videos are greater than or equal to score=0.5, then it is determined that video transcoding can be performed in area c. Specifically, after searching, among the IDs of the 10 playback records, there are 4 playback records with IDs I3~I6 that meet the first condition, accounting for 40% of the total video playback times 10, and the video playback coverage rate of video 3 is greater than or equal to the preset video playback coverage rate of 40%, and only video 3 meets the condition, then it is determined that only one video in area c is transcoded, and its playback coverage rate is 40%, which meets the condition.
[0102] The method provided in this embodiment realizes an automatic solution method for multi-region thresholds when users or authors upload videos in different regions, and then obtains the minimum number of video transcodings that meets the preset video playback coverage under different thresholds in multiple regions.
[0103] Embodiment 3
[0104] In another embodiment of the present invention, the preset time period in the above step S101 is further split, that is, constraints are added in the time dimension, and the division of time granularity is increased compared with the above-mentioned embodiments 1 and 2.
[0105] Specifically, the preset time period is divided into a plurality of sub-time periods, that is, the preset time period includes a plurality of sub-time periods. For example, the 24 hours of the preset time period is divided into 3 sub-time periods [t0, t1], [t1, t2], and [t2, t3]. Optionally, the duration of the sub-time period can be customized as needed, and the duration that can be set includes but is not limited to 1 hour, 1 day, 1 month, 1 year, etc., which is not limited in this embodiment, and then the corresponding threshold value and the number of videos to be transcoded are determined in different sub-time periods.
[0106] Furthermore, if Figure 4 As shown, in the above step S101, the obtained video playback information also includes: a timestamp of the video playback in each sub-time period, and the timestamp is represented by "T".
[0107] The above step S102, calculating the target threshold of video transcoding under the condition of satisfying the preset video playback coverage, includes:
[0108] Step S102-1: According to the timestamp, a sub-threshold of video transcoding is calculated in each sub-time period under the video playback coverage of the current sub-time period through a second constraint model.
[0109] The second constraint model operation constraint is: the timestamp of the current video playback is within a sub-time period, and the score corresponding to the trend feature of the current video is greater than or equal to the threshold score t , threshold score t Indicates the threshold score corresponding to the current sub-time period t.
[0110] Step S102-2: Calculate the number of videos that need to be transcoded corresponding to each sub-threshold.
[0111] Step S102-3: Count the number of videos that need to be transcoded under all the sub-thresholds to obtain the total number of videos that need to be transcoded.
[0112] The second constraint model can be expressed by equations (5) and (6):
[0113]
[0114]
[0115] Among them, t represents a sub-time period, score t Indicates the sub-threshold to be solved in the sub-time period t. The symbol "&&" indicates that the conditions on both sides of the symbol are met at the same time, that is, when the timestamp Ti of the i-th video playback belongs to a sub-time period j, and the score S corresponding to the video trend feature i Greater than or equal to the threshold score corresponding to the sub-time period t t That is, the above equations (5) and (6) require calculating the sub-threshold score corresponding to the one with the least number of video transcoding under different first conditions (corresponding to different thresholds) within a sub-time period. t . Solve the sub-threshold score by constraints t Then, the aforementioned steps S102-2 and S102-3 are performed, and finally the total number of videos in the entire time period is obtained. The specific process can be referred to the description of the aforementioned embodiment 1 and embodiment 2, and will not be repeated in this embodiment.
[0116] In a specific embodiment, assuming that the constraint of the time dimension is added, there are a total of 9 video playback records in a sub-time period (or time segment), involving a total of 4 authors, from three sub-time periods, recorded as t1, t2 and t3. The specific playback record data of each video is shown in Table 3, where each row represents the playback information of a video, which respectively represents the playback record ID, video ID, time period and trend characteristics of the video.
[0117] Table 3: Playback information of 9 videos
[0118]
[0119] Then, based on the playback information of the above 9 videos, constraint conditions are set, that is, through the second constraint model constraint: the threshold value of the minimum number of transcoded videos is required to meet the condition that the video playback coverage is greater than or equal to 30%.
[0120] By solving the second constraint model, it can be obtained that when the transcoding threshold of the first sub-time period t1 is set to 1, as shown in Table 3, the scores corresponding to the trend features of all videos are less than 1, which does not meet S i ≥score t At this time, there is no need to transcode the video in the first sub-time period t1.
[0121] Similarly, when the transcoding threshold of the second sub-time period t2 is set to 1, since the scores corresponding to the trend features of all videos are less than 1, S i ≥score t , at this time, there is no need to transcode the video in the second sub-time period t2. When the transcoding threshold of the third sub-time period t3 is set to 0.5, after comparison, there are 3 videos whose scores corresponding to the video trend features are equal to 0.5, satisfying S i ≥score t The condition is that there are 3 playback record IDs I4~I6, and the corresponding video playback coverage in the third sub-time period t3 is 3 / 9=33.3%, which is greater than the preset video playback coverage of 30%. At this time, the number of transcoded videos is determined to be 1, and the video is G3.
[0122] The method provided in this embodiment adds constraints in the time dimension, thereby achieving the determination of video transcoding thresholds with smaller granularity, so that the number of video transcodings is increased during the time period when fewer videos are released, thereby balancing the use of resources and maximizing the video transcoding efficiency.
[0123] In addition, the number of sub-time periods and the number of regions for uploading videos can be flexibly adjusted according to the data. By adding constraints in the time dimension and the regional dimension, the function can be flexibly adjusted according to different needs. For example, in the automatic threshold solution of multiple regions, the number of video transcoding in this region must exceed 0.8 times the total number of transcodings, and the threshold of each time period in the time-sensitive threshold solution problem cannot exceed 0.1 times, etc., which can be obtained by adjusting some parameters through the method of the above embodiment.
[0124] In addition, if Figure 5 As shown, after determining the target threshold and determining the number of videos that need to be transcoded according to the target threshold, the method further includes:
[0125] After the optimization solution, it is detected whether the number of videos that need to be transcoded currently meets the requirements; or the submitter determines whether the calculation result is reasonable. If not (does not meet the requirements / is unreasonable), the preset video playback coverage is adjusted, and the number of videos to be transcoded is recalculated using the adjusted video playback coverage. Or the target parameters and conditions are adjusted, such as submitting the calculation task, design goals, and specified constraints, until the number of videos to be recalculated is small or reasonable, and then the transcoding parameter experiment is started. The specific process is not described in detail in the embodiment of this application.
[0126] The playback information of all videos may be stored in the Hive module of the data warehouse tool, and the online data may be obtained by dumping the data of each time slice. The specific storage method and acquisition means are not limited in this embodiment.
[0127] In this embodiment, a device for determining parameters of video transcoding is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0128] This embodiment provides a device for determining parameters of video transcoding. Figure 5 As shown, the device comprises:
[0129] The acquisition module 501 is used to obtain the playback information of multiple videos played by the platform within a preset time period, wherein the playback information of each video includes: the ID of the video and the trend characteristics of the video, and the trend characteristics of the video are used to describe the number of times the current video is played in the future period of time.
[0130] A calculation module 502 is used to calculate a target threshold for video transcoding under the condition of satisfying a preset video playback coverage rate according to the ID of each video and the trend characteristics of each video;
[0131] The determination module 503 is used to determine the number of videos that need to be transcoded under a preset video playback coverage rate according to the target threshold.
[0132] In addition, the device may also include more or fewer modules and units, which is not limited in this embodiment.
[0133] Optionally, in a specific implementation of this embodiment, the number of the multiple videos is N, N≥2,
[0134] The calculation module 502 is specifically used to set at least one threshold value and a first condition under each of the threshold values, wherein the first condition is that the score corresponding to the trend feature of the video is greater than or equal to the current threshold value; according to the first condition under each threshold value and the preset video playback coverage, the playback information of N videos is screened to obtain M video playback information corresponding to each threshold value, and at least one video number corresponding to the at least one threshold value is determined based on the M video playback information; and the target threshold value is determined to be the threshold value corresponding to the smallest number of videos among the at least one number of videos.
[0135] Optionally, in another specific implementation of this embodiment, the acquisition module 501 is further used to acquire the region ID of each video upload and the playback region ID of each video from the playback information of each video;
[0136] The calculation module 502 is further used to obtain the target threshold through the first constraint model calculation according to the ID of each video, the trend feature of each video, the area ID of each video upload and the playback area ID of each video.
[0137] Among them, the first constraint model constraints: the playback area ID of the current video belongs to the current area j, and the score corresponding to the trend feature of the current video is greater than or equal to the threshold, j is the area identifier, and the threshold is the threshold corresponding to the current area j.
[0138] Optionally, in another specific implementation of this embodiment, if the preset time period includes multiple sub-time periods, the acquisition module 501 is further configured to acquire a timestamp of video playback in each sub-time period.
[0139] The calculation module 502 is also used to calculate the sub-threshold of video transcoding in each sub-time period according to the timestamp and the video playback coverage of the current sub-time period through the second constraint model; and calculate the number of videos that need to be transcoded corresponding to each of the sub-thresholds; count the number of videos that need to be transcoded under all sub-thresholds to obtain the total number of videos that need to be transcoded.
[0140] The second constraint model operation constraint is: the timestamp of the current video playback is within a sub-time period, and the score corresponding to the trend feature of the current video is greater than or equal to a threshold, and the threshold is the threshold corresponding to the current sub-time period.
[0141] Optionally, in another specific implementation of this embodiment, the device also includes a detection module, which is used to detect whether the number of videos that need to be transcoded meets the requirements after determining the number of videos that need to be transcoded; if not, the calculation module 502 adjusts the parameters of the preset video playback coverage and recalculates the number of videos to be transcoded.
[0142] The above-mentioned device is also used to implement other method functions in the above-mentioned embodiments 1 to 3. For details, please refer to the description of the above-mentioned embodiments, which will not be described in detail in this embodiment.
[0143] In addition, the video transcoding parameter determination device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0144] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0145] The embodiment of the present invention also provides a computer device having the above Figure 6 The device for determining parameters of video transcoding is shown.
[0146] See also Figure 7 , is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 7As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7 A processor 10 is taken as an example.
[0147] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0148] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0149] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the use of a computer device based on the presentation of a small program landing page, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0150] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0151] The computer device further comprises a communication interface 30, which is used for the computer device to communicate with other devices or communication networks, such as performing data transmission with at least one terminal device or database.
[0152] An embodiment of the present invention also provides a computer-readable storage medium, and the above-mentioned method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented by downloading through a network and originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware.
[0153] The storage medium may be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid state drive, etc.; further, the storage medium may also include a combination of the above-mentioned types of memories. It is understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by the computer, processor or hardware, the method shown in the above embodiment is implemented.
[0154] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for determining parameters of video transcoding, characterized in that: The method comprises: Obtaining playback information of multiple videos played on the platform within a preset time period, wherein the playback information of each video includes: a video ID and a trend feature of the video, wherein the trend feature of the video is used to describe the number of times the current video is played in a future period of time; Calculate the target threshold of video transcoding under the condition of satisfying the preset video playback coverage according to the ID of each video and the trend characteristics of the video; According to the target threshold, the number of videos that need to be transcoded under the preset video playback coverage is determined.
2. The method according to claim 1, characterized in that The number of the plurality of videos is N, N≥2, According to the ID of each video and the trend characteristics of the video, a target threshold of video transcoding is calculated under the condition of satisfying a preset video playback coverage, including: Setting at least one threshold value and a first condition under each threshold value, wherein the first condition is that the score corresponding to the trend feature of the video is greater than or equal to the current threshold value; According to the first condition under each threshold and the preset video playback coverage, the playback information of the N videos is screened to obtain M video playback information corresponding to each threshold, and the number of at least one video corresponding to the at least one threshold is determined according to the M video playback information; The target threshold is determined to be a threshold corresponding to a smallest video quantity among the at least one video quantity.
3. The method according to claim 1, characterized in that The method further comprises: If the multiple videos being played are uploaded from different regions, the region ID of each video upload and the region ID of each video being played are also obtained from the play information of each video; The calculating of the target threshold of video transcoding under the condition of satisfying a preset video playback coverage rate includes: The target threshold is obtained by calculating the first constraint model according to the ID of each video, the trend feature of each video, the area ID of each video upload and the playback area ID of each video.
4. The method according to claim 3, characterized in that The first constraint model constraints: the playback area ID of the current video belongs to the current area j, and the score corresponding to the trend feature of the current video is greater than or equal to a threshold, j is the area identifier, and the threshold is the threshold corresponding to the current area j.
5. The method according to any one of claims 1 to 4, characterized in that: If the preset time period includes multiple sub-time periods, the acquired video playback information also includes: a timestamp of the video playback in each sub-time period; Calculate the target threshold of video transcoding under the condition of meeting the preset video playback coverage, including: According to the timestamp, a sub-threshold of video transcoding is calculated in each sub-time period under the video playback coverage of the current sub-time period through a second constraint model; And, calculating the number of videos that need to be transcoded corresponding to each of the sub-thresholds; The number of videos that need to be transcoded under all the sub-thresholds is counted to obtain the total number of videos that need to be transcoded.
6. The method according to claim 5, characterized in that The second constraint model operates on the constraints: The timestamp of the current video playback is within a sub-time period, and the score corresponding to the trend feature of the current video is greater than or equal to a threshold, and the threshold is a threshold corresponding to the current sub-time period.
7. The method according to claim 1, characterized in that After determining the number of videos that need to be transcoded, it also includes: Check whether the number of videos that need to be transcoded meets the requirement; If the number of videos does not meet the requirement, the parameters of the preset video playback coverage are adjusted, and the number of videos to be transcoded is recalculated.
8. A device for determining parameters of video transcoding, characterized in that: The device comprises: An acquisition module is used to acquire the playback information of multiple videos played on the platform within a preset time period, wherein each playback information includes: a video ID and a trend feature of the video, wherein the trend feature of the video is used to describe the number of times the current video is played in a future period of time; A calculation module, used to calculate a target threshold for video transcoding under the condition of satisfying a preset video playback coverage rate according to the ID of each video and the trend characteristics of the video; The determination module is used to determine the number of videos that need to be transcoded under a preset video playback coverage rate according to the target threshold.
9. A computer device, characterized in that: comprising a memory and a processor, wherein the memory and the processor are communicatively connected with each other; The memory stores computer instructions, and the processor executes the parameter determination method for video transcoding according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer readable storage medium has computer instructions stored thereon. The computer instructions are used to enable a computer to execute the video transcoding parameter determination method according to any one of claims 1 to 7.
