Video encoding method, device and storage medium
By classifying the texture and motion characteristics of the video frame image, the target code rate is determined, and the contradiction between image quality and code rate control in the prior art is solved, and the effect of reducing the amount of video data under preset quality is achieved.
Patent Information
- Application Number
- CN202211514738.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-24
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2042-11-24
AI Technical Summary
The existing video encoding technology is difficult to effectively reduce the code rate of each frame of the video image while ensuring image quality, thereby reducing the amount of video data. Especially in the case of multi-resolution, the code rate corresponding to the image resolution of the original code point. Not necessarily the smallest.
By extracting the texture features and motion features of the video frame image, classification processing is performed to determine whether there is a code rate smaller than the initial code rate, and the target code rate is determined based on the characteristics to reduce the amount of data of the video under the preset image quality.
While ensuring the quality of video images, the amount of encoded video data is reduced and the storage and transmission efficiency of video is improved.
Smart Images

Figure CN117750014B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a video encoding method, device and storage medium. Background Art
[0002] Bit rate control is a method to control the size of video files and the quality of video images by deciding how many bits are allocated to each frame of an image. The commonly used bit rate control method for video coding is a constant rate factor (CRF), that is, the image quality of each frame of the video is kept constant, and the bit rate (the number of bits transmitted per unit time during data transmission) is variable. CRF mainly selects image quality parameters and image resolution (also known as selected original code points) based on the average bit rate and average image quality of the video to encode the video. Since the smaller the bit rate, the smaller the amount of video data is, the more convenient it is to transmit, but in the case of multiple resolutions, the image resolution of the original code point is not necessarily the minimum bit rate corresponding to the video quality indicated by the image quality parameter. Therefore, how to determine the minimum bit rate for each frame of the video to encode the video while ensuring the image quality of the video is a problem that needs to be solved at present. Summary of the invention
[0003] The embodiments of the present application provide a video encoding method, device and storage medium, which can reduce the data volume of the encoded video while ensuring that the image quality of each frame image in the video reaches a preset image quality, which is beneficial to the storage and transmission of the video.
[0004] On the one hand, an embodiment of the present application provides a video encoding method, including:
[0005] Performing feature extraction processing on each frame image in the target video to obtain texture features of each frame image and motion features of each frame image;
[0006] Determining an initial bit rate of each frame of the image based on a preset image quality of the target video and a preset image resolution of the target video;
[0007] Classifying the target video according to the texture features of each frame image and the motion features of each frame image to obtain a classification result; wherein the classification result is used to indicate whether there is a bit rate less than an initial bit rate of each frame image when the image quality of each frame image reaches the preset image quality;
[0008] If the classification result indicates that when the image quality of each frame image reaches the preset image quality, there is a bit rate that is less than the initial bit rate of each frame image, then determine the target bit rate of each frame image according to the texture features of each frame image and the motion features of each frame image; wherein the target bit rate of each frame image refers to the bit rate of each frame image when the image quality of each frame image reaches the preset image quality; the target bit rate of each frame image is less than the initial bit rate of each frame image;
[0009] The target video is encoded according to the target bit rate of each frame image to obtain an encoded target video.
[0010] On the one hand, an embodiment of the present application provides a video encoding device, the video encoding device comprising a processing unit and an encoding unit, wherein:
[0011] The processing unit is used to perform feature extraction processing on each frame image in the target video to obtain texture features of each frame image and motion features of each frame image;
[0012] The processing unit is further used to determine the initial bit rate of each frame image based on the preset image quality of the target video and the preset image resolution of the target video;
[0013] The processing unit is further used to classify the target video according to the texture features of each frame image and the motion features of each frame image to obtain a classification result; wherein the classification result is used to indicate whether there is a bit rate less than an initial bit rate of each frame image when the image quality of each frame image reaches the preset image quality;
[0014] The processing unit is further configured to determine, if the classification result indicates that when the image quality of each frame image reaches the preset image quality, a bit rate less than an initial bit rate of each frame image exists, a target bit rate of each frame image according to a texture feature of each frame image and a motion feature of each frame image; wherein the target bit rate of each frame image refers to the bit rate of each frame image when the image quality of each frame image reaches the preset image quality; and the target bit rate of each frame image is less than the initial bit rate of each frame image;
[0015] The encoding unit is further used to encode the target video according to the target bit rate of each frame image to obtain an encoded target video.
[0016] In one aspect, an embodiment of the present application provides an electronic device, the electronic device comprising an input interface and an output interface, and further comprising:
[0017] a processor adapted to implement one or more instructions; and,
[0018] A computer storage medium storing one or more instructions, wherein the one or more instructions are suitable for being loaded by the processor and executing the above-mentioned video encoding method.
[0019] On the one hand, an embodiment of the present application provides a computer storage medium, in which computer program instructions are stored. When the computer program instructions are executed by a processor, they are used to execute the above-mentioned video encoding method.
[0020] On the one hand, an embodiment of the present application provides a computer program product or a computer program, wherein the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium; a processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions. When the computer instructions are executed by the processor, they are used to execute the above-mentioned video encoding method.
[0021] In the embodiment of the present application, the texture features and motion features of each frame image are first used to determine whether there is a bit rate less than the initial bit rate of each frame image when the image quality of each frame image reaches the preset image quality, and to determine whether the bit rate of each frame image can be further reduced. After determining that there is still room for reducing the initial bit rate of each frame image, the texture features and motion features of each frame image can be further used to obtain the target bit rate of each frame image that can ensure that the image quality reaches the preset image quality and is less than the initial bit rate of each frame image. That is to say, after determining that the bit rate of each frame image can be reduced, the embodiment of the present application will further use the texture features and motion features of each frame image to obtain a target bit rate less than the initial bit rate of each frame image, so as to encode the video, thereby reducing the amount of data of the encoded video while ensuring that the image quality of each frame image in the video reaches the preset image quality, which is beneficial to the storage and transmission of the video. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0023] Figure 1 is a structural diagram of a video encoding system provided in an embodiment of the present application;
[0024] Figure 2It is a flowchart of a video encoding method provided by an embodiment of the present application;
[0025] Figure 3 This is a schematic diagram of the relationship between image quality and bit rate provided in an embodiment of the present application;
[0026] Figure 4 is another schematic diagram of the relationship between image quality and bit rate provided in an embodiment of the present application;
[0027] Figure 5 It is a flowchart of another video encoding method provided by an embodiment of the present application;
[0028] Figure 6 is a schematic diagram of a video encoding process provided by an embodiment of the present application;
[0029] Figure 7 is a structural diagram of a video encoding device provided in an embodiment of the present application;
[0030] Figure 8 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0032] With the continuous development of Internet technology, artificial intelligence (AI) technology has also been better developed. The so-called artificial intelligence technology refers to the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science; it mainly produces a new intelligent machine that can respond in a similar way to human intelligence by understanding the essence of intelligence, so that the intelligent machine has multiple functions such as perception, reasoning and decision-making. Correspondingly, AI technology is a comprehensive discipline, which mainly includes computer vision technology (Computer Vision, CV), speech processing technology, natural language processing technology and machine learning (Machine Learning, ML) / deep learning and other major directions.
[0033] Among them, machine learning is a multi-disciplinary cross-discipline involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of AI and the fundamental way to make computer devices intelligent; the so-called machine learning is a multi-disciplinary cross-discipline involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines; it specializes in studying how computer devices simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Deep learning is a technology that uses deep neural network systems to perform machine learning; machine learning / deep learning can usually include artificial neural networks, reinforcement learning (RL), supervised learning, unsupervised learning, contrastive learning and other technologies; the so-called supervised learning refers to the processing method of using training samples with known categories (with labeled categories) for model training, and unsupervised learning refers to the processing method of using training samples with unknown categories (not labeled) for model training.
[0034] In addition, video is a continuous sequence of images, consisting of continuous image frames. Video encoding is a way of converting files in the original video format into files in another video format through compression technology. Due to the visual persistence effect of the human eye, when the frame sequence is played at a certain rate, what we see is a video with continuous action. The similarity between continuous images is very high, so in order to facilitate storage and transmission, the original video can be encoded and compressed to remove the redundancy of the spatial and temporal dimensions in the video.
[0035] In addition, bit rate refers to the number of data bits transmitted per unit time. The bit rate of each frame in the video is related to the data volume of the video. Due to different video compression ratios, the data volume of the video will also be different. Generally speaking, the greater the video compression ratio, the smaller the video data volume, and the more convenient it is to transmit; but the greater the video compression ratio, the worse the video image quality. Therefore, the image quality and data volume of the video can be balanced by controlling the bit rate of each frame in the video.
[0036] Based on this, an embodiment of the present application provides a video encoding scheme, which classifies the target video according to the texture features and motion features of each frame image in the target video to determine whether there is a bit rate less than the initial bit rate of each frame image when the image quality of each frame image reaches the preset image quality. If it is determined that there is a bit rate less than the initial bit rate of each frame image when the image quality of each frame image reaches the preset image quality, the target bit rate of each frame image can be obtained according to the texture features and motion features of each frame image, so as to encode the target video according to the target bit rate of each frame image to obtain the encoded target video. It should be noted that: the target bit rate of each frame image refers to the bit rate of each frame image when the image quality of each frame image reaches the preset image quality; the target bit rate of each frame image is less than the initial bit rate of each frame image.
[0037] Since the texture features of each frame image can reflect the content complexity of each frame image, and the motion features can reflect the motion complexity of each frame image, the redundant information in each frame image can be determined by the texture features and motion features of each frame image. Therefore, this scheme will first determine whether there is a code rate less than the initial code rate of each frame image when the image quality of each frame image reaches the preset image quality through the texture features and motion features of each frame image, and determine whether the code rate of each frame image can be further reduced. After determining that there is still room for reducing the initial code rate of each frame image, the texture features and motion features of each frame image can be further used to obtain the target code rate of each frame image that can ensure that the image quality reaches the preset image quality and is less than the initial code rate of each frame image. It can be seen that after determining that the code rate of each frame image can be reduced, the scheme will further obtain the target code rate less than the initial code rate of each frame image through the texture features and motion features of each frame image, so as to encode the video, thereby reducing the data volume of the encoded video while ensuring that the image quality of each frame image in the video reaches the preset image quality, which is beneficial to the storage and transmission of the video.
[0038] Wherein, the initial bit rate of each frame image is obtained based on the preset image quality of the target video and the preset image resolution of the target video. The preset image quality refers to the image quality of the target video preset by humans or electronic devices. Wherein, the electronic device may refer to the terminal device or server hereinafter. Optionally, the electronic device may analyze the transmission requirements and / or storage requirements of the target video and set a reasonable preset image quality. It may also be that the electronic device directly sets a preset image quality that can meet the viewing requirements of the human eye. For example, the transmission requirement of the target video is that the transmission time is less than 5 seconds, and the storage requirement is that the storage space is less than 800kB. Then the electronic device can analyze and obtain the preset image quality that meets the conditions according to the original data volume of the target video, the transmission time is less than 5 seconds, and the storage space is less than 800kB.
[0039] In a specific implementation, when the bit rate control mode is a constant rate factor (CRF), a constant rate factor, i.e., CRF, can be set to reflect the image quality in the video. The value range of CRF is 0 to 51, where 0 is a lossless mode, i.e., the image quality of the encoded video is controlled to be the original image quality of the video; and the larger the value of CRF, the worse the image quality of the encoded video. Therefore, the preset image quality can specifically be the image quality indicated by the preset CRF value.
[0040] At the same time, the preset image resolution refers to the image resolution of the target video preset by humans or electronic devices. Optionally, the electronic device can obtain the preset image resolution after analyzing the display requirements of the target video. Exemplarily, since the display resolution of the electronic device to display the target video is up to 720P, the display requirement of the target video is an image resolution less than or equal to 720P, then the electronic device can set the preset image resolution to 720P, 540P and 360P.
[0041] Specifically, the image resolution of a video refers to the number of pixels in each frame of the video. For example, the resolution of 720P is 1280*720 pixels (P, Progressive, i.e., progressive scanning, where the number of Ps indicates the number of vertical rows of pixels in the area), the resolution of 1080P is 1920*1080 pixels, and the resolution of 2k is 2560*1440 pixels. In addition, the same video can have one or more preset image resolutions.
[0042] In addition, texture features refer to a visual feature that reflects homogeneous phenomena in an image. It reflects the slowly changing or periodically changing surface structure and organization properties of an object. Specifically, texture features can be expressed by the grayscale distribution of pixels and their surrounding spatial domains. According to the grayscale range, they can be divided into local texture features and global texture features. Motion features include the motion trajectory and motion vector of the moving object in each frame image.
[0043] Based on the above video encoding method, the present application embodiment provides a video encoding system, which can be seen in Figure 1 , Figure 1 The video encoding system shown may include multiple terminal devices 101 and multiple servers 102, wherein a communication connection is established between any terminal device and any server. The terminal device 101 may include any one or more of a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart car-mounted device, and a smart wearable device. A variety of applications (application, APP) can be run in the terminal device 101, such as a multimedia playback client, a social client, a browser client, an information stream client, an education client, and the like. The server 102 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms. The terminal device 101 and the server 102 may be directly or indirectly connected in communication via wired or wireless communication, and this application is not limited here.
[0044] In one embodiment, the above video encoding method can be performed by Figure 1The terminal device 101 in the video coding system shown in the figure performs, and the specific execution process is: the terminal device 101 can first perform feature extraction processing on each frame image in the target video to obtain the texture features of each frame image and the motion features of each frame image; at the same time, the terminal device 101 will also determine the initial bit rate of each frame image through the preset image quality of the target video and the preset image resolution of the target video. Then, the terminal device 101 will classify the target video according to the texture features of each frame image and the motion features of each frame image, and obtain a classification result for indicating whether there is a bit rate less than the initial bit rate of each frame image when the image quality of each frame image reaches the preset image quality. If the classification result indicates that there is a bit rate less than the initial bit rate of each frame image when the image quality of each frame image reaches the preset image quality, the terminal device 101 will determine the target bit rate of each frame image according to the texture features of each frame image and the motion features of each frame image. Afterwards, the terminal device 101 can encode the target video according to the target bit rate of each frame image to obtain the encoded target video. Optionally, the terminal device 101 may also transmit the encoded target video to the server 102 , so that the server 102 may transmit the encoded target video to other terminal devices.
[0045] Optionally, the above video encoding method may also be performed only by Figure 1 The server 102 in the video encoding system shown in the figure executes, and its specific execution process can refer to the specific execution process of the terminal device 101 during video encoding, which will not be repeated here. Optionally, the terminal device 101 can also transmit the encoded target video to the server 102, and then the server 102 can decode the encoded target video to obtain a decoded video; finally, the server 102 can display the decoded video or transmit the decoded video to other terminal devices.
[0046] In another embodiment, the video encoding method may be run in a video encoding system, which may include a terminal device and a server. Figure 1The terminal device 101 and the server 102 included in the video encoding system shown are jointly completed, and the specific execution process is: the terminal device 101 collects the preset image quality and the preset image resolution of the target video, and then uploads the collected preset image quality and preset image resolution of the target video to the server 102. Then, the server 102 will first perform feature extraction processing on each frame image in the target video to obtain the texture features of each frame image and the motion features of each frame image; at the same time, the server 102 will also determine the initial bit rate of each frame image through the preset image quality of the target video and the preset image resolution of the target video. Afterwards, the server 102 can classify the target video according to the texture features of each frame image and the motion features of each frame image, and obtain a classification result for indicating whether there is a bit rate less than the initial bit rate of each frame image when the image quality of each frame image reaches the preset image quality. If the classification result indicates that when the image quality of each frame image reaches the preset image quality, there is a bit rate less than the initial bit rate of each frame image, the server 102 will determine the target bit rate of each frame image according to the texture features of each frame image and the motion features of each frame image. Finally, the server 102 can encode the target video according to the target bit rate of each frame image to obtain the encoded target video.
[0047] Optionally, the server 102 may also transmit the encoded target video to the terminal device 101, so that the terminal device 101 may decode the encoded target video and then display the decoded target video.
[0048] Optionally, the terminal device 101 may first display a video selection interface, wherein the video selection interface includes multiple video identifiers, and different video identifiers indicate different videos. Optionally, in order to facilitate the object using the terminal device 101 to determine the video they want to watch, the video selection interface may also include multiple video thumbnails, wherein one video thumbnail corresponds to a video identifier. Specifically, the video thumbnail is equivalent to the cover of the video; the video identifier may be a character or character segment that can identify the video, such as a serial number or a video name, which is not limited here.
[0049] Then, the terminal device 101 can respond to the selection operation of multiple video identifiers in the video selection interface to obtain the target video identifier. The terminal device 101 collects the preset image quality and the preset image resolution. Among them, the specific way for the terminal device 101 to collect the preset image quality and the preset image resolution can be: the terminal device 101 displays the video format editing interface, wherein the video format editing interface includes a quality setting component and a resolution setting component; the terminal device 101 responds to the editing operation of the quality setting component to obtain the preset image quality; and the terminal device 101 responds to the editing operation of the resolution setting component to obtain the preset resolution. The terminal device 101 generates a video acquisition request based on the target video identifier, the preset image quality and the preset resolution. Finally, the terminal device 101 sends the video acquisition request to the server 102.
[0050] After receiving the video acquisition request, the server 102 may parse the video acquisition request to obtain the target video identifier, the preset image quality and the preset resolution. The server 102 first searches for the target video whose video identifier is the target video identifier in the preset video library; then, the server 102 performs feature extraction processing on each frame image in the found target video to obtain the texture features of each frame image and the motion features of each frame image. At the same time, the server 102 also determines the initial bit rate of each frame image by parsing the preset image quality and the preset image resolution. Afterwards, the server 102 may classify the target video according to the texture features of each frame image and the motion features of each frame image to obtain a classification result indicating whether there is a bit rate less than the initial bit rate of each frame image when the image quality of each frame image reaches the preset image quality. If the classification result indicates that there is a bit rate less than the initial bit rate of each frame image when the image quality of each frame image reaches the preset image quality, the server 102 determines the target bit rate of each frame image according to the texture features of each frame image and the motion features of each frame image. Finally, the server 102 may encode the target video according to the target bit rate of each frame image to obtain an encoded target video.
[0051] After obtaining the encoded target video, the server 102 sends the encoded target video to the terminal device 101. After receiving the encoded target video, the terminal device 101 may decode the encoded target video and display the decoded target video.
[0052] Based on the above video encoding scheme and video encoding system, the embodiment of the present application provides a video encoding method. Figure 2 , is a flow chart of a video encoding method provided in an embodiment of the present application. Figure 2 The video encoding method shown can be executed by a server or a terminal device. Figure 2The video encoding method shown may include steps S201-S205:
[0053] S201, performing feature extraction processing on each frame image in the target video to obtain texture features of each frame image and motion features of each frame image.
[0054] In the embodiment of the present application, the target video refers to the video to be encoded. For example, when the video M is selected as the video to be encoded, so as to facilitate the storage and transmission of the video M, the video M is the target video. At the same time, since a video is composed of multiple frames of images in a certain image sequence, each frame of the target video refers to each frame of the multiple frames of images that constitute the target video.
[0055] In addition, texture features refer to features that reflect the surface texture of an object in an image. Optionally, texture features in a video can also be referred to as spatial complexity. Specifically, texture features may include grayscale variation features, gray-level co-occurrence matrix (CLCM), and other features used to characterize one or more features of image texture. Specifically, the grayscale variation feature refers to normalized cross-correlation (NCC).
[0056] In a specific implementation, when the texture feature is a grayscale co-occurrence matrix, feature extraction processing is performed on each frame image in the target video, and the specific method for obtaining the texture feature of each frame image can be: obtaining the grayscale value of each pixel in each frame image of the target video; constructing the grayscale co-occurrence matrix of each frame image according to the grayscale value of each pixel in each frame image; wherein the grayscale co-occurrence matrix of each frame image is used to characterize: the grayscale ratio between each pixel in each frame image and the pixel within a preset range from each pixel. It should be noted that the preset range can be set manually or by the system, which is not limited here. For example, the preset range can be 5 pixels (i.e., the pixel within the preset range from a certain pixel is the pixel within 5 pixels from a certain pixel), 10 pixels (i.e., the pixel within the preset range from a certain pixel is the pixel within 10 pixels from a certain pixel), etc.
[0057] When the texture feature is a grayscale change feature, feature extraction processing is performed on each frame image in the target video, and the specific method for obtaining the texture feature of each frame image can be: obtaining the grayscale value of each pixel point in each frame image of the target video; constructing the grayscale co-occurrence matrix of each frame image according to the grayscale value of each pixel point in each frame image; wherein the grayscale co-occurrence matrix of each frame image is used to characterize: the grayscale ratio between each pixel point in each frame image and the pixel points within a preset range from each pixel point; for each grayscale ratio in the grayscale co-occurrence matrix of each frame image, counting the number of grayscale ratios in the grayscale co-occurrence matrix of each frame image, and obtaining the grayscale change feature of each frame image.
[0058] Optionally, texture features may also include grayscale variation features, grayscale co-occurrence matrix, Tamura texture features, wavelet transform, etc., which are used to characterize one or more features of image texture, which are not limited here. Among them, Tamura texture features refer to the expression of texture features proposed by Tamura et al. The six components of Tamura texture features correspond to the six attributes of texture features from a psychological perspective, namely coarseness, contrast, directionality, linelikeness, regularity, and roughness. It should be noted that the technical means of extracting Tamura texture features and wavelet transform of each frame image in the video are technical means commonly used by those skilled in the art, and will not be repeated here.
[0059] In addition, motion features refer to features that reflect the degree of motion of the image content of each frame image in the video. Optionally, motion features can also be called temporal complexity. Specifically, motion features can include a weighted peak signal-to-noise ratio (XPSNR), a displacement between each pixel block in each frame image and a corresponding pixel block in a target image of each frame image.
[0060] It should be noted that the target image of each frame image refers to an image whose difference between the image sequence number in the target video and the image sequence number of each frame image in the target video is less than or equal to a preset threshold. Specifically, the preset threshold can be set manually or by the system, which is not limited here. For example, the preset threshold can be 10, 6, 2, etc. When the preset threshold is 2, the image sequence number of image A in the target video is 10 in the target video, then the target image of image A includes images whose image sequence numbers in the target video are 8, 9, 11, and 12.
[0061] In a specific implementation, the displacement between each pixel block in each frame image and the corresponding pixel block in the target image of each frame image is also called motion estimation. When the motion feature is the displacement between each pixel block in each frame image and the corresponding pixel block in the target image of each frame image, the specific method of performing feature extraction processing on each frame image in the target video to obtain the motion feature of each frame image can be: for each pixel block in each frame image, search for a target pixel block matching the pixel block in the target image of each frame image (i.e., the corresponding pixel block in the target image of each frame image); wherein any pixel block includes at least one pixel point, and the pixel block can also be called a macroblock of the image. Then, based on the position information of each pixel block in each frame image in each frame image, and the position information of the target pixel block corresponding to each pixel block in each frame image in the target image of each frame image, the displacement between each pixel block in each frame image and the corresponding pixel block in the target image of each frame image is obtained.
[0062] Optionally, the specific method of searching for a target pixel block matching the pixel block in the target image of each frame image for each pixel block in each frame image may be: for each pixel block in each frame image, determining at least one overlapping pixel block of the pixel block in the target image of each frame image; obtaining a pixel block similarity between the pixel block and each overlapping pixel block based on the grayscale value of each pixel point in the pixel block and the grayscale value of each pixel point in each overlapping pixel block; and determining the overlapping pixel block with the greatest pixel block similarity as the target pixel block.
[0063] In addition, the weighted peak signal-to-noise ratio is usually used to reflect the error between the original image and the compressed original image. The technical means for extracting the weighted peak signal-to-noise ratio are commonly used by those skilled in the art and will not be described in detail here.
[0064] S202, determining an initial bit rate of each frame image based on a preset image quality of the target video and a preset image resolution of the target video.
[0065] In the embodiments of the present application, the preset image quality refers to the image quality preset by humans or electronic devices. Among them, the image quality can be the distortion of the image, or the clarity of the image perceived by the human eye, etc. In other words, there are many evaluation criteria for image quality, so they are not repeated here. In addition, various distortions or distortions may occur in the process of video acquisition, compression, transmission and storage. Any distortion or distortion may cause a decrease in the image quality perceived by the human eye. Therefore, the image quality that the image quality in the target video must at least reach can be preset to ensure the overall image quality of the target video. It should be noted that the preset image quality can be a specific value or a range of values, which is not limited here.
[0066] In addition, the preset image resolution refers to the image resolution of the target video preset by humans or electronic devices. The image resolution of a video refers to the number of pixels included in each frame of the video. In the embodiment of the present application, since the same video can usually display multiple resolutions when displayed on a terminal device, it is convenient for the user of the terminal device to select the most appropriate resolution according to the current network conditions. Therefore, the preset image resolution in the embodiment of the present application can be one or more.
[0067] In a specific implementation, when the bit rate control mode is a constant rate factor (CRF), the preset image quality refers to a fixed bit rate factor (CRF) preset by humans or the system to reflect the image quality in the video. The preset image resolution can be multiple image resolutions set by humans or the system according to the video playback requirements. For example, CRF=23 can be set, and the preset image resolutions include 360P, 720P, and 1080P.
[0068] Optionally, based on the preset image quality of the target video and the preset image resolution of the target video, the specific method of determining the initial bit rate of each frame image can be: according to the preset image quality of the target video and the preset image resolution of the target video, determine the fixed quantization value (i.e., Constant Quantizer, QP) of each frame image in the target video; based on the fixed quantization value of each frame image and the data amount of each frame image, obtain the initial bit rate of each frame image. Among them, determining the fixed quantization value of each frame image in the target video is a technical means commonly used by those skilled in the art, which will not be repeated here.
[0069] S203, classifying the target video according to the texture features of each frame image and the motion features of each frame image to obtain a classification result.
[0070] In an embodiment of the present application, the classification result refers to an indication of whether there is a bit rate less than the initial bit rate of each frame image when the image quality of each frame image reaches the preset image quality. Specifically, the classification result refers to whether the bit rate of each frame image can be smaller on the basis of the initial bit rate of each frame image while maintaining the image quality of each frame image at the lowest preset image quality. For example, the classification result can be 1 or 0, and 1 is pre-set to indicate that when the image quality of each frame image reaches the preset image quality, there is a bit rate less than the initial bit rate of each frame image; and 0 indicates that when the image quality of each frame image reaches the preset image quality, there is no bit rate less than the initial bit rate of each frame image.
[0071] Since the texture features of each frame image can reflect the content complexity of each frame image (also known as spatial complexity), and the motion features can reflect the motion complexity of each frame image (also known as temporal complexity), and the purpose of encoding and compressing the video is to remove the redundancy of the spatial and temporal dimensions in the video. Therefore, the redundant information in each frame image can be determined through the texture features and motion features of each frame image, which is conducive to the subsequent determination of whether there is room for reducing the bit rate of each frame image.
[0072] For specific implementation, please refer to the attached Figure 3 , which shows a schematic diagram of the relationship between image quality and bit rate. Figure 3 The horizontal axis is the bit rate, in k / bps; the vertical axis is the Visual Multimethod Assessment Fusion (VMAF) parameter used to evaluate the image quality of the video. The higher the VMAF, the better the image quality of the encoded video, and the lower the bit rate, the easier it is to transmit and store the encoded video. In addition, the preset image quality of video M can be set to the image quality indicated when VMAF is 94, and the preset image resolution of video M is 540P, 720P, and 1080P. Figure 3 The light gray curve indicates the actual measured relationship between the bit rate and image quality of a frame image in video M when the image resolution is 540P; the dark gray curve indicates the actual measured relationship between the bit rate and image quality of a frame image in video M when the image resolution is 720P; the black curve indicates the actual measured relationship between the bit rate and image quality of a frame image in video M when the image resolution is 1080P.
[0073] First, the CRF bit rate control method can be used to determine the average bit rate and average image quality of the video M. Figure 3 For the original code point shown, when VMAF is 94, the bit rate of the original code point (ie, the initial bit rate mentioned above) is 900k / bps, and the image resolution is 720P.
[0074] But if Figure 3 As shown in the figure, when VMAF is 94, the bit rate corresponding to the black curve is smaller than the bit rate of the original code point. Therefore, in fact, when VMAF is 94, the bit rate of the original code point is not the minimum bit rate, that is to say, the original code point is not the optimal code point, and the bit rate of the optimal code point should be 750k / bps, and the image resolution is 1080P.
[0075] Also, see the attached Figure 4 , shows another schematic diagram of the relationship between image quality and bit rate. Figure 4 The horizontal axis in is the bit rate, in k / bps; the vertical axis is VMAF. The preset image quality of video M can be set to the image quality indicated when VMAF is 73, and the preset image resolution of video M is 540P, 720P, and 1080P. Figure 4 The light gray curve indicates the actual measured relationship between the bit rate and image quality of a frame image in video M when the image resolution is 540P; the dark gray curve indicates the actual measured relationship between the bit rate and image quality of a frame image in video M when the image resolution is 720P; the black curve indicates the actual measured relationship between the bit rate and image quality of a frame image in video M when the image resolution is 1080P.
[0076] First, the CRF bit rate control method can be used to determine the average bit rate and average image quality of the video M. Figure 4 For the original code point shown in FIG. 1 , when VMAF is 73, the code rate of the original code point (i.e., the initial code rate mentioned above) is 2600k / bps, and the image resolution is 720P. Then, as Figure 4 As shown in the figure, when VMAF is 73, there is no curve corresponding to a bit rate smaller than 2600k / bps. Therefore, when VMAF is 73, the bit rate of the original code point is the minimum bit rate, and the original code point is the optimal code point.
[0077] It can be seen that the original code point determined by the bit rate control method may be the optimal code point or not; and the classification result indicates whether there is a bit rate less than the initial bit rate of each frame image when the image quality of each frame image reaches the preset image quality, which is equivalent to indicating whether the original code point is the optimal code point.
[0078] Then, optionally, if the classification result indicates that when the image quality of each frame image reaches the preset image quality, there is no bit rate less than the initial bit rate of each frame image, then the target video is encoded according to the initial bit rate of each frame image to obtain the encoded target video.
[0079] Optionally, the target video is classified according to the texture features of each frame image and the motion features of each frame image, and the specific method for obtaining the classification result may be: calling the classification model, classifying the texture features of each frame image and the motion features of each frame image, and obtaining the classification result. Specifically, the training process of the classification model is a supervised training process, so the initial classification model can be trained through multiple training videos and the classification labels of each training video to obtain the classification model. Among them, the classification label is used to indicate whether there is a bit rate less than the initial bit rate of each frame image in each training video when the image quality of each frame image in each training video reaches the preset image quality. The initial bit rate of each frame image in each training video is obtained based on the preset image quality of each training video and the preset image resolution of each training video.
[0080] In a specific implementation, any of a variety of boosting algorithms (a machine learning algorithm that can be used to reduce bias in supervised learning) such as adaptive boosting algorithm (Ada boosting), gradient boosting algorithm (GradientBoosting, GBDT), XGBoost (eXtreme Gradient Boosting, a decision tree-based integrated machine learning algorithm, using a gradient ascent framework) can be used to perform supervised training on the neural network model (i.e., the above-mentioned initial classification model) to obtain a classification model. Among them, the neural network model can specifically be one of a variety of models with classification capabilities such as a recurrent neural network model (Recurrent Neural Network, RNN), a convolutional neural network model (Convolutional Neural Network, CNN), and a decision tree model.
[0081] Optionally, since it is mentioned in step S201 that each frame image may have one or more texture features, and each frame image may have one or more motion features; therefore, the target video is classified according to the texture features of each frame image and the motion features of each frame image, and the specific method for obtaining the classification result may also be: splicing the various texture features of each frame image to obtain the target texture features of each frame image; and splicing the various motion features of each frame image to obtain the target motion features of each frame image; finally, according to the target texture features of each frame image and the target motion features of each frame image, the target video is classified to obtain the classification result.
[0082] S204, if the classification result indicates that when the image quality of each frame image reaches the preset image quality, there is a bit rate less than the initial bit rate of each frame image, then determine the target bit rate of each frame image according to the texture features of each frame image and the motion features of each frame image.
[0083] In the embodiment of the present application, the target bit rate of each frame image refers to the bit rate of each frame image when the image quality of each frame image reaches the preset image quality; at the same time, the target bit rate of each frame image is less than the initial bit rate of each frame image. Figure 3 and Figure 4 In the example in , the bitrate of the original code point refers to the initial bitrate of the image, and the bitrate of the optimal code point refers to the bitrate of the image when the image quality reaches the preset image quality, and the bitrate of the optimal code point is less than the bitrate of the original code point. Therefore, in the specific implementation, the target bitrate of each frame image is equivalent to the bitrate of the optimal code point; that is, the determined target bitrate of each frame image is equivalent to the bitrate of the optimal code point of each frame image.
[0084] In addition, according to the texture features of each frame image and the motion features of each frame image, the specific method of determining the target bit rate of each frame image can be: calling the regression prediction model, performing regression prediction processing on the texture features of each frame image and the motion features of each frame image, and obtaining the target bit rate of each frame image. Specifically, the training process of the regression prediction model is a supervised training process, so the initial regression prediction model can be trained through multiple training videos and the training bit rates of each frame image in each training video to obtain the regression prediction model. Among them, the training bit rate refers to the bit rate of each frame image of each training video when the image quality of each frame image of each training video reaches the training image quality; the training bit rate is less than the initial bit rate of each frame image of each training video. The specific meaning of the training image quality can be referred to the preset image quality, which will not be repeated here.
[0085] In a specific implementation, any of a variety of boosting algorithms (a machine learning algorithm that can be used to reduce bias in supervised learning) such as adaptive boosting algorithm (Ada boosting), gradient boosting (GradientBoosting, GBDT), XGBoost (eXtreme Gradient Boosting, a decision tree-based integrated machine learning algorithm, using a gradient ascent framework) can be used to perform supervised training on the neural network model (i.e., the above-mentioned initial regression prediction model) to obtain a regression prediction model. Among them, the neural network model can specifically be one of a variety of models with regression prediction capabilities such as a deep neural network model (Deep Neural Networks, DNN), a convolutional neural network model (Convolutional Neural Network, CNN), and a decision tree model.
[0086] Optionally, since it is mentioned in step S201 that each frame image may have one or more texture features, and each frame image may have one or more motion features; therefore, the specific method of determining the target bit rate of each frame image based on the texture features of each frame image and the motion features of each frame image may also be: splicing the various texture features of each frame image to obtain the target texture features of each frame image; and splicing the various motion features of each frame image to obtain the target motion features of each frame image; finally, based on the target texture features of each frame image and the target motion features of each frame image, regression prediction processing is performed on the target video to obtain the target bit rate of each frame image.
[0087] S205, encoding the target video according to the target bit rate of each frame image to obtain an encoded target video.
[0088] In an embodiment of the present application, the specific method of encoding the target video according to the target bit rate of each frame image to obtain the encoded target video may be: according to the target bit rate of each frame image and the data amount of each frame image, the corresponding image in the target video is encoded to obtain the encoded target video.
[0089] Similarly, in step S204, the target video is encoded according to the initial bit rate of each frame image, and the specific method for obtaining the encoded target video can be: according to the initial bit rate of each frame image and the data amount of each frame image, the corresponding image in the target video is encoded to obtain the encoded target video.
[0090] In the embodiment of the present application, the texture features and motion features of each frame image are first used to determine whether there is a bit rate less than the initial bit rate of each frame image when the image quality of each frame image reaches the preset image quality, and to determine whether the bit rate of each frame image can be further reduced. After determining that there is still room for reducing the initial bit rate of each frame image, the texture features and motion features of each frame image can be further used to obtain the target bit rate of each frame image that can ensure that the image quality reaches the preset image quality and is less than the initial bit rate of each frame image. That is to say, after determining that the bit rate of each frame image can be reduced, the embodiment of the present application will further use the texture features and motion features of each frame image to obtain a target bit rate less than the initial bit rate of each frame image, so as to encode the video, thereby reducing the amount of data of the encoded video while ensuring that the image quality of each frame image in the video reaches the preset image quality, which is beneficial to the storage and transmission of the video.
[0091] Based on the above video encoding scheme and video encoding system, the embodiment of the present application provides another video encoding method. Figure 5 , which is a flow chart of another video encoding method provided in an embodiment of the present application. Figure 5 The video encoding method shown can be Figure 1 The server or terminal device shown is executed. Figure 5 The video encoding method shown may include the following steps:
[0092] S501, performing feature extraction processing on each frame image in the target video to obtain texture features of each frame image and motion features of each frame image.
[0093] S502: Determine an initial bit rate of each frame of the image based on a preset image quality of the target video and a preset image resolution of the target video.
[0094] The specific implementation of steps S501-S502 may refer to the specific implementation of steps S201-S202, which will not be described in detail here.
[0095] S503, calling each decision classifier in the classification model, performing decision processing on the target video according to the texture features of each frame image and the motion features of each frame image, and obtaining the decision results of each decision classifier.
[0096] In the embodiment of the present application, the decision result of each decision classifier is used to indicate whether there is a bit rate less than the initial bit rate of each frame image when the image quality of each frame image reaches the preset image quality. The classification model includes multiple decision classifiers. In a specific implementation, each decision classifier in the classification model is a small neural network model for classification.
[0097] Optionally, the training process of the classification model may specifically be as follows: first, obtain multiple training video sets; wherein any training video set includes at least one training video, the target decision results of each training video in at least one training video, and the texture features and motion features of each frame image of each training video in at least one training video. Then, call multiple decision classifiers in the initial classification model, perform decision processing on the texture features and motion features of each frame image of each training video in the multiple training video sets, and obtain the training decision results of each training video in the multiple training video sets. Finally, according to the training decision results of each training video in the multiple training video sets and the target decision results of each training video in the multiple training video sets, the initial classification model is trained to obtain the classification model.
[0098] In a specific implementation, the specific process of calling multiple decision classifiers in the initial classification model, making decisions on the texture features and motion features of each frame image of each training video in the multiple training video sets, and obtaining the training decision results of each training video in the multiple training video sets can be: traversing each decision classifier in the initial classification model, based on the training decision results of each training video in the training video set corresponding to the last traversed decision classifier obtained by processing the decision classifier of the last traversal, determining the target training video set corresponding to the currently traversed target decision classifier from the multiple training video sets. Then, calling the target decision classifier, making decisions on each training video in the target training video set according to the texture features and motion features of each frame image of each training video in the target training video set, and obtaining the training decision results of each training video in the target training video set.
[0099] Specifically, based on the training decision results of each training video in the training video set corresponding to the last traversed decision classifier obtained by processing the decision classifier last traversed, the method for determining the target training video set corresponding to the currently traversed target decision classifier from multiple training video sets can be: when the target decision classifier is the first traversed decision classifier, first select any training video set from the multiple training video sets as the target training video set of the first traversed decision classifier; when the target decision classifier is not the first traversed decision classifier, based on the training videos whose training decision results in the target training video set of the last traversed decision classifier are different from the target decision results, and a training video set selected from the remaining training video sets of the multiple training video sets, the target training video set of the target decision classifier is obtained.
[0100] In addition, the decision weight of the target decision classifier can be determined according to the training decision results of each training video in the target training video set and the target decision result, so as to obtain the decision weight of each decision classifier in the initial classification model.
[0101] Specifically, before starting training, the decision weights of each decision classifier in the initial classification model are evenly distributed. For example, if the initial classification model includes 10 decision classifiers, the decision weights of each decision classifier in the initial classification model are all 0.1. Then, the classification accuracy of each traversed decision classifier is determined by whether the training decision results of each training video in the target training video set of each traversed decision classifier are the same as its target decision result; finally, the decision weights of each traversed decision classifier are obtained through the classification accuracy of each traversed decision classifier.
[0102] S504, obtaining a classification result according to the decision weights of each decision classifier and the decision results of each decision classifier.
[0103] In the embodiment of the present application, the decision weight of each decision classifier in the classification model is a value less than 1, and the decision weights of all decision classifiers in the classification model add up to 1. As can be seen from step S503, the decision weights of each decision classifier in the classification model are obtained based on the training decision results of each training video in the target training video set of each decision classifier during training and the target decision results. This is not repeated here.
[0104] In addition, according to the decision weights of each decision classifier and the decision results of each decision classifier, the specific method of obtaining the classification result can be: multiplying the decision weights of each decision classifier by the decision results of the corresponding decision classifier to obtain the weighted decision results of each decision classifier; finally, adding the weighted decision results of all decision classifiers in the classification model to obtain the classification result.
[0105] S505, if the classification result indicates that when the image quality of each frame image reaches the preset image quality, there is a bit rate less than the initial bit rate of each frame image, then determine the target bit rate of each frame image according to the texture features of each frame image and the motion features of each frame image.
[0106] In the embodiment of the present application, the specific method of determining the target bit rate of each frame image according to the texture features of each frame image and the motion features of each frame image can be: calling each regression predictor in the regression prediction model, predicting the texture features of each frame image and the motion features of each frame image, and obtaining the predicted bit rate of each regression predictor; based on the regression weight of each regression predictor and the predicted bit rate of each regression predictor, the target bit rate of each frame image is obtained. Specifically, the regression weights of each regression predictor can be the same. For example, the regression weights of each regression predictor can be 1.
[0107] Optionally, the training process of the regression prediction model can be specifically as follows: first, obtain the training video, the training bit rate of each frame image of the training video, and the texture features and motion features of each frame image of the training video; wherein the training bit rate of each frame image of the training video refers to the bit rate of each frame image of the training video when the image quality of each frame image of the training video reaches the training image quality; the training bit rate of each frame image of the training video is less than the initial bit rate of each frame image of the training video. Then, call each initial regression predictor in the initial regression prediction model, perform prediction processing on the texture features and motion features of each frame image of the training video, and obtain the prediction bit rate of each initial regression predictor. Finally, according to the prediction bit rate of each initial regression predictor and the training bit rate of each frame image of the training video, the initial regression prediction model is trained to obtain the regression prediction model.
[0108] Specifically, the process of calling each initial regression predictor in the initial regression prediction model, predicting the texture features and motion features of each frame image of the training video, and obtaining the predicted bit rate of each initial regression predictor can be: traversing each initial regression predictor in the initial regression prediction model, and calling the currently traversed initial regression predictor, predicting the texture features and motion features of each frame image of the training video, and obtaining the predicted bit rate of the currently traversed initial regression predictor.
[0109] Then, the initial regression prediction model is trained according to the prediction bit rates of each initial regression predictor and the training bit rates of each frame image of the training video, and the process of obtaining the regression prediction model can be: based on the training bit rates of each frame image of the training video and the prediction bit rates of the traversed initial regression predictors, the residual bit rate of the currently traversed initial regression predictor is determined; according to the residual bit rate of the currently traversed initial regression predictor and the residual bit rates of the traversed initial regression predictors, the initial regression prediction model is trained to obtain the regression prediction model.
[0110] That is to say, each initial regression predictor in the initial regression prediction model will process the training video and predict a predicted bit rate; then, the training bit rate of the training video minus the predicted bit rate of the traversed initial regression predictor and the predicted bit rate of the currently traversed initial regression predictor, the residual bit rate of the currently traversed initial regression predictor is obtained. Then, the initial regression prediction model is trained by training each initial regression predictor in the direction of reducing the residual bit rate of each initial regression predictor, thereby obtaining a regression prediction model.
[0111] Optionally, in addition to determining the target bit rate of each frame image according to the texture features of each frame image and the motion features of each frame image, the target bit rate and target image resolution of each frame image may also be determined according to the texture features of each frame image and the motion features of each frame image. The target image resolution of each frame image in the video may be the same. The target image resolution refers to the image resolution corresponding to the target bit rate of each frame image when the image quality of each frame image reaches the preset image quality.
[0112] Specifically, according to the texture features of each frame image and the motion features of each frame image, the specific method for determining the target bit rate and target image resolution of each frame image can be: calling the regression prediction model, performing regression prediction processing on the texture features of each frame image and the motion features of each frame image, and obtaining the target bit rate and target image resolution of each frame image.
[0113] It should be noted that, since the regression prediction model can predict the target bit rate and target image resolution of each frame image at this time, the regression prediction model can train the initial classification model through multiple training videos, as well as the training bit rate and training image resolution of each training video, thereby obtaining a classification model. Among them, the training image resolution refers to the image resolution corresponding to the training bit rate of each frame image when the image quality of each frame image reaches the training image quality.
[0114] S506, encoding the target video according to the target bit rate of each frame image to obtain an encoded target video.
[0115] The specific implementation of step S506 may refer to the specific implementation of step S205, which will not be described in detail here.
[0116] In practical applications, please refer to the attached Figure 6 , showing a schematic diagram of a video encoding process. A target video is input, and the target video is decoded to obtain multiple frames of images in a preset video format. Among them, the specific process of decoding the target video can be: converting the original video format of the target video into a preset video format. For example, the preset video format can be YUV (a color encoding method. Commonly used in various video processing components, common YUV formats include YUV420p, YUV420sp, NV21, etc.), RGB (a color standard), Raw (an unprocessed and uncompressed video format), etc., which are not limited here.
[0117] After obtaining multiple frames of images in a preset video format, texture features and motion features of each frame of the image can be extracted, and the texture features and motion features of each frame of the image can be input into a classification model to obtain a classification result. If the classification result indicates that the original code point is the optimal code point (that is, the classification result indicates that when the image quality of each frame of the image reaches the preset image quality, there is no bit rate less than the initial bit rate of each frame of the image), then according to the initial bit rate of each frame of the image, the target video is encoded to obtain an encoded target video.
[0118] If the classification result indicates that the original code point is not the optimal code point (i.e., the classification result indicates that when the image quality of each frame image reaches the preset image quality, there is a bit rate that is less than the initial bit rate of each frame image), the texture features and motion features of each frame image are input into the regression prediction model to obtain the target bit rate of each frame image. Finally, according to the target bit rate of each frame image, the target video is encoded to obtain the encoded target video.
[0119] In the embodiment of the present application, the texture features and motion features of each frame image are first used to determine whether there is a bit rate less than the initial bit rate of each frame image when the image quality of each frame image reaches the preset image quality, and to determine whether the bit rate of each frame image can be further reduced. After determining that there is still room for reducing the initial bit rate of each frame image, the texture features and motion features of each frame image can be further used to obtain the target bit rate of each frame image that can ensure that the image quality reaches the preset image quality and is less than the initial bit rate of each frame image. That is to say, after determining that the bit rate of each frame image can be reduced, the embodiment of the present application will further use the texture features and motion features of each frame image to obtain a target bit rate less than the initial bit rate of each frame image, so as to encode the video, thereby reducing the amount of data of the encoded video while ensuring that the image quality of each frame image in the video reaches the preset image quality, which is beneficial to the storage and transmission of the video.
[0120] In addition, the embodiment of the present application will obtain the final classification result based on the multiple decision results obtained by processing the texture features and motion features of each frame image according to each decision classifier in the classification model, which is conducive to improving the accuracy of the classification result. At the same time, the embodiment of the present application will also obtain the target bit rate of each frame image according to the multiple predicted bit rates of each frame image obtained by processing the texture features and motion features of each frame image according to each regression predictor in the regression prediction model, which is conducive to improving the accuracy of the predicted bit rate.
[0121] Based on the relevant description of the above video encoding method, the present application also discloses a video encoding device. The video encoding device may be a computer program (including program code) running in the above-mentioned computer device. The video encoding device may perform the following steps: Figure 2 and Figure 5 For the video encoding method shown, see Figure 7 , the video encoding device may at least include: a processing unit 701 and an encoding unit 702.
[0122] The processing unit 701 is used to perform feature extraction processing on each frame image in the target video to obtain texture features and motion features of each frame image;
[0123] The processing unit 701 is further configured to determine an initial bit rate of each frame of the image based on a preset image quality of the target video and a preset image resolution of the target video;
[0124] The processing unit 701 is further used to classify the target video according to the texture features of each frame image and the motion features of each frame image to obtain a classification result; wherein the classification result is used to indicate whether there is a bit rate less than the initial bit rate of each frame image when the image quality of each frame image reaches a preset image quality;
[0125] The processing unit 701 is further used to determine the target bit rate of each frame image according to the texture features of each frame image and the motion features of each frame image if the classification result indicates that when the image quality of each frame image reaches the preset image quality, there is a bit rate less than the initial bit rate of each frame image; wherein the target bit rate of each frame image refers to the bit rate of each frame image when the image quality of each frame image reaches the preset image quality; the target bit rate of each frame image is less than the initial bit rate of each frame image.
[0126] The encoding unit 702 is used to encode the target video according to the target bit rate of each frame image to obtain the encoded target video.
[0127] In one implementation, when the processing unit 701 classifies the target video according to the texture features of each frame image and the motion features of each frame image to obtain the classification result, it can also be used to perform:
[0128] Calling each decision classifier in the classification model, performing decision processing on the target video according to the texture features of each frame image and the motion features of each frame image, and obtaining the decision results of each decision classifier; wherein the decision results are used to indicate whether there is a bit rate less than the initial bit rate of each frame image when the image quality of each frame image reaches the preset image quality;
[0129] The classification result is obtained according to the decision weights of each decision classifier and the decision results of each decision classifier.
[0130] In yet another embodiment, the processing unit 701 may also be configured to execute:
[0131] Acquire multiple training video sets; wherein any training video set includes at least one training video, target decision results of each training video in at least one training video, and texture features and motion features of each frame image of each training video in at least one training video;
[0132] Calling multiple decision classifiers in the initial classification model to perform decision processing on texture features and motion features of each frame image of each training video in the multiple training video sets, and obtaining training decision results for each training video in the multiple training video sets;
[0133] According to the training decision results of each training video in the multiple training video sets and the target decision results of each training video in the multiple training video sets, the initial classification model is trained to obtain a classification model.
[0134] In another embodiment, when the processing unit 701 calls multiple decision classifiers in the initial classification model, performs decision processing on the texture features and motion features of each frame image of each training video in the multiple training video sets, and obtains the training decision results of each training video in the multiple training video sets, it can also be specifically used to execute:
[0135] Traversing each decision classifier in the initial classification model, based on the training decision results of each training video in the training video set corresponding to the last traversed decision classifier obtained by processing the last traversed decision classifier, determining the target training video set corresponding to the currently traversed target decision classifier from multiple training video sets;
[0136] The target decision classifier is called to perform decision processing on each training video in the target training video set according to the texture features and motion features of each frame image of each training video in the target training video set, so as to obtain the training decision results of each training video in the target training video set.
[0137] In one implementation, when the processing unit 701 determines the target bit rate of each frame image according to the texture feature of each frame image and the motion feature of each frame image, it can be specifically used to perform:
[0138] Calling each regression predictor in the regression prediction model, performing prediction processing on the texture features of each frame image and the motion features of each frame image, and obtaining the prediction bit rate of each regression predictor;
[0139] Based on the regression weights of the respective regression predictors and the predicted bit rates of the respective regression predictors, a target bit rate of each frame image is obtained.
[0140] In one implementation, the processing unit 701 may also be configured to execute:
[0141] Obtaining a training video, a training bit rate of each frame image of the training video, and texture features and motion features of each frame image of the training video; wherein the training bit rate of each frame image of the training video refers to the bit rate of each frame image of the training video when the image quality of each frame image of the training video reaches the training image quality, and the training bit rate of each frame image of the training video is less than the initial bit rate of each frame image of the training video;
[0142] Calling each initial regression predictor in the initial regression prediction model, performing prediction processing on the texture features and motion features of each frame image of the training video, and obtaining the prediction bit rate of each initial regression predictor;
[0143] The initial regression prediction model is trained according to the prediction bit rates of each initial regression predictor and the training bit rates of each frame image of the training video to obtain a regression prediction model.
[0144] In another embodiment, when the processing unit 701 calls each initial regression predictor in the initial regression prediction model, performs prediction processing on the texture features and motion features of each frame image of the training video, and obtains the prediction bit rate of each initial regression predictor, it can be specifically used to execute:
[0145] Traversing each initial regression predictor in the initial regression prediction model, and calling the currently traversed initial regression predictor, predicting the texture features and motion features of each frame image of the training video, and obtaining the predicted bit rate of the currently traversed initial regression predictor;
[0146] When the processing unit 701 trains the initial regression prediction model according to the prediction bit rates of each initial regression predictor and the training bit rates of each frame image of the training video to obtain the regression prediction model, it can be specifically used to execute:
[0147] Determine the residual bit rate of the currently traversed initial regression predictor based on the training bit rate of each frame image of the training video and the prediction bit rate of the traversed initial regression predictor;
[0148] The initial regression prediction model is trained according to the residual bit rate of the currently traversed initial regression predictor and the residual bit rates of the traversed initial regression predictors to obtain the regression prediction model.
[0149] In another embodiment, the texture features of each frame image include at least one of the following: grayscale change features, grayscale co-occurrence matrix; the motion features of each frame image include at least one of the following: weighted peak signal-to-noise ratio, displacement between each pixel block in each frame image and the corresponding pixel block in the target image of each frame image; wherein, the target image of each frame image refers to an image whose difference between the image sequence number in the target video and the image sequence number of each frame image in the target video is less than or equal to a preset threshold.
[0150] When the processing unit 701 classifies the target video according to the texture features of each frame image and the motion features of each frame image to obtain the classification result, it can be specifically used to execute:
[0151] The texture features of each frame image are spliced to obtain the target texture features of each frame image;
[0152] The motion features of each frame image are spliced to obtain the target motion features of each frame image;
[0153] According to the target texture features of each frame image and the target motion features of each frame image, the target video is classified and processed to obtain a classification result.
[0154] According to one embodiment of the present application, Figure 2 and Figure 5 The various steps involved in the method shown can be performed by Figure 7 The video encoding device shown in FIG. 1 is executed by each unit in the video encoding device shown in FIG. Figure 2 Steps S201 to S204 shown in FIG. Figure 7 The processing unit 701 in the video encoding device shown in FIG. 1 is used to perform the step S205; the step S205 may be performed by Figure 7 The encoding unit 702 in the video encoding device shown in the figure is used for execution. Figure 5 Steps S501 to S505 shown in FIG. Figure 7 The processing unit 701 in the video encoding device shown in FIG. 1 is executed; step S506 may be performed by Figure 7 The encoding unit 702 in the video encoding device shown is used for execution.
[0155] According to another embodiment of the present application, Figure 7 The various units in the video encoding device shown are divided based on logical functions, and the above-mentioned various units can be separately or all merged into one or several other units to constitute, or one (some) of the units can be further divided into multiple smaller units in function to constitute, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. In other embodiments of the present application, the above-mentioned video encoding device can also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.
[0156] According to another embodiment of the present application, the program can be executed on a general computing device such as a computer device including a central processing unit (CPU), a random access memory medium (RAM), a read-only memory medium (ROM), and other processing elements and storage elements. Figure 2 or Figure 5 A computer program (including program code) for each step of the method shown in FIG. Figure 7 The video encoding device shown in the figure is used to implement the video encoding method of the embodiment of the present application. The computer program can be recorded on a computer storage medium, for example, and loaded into the above-mentioned computer device through the computer storage medium and run therein.
[0157] In the embodiment of the present application, the texture features and motion features of each frame image are first used to determine whether there is a bit rate less than the initial bit rate of each frame image when the image quality of each frame image reaches the preset image quality, and to determine whether the bit rate of each frame image can be further reduced. After determining that there is still room for reducing the initial bit rate of each frame image, the texture features and motion features of each frame image can be further used to obtain the target bit rate of each frame image that can ensure that the image quality reaches the preset image quality and is less than the initial bit rate of each frame image. That is to say, after determining that the bit rate of each frame image can be reduced, the embodiment of the present application will further use the texture features and motion features of each frame image to obtain a target bit rate less than the initial bit rate of each frame image, so as to encode the video, thereby reducing the amount of data of the encoded video while ensuring that the image quality of each frame image in the video reaches the preset image quality, which is beneficial to the storage and transmission of the video.
[0158] Based on the above method embodiment and device embodiment, the present application also provides an electronic device. Figure 8 , is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 8 The electronic device shown may include at least a processor 801, an input interface 802, an output interface 803, and a computer storage medium 804. The processor 801, the input interface 802, the output interface 803, and the computer storage medium 804 may be connected via a bus or other means.
[0159] The computer storage medium 804 may be stored in the memory of the electronic device, and the computer storage medium 804 is used to store a computer program, and the computer program includes program instructions, and the processor 801 is used to execute the program instructions stored in the computer storage medium 804. The processor 801 (or CPU (Central Processing Unit)) is the computing core and control core of the electronic device, which is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions to implement the above-mentioned video encoding method process or corresponding functions.
[0160] The embodiment of the present application also provides a computer storage medium (Memory), which is a memory device in an electronic device for storing programs and data. It is understandable that the computer storage medium here can include both the built-in storage medium in the terminal and the extended storage medium supported by the terminal. The computer storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by the processor 801 are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer storage medium here can be a high-speed random access memory (RAM) memory, or a non-volatile memory (non-volatile memory), such as at least one disk storage; optionally, it can also be at least one computer storage medium located away from the aforementioned processor.
[0161] In one embodiment, the processor 801 may load and execute one or more instructions stored in a computer storage medium to implement the above-mentioned Figure 2 and Figure 5 In the corresponding steps of the method in the video encoding method embodiment, in a specific implementation, one or more instructions in the computer storage medium are loaded by the processor 801 and the following steps are executed:
[0162] The processor 801 performs feature extraction processing on each frame image in the target video to obtain texture features of each frame image and motion features of each frame image;
[0163] The processor 801 determines an initial bit rate of each frame image based on a preset image quality of the target video and a preset image resolution of the target video;
[0164] The processor 801 classifies the target video according to the texture features of each frame image and the motion features of each frame image to obtain a classification result; wherein the classification result is used to indicate whether there is a bit rate less than the initial bit rate of each frame image when the image quality of each frame image reaches a preset image quality;
[0165] If the classification result indicates that when the image quality of each frame image reaches the preset image quality, there is a bit rate less than the initial bit rate of each frame image, the processor 801 determines the target bit rate of each frame image according to the texture feature of each frame image and the motion feature of each frame image; wherein the target bit rate of each frame image refers to the bit rate of each frame image when the image quality of each frame image reaches the preset image quality; the target bit rate of each frame image is less than the initial bit rate of each frame image;
[0166] The processor 801 encodes the target video according to the target bit rate of each frame image to obtain an encoded target video.
[0167] In one embodiment, when the processor 801 classifies the target video according to the texture features of each frame image and the motion features of each frame image to obtain the classification result, it can be specifically used to execute:
[0168] Calling each decision classifier in the classification model, performing decision processing on the target video according to the texture features of each frame image and the motion features of each frame image, and obtaining the decision results of each decision classifier; wherein the decision results are used to indicate whether there is a bit rate less than the initial bit rate of each frame image when the image quality of each frame image reaches the preset image quality;
[0169] The classification result is obtained according to the decision weights of each decision classifier and the decision results of each decision classifier.
[0170] In one embodiment, the processor 801 may be further configured to execute:
[0171] Acquire multiple training video sets; wherein any training video set includes at least one training video, target decision results of each training video in at least one training video, and texture features and motion features of each frame image of each training video in at least one training video;
[0172] Calling multiple decision classifiers in the initial classification model to perform decision processing on texture features and motion features of each frame image of each training video in the multiple training video sets, and obtaining training decision results for each training video in the multiple training video sets;
[0173] According to the training decision results of each training video in the multiple training video sets and the target decision results of each training video in the multiple training video sets, the initial classification model is trained to obtain a classification model.
[0174] In one embodiment, when the processor 801 calls multiple decision classifiers in the initial classification model, performs decision processing on the texture features and motion features of each frame image of each training video in the multiple training video sets, and obtains the training decision results of each training video in the multiple training video sets, it can be specifically used to execute:
[0175] Traversing each decision classifier in the initial classification model, based on the training decision results of each training video in the training video set corresponding to the last traversed decision classifier obtained by processing the last traversed decision classifier, determining the target training video set corresponding to the currently traversed target decision classifier from multiple training video sets;
[0176] The target decision classifier is called to perform decision processing on each training video in the target training video set according to the texture features and motion features of each frame image of each training video in the target training video set, so as to obtain the training decision results of each training video in the target training video set.
[0177] In one embodiment, when the processor 801 determines the target bit rate of each frame image according to the texture feature of each frame image and the motion feature of each frame image, it can be specifically used to perform:
[0178] Calling each regression predictor in the regression prediction model, performing prediction processing on the texture features of each frame image and the motion features of each frame image, and obtaining the prediction bit rate of each regression predictor;
[0179] Based on the regression weights of the respective regression predictors and the predicted bit rates of the respective regression predictors, a target bit rate of each frame image is obtained.
[0180] In one embodiment, the processor 801 may also be configured to execute:
[0181] Obtaining a training video, a training bit rate of each frame image of the training video, and texture features and motion features of each frame image of the training video; wherein the training bit rate of each frame image of the training video refers to the bit rate of each frame image of the training video when the image quality of each frame image of the training video reaches the training image quality, and the training bit rate of each frame image of the training video is less than the initial bit rate of each frame image of the training video;
[0182] Calling each initial regression predictor in the initial regression prediction model, performing prediction processing on the texture features and motion features of each frame image of the training video, and obtaining the prediction bit rate of each initial regression predictor;
[0183] The initial regression prediction model is trained according to the prediction bit rates of each initial regression predictor and the training bit rates of each frame image of the training video to obtain a regression prediction model.
[0184] In one embodiment, when the processor 801 calls each initial regression predictor in the initial regression prediction model, performs prediction processing on the texture features and motion features of each frame image of the training video, and obtains the prediction bit rate of each initial regression predictor, it can be specifically used to execute:
[0185] Traversing each initial regression predictor in the initial regression prediction model, and calling the currently traversed initial regression predictor, predicting the texture features and motion features of each frame image of the training video, and obtaining the predicted bit rate of the currently traversed initial regression predictor;
[0186] When the processor 801 trains the initial regression prediction model according to the prediction bit rates of each initial regression predictor and the training bit rates of each frame image of the training video to obtain the regression prediction model, it can be specifically used to execute:
[0187] Determine the residual bit rate of the currently traversed initial regression predictor based on the training bit rate of each frame image of the training video and the prediction bit rate of the traversed initial regression predictor;
[0188] The initial regression prediction model is trained according to the residual bit rate of the currently traversed initial regression predictor and the residual bit rates of the traversed initial regression predictors to obtain the regression prediction model.
[0189] In one embodiment, the texture features of each frame image include at least one of the following: grayscale change features, grayscale co-occurrence matrix; the motion features of each frame image include at least one of the following: weighted peak signal-to-noise ratio, displacement between each pixel block in each frame image and the corresponding pixel block in the target image of each frame image; wherein the target image of each frame image refers to an image whose difference between the image sequence number in the target video and the image sequence number of each frame image in the target video is less than or equal to a preset threshold;
[0190] When the processor 801 classifies the target video according to the texture features of each frame image and the motion features of each frame image to obtain the classification result, it can be specifically used to execute:
[0191] The texture features of each frame image are spliced to obtain the target texture features of each frame image;
[0192] The motion features of each frame image are spliced to obtain the target motion features of each frame image;
[0193] According to the target texture features of each frame image and the target motion features of each frame image, the target video is classified and processed to obtain a classification result.
[0194] In the embodiment of the present application, the texture features and motion features of each frame image are first used to determine whether there is a bit rate less than the initial bit rate of each frame image when the image quality of each frame image reaches the preset image quality, and to determine whether the bit rate of each frame image can be further reduced. After determining that there is still room for reducing the initial bit rate of each frame image, the texture features and motion features of each frame image can be further used to obtain the target bit rate of each frame image that can ensure that the image quality reaches the preset image quality and is less than the initial bit rate of each frame image. That is to say, after determining that the bit rate of each frame image can be reduced, the embodiment of the present application will further use the texture features and motion features of each frame image to obtain a target bit rate less than the initial bit rate of each frame image, so as to encode the video, thereby reducing the amount of data of the encoded video while ensuring that the image quality of each frame image in the video reaches the preset image quality, which is beneficial to the storage and transmission of the video.
[0195] The embodiment of the present application provides a computer program product or a computer program, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. The processor of the electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device performs the above-mentioned Figure 2 and Figure 5 The computer-readable storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0196] The video encoding method in the embodiment of the present invention is mainly illustrated by taking the field of video transmission and storage as an example. The video encoding method in the embodiment of the present invention can also be applied to scenes related to video encoding and decoding, such as video display, which is not limited here.
[0197] The above is only a specific implementation 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. In addition, the present application does not limit the execution order of each step in the specific implementation.
Claims
1. A video encoding method, characterized in that: include: Performing feature extraction processing on each frame image in the target video to obtain texture features of each frame image and motion features of each frame image; Determining an initial bit rate of each frame of the image based on a preset image quality of the target video and a preset image resolution of the target video; Classifying the target video according to the texture features of each frame image and the motion features of each frame image to obtain a classification result; wherein the classification result is used to indicate whether there is a bit rate less than an initial bit rate of each frame image when the image quality of each frame image reaches the preset image quality; If the classification result indicates that when the image quality of each frame image reaches the preset image quality, there is a bit rate that is less than the initial bit rate of each frame image, calling the regression prediction model, performing regression prediction processing on the texture features of each frame image and the motion features of each frame image, and obtaining the target bit rate of each frame image; wherein the target bit rate of each frame image refers to the bit rate of each frame image when the image quality of each frame image reaches the preset image quality; the target bit rate of each frame image is less than the initial bit rate of each frame image; The target video is encoded according to the target bit rate of each frame image to obtain an encoded target video.
2. The method according to claim 1, characterized in that The classifying process of the target video according to the texture features of each frame image and the motion features of each frame image to obtain the classification result includes: Calling each decision classifier in the classification model, performing decision processing on the target video according to the texture features of each frame image and the motion features of each frame image, and obtaining the decision results of each decision classifier; wherein the decision results are used to indicate whether there is a bit rate less than the initial bit rate of each frame image when the image quality of each frame image reaches the preset image quality; The classification result is obtained according to the decision weights of the respective decision classifiers and the decision results of the respective decision classifiers.
3. The method according to claim 2, characterized in that The method further comprises: Acquire multiple training video sets; wherein any training video set includes at least one training video, target decision results of each training video in the at least one training video, and texture features and motion features of each frame image of each training video in the at least one training video; Calling multiple decision classifiers in the initial classification model to perform decision processing on the texture features and motion features of each frame image of each training video in the multiple training video sets, and obtaining training decision results for each training video in the multiple training video sets; The initial classification model is trained according to the training decision results of each training video in the multiple training video sets and the target decision results of each training video in the multiple training video sets to obtain the classification model.
4. The method according to claim 3, characterized in that The calling of multiple decision classifiers in the initial classification model to perform decision processing on the texture features and motion features of each frame image of each training video in the multiple training video sets to obtain the training decision results of each training video in the multiple training video sets includes: Traversing each decision classifier in the initial classification model, based on the training decision results of each training video in the training video set corresponding to the decision classifier traversed last time obtained by processing the decision classifier traversed last time, determining the target training video set corresponding to the target decision classifier traversed currently from the multiple training video sets; The target decision classifier is called to perform decision processing on each training video in the target training video set according to the texture features and motion features of each frame image of each training video in the target training video set, so as to obtain the training decision results of each training video in the target training video set.
5. The method according to claim 1, characterized in that The determining the target bit rate of each frame image according to the texture feature of each frame image and the motion feature of each frame image comprises: Calling each regression predictor in the regression prediction model, performing prediction processing on the texture features of each frame image and the motion features of each frame image, and obtaining the prediction bit rate of each regression predictor; Based on the regression weights of the respective regression predictors and the predicted bit rates of the respective regression predictors, a target bit rate of each frame image is obtained.
6. The method according to claim 5, characterized in that The method further comprises: Acquire a training video, a training bit rate of each frame image of the training video, and texture features and motion features of each frame image of the training video; wherein the training bit rate of each frame image of the training video refers to the bit rate of each frame image of the training video when the image quality of each frame image of the training video reaches the training image quality, and the training bit rate of each frame image of the training video is less than the initial bit rate of each frame image of the training video; Calling each initial regression predictor in the initial regression prediction model, performing prediction processing on the texture features and motion features of each frame image of the training video, and obtaining the prediction bit rate of each initial regression predictor; The initial regression prediction model is trained according to the prediction bit rates of the respective initial regression predictors and the training bit rates of the respective frame images of the training video to obtain the regression prediction model.
7. The method according to claim 6, characterized in that The calling of each initial regression predictor in the initial regression prediction model, performing prediction processing on the texture features and motion features of each frame image of the training video, and obtaining the prediction bit rate of each initial regression predictor includes: Traversing each initial regression predictor in the initial regression prediction model, and calling the currently traversed initial regression predictor, performing prediction processing on the texture features and motion features of each frame image of the training video, and obtaining the prediction bit rate of the currently traversed initial regression predictor; The step of training the initial regression prediction model according to the prediction bit rates of the initial regression predictors and the training bit rates of the frames of the training video to obtain the regression prediction model comprises: Determine the residual bit rate of the currently traversed initial regression predictor based on the training bit rate of each frame image of the training video and the prediction bit rate of the traversed initial regression predictor; The initial regression prediction model is trained according to the residual bit rate of the currently traversed initial regression predictor and the residual bit rates of the traversed initial regression predictors to obtain the regression prediction model.
8. The method according to claim 1, characterized in that: The texture features of each frame image include at least one of the following: grayscale change features, grayscale co-occurrence matrix; the motion features of each frame image include at least one of the following: weighted peak signal-to-noise ratio, displacement between each pixel block in each frame image and the corresponding pixel block in the target image of each frame image; wherein the target image of each frame image refers to an image whose difference between the image sequence number in the target video and the image sequence number of each frame image in the target video is less than or equal to a preset threshold; The classifying process of the target video according to the texture features of each frame image and the motion features of each frame image to obtain the classification result includes: Splicing the texture features of each frame image to obtain the target texture features of each frame image; splicing the motion features of the frames to obtain target motion features of the frames; The target video is classified according to the target texture features of each frame image and the target motion features of each frame image to obtain the classification result.
9. A video encoding device, characterized in that: The video encoding device comprises a processing unit and an encoding unit, wherein: The processing unit is used to perform feature extraction processing on each frame image in the target video to obtain texture features of each frame image and motion features of each frame image; The processing unit is further used to determine the initial bit rate of each frame image based on the preset image quality of the target video and the preset image resolution of the target video; The processing unit is further used to classify the target video according to the texture features of each frame image and the motion features of each frame image to obtain a classification result; wherein the classification result is used to indicate whether there is a bit rate less than an initial bit rate of each frame image when the image quality of each frame image reaches the preset image quality; The processing unit is further configured to, if the classification result indicates that when the image quality of each frame image reaches the preset image quality, there is a bit rate less than the initial bit rate of each frame image, call the regression prediction model to perform regression prediction processing on the texture features of each frame image and the motion features of each frame image to obtain a target bit rate of each frame image; wherein the target bit rate of each frame image refers to the bit rate of each frame image when the image quality of each frame image reaches the preset image quality; and the target bit rate of each frame image is less than the initial bit rate of each frame image; The encoding unit is further used to encode the target video according to the target bit rate of each frame image to obtain an encoded target video.
10. A computer storage medium, characterized in that: The computer storage medium stores one or more computer programs, and the one or more computer programs are suitable for being loaded by a processor and executing the video encoding method according to any one of claims 1-8.
11. An electronic device, characterized in that: The electronic device comprises an input interface and an output interface, and further comprises: a processor adapted to implement one or more instructions; and, A computer storage medium storing one or more instructions, wherein the one or more instructions are suitable for being loaded by the processor and executing the video encoding method according to any one of claims 1 to 8.
12. A computer program product, characterized in that The computer program product comprises computer instructions, which are stored in a computer storage medium and are suitable for being loaded by a processor to execute the video encoding method according to any one of claims 1 to 8.
