Data processing method, data processing device, electronic equipment and storage medium
By determining and selecting appropriate candidate compressed videos and segmentation processing during video transmission, the problem of video quality and memory occupation in video transmission is solved, ensuring efficient transmission and storage of videos.
Patent Information
- Application Number
- CN202410809015.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-21
- Publication Date
- 2024-08-23
AI Technical Summary
During the video transmission process, the video occupies too much memory, causing transmission failure, and it is difficult to maintain video quality during video compression, affecting the clarity and smoothness of the video.
Ensure the video quality of the compressed video by determining the candidate values of the parameters to be adjusted and selecting the appropriate compressed video according to the preset conditions of video quality. If the conditions are not met, the previous candidate compressed video is selected as the target compressed video, and if necessary Split the video to meet preset memory limits.
It effectively ensures video quality and memory usage during video compression, reduces the risk of transmission failure, and improves video storage and transmission efficiency.
Smart Images

Figure CN118540486A
Abstract
Description
Technical Field
[0001] The present application relates to the field of multimedia technology, and more specifically, to a data processing method, a data processing device, an electronic device and a storage medium in the field of multimedia technology. Background Art
[0002] When a user uses an application (Application, App) in an electronic device to transfer a video, if the video occupies a large amount of memory, for example, 4.5 GB, the upload may fail, thereby affecting the normal transmission of the video.
[0003] Currently, videos can be compressed to reduce the memory occupied by the videos and ensure normal transmission of the videos. However, in the process of compressing the videos, the clarity and / or smoothness of the videos may be affected, thereby reducing the video quality of the videos.
[0004] Therefore, when compressing a video, how to ensure the video quality is a problem that needs to be solved urgently. Summary of the invention
[0005] The present application provides a data processing method, a data processing device, an electronic device and a storage medium. When compressing a video, the method can ensure the video quality of the compressed video.
[0006] In a first aspect, a data processing method is provided, the method comprising:
[0007] Based on the initial value of the parameter to be adjusted in the original video, multiple candidate values of the parameter to be adjusted are determined; wherein the multiple candidate values are all smaller than the initial value; if the video quality of the first candidate compressed video meets the preset conditions, the i-th candidate value in the preset order is selected from the multiple candidate values, and the original video is compressed based on the i-th candidate value to obtain the i-th candidate compressed video; wherein i is an integer greater than 1; the first candidate compressed video is a compressed video obtained based on the first candidate value in the preset order; the ranking position of the candidate value in the preset order is positively correlated with the video quality of the candidate compressed video corresponding to the candidate value; determine whether the video quality of the i-th candidate compressed video meets the preset conditions; if the video quality of the i-th candidate compressed video does not meet the preset conditions, determine the i-1th candidate compressed video as the target compressed video; wherein the i-1th candidate compressed video is a compressed video obtained based on the i-1th candidate value in the preset order.
[0008] In an embodiment of the present application, when the compressed video obtained by the 1st candidate value, that is, the video quality of the 1st candidate compressed video meets the preset condition, the i-th candidate compressed video is obtained by compressing the original video with the i-th candidate value, and when the i-th candidate compressed video does not meet the preset condition, the i-1-th candidate compressed video is determined as the target compressed video. Since the ranking position of the candidate value is positively correlated with the video quality of the candidate compressed video corresponding to the candidate value, that is, the higher the ranking position of the candidate value, the higher the video quality, therefore, when the video quality of the 1st candidate compressed video meets the preset condition and the i-th candidate compressed video does not meet the preset condition, the i-1-th candidate compressed video before the i-th candidate compressed video can be selected as the target compressed video, so that the video quality of the determined target compressed video can meet the preset condition, and a compressed video with higher video quality is obtained, so that when compressing the video, the video quality of the compressed video can be ensured.
[0009] In combination with the first aspect, in some implementations of the first aspect, the parameters to be adjusted are at least two parameters to be adjusted, and if the video quality of the i-th candidate compressed video does not meet the preset condition, determining the i-1th candidate compressed video as the target compressed video includes:
[0010] If the video quality of the i-th candidate compressed video corresponding to each of the at least two parameters to be adjusted does not meet the preset conditions, the target compressed video is determined based on the video quality and / or occupied memory of the i-1-th candidate compressed video corresponding to each parameter to be adjusted.
[0011] In an embodiment of the present application, when the video qualities of candidate compressed videos at the same sorting position corresponding to multiple parameters to be adjusted do not meet preset conditions, the target compressed video can be determined based on the video qualities and / or occupied memory of multiple candidate compressed videos at the same sorting position, so that the determined compressed video can meet the compression requirements in terms of video quality and / or occupied memory.
[0012] In combination with the first aspect and the above implementation manner, in some implementation manners of the first aspect, determining the target compressed video based on the video quality and / or occupied memory of the i-1th candidate compressed video corresponding to each parameter to be adjusted includes:
[0013] The compressed video corresponding to the minimum memory usage among the i-1th candidate compressed videos corresponding to each parameter to be adjusted is determined as the target compressed video; or, the compressed video corresponding to the highest video quality among the i-1th candidate compressed videos corresponding to each parameter to be adjusted is determined as the target compressed video.
[0014] In an embodiment of the present application, the compressed video corresponding to the smallest memory usage among the candidate compressed videos at the same sorting position corresponding to multiple parameters to be adjusted is determined as the target compressed video, which reduces the memory usage of the compressed video and is beneficial to the storage and transmission of the compressed video.
[0015] Alternatively, the compressed video corresponding to the highest video quality among the candidate compressed videos at the same sorting position corresponding to multiple parameters to be adjusted is determined as the target compressed video, thereby improving the video quality of the compressed video and further ensuring the video quality of the compressed video.
[0016] In combination with the first aspect and the foregoing implementations, in some implementations of the first aspect, the method further includes:
[0017] Obtain the memory occupied by the target compressed video; if the memory occupied by the target compressed video is greater than the preset memory occupied, segment the target compressed video based on the preset memory occupied to obtain multiple first compressed videos; wherein the memory occupied by each compressed video in the multiple first compressed videos is less than or equal to the preset memory occupied.
[0018] In an embodiment of the present application, when the memory occupied by the target compressed video is greater than the preset memory occupied, that is, when the memory occupied by the target compressed video is larger, the target compressed video can be segmented according to the preset memory occupied, so that the memory occupied by each of the multiple compressed videos obtained after the segmentation process is less than or equal to the preset memory occupied, thereby reducing the memory occupied by the compressed video, thereby making the compressed video with a smaller memory occupied easier to store and transmit.
[0019] In combination with the first aspect and the above implementation, in some implementations of the first aspect, the target compressed video is segmented based on the preset occupied memory to obtain multiple first compressed videos, including:
[0020] Determine a multiple of the memory occupied by the target compressed video and the preset memory occupied; based on the multiple, segment the target compressed video to obtain a plurality of first compressed videos.
[0021] In an embodiment of the present application, the target compressed video is segmented by comparing the occupied memory of the target compressed video with a multiple of the preset occupied memory, so that the occupied memory of each compressed video in the multiple compressed videos obtained after the segmentation will not be greater than the preset occupied memory, that is, the occupied memory of each compressed video after the segmentation is always less than or equal to the preset occupied memory, thereby improving the convenience of compressed video storage and transmission.
[0022] In combination with the first aspect and the above implementation manner, in some implementation manners of the first aspect, the above determining multiple candidate values of the parameter to be adjusted based on the initial value of the parameter to be adjusted in the original video includes:
[0023] Based on the parameter to be adjusted, a target mapping relationship is determined; in the target mapping relationship, multiple candidate values corresponding to the initial value are mapped.
[0024] In an embodiment of the present application, in the mapping relationship corresponding to the parameters to be adjusted in the original video, multiple candidate values corresponding to the initial values of the parameters to be adjusted are mapped, which can ensure that the mapped candidate values and the initial values are the same parameters to be adjusted, thereby improving the accuracy of the candidate values.
[0025] In combination with the first aspect and the foregoing implementations, in some implementations of the first aspect, the method further includes:
[0026] Obtain the absolute path of the original video; encapsulate the absolute path and generate a compression instruction for the original video; the above-mentioned compressing the original video based on the i-th candidate value to obtain the i-th candidate compressed video includes: after the compression instruction is generated, compressing the original video based on the i-th candidate value to obtain the i-th candidate compressed video.
[0027] In an embodiment of the present application, the absolute path of the original video is encapsulated to generate a compression instruction corresponding to the original video, that is, the original video and the compression instruction are one-to-one corresponding, so that after the compression instruction is generated, the original video can be compressed instead of videos other than the original video, thereby ensuring the accuracy of the compression processing of the original video.
[0028] In a second aspect, a data processing device is provided, the device comprising:
[0029] A determination module, used to determine multiple candidate values of the parameter to be adjusted based on the initial value of the parameter to be adjusted in the original video; wherein the multiple candidate values are all smaller than the initial value;
[0030] A compression module, configured to select an i-th candidate value in a preset order from among multiple candidate values if the video quality of the first candidate compressed video meets a preset condition, and compress the original video based on the i-th candidate value to obtain an i-th candidate compressed video; wherein i is an integer greater than 1; the first candidate compressed video is a compressed video obtained based on the first candidate value in the preset order; and the order position of the candidate value in the preset order is positively correlated with the video quality of the candidate compressed video corresponding to the candidate value;
[0031] A judgment module, used to determine whether the video quality of the i-th candidate compressed video meets a preset condition;
[0032] A processing module is used to determine a target compressed video based on the i-1th candidate compressed video if the video quality of the i-th candidate compressed video does not meet the preset conditions; wherein the i-1th candidate compressed video is a compressed video obtained based on the i-1th candidate value in the preset sorting.
[0033] In a third aspect, an electronic device is provided, comprising a memory and a processor. The memory is used to store executable program code, and the processor is used to call and run the executable program code from the memory, so that the electronic device executes the method in the first aspect or any possible implementation of the first aspect.
[0034] In a fourth aspect, a computer program product is provided, comprising: a computer program code, which, when executed on a computer, enables the computer to execute the method in the first aspect or any possible implementation of the first aspect.
[0035] In a fifth aspect, a computer-readable storage medium is provided, which stores a computer program code. When the computer program code runs on a computer, the computer executes the method in the above-mentioned first aspect or any possible implementation manner of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 It is a schematic diagram of a video transmission scenario in related technology.
[0037] Figure 2 It is a schematic diagram of the architecture of a video compression provided in an embodiment of the present application.
[0038] Figure 3 It is a flowchart of a data processing method provided in an embodiment of the present application.
[0039] Figure 4 It is a structural diagram of a data processing device provided in an embodiment of the present application.
[0040] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0041] The technical solution in the present application will be described clearly and in detail below in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B: "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0042] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.
[0043] Figure 1 It is a schematic diagram of a video transmission scenario in related technology.
[0044] For example, Figure 1 As shown, Figure 1 The electronic device 110 is included, and the electronic device 110 can transmit multimedia data; wherein the multimedia data includes but is not limited to video, audio data and image data.
[0045] Exemplarily, the electronic device 110 may receive a text message sent from user A to user B, such as “please send the video to me”. After receiving the text message, user B needs to send the corresponding video to user A via the network.
[0046] Due to server pressure and other reasons, the memory size occupied by the video may be limited. If the memory occupied by the video is too large, for example, 4.5GB, which is larger than the limit of 4GB, the upload will fail, thus affecting the normal transmission of the video. Figure 1 of 120.
[0047] In order to ensure the normal transmission of the video, user B can choose to open the VIP service to increase the memory usage limit, but the VIP service will cause economic losses to user B. Therefore, compressing the video to reduce the memory usage of the video is a common method. After compressing the 4.5GB video, a 2GB compressed video can be obtained, and then the compressed video is successfully sent to user A through the network. Figure 1 of 130.
[0048] However, in the process of compressing the video, the clarity and / or smoothness of the video may be reduced, thereby reducing the video quality of the video.
[0049] It should be noted that the electronic device may be a smart device with data transmission and data compression functions, including but not limited to: a personal computer, a tablet computer, a handheld device, a vehicle-mounted device, a wearable device, a computing device or other processing device connected to a wireless modem, etc. Electronic devices may be called different names in different networks, such as: user equipment, access electronic equipment, user unit, user station, mobile station, mobile station, remote station, remote electronic device, mobile device, user electronic device, electronic device, wireless communication device, user agent or user device, cellular phone, cordless phone, 5G network or electronic device in future evolution network, etc., which is not limited by the comparison of the embodiments of the present application.
[0050] In order to solve the problem of reducing video quality when compressing video, the present application proposes a data processing method, a data processing device, an electronic device and a storage medium.
[0051] Combine the following Figures 2 to 3 The data processing method provided in the embodiment of the present application is described in detail.
[0052] Figure 2 It is a schematic diagram of the architecture of a video compression provided in an embodiment of the present application.
[0053] For example, Figure 2 As shown, the architecture 200 includes a language module 201, a tool file library 202, a packaging module 203+a compression module 204. The video to be compressed (i.e., the original video) is used as input, and the compressed video (i.e., the compressed video) is used as output.
[0054] Exemplarily, the tool file library 202 can be designed by the third-party library PyQ5 in the language module 201 (for example, the Python language module) so that the tool file library 202 has a visual interface. Among them, PyQ5 can be named and installed by Pip Install PyQt5. After the installation of PyQ5 is completed, the original video is dragged to the tool file library 202, and the QWidget package under PyQt5.QtWidgets is used to call the event.mimeData().urls() method to obtain the absolute path of the original video through the event.mimeData().urls() method, that is, the actual storage path of the original video in the electronic device.
[0055] Further, after obtaining the absolute path of the original video, the absolute path can be used as a compressed video input parameter of the encapsulation module 203 (e.g., Fast Forward Moving Picture Experts Group, FFmrpeg) for command encapsulation to obtain the encapsulated compression instruction. Finally, the compression module 204 in FFmrpeg adjusts one or more of the resolution, bit rate and encoding format of the original video to obtain a compressed video that occupies less memory than the original video.
[0056] Optionally, the formats of the compression instructions corresponding to the resolution, bit rate and encoding format are different. For example, the compression instruction corresponding to the resolution is: FFmpeg-iinput.Mp4-vf scale=640:360output.Mp4. Among them, -iinput.Mp4 is used to represent the original video corresponding to the absolute path, and the format of the original video is Mp4; -vf scale is used to indicate that the compression process of the original video is resolution compression processing; 640:360output.Mp4 is used to indicate that the resolution of the original video is compressed to 640:360, and the compressed video format is Mp4. Among them, the larger the resolution, the higher the clarity of the video, and the larger the memory occupied by the video, that is, the resolution is positively correlated with the clarity of the video and the memory occupied by the video.
[0057] For another example, the compression instruction corresponding to the bit rate is: FFmpeg-iinput.Mp4-b:v 512koutput.Mp4. Among them, -b:v 512k is used to indicate that the compression process of the original video is a bit rate compression process, and the bit rate of the original video is compressed to 512k. Among them, the larger the bit rate, the higher the fluency of the video, and the larger the memory occupied by the video, that is, the bit rate is positively correlated with the fluency of the video and the memory occupied by the video.
[0058] For example, the compression instruction corresponding to the encoding format is: FFmpeg-iinput.Mp4-c:v libx265-crf28output.Mp4. Among them, -c:v libx265 is used to indicate that the original video is encoded and compressed using the x265 encoder; -crf 28 is used to indicate that the encoding value of the original video is compressed to 28. Among them, the encoding value can be used to indicate the video quality of the compressed video. The smaller the encoding value, the higher the clarity and smoothness of the video, and the larger the memory occupied by the video, that is, the encoding value is negatively correlated with the clarity, smoothness and memory occupied of the video.
[0059] It should be noted that the video format may include but is not limited to Mp4, Mov, Wmv and Flv, and needs to be selected according to user needs. The embodiment of the present application does not limit this.
[0060] Figure 3 is a flow chart of a data processing method provided in an embodiment of the present application. The method can be Figure 1 The electronic device 110 is executed. Figure 3 The method 300 shown can process multimedia data. For ease of description, this application takes video data as an example.
[0061] For example, Figure 3 As shown, the method 300 includes the following implementation process:
[0062] S310, determining multiple candidate values of the parameter to be adjusted based on the initial value of the parameter to be adjusted in the original video.
[0063] Among them, multiple candidate values are all smaller than the initial value.
[0064] The parameters to be adjusted are used to represent parameters that need to be compressed, for example, one or more of resolution, bit rate and encoding format.
[0065] For example, when the memory occupied by the video (which may be referred to as the "original video") is too large, the original video may be compressed for transmission. When compressing the original video, the parameter to be adjusted (e.g., resolution) in the original video may be obtained first, and the resolution value corresponding to the resolution before the compression process is performed (which may be referred to as the "initial value") may be obtained, for example, 1024:768.
[0066] Furthermore, in order to compress the original video, multiple resolution values (referred to as "candidate values") corresponding to the resolution for compression processing may be determined by the above initial value, and each of the multiple candidate values is smaller than the initial value of the resolution. For example, the candidate values may include but are not limited to 1024:512, 1024:360, and 512:360.
[0067] Optionally, when the parameter to be adjusted is the bit rate, and the initial value corresponding to the bit rate is 5000k, candidate values corresponding to the bit rate may include but are not limited to 2048k, 1024k and 512k.
[0068] Optionally, when the parameter to be adjusted is a coding format, and the initial value corresponding to the coding format is 14, candidate values corresponding to the coding format may include but are not limited to 28, 36 and 52.
[0069] For example, when the candidate value of the parameter to be adjusted is greater than or equal to the initial value, compressing the original video cannot reduce the memory occupied by the original video; therefore, in order to reduce the memory occupied by the original video, any candidate value of the parameter to be adjusted should be smaller than the initial value of the parameter to be adjusted.
[0070] Optionally, the determining of multiple candidate values of the parameter to be adjusted based on the initial value of the parameter to be adjusted in the original video includes: determining a target mapping relationship based on the parameter to be adjusted; and mapping multiple candidate values corresponding to the initial value in the target mapping relationship.
[0071] The target mapping relationship is used to represent a mapping relationship that corresponds one-to-one to the parameter to be adjusted. For example, the resolution corresponds to mapping relationship 1, the bit rate corresponds to mapping relationship 2, and the encoding format corresponds to mapping relationship 3.
[0072] Exemplarily, when the parameter to be adjusted is resolution, a mapping relationship 1 corresponding to the resolution can be determined; and in the mapping relationship 1, multiple candidate values that are smaller than the initial value of the resolution are mapped to ensure that the multiple candidate values obtained are resolution values, rather than bit rate values, thereby improving the accuracy of the candidate values.
[0073] Exemplarily, when the parameter to be adjusted is the bit rate, a mapping relationship 2 corresponding to the bit rate may be determined; and in the mapping relationship 2, a plurality of candidate values that are smaller than the initial value of the bit rate are mapped.
[0074] Exemplarily, when the parameter to be adjusted is a coding format, a mapping relationship 3 corresponding to the coding format may be determined; and in the mapping relationship 3, a plurality of candidate values that are smaller than an initial value of the coding format are mapped.
[0075] In an embodiment of the present application, in the mapping relationship corresponding to the parameters to be adjusted in the original video, multiple candidate values corresponding to the initial values of the parameters to be adjusted are mapped, which can ensure that the mapped candidate values and the initial values are the same parameters to be adjusted, thereby improving the accuracy of the candidate values.
[0076] S320, if the video quality of the first candidate compressed video meets the preset condition, select the i-th candidate value in the preset order from multiple candidate values, compress the original video based on the i-th candidate value, and obtain the i-th candidate compressed video.
[0077] Wherein, i is an integer greater than 1; the first candidate compressed video is a compressed video obtained based on the first candidate value in the preset sorting; the sorting position of each candidate value in the preset sorting is positively correlated with the video quality of the candidate compressed video corresponding to each candidate value. And, the higher the video quality, the higher the clarity and / or smoothness of the video, that is, the video quality is positively correlated with the clarity and / or smoothness.
[0078] Exemplarily, the clarity and / or smoothness (i.e., video quality) of the original video will be reduced after compression processing. In order to gradually reduce the video quality of the compressed video (which can be called "compressed video") from high to low, the ranking position of each candidate value among the multiple candidate values can be associated with the video quality of the compressed video. The compressed video corresponding to the candidate value with a higher ranking position among the multiple candidate values has higher video quality, and the compressed video corresponding to the candidate value with a lower ranking position has lower video quality, that is, the ranking position of each candidate value among the multiple candidate values is positively correlated with the video quality of the candidate compressed video corresponding to each candidate value.
[0079] Exemplarily, after a plurality of candidate values of the parameter to be adjusted are determined, the plurality of candidate values may be sorted in order from large to small or from small to large to obtain a sorting position of each candidate value in the plurality of candidate values.
[0080] Optionally, since the resolution is positively correlated with the clarity of the video and the memory occupied by the video, and the bit rate is positively correlated with the smoothness of the video and the memory occupied by the video. Therefore, the multiple candidate values corresponding to the resolution and the bit rate can be sorted in order from large to small, so as to obtain the sorting positions of the respective candidate values corresponding to the resolution and the bit rate. For example, the sorting positions of the candidate values corresponding to the resolution are, from front to back: 1024:512, 1024:360 and 512:360; the sorting positions of the candidate values corresponding to the bit rate are, from front to back: 2048k, 1024k and 512k.
[0081] Optionally, since the coding value is negatively correlated with the clarity, smoothness, and memory usage of the video, multiple candidate values corresponding to the coding format can be sorted in ascending order to obtain the sorting position of each candidate value corresponding to the coding format. For example, the sorting positions of each candidate value corresponding to the coding format are 28, 36, and 52 from front to back.
[0082] Exemplarily, after compressing the original video using the first candidate value corresponding to the resolution (e.g., 1024:512), a compressed video 1 (which may be referred to as a "candidate compressed video") with a resolution of 1024:512 is obtained. Afterwards, it is determined whether the video quality of the compressed video 1 meets a preset condition (i.e., the video quality is greater than or equal to a preset value, e.g., 5). When the video quality of the compressed video 1 is less than 5 and does not meet the preset condition, that is, the video quality of the compressed video 1 is low, indicating that the compression of the original video cannot obtain a compressed video with a high video quality. A suggestion message may be sent to the user to suggest that the user copy the original video using a memory card or activating a VIP service, thereby achieving the transmission of the original video.
[0083] Alternatively, when the video quality of compressed video 1 meets the preset conditions, that is, the video quality of compressed video 1 is high, the original video can be further compressed through the second candidate value corresponding to the resolution (for example, 1024:360) to obtain compressed video 2 with a resolution of 1024:360, that is, the i-th candidate compressed video.
[0084] In a possible implementation, the absolute path of the original video is obtained; the absolute path is encapsulated to generate a compression instruction for the original video; the above-mentioned compressing the original video based on the i-th candidate value to obtain the i-th candidate compressed video includes: after the compression instruction is generated, compressing the original video based on the i-th candidate value to obtain the i-th candidate compressed video.
[0085] refer to Figure 2 , you can drag the original video to the tool library, and use the QWidget package under PyQt5.QtWidgets to call the event.mimeData().urls() method to obtain the absolute path corresponding to the original video through the event.mimeData().urls() method. After obtaining the absolute path corresponding to the original video, input the absolute path into FFmrpeg for command encapsulation to generate the encapsulated compression instruction. The compression instruction can indicate one or more compression processing of the original video in terms of resolution, bit rate and encoding format.
[0086] Exemplarily, when the parameter to be adjusted is resolution, the compression instruction corresponding to the first candidate value for compressing the original video is: FFmpeg-iinput.Mp4-vf scale=1024:512output.Mp4; the compression instruction corresponding to the second candidate value for compressing the original video is: FFmpeg-iinput.Mp4-vf scale=1024:360output.Mp4; the compression instruction corresponding to the third candidate value for compressing the original video is: FFmpeg-iinput.Mp4-vf scale=512:360output.Mp4, and so on, to obtain the compression instruction for each candidate value corresponding to the resolution.
[0087] Exemplarily, when the parameter to be adjusted is the bit rate, the compression instruction corresponding to the first candidate value for compressing the original video is: FFmpeg-iinput.Mp4-b:v 2048k output.Mp4; the compression instruction corresponding to the second candidate value for compressing the original video is: FFmpeg-iinput.Mp4-b:v1024k output.Mp4; the compression instruction corresponding to the third candidate value for compressing the original video is: FFmpeg-iinput.Mp4-b:v 512k output.Mp4, and so on, to obtain the compression instruction for each candidate value corresponding to the bit rate.
[0088] Exemplarily, when the parameter to be adjusted is the encoding format, the compression instruction corresponding to the first candidate value for compressing the original video is: FFmpeg-iinput.Mp4-c:v libx265-crf 28output.Mp4; the compression instruction corresponding to the second candidate value for compressing the original video is: FFmpeg-iinput.Mp4-c:v libx265-crf36output.Mp4; the compression instruction corresponding to the third candidate value for compressing the original video is: FFmpeg-iinput.Mp4-c:v libx265-crf 52output.Mp4, and so on, to obtain the compression instruction of each candidate value corresponding to the encoding format.
[0089] Furthermore, after the compression instruction is generated, the original video is compressed using the second candidate value corresponding to the resolution (eg, 1024:360) to obtain a compressed video 2 with a resolution of 1024:360.
[0090] In an embodiment of the present application, the absolute path of the original video is encapsulated to generate a compression instruction corresponding to the original video, that is, the original video and the compression instruction are one-to-one corresponding, so that after the compression instruction is generated, the original video can be compressed instead of videos other than the original video, thereby ensuring the accuracy of the compression processing of the original video.
[0091] S330, determining whether the video quality of the i-th candidate compressed video meets a preset condition.
[0092] Exemplarily, after the compressed video 2 is obtained, it can be determined whether the video quality of the compressed video 2 meets a preset condition.
[0093] Optionally, when the video quality of compressed video 2 meets the preset conditions, the original video can be further compressed using the third candidate value corresponding to the resolution (for example, 512:360) to obtain a compressed video 3 with a resolution of 512:360, and then determine whether the video quality of the compressed video 3 meets the preset conditions, and so on, until the i-th candidate compressed video that does not meet the preset conditions appears.
[0094] S340: If the video quality of the i-th candidate compressed video does not meet a preset condition, determine a target compressed video based on the i-1-th candidate compressed video.
[0095] The i-1th candidate compressed video is a compressed video obtained based on the i-1th candidate value in the preset order. For example, if the i-th candidate compressed video is compressed video 2, then the i-1th candidate compressed video is compressed video 1.
[0096] Exemplarily, when the video quality of compressed video 2 does not meet the preset conditions, that is, the video quality of compressed video 2 is low and lower than the video quality of compressed video 1, compressed video 1 can be obtained after the last compression processing of the original video before compressed video 2, and the final compressed video (which can be called "target compressed video") can be determined through the compressed video 1.
[0097] In such Figure 3 In the method 300 shown, when the compressed video obtained by the first candidate value, that is, the video quality of the first candidate compressed video meets the preset condition, the original video is compressed by the i-th candidate value to obtain the i-th candidate compressed video, and when the i-th candidate compressed video does not meet the preset condition, the i-1-th candidate compressed video is determined as the target compressed video. Since the ranking position of the candidate value is positively correlated with the video quality of the candidate compressed video corresponding to the candidate value, that is, the higher the ranking position of the candidate value, the higher the video quality, therefore, when the video quality of the first candidate compressed video meets the preset condition and the i-th candidate compressed video does not meet the preset condition, the i-1-th candidate compressed video before the i-th candidate compressed video can be selected as the target compressed video, so that the video quality of the determined target compressed video can meet the preset condition, and a compressed video with higher video quality is obtained, so that when compressing the video, the video quality of the compressed video can be ensured.
[0098] Optionally, the number of parameters to be adjusted may be obtained. When the number of parameters to be adjusted is one, that is, the parameter to be adjusted is any one of resolution, bit rate and encoding format, compressed video 1 may be directly determined as the target compressed video.
[0099] Alternatively, when there are at least two parameters to be adjusted, if the video quality of the i-th candidate compressed video does not meet the preset conditions, the i-1th candidate compressed video is determined as the target compressed video, including: if the video quality of the i-th candidate compressed video corresponding to each of the at least two parameters to be adjusted does not meet the preset conditions, the target compressed video is determined based on the video quality and / or occupied memory of the i-1th candidate compressed video corresponding to each parameter to be adjusted.
[0100] The at least two parameters to be adjusted may be resolution and bit rate, resolution and encoding format, bit rate and encoding format, or resolution, bit rate and encoding format. For ease of understanding, the following embodiments are described with at least two parameters to be adjusted being resolution and bit rate.
[0101] Exemplarily, when the parameters to be adjusted are resolution and bit rate, the i-th candidate compressed video corresponding to the resolution (for example, compressed video 2′) and the i-th candidate compressed video corresponding to the bit rate (for example, compressed video 2″) can be obtained. Then, it is determined whether the video quality of compressed video 2′ and the video quality of compressed video 2″ meet the preset conditions.
[0102] Optionally, when the video quality of the compressed video 2′ meets the preset conditions, but the video quality of the compressed video 2″ does not meet the preset conditions, the compressed video 1 corresponding to the bit rate can be determined as the target compressed video. Alternatively, when the video quality of the compressed video 2′ does not meet the preset conditions, but the video quality of the compressed video 2″ meets the preset conditions, the compressed video 1 corresponding to the resolution can be determined as the target compressed video.
[0103] Optionally, when the video quality of compressed video 2′ and the video quality of compressed video 2″ both meet preset conditions, the video quality and occupied memory of each of compressed video 2′ and compressed video 2″ can be obtained, and the target compressed video can be determined through the video quality and / or occupied memory of each of compressed video 2′ and compressed video 2″.
[0104] In an embodiment of the present application, when the video qualities of candidate compressed videos at the same sorting position corresponding to multiple parameters to be adjusted do not meet preset conditions, the target compressed video can be determined based on the video qualities and / or occupied memory of multiple candidate compressed videos at the same sorting position, so that the determined compressed video can meet the compression requirements in terms of video quality and / or occupied memory.
[0105] Furthermore, the target compressed video is obtained based on the video quality and / or occupied memory of the i-1th candidate compressed video corresponding to each parameter to be adjusted, including: determining the compressed video corresponding to the smallest occupied memory among the i-1th candidate compressed videos corresponding to each parameter to be adjusted as the target compressed video; or determining the compressed video corresponding to the highest video quality among the i-1th candidate compressed videos corresponding to each parameter to be adjusted as the target compressed video.
[0106] Exemplarily, when the video quality of compressed video 2′ and the video quality of compressed video 2″ both meet preset conditions, the memory occupied by compressed video 2′ and the memory occupied by compressed video 2″ can be compared to determine the compressed video corresponding to the minimum memory occupied, and the compressed video corresponding to the minimum memory occupied can be determined as the target compressed video. For example, the memory occupied by compressed video 2′ is 2GB, and the memory occupied by compressed video 2″ is 3.5GB, then the memory occupied by compressed video 2′ (2GB) is less than the memory occupied by compressed video 2″ (3.5GB). In order to improve the transmission efficiency of compressed videos, the compressed video 2′ with the minimum memory occupied can be determined as the target compressed video.
[0107] Alternatively, when the video quality of compressed video 2′ and the video quality of compressed video 2″ both meet preset conditions, the video quality of compressed video 2′ and the video quality of compressed video 2″ can be compared to determine the compressed video corresponding to the highest video quality, and the compressed video corresponding to the highest video quality can be determined as the target compressed video. For example, if the video quality of compressed video 2′ is 3 and the video quality of compressed video 2″ is 5, then the video quality 3 of compressed video 2′ is less than the video quality 5 of compressed video 2″. In order to improve the video quality of the compressed video, the compressed video 2″ with the highest video quality can be determined as the target compressed video.
[0108] Alternatively, when the video quality of compressed video 2′ and the video quality of compressed video 2″ both meet preset conditions, it can be determined whether the occupied memory of compressed video 2′ and the occupied memory of compressed video 2″ are less than or equal to the preset occupied memory (for example, 4GB); when the occupied memory of compressed video 2′ is less than or equal to 4GB, compressed video 2′ can be determined as the target compressed video. And / or, when the occupied memory of compressed video 2″ is less than or equal to 4GB, compressed video 2″ can be determined as the target compressed video. It is not necessary to determine the compressed video corresponding to the smallest occupied memory between the occupied memory of compressed video 2′ and the occupied memory of compressed video 2″, as long as the occupied memory of compressed video 2′ and / or compressed video 2″ is less than or equal to 4GB, normal transmission of the compressed video is ensured.
[0109] It should be noted that the preset memory usage is related to factors such as the processing capability of the server and the memory usage limit of the application software, and the embodiments of the present application do not limit this.
[0110] In an embodiment of the present application, the compressed video corresponding to the smallest memory usage among the candidate compressed videos at the same sorting position corresponding to multiple parameters to be adjusted is determined as the target compressed video, which reduces the memory usage of the compressed video and is beneficial to the storage and transmission of the compressed video.
[0111] Alternatively, the compressed video corresponding to the highest video quality among the candidate compressed videos at the same sorting position corresponding to multiple parameters to be adjusted is determined as the target compressed video, thereby improving the video quality of the compressed video and further ensuring the video quality of the compressed video.
[0112] After obtaining the target compressed video in the above manner, if the memory occupied by the target compressed video is still greater than the preset memory occupied by 4GB, the compressed video transmission will fail. In order to ensure that the compressed video can be successfully transmitted, the memory occupied by the target compressed video can be obtained; if the memory occupied by the target compressed video is greater than the preset memory occupied, the target compressed video is segmented based on the preset memory occupied to obtain multiple first compressed videos; wherein the memory occupied by each of the multiple first compressed videos is less than or equal to the preset memory occupied.
[0113] Exemplarily, the memory occupied by the target compressed video may be obtained, and when the memory occupied by the target compressed video is 3 GB but less than 4 GB, the target compressed video is directly transmitted.
[0114] Optionally, when the memory occupied by the target compressed video is 6GB and is greater than 4GB, the target compressed video can be segmented by 4GB to obtain multiple compressed videos after segmentation (which may be referred to as "multiple first compressed videos"), so that the memory occupied by each compressed video in the multiple first compressed videos is less than or equal to 4GB, thereby ensuring the successful transmission of the compressed video.
[0115] In an embodiment of the present application, when the memory occupied by the target compressed video is greater than the preset memory occupied, that is, when the memory occupied by the target compressed video is larger, the target compressed video can be segmented according to the preset memory occupied, so that the memory occupied by each of the multiple compressed videos obtained after the segmentation process is less than or equal to the preset memory occupied, thereby reducing the memory occupied by the compressed video, thereby making the compressed video with a smaller memory occupied easier to store and transmit.
[0116] Optionally, the above-mentioned segmentation processing of the target compressed video based on the preset occupied memory to obtain multiple first compressed videos includes: determining the multiple of the occupied memory of the target compressed video and the preset occupied memory; based on the multiple, segmenting the target compressed video to obtain multiple first compressed videos.
[0117] For example, when the target compressed video is segmented by 4GB, the multiple of the memory occupied by the target compressed video and 4GB can be determined first. For example, when the memory occupied by the target compressed video is 6GB, the multiple = 6 ÷ 4 = 1.5. The target compressed video is then segmented by 1.5 to obtain the first compressed video occupying 4GB and 2GB of memory.
[0118] Optionally, the target compressed video may be equally divided, and 1.5 may be rounded up to obtain an integer multiple of 2. The target compressed video is then equally divided by 2 to obtain two first compressed videos that occupy 3 GB of memory each, so that the memory occupied by the compressed videos after the equal division is less than or equal to 4 GB.
[0119] In an embodiment of the present application, the target compressed video is segmented by comparing the occupied memory of the target compressed video with a multiple of the preset occupied memory, so that the occupied memory of each compressed video in the multiple compressed videos obtained after the segmentation will not be greater than the preset occupied memory, that is, the occupied memory of each compressed video after the segmentation is always less than or equal to the preset occupied memory, thereby improving the convenience of compressed video storage and transmission.
[0120] It should be understood that the above examples are intended to help those skilled in the art understand the embodiments of the present application, rather than to limit the embodiments of the present application to the specific numerical values or specific scenarios illustrated. Those skilled in the art can obviously make various equivalent modifications or changes based on the above examples, and such modifications or changes also fall within the scope of the embodiments of the present application.
[0121] Combination of the above Figures 1 to 3 The data processing method provided in the embodiment of the present application is described in detail; Figure 4 and Figure 5 The device embodiments of the present application are described in detail. It should be understood that the device in the embodiments of the present application can execute the various methods of the aforementioned embodiments of the present application, that is, the specific working processes of the following various products can refer to the corresponding processes in the aforementioned method embodiments.
[0122] Figure 4 It is a structural diagram of a data processing device provided in an embodiment of the present application.
[0123] For example, Figure 4 As shown, the device 400 includes:
[0124] A determination module 410 is used to determine multiple candidate values of the parameter to be adjusted based on the initial value of the parameter to be adjusted in the original video; wherein the multiple candidate values are all smaller than the initial value;
[0125] The compression module 420 is used for selecting the i-th candidate value in a preset order from among multiple candidate values if the video quality of the first candidate compressed video meets a preset condition, and compressing the original video based on the i-th candidate value to obtain the i-th candidate compressed video; wherein i is an integer greater than 1; the first candidate compressed video is a compressed video obtained based on the first candidate value in the preset order; the order position of the candidate value in the preset order is positively correlated with the video quality of the candidate compressed video corresponding to the candidate value;
[0126] A judgment module 430 is used to determine whether the video quality of the i-th candidate compressed video meets a preset condition;
[0127] The processing module 440 is used to determine the target compressed video based on the i-1th candidate compressed video if the video quality of the i-th candidate compressed video does not meet the preset conditions; wherein the i-1th candidate compressed video is a compressed video obtained based on the i-1th candidate value in the preset sorting.
[0128] In one possible implementation, the parameters to be adjusted are at least two parameters to be adjusted, and the processing module 440 is used to: if the video quality of the i-th candidate compressed video corresponding to each of the at least two parameters to be adjusted does not meet the preset conditions, determine the target compressed video based on the video quality and / or occupied memory of the i-1-th candidate compressed video corresponding to each parameter to be adjusted.
[0129] In one possible implementation, the processing module 440 is used to: determine the compressed video corresponding to the smallest memory usage among the i-1th candidate compressed videos corresponding to each parameter to be adjusted as the target compressed video; or determine the compressed video corresponding to the highest video quality among the i-1th candidate compressed videos corresponding to each parameter to be adjusted as the target compressed video.
[0130] In one possible implementation, the processing module 440 is used to: obtain the occupied memory of the target compressed video; if the occupied memory of the target compressed video is greater than the preset occupied memory, segment the target compressed video based on the preset occupied memory to obtain multiple first compressed videos; wherein the occupied memory of each compressed video in the multiple first compressed videos is less than or equal to the preset occupied memory.
[0131] In a possible implementation, the processing module 440 is used to: determine a multiple of the memory occupied by the target compressed video and a preset memory occupied; and based on the multiple, segment the target compressed video to obtain a plurality of first compressed videos.
[0132] In a possible implementation, the determination module 410 is used to: determine a target mapping relationship based on the parameter to be adjusted; and map multiple candidate values corresponding to the initial value in the target mapping relationship.
[0133] In one possible implementation, the compression module 420 is used to: obtain the absolute path of the original video; encapsulate the absolute path and generate a compression instruction for the original video; the above-mentioned compressing the original video based on the i-th candidate value to obtain the i-th candidate compressed video includes: after the compression instruction is generated, compressing the original video based on the i-th candidate value to obtain the i-th candidate compressed video.
[0134] It should be noted that the above device 400 is embodied in the form of a functional module. The term "module" here can be implemented in the form of software and / or hardware, and is not specifically limited to this.
[0135] For example, a "module" may be a software program, a hardware circuit, or a combination of the two that implements the above functions. The hardware circuit may include an application specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a dedicated processor, or a group processor, etc.) and a memory for executing one or more software or firmware programs, a combined logic circuit, and / or other suitable components that support the described functions.
[0136] Therefore, the modules of each example described in the embodiments of the present application can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0137] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0138] For example, Figure 5 As shown, the electronic device 500 includes: a memory 510 and a processor 520, wherein the memory 510 stores an executable program code 5101, and the processor 520 is used to call and execute the executable program code 5101 to perform a data processing method.
[0139] The present application can divide the functional modules of the electronic device according to the above method example. For example, each functional module can be corresponded, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0140] In the case of dividing each functional module according to each function, the electronic device may include: a determination module, a compression module, a judgment module, a processing module, etc. It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, which will not be repeated here.
[0141] The electronic device provided in the present application is used to execute the above-mentioned data processing method, and thus can achieve the same effect as the above-mentioned implementation method.
[0142] In the case of an integrated unit, the electronic device may include a processing module and a storage module. The processing module may be used to control and manage the actions of the electronic device. The storage module may be used to support the electronic device in executing related program codes and data.
[0143] The processing module may be a processor or a controller, which may implement or execute various exemplary logic blocks, modules and circuits shown in conjunction with the disclosure of the present application. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc. The storage module may be a memory.
[0144] The present application also provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the steps of the method of any of the above embodiments are implemented. The computer-readable storage medium may include, but is not limited to, any type of disk, including a floppy disk, an optical disk, a DVD (Digital Video Disc), a CD-ROM (Compact Disc Read-Only Memory), a micro drive and a magneto-optical disk, a ROM (Read-Only Memory), a RAM (Random Access Memory), an EPROM (Erasable Programmable Read-Only Memory), an EEPROM (Electrically Erasable Programmable Read Only Memory), a DRAM (Dynamic Random Access Memory), a VRAM (Video Random Access Memory), a flash memory device, a magnetic card or an optical card, a nanosystem (including a molecular memory IC), or any type of medium or device suitable for storing instructions and / or data.
[0145] The present application also provides a computer program product. When the computer program product runs on a computer, the computer is enabled to execute the above-mentioned related steps to implement a data processing method in the above-mentioned embodiment.
[0146] In addition, the electronic device provided in the embodiments of the present application may specifically be a chip, a component or a module, and the electronic device may include a connected processor and a memory; wherein the memory is used to store instructions, and when the electronic device is running, the processor may call and execute instructions so that the chip executes a data processing method in the above-mentioned embodiments.
[0147] Among them, the electronic device, computer-readable storage medium, computer program product or chip provided in this application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here.
[0148] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0149] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0150] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A data processing method, characterized in that: The method comprises: Determining multiple candidate values of the parameter to be adjusted based on an initial value of the parameter to be adjusted in the original video; wherein the multiple candidate values are all smaller than the initial value; If the video quality of the first candidate compressed video meets a preset condition, select the i-th candidate value in a preset ranking from the multiple candidate values, compress the original video based on the i-th candidate value, and obtain the i-th candidate compressed video; wherein i is an integer greater than 1; the first candidate compressed video is a compressed video obtained based on the first candidate value in the preset ranking; the ranking position of the candidate value in the preset ranking is positively correlated with the video quality of the candidate compressed video corresponding to the candidate value; Determining whether the video quality of the i-th candidate compressed video meets the preset condition; If the video quality of the i-th candidate compressed video does not meet the preset conditions, the i-1th candidate compressed video is determined as the target compressed video; wherein the i-1th candidate compressed video is a compressed video obtained based on the i-1th candidate value in the preset sorting.
2. The method according to claim 1, characterized in that The parameters to be adjusted are at least two parameters to be adjusted, and if the video quality of the i-th candidate compressed video does not meet the preset condition, determining the i-1th candidate compressed video as the target compressed video includes: If the video quality of the i-th candidate compressed video corresponding to each of the at least two parameters to be adjusted does not meet the preset conditions, the target compressed video is determined based on the video quality and / or occupied memory of the i-1-th candidate compressed video corresponding to each parameter to be adjusted.
3. The method according to claim 2, characterized in that The determining the target compressed video based on the video quality and / or memory usage of the (i-1)th candidate compressed video corresponding to each parameter to be adjusted includes: Determine the compressed video corresponding to the smallest memory usage among the i-1th candidate compressed videos corresponding to each parameter to be adjusted as the target compressed video; or The compressed video corresponding to the highest video quality among the i-1th candidate compressed videos corresponding to each parameter to be adjusted is determined as the target compressed video.
4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: Obtaining the memory occupied by the target compressed video; If the memory occupied by the target compressed video is greater than the preset memory occupied, segmenting the target compressed video based on the preset memory occupied to obtain a plurality of first compressed videos; The memory occupied by each of the multiple first compressed videos is less than or equal to the preset memory occupied.
5. The method according to claim 4, characterized in that The step of segmenting the target compressed video based on the preset occupied memory to obtain a plurality of first compressed videos includes: Determine a multiple of the memory occupied by the target compressed video and the preset memory occupied; Based on the multiple, the target compressed video is segmented to obtain the multiple first compressed videos.
6. The method according to any one of claims 1 to 3, characterized in that The step of determining a plurality of candidate values of the parameter to be adjusted based on the initial value of the parameter to be adjusted in the original video includes: Determining a target mapping relationship based on the parameters to be adjusted; In the target mapping relationship, the multiple candidate values corresponding to the initial value are mapped.
7. The method according to any one of claims 1 to 3, characterized in that The method further comprises: Get the absolute path of the original video; Encapsulating the absolute path and generating a compression instruction for the original video; The compressing the original video based on the i-th candidate value to obtain the i-th candidate compressed video includes: After the compression instruction is generated, the compression process is performed on the original video based on the i-th candidate value to obtain the i-th candidate compressed video.
8. A data processing device, characterized in that: The device comprises: a determination module, configured to determine a plurality of candidate values of the parameter to be adjusted based on an initial value of the parameter to be adjusted in the original video; wherein the plurality of candidate values are all smaller than the initial value; a compression module configured to, if the video quality of the first candidate compressed video meets a preset condition, select an i-th candidate value in a preset ranking from among the multiple candidate values, and compress the original video based on the i-th candidate value to obtain an i-th candidate compressed video; wherein i is an integer greater than 1; the first candidate compressed video is a compressed video obtained based on the first candidate value in the preset ranking; and the ranking position of the candidate value in the preset ranking is positively correlated with the video quality of the candidate compressed video corresponding to the candidate value; A judgment module, configured to determine whether the video quality of the i-th candidate compressed video meets the preset condition; A processing module is used to determine a target compressed video based on the i-1th candidate compressed video if the video quality of the i-th candidate compressed video does not meet the preset conditions; wherein the i-1th candidate compressed video is a compressed video obtained based on the i-1th candidate value in the preset sorting.
9. An electronic device, characterized in that: The electronic device comprises: a memory for storing executable program code; A processor, configured to call and run the executable program code from the memory, so that the electronic device executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 7 is implemented.
