Video coding method, system and apparatus, and electronic device and computer program product
By acquiring video features in advance and refining the bit rate allocation, the problem of poor encoding quality in high-real-time video encoding is solved, and the effect of improving video quality while ensuring the rate is achieved.
Patent Information
- Application Number
- PCT/IB2025/051996
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-04-07
- Filing Date
- 2025-02-25
- Publication Date
- 2025-10-16
AI Technical Summary
In video encoding scenarios with high real-time requirements, the existing technology uses a single-pass encoding method, which leads to poor video encoding quality and cannot improve video quality while ensuring the encoding rate.
By obtaining the video features of the target video in advance, determining the encoding information based on the video features, refining the bit rate allocation for each video frame, and adopting the appropriate bit rate allocation method for encoding.
While ensuring the real-time performance of video playback, it improves the video encoding quality, avoids bit rate waste and mosaic phenomenon, and improves encoding efficiency.
Smart Images

Figure IB2025051996_16102025_PF_FP_ABST
Abstract
Description
[0001] Video encoding method, system, device, electronic device and computer program product The present application claims priority to the Chinese patent application No. 202410411916.X entitled "Video encoding method, system, device, electronic device and computer program product" filed on April 7, 2024 with the China Patent Office, the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD The present application relates to the field of video processing, in particular, to a video encoding method, system, device, electronic device and computer program product. BACKGROUND In online video playback, the target video usually needs to be transcoded to adapt to different network bandwidth conditions, device processing capabilities and different user needs, wherein the transcoding process of the target video is the process of decoding the target video and then encoding it. In related technologies, in the cloud on-demand or video playback scenarios with high real-time requirements, such as the playback of videos stored in a network disk, in order to ensure the encoding rate, a one-time encoding method is usually used to encode the target video. The problem of this method is that although the real-time performance of encoding can be ensured, the encoding quality cannot be guaranteed, which may lead to insufficient allocation of code rate for complex scenes in the video and mosaic, or excessive allocation of code rate for simple scenes, resulting in insufficient use of encoding space. In view of the above problems, no effective solution has been proposed so far. SUMMARY The embodiments of the present application provide a video encoding method, system, device, electronic device and computer program product, at least to solve the technical problem of poor video encoding quality caused by the one-time encoding method in the related art when encoding the video in a high real-time requirement scenario. According to one aspect of the embodiments of the present application, a video encoding method is provided, comprising: in response to a video playback request for indicating playing a target video, obtaining a video feature of the target video, wherein the video feature includes a feature directly extracted from the target video before receiving the video playback request and / or a feature determined according to a historical video feature analysis result of the target video; determining encoding information of the target video according to the video feature, wherein the encoding information is at least used to represent a code rate allocation method used when encoding the target video; identifying a code rate allocation result allocated to each video frame in the target video in the code rate allocation method, and encoding the target video according to the code rate allocation result allocated to each video frame.According to another aspect of the embodiments of the present application, a video coding method is further provided, comprising: sending a video playing request to a target server, wherein the video playing request is used to instruct the target server to send a target video to a terminal device; receiving the target video coded by the target server according to video features of the target video, wherein the video features of the target video are used to determine coding information of the target video, the video features comprise features directly extracted from the target video by the target server before receiving the video playing request and / or features determined according to historical video feature analysis results of the target video, the coding information is used to at least represent a code rate allocation mode adopted when coding the target video, and the code rate allocation mode comprises code rate allocation results allocated to each video frame of the target video. According to another aspect of the embodiments of the present application, a video coding system is further provided, comprising: a target server configured to respond to a video playing request sent by a terminal device and used to instruct playing a target video, acquire video features of the target video, wherein the video features comprise features directly extracted from the target video before receiving the video playing request and / or features determined according to historical video feature analysis results of the target video; determine coding information of the target video according to the video features, wherein the coding information is used to at least represent a code rate allocation mode adopted when coding the target video; identify code rate allocation results allocated to each video frame of the target video in the code rate allocation mode, and code the target video according to the code rate allocation results allocated to each video frame. According to another aspect of the embodiments of the present application, a video coding apparatus is further provided, comprising: a feature retrieval module configured to respond to a video playing request used to instruct playing a target video, acquire video features of the target video, wherein the video features comprise features directly extracted from the target video before receiving the video playing request and / or features determined according to historical video feature analysis results of the target video; a coding configuration module configured to determine coding information of the target video according to the video features, wherein the coding information comprises a code rate allocation mode adopted when coding the target video; and a video coding module configured to identify code rates allocated to each video frame of the target video in the code rate allocation mode, and code the target video according to the code rates allocated to each video frame. According to another aspect of the embodiments of the present application, an electronic device is further provided, comprising: a memory storing an executable program; and a processor configured to run the program, wherein the program is executed to perform the method in each embodiment of the present application. According to another aspect of the embodiments of the present application, a computer readable storage medium is further provided, comprising a stored executable program, wherein the computer readable storage medium is controlled to perform the method in each embodiment of the present application when the executable program is run.According to another aspect of the embodiments of the present application, a computer program product is provided, which includes a computer program. The computer program, when executed by a processor, implements the method in any of the embodiments of the present application. According to another aspect of the embodiments of the present application, a computer program product is provided, which includes a nonvolatile computer readable storage medium. The nonvolatile computer readable storage medium stores a computer program. The computer program, when executed by a processor, implements the method in any of the embodiments of the present application. According to another aspect of the embodiments of the present application, a computer program is provided. The computer program, when executed by a processor, implements the method in any of the embodiments of the present application. In the embodiments of the present application, after receiving a video playing request for indicating playing a target video, a video feature of the target video stored in a target server is acquired, wherein the video feature includes a feature directly extracted from the target video before receiving the video playing request or a feature determined according to a historical video feature analysis result of the target video; coding information of the target video is determined according to the video feature, wherein the coding information includes a code rate allocation manner when the target video is encoded; and the target video is encoded according to the code rate allocated to each video frame in the code rate allocation manner. By acquiring the video feature of the target video in advance and determining the coding information of the target video according to the video feature when it is determined that the target video needs to be played, the code rate allocation manner of the target video is determined, so that appropriate code rate is allocated to each video frame when encoding, thereby achieving the technical effect of improving the video coding quality while ensuring the real-time performance of video playing, and further solving the technical problem of poor video coding quality caused by using a single coding manner when encoding the video in a high real-time requirement scene in the related art. It is easily noticed that the general description and the detailed description above are merely for illustrating and explaining the present application, and do not constitute limitation on the present application. BRIEF DESCRIPTION OF DRAWINGS The drawings explained herein are used to provide further understanding of the present application, constitute a part of the present application, and the illustrative embodiments of the present application and the explanation thereof are used to explain the present application, and do not constitute improper limitation on the present application.In the drawings: Fig. 1 is a schematic diagram of a computer terminal (or server) according to an embodiment of the present application; Fig. 2 is a structural block diagram of a computing environment according to an embodiment of the present application; Fig. 3 is a schematic diagram of a service mesh according to an embodiment of the present application; Fig. 4 is a flowchart of an optional video encoding method according to an embodiment of the present application; Fig. 5 is a structural diagram of another optional video encoding method according to an embodiment of the present application; Fig. 6 is a structural diagram of an optional video encoding system according to an embodiment of the present application; Fig. 7 is a structural diagram of an optional video encoding apparatus according to an embodiment of the present application; Fig. 8 is a block diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION In order for those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work should fall within the scope of protection of the present application. It should be noted that the terms "first", "second" and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units need not be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices. First, some nouns or terms appearing in the description of the embodiments of the present application are applicable to the following explanations: transcoding: transcoding refers to the operation of converting an already compressed and encoded audio / video bitstream into another audio / video bitstream. By transcoding the audio / video bitstream, different network bandwidths, different terminal processing capabilities and different user needs can be adapted, so that the audio / video bitstream can be played in different terminal devices. Transcoding is essentially a process of decoding first and then encoding, so the bitstream before and after conversion can follow the same video encoding format, or can not follow the same video encoding format, and the video encoding format after conversion can be determined according to the encoding format that the terminal device can parse or user needs. Common encoding formats include H.264, H.265, AV1, etc.Bitrate: Bitrate refers to the data flow used by a video file in a unit of time, also known as bitstream or bitstream rate, which is the most important part of picture quality control in video encoding. The unit of measurement is "bit per second" (bit / s or bps), and Kbps (how many kilobits per second) or Mbps (how many megabits per second) are commonly used. Generally speaking, under the same video resolution, the larger the bitrate of the video file, the smaller the compression ratio, and the higher the picture quality. The larger the bitrate, the larger the sampling rate per unit of time, the higher the data stream precision, the closer the processed file to the original file, the better the image quality, the clearer the picture, and the higher the decoding capability required by the playback device. Single encoding: also known as One-Pass or Singal-Pass, is a common encoding mode when encoding a video. In this encoding mode, the video is only encoded once, and the video bitrate can be controlled based on variable bitrate (Variable Bitrate, abbreviated as VBR), constant bitrate (Constant Bitrate, abbreviated as CBR), etc. Double encoding: also known as Two-Pass, is an encoding mode that performs two encoding operations to accurately allocate bitrate and obtain smaller and higher quality encoding results. In this mode, the video is analyzed during the first encoding, and the encoding information is generated based on the analysis results. The second encoding is performed based on the generated encoding information, resulting in high-quality encoding results. The problem with double encoding is that it takes more time to encode the same video compared to single encoding, and it cannot be applied in scenarios that require real-time transcoding, such as live streaming, real-time communication, cloud video on demand, etc. Intelligent media management (Intel l igent Media Management, abbreviated as IMM): a cloud-based multimedia service tool that can be set up in a cloud server to assist users in managing and processing multimedia content of various formats, including audio, video, images and documents, etc.In the encoding process, the complexity of each frame of the original video is constantly changing with the video content, the higher the video complexity, the higher the output encoding bit number, if the code stream is not controlled, the video code rate obtained after encoding will change constantly, the code rate changing greatly cannot meet the requirements of actual transmission channel and transmission bandwidth, therefore, the code rate control is essential in the actual application of video encoding standard. In the scene with high real-time requirement such as video on demand, live broadcast, direct playback of video stored in the cloud or network disk, in order to ensure real-time performance, single encoding technology such as CBR is usually used in the scene with high real-time requirement to maintain the code rate basically at the average code rate. The problem of this method is that for complex scenes, mosaic phenomenon may occur due to insufficient code rate, and for simple scenes, the encoding space cannot be fully utilized. Related technologies also provide a secondary encoding method, which encodes the video twice to ensure the quality of the encoding result. Although this method improves the encoding quality compared with single encoding, it needs to perform two encoding operations continuously during encoding, which is time-consuming and not suitable for real-time conversion scenes. Therefore, in the video playback scene with high real-time requirement, related technologies cannot improve the encoding quality of the video while ensuring the encoding rate, resulting in poor video playback effect. In order to solve the above problems, according to the embodiments of the present application, a video encoding method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here. The method provided by the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Fig. 1 shows a hardware structure block diagram of a computer terminal (or mobile device) for implementing a video encoding method. As shown in Fig. 1, the computer terminal 10 (or mobile device) can include one or more (shown as 102a, 102b, >....., 102n in the figure) processors 102 (the processor 102 can include but not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication function. In addition, it can also include a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which can be included as one of the ports of the bus), a network interface, a power supply and / or a camera.Those skilled in the art can understand that the structure shown in FIG. 1 is only schematic, which does not limit the structure of the electronic device described above. For example, the computer terminal 10 can further include more or less components than those shown in FIG. 1, or have a different configuration from that shown in FIG. 1. It should be noted that the one or more processors 102 and / or other data processing circuitry described above can be referred to herein generally as "data processing circuitry". The data processing circuitry can be embodied in whole or in part as software, hardware, firmware, or any combination thereof. Furthermore, the data processing circuitry can be a single independent processing module, or any one of the other elements incorporated in whole or in part into the computer terminal 10 (or mobile device). As referred to in the embodiments of the present application, the data processing circuitry controls, for example, the selection of the variable resistance terminal path connected to the interface, as a processor. The memory 104 can be used to store software programs and modules of application software, such as program instructions / data storage means corresponding to the method of the embodiments of the present application. The processor 102 performs various functional applications and data processing by running the software programs and modules stored in the memory 104, i.e. implements the method of the embodiments described above. The memory 104 can include a high-speed random access memory, and can further include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory 104 can further include a memory disposed remotely with respect to the processor 102, which can be connected to the computer terminal 10 through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof. The transmission device 106 is used to receive or send data via a network. The specific examples of the network can include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to be able to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, RF) module, which is used to communicate with the Internet in a wireless manner. The display can be, for example, a touch screen type liquid crystal display (Liquid Crystal Display, LCD), which can enable a user to interact with the user interface of the computer terminal 10 (or mobile device).Figure 1 illustrates a hardware architecture diagram that can serve as an exemplary diagram for the computer terminal 10 (or mobile device) described above, as well as an exemplary diagram for the servers described above. In an alternative embodiment, Figure 2 illustrates an embodiment in which the computer terminal 10 (or mobile device) described above in Figure 1 is used as a compute node in a computing environment 201. Figure 2 illustrates a structural diagram of a computing environment, as shown in Figure 2, the computing environment 201 includes multiple (shown as 210-1, 210-2, etc.) compute nodes (e.g., servers) running on a distributed network. The compute nodes all contain local processing and memory resources, and an end user 202 can remotely run applications or store data in the computing environment 201. Applications can be provided as multiple services 220-1, 220-2, 220-3, and 220-4 in the computing environment 201, representing services “A”, “D”, “E”, and “H”, respectively. The end user 202 can provide and access the services through a web browser or other software application on a client, and in some embodiments, the provisioning and / or requests of the end user 202 can be provided to an ingress gateway 230. The ingress gateway 230 can include a corresponding proxy to handle the provisioning and / or requests for services (one or more services provided in the computing environment 201). The services are provided or deployed according to various virtualization technologies supported by the computing environment 201. In some embodiments, the services can be provided according to virtualization based on virtual machines (VMs), virtualization based on containers, and / or the like. Virtualization based on virtual machines can emulate a real computer by initializing a virtual machine to execute programs and applications without directly accessing any actual hardware resources. While the virtual machine is virtualized, according to virtualization based on containers, a container can be launched to virtualize an entire operating system (OS) so that multiple workloads can run on a single operating system instance. In one embodiment based on container virtualization, several containers of a service can be assembled into a Pod (e.g., a Kubernetes Pod). o For example, as shown in Figure 2, The Pods 240-1, 240-2, 240-N (collectively, Pods) can include a proxy 245 and one or more containers
[0002] 242-1, 242-2, 242-M (collectively referred to as containers). One or more containers in a Pod handle requests related to one or more respective functions of a service, and a proxy 245 generally controls network functions related to the service, such as routing, load balancing, etc. Other services can also be equipped with similar Pods. During operation, executing a user request from an end user 202 can require invoking one or more services in the computing environment 201, and executing one function of a service can require invoking one or more functions of another service. As shown in FIG. 2, a service “A” 220-1 receives a user request from an end user 202 from an ingress gateway 230, the service “A” 220-1 can invoke a service “D” 220-2, which can request a service “E” 220-3 to perform one or more functions. The computing environment described above can be a cloud computing environment, where allocation of resources is managed by a cloud service provider, allowing development of functions without considering implementation, tuning, or scaling servers. The computing environment allows developers to execute code that responds to events without building or maintaining complex infrastructure. Instead of scaling a single hardware device to handle potential loads, services can be split into a set of functions that can automatically scale independently. In another alternative embodiment, FIG. 3 illustrates a block diagram of an embodiment of a service mesh using the computer terminal 10 (or mobile device) shown in FIG. 1 described above as a service mesh. FIG. 3 illustrates a block diagram of a structure of a service mesh, as shown in FIG. 3, the service mesh 300 is primarily used to facilitate secure and reliable communication between multiple microservices, where a microservice refers to breaking an application into multiple smaller services or instances and distributing them to run on different clusters / machines. As shown in FIG. 3, the microservices can include an application service instance X and an application service instance Y, which form a functional application layer of the service mesh 300. In one implementation, the application service instance X runs in the form of a container / process 308 on a machine / workload container group 314 (Pod), and the application service instance Y runs in the form of a container / process 310 on a machine / workload container group 316 (Pod). In one implementation, the application service instance X can be a service that provides playable videos, and the application service instance Y can be a service that provides encoded videos. As shown in FIG. 3, the application service instance A and a mesh proxy (sidecar) 303 coexist in the machine workload container group 314, and the application service instance B and a mesh proxy 305 coexist in the machine workload container 316.The mesh proxies 303 and 305 form a data plane layer of the service mesh 300. Among other things, the mesh proxies 303 and 305, in the form of containers / processes 304, 306, respectively, can receive requests 312 for providing a service of playing a video, and can bi-directionally communicate between the mesh proxy 303 and the application service instance A, and between the mesh proxy 305 and the application service instance B. In addition, the mesh proxies 303 and 305 can also bi-directionally communicate. In an implementation, all network traffic of the application service instance A is routed through the mesh proxy 303 to the appropriate destination, and all network traffic of the application service instance B is routed through the mesh proxy 305 to the appropriate destination. It is noted that the network traffic mentioned herein includes, but is not limited to, Hyper Text Transfer Protocol (HTTP), Representational State Transfer (REST), Google Remote Procedure Call (gRPC), Redis, and the like. In an implementation, the functionality of the extended data plane layer can be implemented by writing custom filters (Filter) for the proxies (Envoy) in the service mesh 300, and the service mesh proxy configuration can be configured to enable the service mesh to correctly proxy service traffic, implement service interworking and service governance. The mesh proxies 303 and 305 can be configured to perform at least one of the following functions: service discovery, health checking, routing, load balancing, authentication and authorization, and observability. oAs shown in FIG. 3, the service mesh 300 also includes a control plane layer. The control plane layer can be a group of services running in a dedicated namespace, hosted by a hosting control plane component 301 in a machine / Pod 302. As shown in FIG. 3, the hosting control plane component 301 is in bidirectional communication with the mesh agent 303 and the mesh agent 305. The hosting control plane component 301 is configured to perform some control management functions. For example, the hosting control plane component 301 receives telemetry data transmitted by the mesh agent 303 and the mesh agent 305, and can further aggregate the telemetry data. The services, the hosting control plane component 301 can also provide a user-facing Application Programming Interface (API) to more easily manipulate network behavior, provide configuration data to the mesh agent 303 and the mesh agent 305, and so on. In the above running environment, the video encoding method as shown in FIG. 4 is provided, which is suitable for a server. FIG. 4 is a flowchart of a video encoding method according to Embodiment 1 of the present application. As can be seen from FIG. 4, the video encoding method comprises the following steps: in step S402, in response to a video playing request for indicating a target video to be played, obtaining a video feature of the target video, wherein the video feature comprises a feature directly extracted from the target video before the video playing request is received and / or a feature determined according to a historical video feature analysis result of the target video; in the technical solution provided in step S402, the target video itself can be directly analyzed by the target server after the target video is uploaded to the target server to determine the video feature, or the target video can be encoded in a single encoding manner, and then the video feature is determined according to a video feature analysis result synchronously obtained in the single encoding process, and then the target video is encoded more finely based on the determined video feature. The video feature analysis result synchronously obtained in the single encoding process is the historical video feature analysis result. For example, when the target video is uploaded to the target server and the IMM running in the target server determines that there is enough idle computing power in the current server, if the target video is not required to be played by a user, the video feature of the unplayed target video can be extracted. In order to avoid that the target video cannot be played when a user wants to play the target video during the video feature extraction of the target video, a temporary mirror file of the target video can be established first. In this way, during the video feature extraction of the target video, if a user wants to play the target video, the temporary mirror file can be transcoded in a single encoding manner first.In order to save storage space, the temporary mirror file can be deleted after the video feature extraction of the target video is completed. In addition, the encoding information obtained when the temporary mirror file is encoded can be used to assist in extracting the video features of the target video or adjusting and correcting the directly extracted video features. In some embodiments of the present application, the video features can be directly extracted from the target video, including the following steps: after receiving the target video uploaded to the target server, determining the allocation of computing resources of the target server; determining the idle computing resources of the target server according to the allocation of computing resources, wherein the idle computing resources include unused computing resources, and the meaning of the unused computing resources includes but is not limited to: computing resources in an idle state at the current time when the idle computing resources are determined, and computing resources that have not been allocated corresponding computing tasks within a preset time period; using the idle computing resources to analyze the target video to obtain the video features of the target video. As an optional implementation, the step of determining the allocation of computing resources of the target server includes: predicting the predicted analysis time required when analyzing the target video, and determining the analysis time period of analyzing the target video according to the predicted analysis time; determining the task information of the tasks performed by the target server other than analyzing the target video within the analysis time period, wherein the task information includes the computing resource information consumed by the task; determining the allocation of computing resources of the target server within the analysis time period according to the computing resource information consumed by each task and the total computing resource information of the target server, wherein the allocation of computing resources includes allocated computing resource information and idle computing resource information of the idle computing resources. Optionally, when determining the predicted analysis time, an analysis time value range can be predicted according to the length and clarity of the target video and other data. The analysis time value range can be determined according to the time consumed when analyzing each video in the historical analysis data and the summary analysis result of the clarity of the video. The computing resource information consumed by each task includes the computing resource information pre-allocated to the task when executing the task, and the additional computing resource information temporarily required during the execution of the task.In the process of extracting video features of a target video by using idle computing resources, in order to avoid the situation that idle computing resources are insufficient to support feature extraction of the target video, when analyzing the target video by using idle computing resources to obtain video features of the target video, the following method can be used: predicting the computing resource information required for analyzing the target video; comparing the computing resource information and the idle computing resource information; in the case that the comparison result represents that the idle computing resources are not less than the computing resources required for analyzing the target video, calling the target computing resources from the idle computing resources to analyze the target video, wherein the target computing resources are not less than the computing resources required for analyzing the target video; in the case that the comparison result represents that the idle computing resources are less than the computing resources required for analyzing the target video, adding the target video to the waiting queue, and after the idle computing resources are not less than the computing resources required for analyzing the target video, calling the target computing resources from the idle computing resources to analyze the target video. In predicting the computing resource information required for analyzing the target video, the computing resource information that may be required can be predicted according to the length and resolution of the video. In addition, the required computing resources can also be predicted according to the video category label added to the video by the customer uploading the target video. The video category label is used to indicate the content contained in the video. For two videos with the same length, resolution and other information, but different video contents, the complexity of their video features will be different due to the difference in video content. For example, for an interview type video, the motion changes and scene changes involved in the video are usually less, so the features contained in the video are relatively simple, and therefore the computing resources required for extracting the video features are also less. For an action movie, such a video usually contains a large amount of motion change information and scene change information, so the video features contained in the video are more, and the computing resources required for extracting the video features are also more. Therefore, the computing resource information consumed by videos with different video contents in extracting video features can be counted, and the computing resource information that videos with the same video content may require in extracting video features can be estimated according to the statistical result. By using idle computing resources to extract video features of the target video, and determining encoding information according to the extracted video features to guide the encoding process of the target video, on the one hand, the encoding quality and rate are improved by determining the video features of the video in advance as the guiding information of the encoding process, and on the other hand, the utilization rate of the server's computing resources is improved without affecting the computing tasks being processed by the server.In addition to extracting the video features directly from the target video, the video features of the target video can also be determined according to the historical video feature analysis result of the target video. Optionally, when the target video is uploaded to the target server, the target video can be encoded in a single encoding manner when the target video is first required to be played by a user, and the video feature data of the target video can be collected simultaneously in the encoding process, and the video feature data of the target video can be stored in the target server as part of the historical video feature analysis result after the encoding and collection are completed. When the subsequent target video is required to be played again, the encoding information of the target video can be determined according to the video features collected when the target video is encoded before. Optionally, the video features can be determined according to the historical video feature analysis result of the target video in the following manner: obtaining the play record of the target video; in the case that the play record indicates that the target video has been completely played at least once, retrieving the historical encoding result of the target video in the target server; in the case that the historical encoding result is not retrieved, obtaining the historical video feature analysis result stored in the target server, wherein the historical video feature analysis result includes the historical video features of the target video extracted when the target video is encoded; and then the historical video features can be used as the video features. For a video uploaded to the server, if the video is required to be played frequently, the server will usually select to delete the encoding result of the video. However, in the embodiment of the present application, the historical video feature analysis result obtained synchronously when the video is encoded is still retained after the encoding result is deleted, and the historical video feature analysis result is used as the video features to guide the encoding process when the video is required to be played subsequently. On the one hand, since the encoding result of the video does not need to be stored for a long time, the storage cost of the video is reduced. On the other hand, by retaining the historical video feature analysis result, the encoding efficiency and effect when the video is encoded again are improved. As an optional implementation manner, in the process of encoding the target video, the video features of the target video can be updated according to the encoding result. In some embodiments of the present application, in addition to extracting the video features in the encoding process when the video is played for the first time, the video features can also be extracted simultaneously when the video is encoded subsequently, and the original historical video features are deleted, so as to realize the continuous updating of the video features. When the historical video features are updated, the similarity between the currently obtained video features and the stored historical video features can be compared first. If the similarity is less than a preset similarity threshold, it is indicated that the extracted video features do not need to be optimized any more, and the operation of extracting the video features simultaneously when the video is encoded is not continued after the video features are extracted this time.If the similarity is not less than the preset similarity threshold, it indicates that the video feature needs to be continuously optimized, and the operation of updating the video feature needs to be continuously performed until the similarity is less than the preset similarity threshold. In step S404, encoding information of the target video is determined according to the video feature, wherein the encoding information includes a code rate allocation manner used when the target video is encoded. In the technical solution provided in step S404, the video feature of the target video includes at least one of the following: texture complexity information of each video frame in the target video, motion intensity information of each video frame in the target video, and brightness and contrast feature information of each video frame in the target video. Optionally, by extracting and analyzing the video feature of the target video, the area in each video frame of the target video that is more focused on by the human eye and the area that is more easily ignored can be determined, so that more code rate is allocated to the area in each video frame that is more focused on by the human eye, and less code rate is allocated to the area that is more easily ignored, and more code rate is allocated to the video frame that contains more areas that are easily focused on by the human eye. For example, the human eye is usually more likely to focus on an area with high texture complexity, and is more likely to ignore a flat area with low texture complexity. The human eye is more likely to focus on an area with intense motion, and is more likely to ignore an area with gentle motion. In addition, by adjusting the brightness or contrast of the video, some areas that are not interesting to the human eye can be discarded, so that the code rate is concentrated in the area that is interesting to the human eye. In addition, the video features contained in different video frames are not the same, and the video frame that contains higher complexity is usually the video frame that contains more areas that are interesting to the human eye, and needs to be allocated more code rate, and vice versa, which indicates that less code rate should be allocated. From the above, it can be seen that by determining the encoding information of the target video according to the video feature, the code rate allocation manner when the video is encoded can be effectively optimized, and invalid code rate waste can be avoided.As an optional implementation, in order to realize accurate allocation of code rates, the video features include features of each video frame in the target video and features of each coding unit in each video frame, and the code rate allocation result can include a code rate allocated for each video frame and code rates allocated for each coding unit; determining the coding information of the target video according to the video features includes: determining first type video frames and second type video frames in the target video according to the video features, wherein the first type video frames correspond to feature complexity indicators greater than a preset feature complexity indicator, the second type video frames correspond to feature complexity indicators not greater than the preset feature complexity indicator, and the feature complexity indicators are used to reflect feature complexity of the video frames in the target video; determining a code rate allocated for the first type video frames and a code rate allocated for the second type video frames; determining code rates allocated for each coding unit in the first type video frames according to feature complexity indicators of the coding units in the first type video frames and the code rate allocated for the first type video frames, and determining code rates allocated for each coding unit in the second type video frames according to feature complexity indicators of the coding units in the second type video frames and the code rate allocated for the second type video frames, wherein the code rate corresponding to the first type video frames is not less than a first preset code rate, the code rate corresponding to the second type video frames is not greater than a second preset code rate, and the first preset code rate is greater than the second preset code rate. In some embodiments of the present application, determining the code rates allocated for each coding unit in the first type video frames according to the feature complexity indicators of the coding units in the first type video frames and the code rate allocated for the first type video frames includes: determining first code rate allocation proportion information of each coding unit in the first type video frames according to the feature complexity indicators of the coding units in the first type video frames, wherein the first code rate allocation proportion information is used to at least represent a ratio of the code rates allocated for each coding unit in the first type video frames to the code rate allocated for the first type video frames; and determining the code rates allocated for each coding unit in the first type video frames according to the code rate allocated for the first type video frames and the first code rate allocation proportion information. Determining the code rates allocated for each coding unit in the second type video frames according to the feature complexity indicators of the coding units in the second type video frames and the code rate allocated for the second type video frames includes: determining second code rate allocation proportion information of each coding unit in the second type video frames according to the feature complexity indicators of the coding units in the second type video frames, wherein the second code rate allocation proportion information is used to at least represent a ratio of the code rates allocated for each coding unit in the second type video frames to the code rate allocated for the second type video frames; and determining the code rates allocated for each coding unit in the second type video frames according to the code rate allocated for the second type video frames and the second code rate allocation proportion information.As an optional implementation, when determining the code rate allocated to each coding unit, the code rate allocation result can also be adjusted according to the feature type in the coding unit. For example, when the features in the coding unit are features that are more likely to be paid attention to by the human eye, the code rate allocated to the coding unit can be increased, and when the features in the coding unit are mainly features that are more likely to be ignored by the human eye, the code rate allocated to the coding unit can be decreased. As an optional implementation, the code rate of a video frame or a coding unit can also be adjusted according to the feature complexity in the video frame or the coding unit through a preset formula. The preset formula can be any formula that reflects the corresponding relationship between the feature complexity and the code rate, which is not limited herein in the embodiments of the present application. By allocating the code rate during encoding according to the feature complexity indicators of the video frame and each coding unit in the video frame, a higher code rate can be provided for a video frame with higher feature complexity and more human eye interested regions, so as to improve the user experience when watching the video without increasing the size of the encoded video file. The feature complexity indicator can be one or a combination of multiple feature complexity quantization parameters, and the quantization parameters of the feature complexity can be information entropy, spatial redundancy, edge density, texture complexity, and the like of the video frame. When multiple parameter combinations are used to determine the complexity indicator, in order to solve the problem of different units of different parameters, the various types of quantization parameters corresponding to each video frame or coding unit can be normalized according to the statistical results of the different types of quantization parameters of each video frame in the video, and then the normalized calculation results of the various types of quantization parameters corresponding to each video frame are weighted and summed or weighted and averaged, and the final calculation result is taken as the feature complexity indicator. The weights corresponding to each type of quantization parameter can be set by the developer. In addition, it should be noted that the code rate allocation result represented by the encoding information can be a reference code rate allocation result to guide the specific encoding process when encoding the target video, so that the actual code rate of each video frame or coding unit in the actual encoding process can have a certain difference from the code rate allocation result, and the difference is within a preset value range. Or the video can also be encoded according to the code rate allocation result represented by the encoding information in the encoding process, and the code rate of each video frame and the coding unit in the video frame in the final encoding process is consistent with the code rate allocation result. In some embodiments of the present application, after the encoding information is determined and the code rate allocation mode indicated by the encoding information is determined, the encoding mode corresponding to the target video can be further determined.The encoding mode includes pre-allocated encoding calculation cost and video playback cost, the video playback cost includes playback bandwidth cost and storage cost, the encoding calculation cost and the consumed computing resource size when encoding the target video are positively correlated, and the video playback cost and the encoding calculation cost are negatively correlated. It should be noted that, by using the method for guiding the encoding process through the video features provided in the embodiments of the present application, the video playback cost can be reduced under the condition that the encoding calculation cost is not increased or is reduced, and the video playback volume is constant. If it is desired to further control the total cost of the target video, the encoding calculation cost and the video playback cost of the target video can be adjusted in the following manner. Alternatively, when the target video is uploaded into the target server, if the number of times of playing the target video is small, a relatively rough transcoding mode can be used to transcode the target video, wherein the relatively rough transcoding mode refers to that the computing resource allocated to the transcoding operation of the target video is small, and the encoding method used is an encoding method that requires less computing resource. The advantage of this relatively rough transcoding mode is that the encoding calculation cost of the video can be saved, but the data volume of the encoded video file is large, which consumes more storage cost and bandwidth cost per play. However, since the frequency of playing the video is low, the total bandwidth cost when using the rough transcoding mode to encode the video within a preset time period is also low, so that the total cost is effectively reduced due to the saving of the encoding calculation cost and the total bandwidth cost, although the storage cost is increased. When the target video is played a large number of times within a period of time, if the rough transcoding mode is still used to transcode the target video, the encoding calculation cost saved is not enough to cover the increased total bandwidth cost and storage cost, so a more fine transcoding configuration can be used, that is, more encoding calculation cost and computing resource are allocated to perform the encoding operation for the target video, and an encoding mode that can ensure the encoding quality and effectively compress the size of the video file but consumes more computing resource is used to encode the target video. In this way, although the encoding calculation cost of the target video is increased, the storage cost and the total bandwidth cost are reduced, and compared with the mode without using the fine transcoding configuration, the total cost is still significantly reduced. It should be noted that the encoding mode suitable for the target video is not fixed, and needs to be adjusted according to the actual playing situation of the target video.Therefore, after determining the encoding mode of the target video according to the video features, it can also be determined whether the video type of the target video changes, wherein the video type includes a hot video and a cold video, the hot video indicates that the number of plays of the target video within a preset time period is greater than a preset play number threshold, and the cold video indicates that the number of plays of the target video within the preset time period is not greater than the preset play number threshold; in the case of a change in the video type, the encoding mode is adjusted according to the changed video type. Optionally, in the case of a change in the video type, the specific steps of adjusting the encoding mode according to the changed video type include: determining a first encoding mode corresponding to the target video; in the case of determining that the video type of the target video changes from a cold video to a hot video, determining a second encoding mode corresponding to the target video, wherein the second encoding mode corresponds to a greater amount of consumed computing resources than the first encoding mode, and the second encoding mode corresponds to a smaller data amount of the encoded target video than the first encoding mode; in the case of determining that the video type of the target video changes from a hot video to a cold video, determining a third encoding mode corresponding to the target video, wherein the third encoding mode corresponds to a smaller amount of consumed computing resources than the first encoding mode, and the third encoding mode corresponds to a larger data amount of the encoded target video than the first encoding mode. The first encoding mode described above refers to the encoding mode before the video type of the target video changes. In addition to the rate allocation mode, the encoding information can also include video scene distribution information determined according to the video features, and the frame types of each video frame, such as independent decoding frames, prediction decoding frames, etc., and can also include the division mode of the encoding unit, the division unit, and the transformation unit in the video frame, as well as the prediction mode of each prediction unit. In addition, in the case of inter-frame prediction, the encoding information also includes the motion vector of the prediction unit. The encoding information can also include the QP (Quantization Parameter) of each encoding unit, the rate-distortion cost, and the number of consumed codewords, etc. In step S406, the rate allocation result allocated to each video frame in the rate allocation mode is identified, and the target video is encoded according to the rate allocated to each video frame. It should be noted that the rate allocation result described above includes the reference rate allocated to each video frame, and the reference rate allocated to each encoding unit in the video frame. In the technical solution provided in step S406, different types of computing devices in the target server can be called to perform different computing tasks.Optionally, when the video feature of the target video stored in the target server is acquired, the historical video feature of the target video can be retrieved in the target server; and in the case that the historical video feature of the target video is not retrieved, the graphics processing unit (GPU) in the target server is invoked to extract the video feature of the target video and store it in the target server. When the encoding information of the target video is determined according to the video feature of the target video, the central processing unit (CPU) in the target server is invoked to determine the encoding information of the target video. By using different types of computing devices to perform different types of computing tasks, the task parallelism of the target server can be effectively improved, for example, the video feature of a first video can be extracted while a second video is encoded. Moreover, different types of computing devices are good at processing different types of computing tasks, and by reasonably allocating computing tasks, the execution efficiency of the video encoding task can be effectively improved. As an optional implementation, the rate allocation mode of the video can also be adjusted according to the feedback results of the user watching the video. Optionally, the video evaluation information sent by the plurality of terminal devices playing the target video can be summarized, wherein the video evaluation information includes the user feedback video segment to be adjusted and the timestamp corresponding to the video segment to be adjusted, and the video segment to be adjusted is a video segment whose video quality problem is fed back by no less than a preset number of users; and the rate allocated to the video segment to be adjusted is improved. In summary, in the embodiments provided in the present application, a plurality of ways of acquiring video features in advance are provided, including directly extracting video features from the video itself using idle computing power, using the historical video features cached when the video is previously transcoded as the video features, invoking a specific type of computing module to quickly acquire the video features, etc. By acquiring the video features in advance and guiding the rate allocation of the encoding process in the transcoding operation according to the acquired video features when the video needs to be transcoded, the encoding quality is improved while ensuring the real-time performance of the video transcoding, so that the transcoded video has higher clarity, better viewing experience and smaller size when played. It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose authorization or refusal.It should be noted that, for the foregoing method embodiments, in order to simply describe, they are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited to the action sequence described, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily necessary for the present application. Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and necessary general hardware platform, and of course it can also be realized by hardware. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes a number of instructions to make a terminal device (which can be a mobile phone, computer, server, or network device, etc.) execute the methods described in various embodiments of the present application. Embodiment 2 The present application provides a video encoding method as shown in FIG. 5, which is suitable for use in a terminal device. FIG. 5 is a flowchart of a video encoding method according to embodiment 2 of the present application. As can be seen from FIG. 5, the video encoding method comprises the following steps: step S502, sending a video playing request to a target server, wherein the video playing request is used to instruct the target server to send a target video to the terminal device; step S504, receiving the target video obtained by the target server according to the video feature of the target video, wherein the video feature of the target video is used to determine the encoding information of the target video, the video feature includes the feature directly extracted from the target video by the target server before receiving the video playing request and / or the feature determined according to the historical video feature analysis result of the target video, and the encoding information includes the code rate allocation mode used when encoding the target video, wherein the code rate allocation mode includes the code rate allocation result allocated for each video frame of the target video. It should be noted that the video encoding method provided in embodiment 2 is a further explanation of the video encoding method provided in embodiment 1, so the related explanation of the video encoding method provided in embodiment 1 also applies to embodiment 2.According to the embodiments of the present application, a video coding system for implementing the above-mentioned video coding method is further provided, as shown in FIG. 6, the system comprises: a target server 60 and a terminal device 62, wherein the target server 60 is configured to, in response to a video playing request sent by the terminal device 62 and used for indicating playing a target video, acquire video features of the target video, wherein the video features comprise features directly extracted from the target video before receiving the video playing request and / or features determined according to historical video feature analysis results of the target video; determine coding information of the target video according to the video features, wherein the coding information comprises a code rate allocation manner used for coding the target video; and identify code rate allocation results of each video frame in the target video in the code rate allocation manner, and code the target video according to the code rate allocation results of each video frame. In some embodiments of the present application, the target server 60 further comprises a graphic processor and a central processing unit, wherein the target server 60 is further configured to retrieve historical video features of the target video; in the case that the historical video features of the target video are not retrieved, invoke the graphic processor to extract the historical video features of the target video; and invoke the central processing unit to determine the coding information of the target video. It should be noted that the preferred implementation schemes involved in the above-mentioned embodiments of the present application are the same as the schemes, application scenarios and implementation processes provided in embodiments 1 and 2, but are not limited to the schemes provided in embodiments 1 and 2, and thus the related explanations and descriptions of the video coding method provided in embodiments 1 and 2 are also applicable to the present embodiment. According to the embodiments of the present application, a video coding device configured to implement the above-mentioned video coding method is further provided, as shown in FIG. 7, the device comprises: a feature retrieval module 70 configured to, in response to a video playing request used for indicating playing a target video, acquire video features of the target video, wherein the video features comprise features directly extracted from the target video before receiving the video playing request and / or features determined according to historical video feature analysis results of the target video; a coding configuration module 72 configured to determine coding information of the target video according to the video features, wherein the coding information comprises a code rate allocation manner used for coding the target video; and a video coding module 74 configured to identify code rate allocation results of each video frame in the target video in the code rate allocation manner, and code the target video according to the code rate allocation results of each video frame. In some embodiments of the present application, the video features of the target video comprise at least one of the following: texture complexity information of each video frame in the target video, motion intensity information of each video frame in the target video, and brightness and contrast feature information of each video frame in the target video.In some embodiments of the present application, the feature retrieval module 70 directly extracts the video features from the target video includes: after receiving the target video uploaded to the target server, determining the allocation of computing resources of the target server; determining the idle computing resources of the target server according to the allocation of computing resources, wherein the idle computing resources include unused computing resources; using the idle computing resources to analyze the target video to obtain the video features of the target video. In some embodiments of the present application, the feature retrieval module 70 determines the allocation of computing resources of the target server includes: predicting the predicted analysis time required for analyzing the target video, and determining the analysis time period for analyzing the target video according to the predicted analysis time; determining the task information of the tasks performed by the target server other than analyzing the target video within the analysis time period, wherein the task information includes the computing resource information consumed by the tasks; determining the allocation of computing resources of the target server within the analysis time period according to the computing resource information consumed by each task and the total computing resource information of the target server, wherein the allocation of computing resources includes allocated computing resource information and idle computing resource information of the idle computing resources. In some embodiments of the present application, the feature retrieval module 70 uses the idle computing resources to analyze the target video to obtain the video features of the target video includes: predicting the computing resource information required for analyzing the target video; comparing the computing resource information and the idle computing resource information; in the case that the comparison result represents that the idle computing resources are not less than the computing resources required for analyzing the target video, calling the target computing resources from the idle computing resources to analyze the target video, wherein the target computing resources are not less than the computing resources required for analyzing the target video; in the case that the comparison result represents that the idle computing resources are less than the computing resources required for analyzing the target video, adding the target video to the waiting queue, and after the idle computing resources are not less than the computing resources required for analyzing the target video, calling the target computing resources from the idle computing resources to analyze the target video. In some embodiments of the present application, determining the video features according to the historical video feature analysis result of the target video includes: obtaining the playback record of the target video; in the case that the playback record indicates that the target video has been completely played at least once, retrieving the historical encoding result of the target video in the target server; in the case that the historical encoding result is not retrieved, obtaining the historical video feature analysis result stored in the target server, wherein the historical video feature analysis result includes the historical video features of the target video extracted when the target video is encoded; taking the historical video features as the video features.In some embodiments of the present application, the feature retrieval module 70 retrieving the video features of the target video stored in the target server comprises: retrieving the historical video features of the target video in the target server; in the case that the historical video features of the target video are not retrieved, calling the graphic processor in the target server to extract the video features of the target video and store them in the target server; the encoding configuration module 72 determining the encoding information of the target video according to the video features of the target video comprises: calling the central processing unit in the target server to determine the encoding information of the target video according to the video features of the target video. In some embodiments of the present application, the video features comprise the features of each video frame in the target video and the features of each coding unit in each video frame, the rate allocation result comprises the rate allocated for each video frame and the rate allocated for each coding unit; the encoding configuration module 72 determining the encoding information of the target video according to the video features of the target video comprises: determining the first type of video frame and the second type of video frame in the target video according to the video features, wherein the feature complexity index corresponding to the first type of video frame is greater than the preset feature complexity index, the feature complexity index corresponding to the second type of video frame is not greater than the preset feature complexity index, and the feature complexity index is used to reflect the feature complexity of the video frame in the target video; determining the rate allocated for the first type of video frame and the rate allocated for the second type of video frame; determining the rate allocated for each coding unit in the first type of video frame according to the feature complexity index of each coding unit in the first type of video frame and the rate allocated for the first type of video frame, and determining the rate allocated for each coding unit in the second type of video frame according to the feature complexity index of each coding unit in the second type of video frame and the rate allocated for the second type of video frame, wherein the rate corresponding to the first type of video frame is not less than the first preset rate, the rate corresponding to the second type of video frame is not greater than the second preset rate, and the first preset rate is greater than the second preset rate.In some embodiments of the present application, the encoding configuration module 72 determines the code rate allocated to each coding unit in the first type of video frame according to the feature complexity indicators of each coding unit in the first type of video frame and the code rate allocated to the first type of video frame, including: determining first code rate allocation proportion information of each coding unit in the first type of video frame according to the feature complexity indicators of each coding unit in the first type of video frame, wherein the first code rate allocation proportion information at least represents the ratio of the code rate allocated to each coding unit in the first type of video frame and the code rate allocated to the first type of video frame; determining the code rate allocated to each coding unit in the first type of video frame according to the code rate allocated to the first type of video frame and the first code rate allocation proportion information; determining the code rate allocated to each coding unit in the second type of video frame according to the feature complexity indicators of each coding unit in the second type of video frame and the code rate allocated to the second type of video frame, including: determining second code rate allocation proportion information of each coding unit in the second type of video frame according to the feature complexity indicators of each coding unit in the second type of video frame, wherein the second code rate allocation proportion information at least represents the ratio of the code rate allocated to each coding unit in the second type of video frame and the code rate allocated to the second type of video frame; and determining the code rate allocated to each coding unit in the second type of video frame according to the code rate allocated to the second type of video frame and the second code rate allocation proportion information. In some embodiments of the present application, after the encoding configuration module 72 determines the encoding information of the target video according to the video features, it is further configured to: determine whether the video type of the target video changes, wherein the video type includes hot video and cold video, the hot video indicates that the number of plays of the target video in a preset time period is greater than a preset play number threshold, and the cold video indicates that the number of plays of the target video in the preset time period is not greater than the preset play number threshold; and in the case where the video type changes, adjust the encoding mode of the target video according to the changed video type, wherein the encoding mode at least includes the amount of computing resource consumption when encoding the target video.In some embodiments of the present application, in the case where the video type changes, the encoding configuration module 72 adjusts the encoding mode of the target video according to the changed video type, including: determining a first encoding mode corresponding to the target video; in the case where it is determined that the video type of the target video changes from a cold video to a hot video, determining a second encoding mode corresponding to the target video, wherein the second encoding mode corresponds to a larger amount of computing resource consumption than the first encoding mode, and the second encoding mode corresponds to a smaller data amount of the encoded target video than the first encoding mode; in the case where it is determined that the video type of the target video changes from a hot video to a cold video, determining a third encoding mode corresponding to the target video, wherein the third encoding mode corresponds to a smaller amount of computing resource consumption than the first encoding mode, and the third encoding mode corresponds to a larger data amount of the encoded target video than the first encoding mode. In some embodiments of the present application, after encoding the target video according to the code rate allocated to each video frame, the video encoding device is further configured to: aggregate video evaluation information sent by a plurality of terminal devices playing the target video, wherein the video evaluation information includes a video segment to be adjusted and a timestamp corresponding to the video segment to be adjusted, which is fed back by no less than a preset number of users, and the video segment to be adjusted is a video segment with video quality problems; and increase the code rate allocated to the video segment to be adjusted. It should be noted that the above-mentioned feature retrieval module 70, encoding configuration module 72 and video encoding module 74 correspond to steps S402 to S406 in Embodiment 1, and the two modules have the same instances and application scenarios as the corresponding steps, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above-mentioned modules or units can be hardware components or software components stored in a memory (for example, memory 104) and processed by one or more processors (for example, processors 102a, 102b,..., 102n), or the above-mentioned modules can be run in the computer terminal 10 provided in Embodiment 1 as part of the device. It should be noted that the preferred embodiments involved in the above embodiments of the present application have the same scheme, application scenario and implementation process as Embodiments 1-3, but are not limited to the schemes provided in Embodiments 1-3, and therefore the related explanations and descriptions of the video encoding method provided in Embodiments 1-3 also apply to the present embodiment.Optionally, in the embodiment, the electronic device can be at least one of a plurality of network devices of a computer network. In the embodiment, the computer terminal can execute program codes in the method. Optionally, FIG. 8 is a structural block diagram of an electronic device according to the embodiment of the present application. As shown in the figure, the electronic device A can include one or more (only one is shown in the figure) processors 102, a memory 104, a storage controller, and a peripheral interface, wherein the peripheral interface is connected with a radio frequency module, an audio module, and a display. The memory can be used to store software programs and modules, such as program instructions / modules corresponding to the method and device in the embodiment of the present application, and the processor can execute various functional applications and data processing by running the software programs and modules stored in the memory, that is, implement the method in the above embodiment. The memory can include a high-speed random access memory, and can also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory can further include a memory remotely arranged with respect to the processor, and the remote memory can be connected to the terminal A through a network. Examples of the network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The processor can call information and application programs stored in the memory through a transmission device to perform the following steps: in response to a video playing request for indicating playing a target video, obtaining video features of the target video, wherein the video features include features directly extracted from the target video before receiving the video playing request and / or features determined according to historical video feature analysis results of the target video; determining encoding information of the target video according to the video features, wherein the encoding information includes a code rate allocation manner used when encoding the target video; identifying code rates allocated to each video frame in the target video in the code rate allocation manner, and encoding the target video according to the code rates allocated to each video frame. Optionally, the processor can also execute program codes of the following steps: sending a video playing request to a target server, wherein the video playing request is used to instruct the target server to send the target video to the terminal device; receiving the target video encoded by the target server according to the video features of the target video, wherein the video features of the target video are used to determine the encoding information of the target video, the video features include features directly extracted from the target video by the target server before receiving the video playing request and / or features determined according to historical video feature analysis results of the target video, the encoding information includes a code rate allocation manner used when encoding the target video, and the code rate allocation manner includes code rate allocation results allocated to each video frame in the target video.According to the embodiment, a video playback request for indicating a target video is received, and a video feature of the target video is obtained, where the video feature includes a feature directly extracted from the target video before the video playback request is received and / or a feature determined according to a historical video feature analysis result of the target video; encoding information of the target video is determined according to the video feature, where the encoding information is used to represent at least a code rate allocation manner used when the target video is encoded; a code rate allocation result of each video frame in the target video in the code rate allocation manner is identified, and the target video is encoded according to the code rate allocation result of each video frame. By obtaining the video feature of the target video in advance, and determining the encoding information of the target video according to the video feature when the target video needs to be played, the code rate allocation manner of the target video is determined, so that appropriate code rates are allocated to each video frame during encoding, and the technical problem of poor video encoding quality caused by the one-time encoding manner of related technologies in a high real-time requirement scene is solved. It can be understood by those skilled in the art that the structure shown in the figure is only schematic, and the electronic device can also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a mobile Internet device (MID), a PAD, and the like. The figure does not limit the structure of the electronic device. For example, the electronic device A can further include more or fewer components (such as a network interface, a display device, etc.) than those shown in the figure, or have a different configuration from that shown in the figure. It can be understood by those skilled in the art that all or part of the steps in the various methods of the above embodiments can be completed by programs instructing related hardware of a terminal device, and the programs can be stored in a computer-readable storage medium. The storage medium can include a flash disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.Optionally, in the embodiment, the computer readable storage medium is configured to store program code for performing the following steps: obtaining video features of the target video in response to a video playing request for instructing playing the target video, wherein the video features include features directly extracted from the target video before receiving the video playing request and / or features determined according to historical video feature analysis results of the target video; determining encoding information of the target video according to the video features, wherein the encoding information is used to represent at least a code rate allocation manner used for encoding the target video; identifying code rate allocation results of each video frame in the target video in the code rate allocation manner, and encoding the target video according to the code rate allocation results of each video frame. Optionally, the computer readable storage medium is further configured to store program code for performing the following steps: sending the video playing request to the target server, wherein the video playing request is used to instruct the target server to send the target video to the terminal device; receiving the target video encoded by the target server according to the video features of the target video, wherein the video features of the target video are used to determine the encoding information of the target video, the video features include features directly extracted from the target video by the target server before receiving the video playing request and / or features determined according to historical video feature analysis results of the target video, the encoding information includes the code rate allocation manner used for encoding the target video, and the code rate allocation manner includes the code rate allocation results of each video frame in the target video. Embodiment 7 The embodiments of the present application further provide a computer program product. Optionally, in the embodiment, the computer program product can include a computer program, and the computer program is used to implement the method provided by the above embodiments when executed by a processor. Embodiment 8 The embodiments of the present application further provide a computer program product. Optionally, the computer program product can include a non-volatile computer readable storage medium, and the non-volatile computer readable storage medium can be used to store a computer program, and the computer program is used to implement the method provided by the above embodiments when executed by a processor. Embodiment 9 The embodiments of the present application further provide a computer program. Optionally, in the embodiment, the computer program is used to implement the method provided by the above embodiments when executed by a processor. The above serial numbers of the embodiments of the present application are only for description, and do not represent advantages or disadvantages of the embodiments. In the above embodiments of the present application, the description of each embodiment is different from each other, and the parts not described in detail in an embodiment can be referred to the related description of other embodiments. In the several embodiments provided by the present application, it should be understood that the disclosed technology can be implemented in other ways.Among them, the apparatus embodiments described above are only illustrative, for example, the division of the units is only a logical function division, and actual implementation can have another division mode, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units or modules shown or discussed can be indirect coupling or communication connection between the units or modules through some interfaces, and can be electrical or other forms. The units described as separate components can be or can not be physically separated, and the components shown as units can be or can not be physical units, that is, they can be located in one place, or can be distributed on multiple network units. Part or all of the units can be selected to achieve the purpose of the embodiment scheme according to actual needs. In addition, the function units in each embodiment of the present application can be integrated in a processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or software function unit. If the integrated unit is realized in the form of software function unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical scheme of the present application or the essential part of the prior art or the whole or part of the technical scheme can be embodied in the form of software product, and the computer software product is stored in a storage medium, including a plurality of instructions for making a computer device (which can be a personal computer, a server or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application. The foregoing storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and various program code storage media. The above is only the preferred embodiment of the present application, and it should be pointed out that for ordinary skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should be considered as the protection scope of the present application.Industrial applicability The scheme provided by the present disclosure can be applied to the field of video processing. In the present disclosure, a video playback request for indicating playing a target video is adopted, a video feature of the target video is obtained, wherein the video feature includes a feature extracted from the target video before receiving the video playback request and / or a feature determined according to a historical video feature analysis result of the target video; encoding information of the target video is determined according to the video feature, wherein the encoding information is used at least to represent a code rate allocation manner adopted when encoding the target video; a code rate allocation result allocated to each video frame in the target video in the code rate allocation manner is identified, and the target video is encoded according to the code rate allocation result allocated to each video frame, thereby achieving the technical effect of improving the video encoding quality while ensuring the real-time performance of video playing.
Claims
Claims 1. A video encoding method, comprising: In response to a video playback request for instructing playback of a target video, video features of the target video are obtained, wherein the video features include features extracted from the target video before receiving the video playback request and / or features determined based on historical video feature analysis results of the target video; encoding information of the target video is determined based on the video features, wherein the encoding information is at least used to characterize a bit rate allocation method used when encoding the target video; bit rate allocation results allocated to each video frame in the target video in the bit rate allocation method are identified, and the target video is encoded according to the bit rate allocation results allocated to each video frame.
2. The method according to claim 1, wherein: Extracting the video features from the target video includes: after receiving the target video uploaded to the target server, determining the computing resource allocation of the target server; determining the idle computing resources of the target server based on the computing resource allocation, wherein the idle computing resources include unused computing resources; and using the idle computing resources to analyze the target video to obtain the video features of the target video.
3. The method according to claim 2, wherein: Determining the computing power resource allocation of the target server includes: predicting the predicted analysis time required for analyzing the target video, and determining the analysis time period for analyzing the target video based on the predicted analysis time period; determining task information of tasks performed by the target server other than analyzing the target video within the analysis time period, wherein the task information includes computing power resource information consumed by the task; determining the computing power resource allocation of the target server within the analysis time period based on the computing power resource information consumed by each task and the total computing power resource information of the target server, wherein the computing power resource allocation includes allocated computing power resource information and idle computing power resource information of the idle computing power resources.
4. The method according to claim 3, wherein: The method of analyzing the target video using the idle computing resources to obtain the video features of the target video includes: predicting the computing resource information required for analyzing the target video; comparing the computing resource information with the idle computing resource information of the idle computing resources; and calling target computing resources from the idle computing resources to analyze the target video when the comparison result indicates that the idle computing resources are not less than the computing resources required for analyzing the target video, wherein the target computing resources are not less than the computing resources required for analyzing the target video. 23 resources; if the comparison result indicates that the idle computing resources are less than the computing resources required for analyzing the target video, add the target video to a waiting queue, and after the idle computing resources are no less than the computing resources required for analyzing the target video, call the target computing resources from the idle computing resources to analyze the target video. The method according to claim 1, wherein Determining the video features based on the historical video feature analysis results of the target video includes: obtaining a playback record of the target video; when the playback record indicates that the target video has been completely played at least once, retrieving a historical encoding result of the target video in a target server; when the historical encoding result is not retrieved, obtaining the historical video feature analysis results stored in the target server, wherein the historical video feature analysis results include historical video features of the target video extracted when encoding the target video; and using the historical video features as the video features. , the method according to claim 1, wherein, The video features include features of each video frame in the target video and features of each coding unit in each video frame, and the bit rate allocation result includes a bit rate allocated to each video frame and a bit rate allocated to each coding unit; Determining encoding information of the target video based on the video features of the target video includes: determining first and second category video frames in the target video based on the video features, wherein a feature complexity index corresponding to the first category video frames is greater than a preset feature complexity index, and a feature complexity index corresponding to the second category video frames is not greater than the preset feature complexity index, and the feature complexity index is used to reflect the feature complexity of the video frames in the target video; determining a bit rate allocated to the first category video frames and a bit rate allocated to the second category video frames; determining a bit rate allocated to each coding unit in the first category video frames based on the feature complexity index of each coding unit in the first category video frames and the bit rate allocated to the first category video frames, and determining a bit rate allocated to each coding unit in the second category video frames based on the feature complexity index of each coding unit in the second category video frames and the bit rate allocated to the second category video frames, wherein the bit rate corresponding to the first category video frames is not less than a first preset bit rate, the bit rate corresponding to the second category video frames is not greater than a second preset bit rate, and the first preset bit rate is greater than the second preset bit rate. The method according to claim 6, wherein Determining, based on the feature complexity index of each coding unit in the first category of video frames and the bit rate allocated to the first category of video frames, the bit rate allocated to each coding unit in the first category of video frames includes: determining, based on the feature complexity index of each coding unit in the first category of video frames, first bit rate allocation ratio information for each coding unit in the first category of video frames, wherein the first bit rate allocation ratio The example information is at least used to characterize the ratio of the bit rate allocated to each coding unit in the first category of video frames to the bit rate allocated to the first category of video frames; determining the bit rate allocated to each coding unit in the first category of video frames based on the bit rate allocated to the first category of video frames and the first bit rate allocation ratio information; determining the bit rate allocated to each coding unit in the second category of video frames based on the feature complexity index of each coding unit in the second category of video frames and the bit rate allocated to the second category of video frames includes: determining second bit rate allocation ratio information for each coding unit in the second category of video frames based on the feature complexity index of each coding unit in the second category of video frames, wherein the second bit rate allocation ratio information is at least used to characterize the ratio of the bit rate allocated to each coding unit in the second category of video frames to the bit rate allocated to the second category of video frames; determining the bit rate allocated to each coding unit in the second category of video frames based on the bit rate allocated to the second category of video frames and the second bit rate allocation ratio information.
8. The method according to claim 1, wherein: After determining the encoding information of the target video based on the video features, the method further includes: determining whether the video type of the target video has changed, wherein the video type includes hot videos and cold videos, the hot video indicates that the number of times the target video is played within a preset time period is greater than a preset playback number threshold, and the cold video indicates that the number of times the target video is played within the preset time period is not greater than the preset playback number threshold; in the case that the video type changes, adjusting the encoding method of the target video according to the changed video type, wherein the encoding method at least includes the computing power resource consumption when encoding the target video.
9. The method according to claim 8, wherein In the case where the video type changes, adjusting the encoding mode of the target video according to the changed video type includes: determining a first encoding mode corresponding to the target video; in the case where it is determined that the video type of the target video changes from the cold video to the hot video, determining a second encoding mode corresponding to the target video, wherein the computing power resource consumption corresponding to the second encoding mode is greater than the computing power resource consumption corresponding to the first encoding mode, and the data volume of the target video after encoding corresponding to the second encoding mode is less than the data volume of the target video after encoding corresponding to the first encoding mode; in the case where it is determined that the video type of the target video changes from the hot video to the cold video, determining a third encoding mode corresponding to the target video, wherein the computing power resource consumption corresponding to the third encoding mode is less than the computing power resource consumption corresponding to the first encoding mode, and the data volume of the target video after encoding corresponding to the third encoding mode is greater than the data volume of the target video after encoding corresponding to the first encoding mode.
10. The method according to claim 8, wherein: The encoding method also includes pre-allocated encoding computing cost and video playback cost, and the video playback cost includes playback bandwidth cost and storage cost, wherein the encoding computing cost is positively correlated with the amount of computing power resources consumed when encoding the target video, and the video playback cost is negatively correlated with the encoding computing cost; adjusting the encoding method according to the changed video type includes: when it is determined that the video type of the target video changes from the cold video to the hot video, increasing the encoding computing cost pre-allocated for the target video, so that the video playback cost is lower than a first preset cost threshold; when it is determined that the video type of the target video changes from the hot video to the cold video, reducing the encoding computing cost pre-allocated for the target video, so that the encoding computing cost is lower than a second preset cost threshold.
11. The method according to claim 1, wherein: Obtaining the video features of the target video stored in the target server includes: retrieving the historical video features of the target video in the target server; if the historical video features of the target video are not retrieved, calling the graphics processor in the target server to extract the video features of the target video and storing them in the target server; determining the encoding information of the target video based on the video features of the target video includes: calling the central processing unit in the target server to determine the encoding information of the target video based on the video features of the target video.
12. The method according to claim 1, wherein: After encoding the target video according to the bit rate assigned to each video frame, the method further includes: aggregating video evaluation information sent by multiple terminal devices that play the target video, wherein the video evaluation information includes a video segment to be adjusted as reported by users and a timestamp corresponding to the video segment to be adjusted, and the video segment to be adjusted is a video segment that has video quality issues as reported by no less than a preset number of users; and increasing the bit rate assigned to the video segment to be adjusted.
13. A video encoding system, comprising a target server and a terminal device, wherein: The target server is configured to respond to a video playback request sent by the terminal device for instructing to play a target video, obtain video features of the target video, wherein the video features include features extracted from the target video before receiving the video playback request and / or features determined based on historical video feature analysis results of the target video; determine encoding information of the target video based on the video features, wherein the encoding information is at least used to characterize a bit rate allocation method used when encoding the target video; identify a bit rate allocation result allocated to each video frame in the target video in the bit rate allocation method, and encode the target video according to the bit rate allocation result allocated to each video frame. 26 code.
14. The system according to claim 13, wherein: The target server includes a graphics processor and a central processing unit, wherein the target server is further configured to retrieve historical video features of the target video; if the historical video features of the target video are not retrieved, call the graphics processor to extract the video features of the target video; and call the central processing unit to determine encoding information of the target video.
15. A video encoding apparatus, comprising: A feature retrieval module is configured to respond to a video playback request for instructing the playback of a target video and obtain video features of the target video, wherein the video features include features extracted from the target video before receiving the video playback request and / or features determined based on historical video feature analysis results of the target video; an encoding configuration module is configured to determine encoding information of the target video based on the video features, wherein the encoding information includes a bit rate allocation method used when encoding the target video; and a video encoding module is configured to identify the bit rate allocated to each video frame in the target video in the bit rate allocation method and encode the target video according to the bit rate allocated to each video frame.
16. An electronic device, comprising: a memory storing an executable program; A processor, configured to run the program, wherein the program executes the method according to any one of claims 1 to 12 when running.
17. A computer-readable storage medium, comprising a stored executable program, wherein when the executable program is executed, the device where the storage medium is located is controlled to execute the method according to any one of claims 1 to 12.
18. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method according to any one of claims 1 to 12. 27
Citation Information
Patent Citations
Video processing method and device
CN109286825A
Video code rate determination method and device, computer device and storage medium
CN111193924A
Video transcoding method and device, equipment and storage medium
CN117156147A