Video decoding method, device, computer equipment and medium
By adjusting the device temperature in real time and selecting the appropriate encoding bitstream, combined with hardware and software decoding methods, the problem of device overheating during video decoding is solved, achieving an efficient, smooth and high-quality video playback experience.
Patent Information
- Application Number
- CN202311036394.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-16
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2043-08-16
AI Technical Summary
During the video decoding process, device heating seriously affects the user's viewing experience, especially when using multi-threaded accelerated decoding. Existing encoding standards such as AV1 and H.265 require large amounts of computation, making it difficult to balance video quality and playback smoothness.
By obtaining the device temperature and temperature threshold, different encoding streams are dynamically selected for decoding. By combining hardware and software decoding methods, the device temperature and bandwidth consumption are optimized, and the encoding stream switching is achieved in real time.
While ensuring video quality and playback smoothness, it effectively prevents device overheating, improves user viewing experience, and takes into account both device heating and bandwidth optimization.
Smart Images

Figure CN117440159B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of video processing technology, and in particular to a video decoding method, apparatus, computer equipment, and medium. Background Art
[0002] In video playback scenarios, the video decoding process involves a large amount of calculations, and the CPU will continue to run at high load, generating a lot of heat. If multi-threaded accelerated decoding is used, the heat generated by the playback device will be even more serious, greatly affecting the user's viewing experience. However, in order to ensure the clarity of video quality and the smoothness of video playback, these calculation processes and multi-threading technology are difficult to avoid. Currently, in video encoding and decoding, commonly used encoding standards such as the AV1 encoding standard and the H.265 encoding standard have good encoding and decoding effects. However, due to the complex algorithms under these encoding standards, the amount of calculation on the video decoding end is usually relatively large, which causes the playback device to generate relatively high heat when playing the video. Summary of the Invention
[0003] Embodiments of the present application provide a video decoding method, apparatus, computer device, and medium, which can adjust the device temperature in real time during the decoding process to prevent the device from overheating during video playback.
[0004] A first aspect of an embodiment of the present application discloses a video decoding method, the method comprising:
[0005] Acquire multiple encoding streams for the target video; different encoding streams are obtained by encoding the target video in different encoding modes;
[0006] Obtaining a device temperature of a target device on which the target video is decoded, and obtaining a temperature threshold for encoding bitstream selection;
[0007] comparing the device temperature with the temperature threshold, and determining a target encoding stream from the plurality of encoding streams based on the comparison result;
[0008] The target coded code stream is decoded to obtain decoded data of the target video.
[0009] A second aspect of an embodiment of the present application discloses a video decoding device, comprising:
[0010] An acquisition unit is used to acquire multiple encoding streams for a target video; different encoding streams are obtained by encoding the target video in different encoding modes;
[0011] The acquisition unit is further configured to acquire a device temperature of a target device on which the target video is decoded, and to acquire a temperature threshold for encoding bitstream selection;
[0012] a determining unit, configured to compare the device temperature with the temperature threshold, and determine a target encoding stream from the multiple encoding streams based on the comparison result;
[0013] The decoding unit is used to decode the target coded code stream to obtain decoded data of the target video.
[0014] A third aspect of an embodiment of the present application discloses a computer device, comprising a processor and a memory, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the method of the first aspect above.
[0015] A fourth aspect of an embodiment of the present application discloses a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the method of the first aspect.
[0016] The fifth aspect of the embodiments of the present application discloses a computer program product or a computer program, wherein the computer program product or the computer program includes program instructions, and when the program instructions are executed by a processor, the method of the first aspect is implemented.
[0017] In an embodiment of the present application, multiple encoding streams for a target video can be obtained; different encoding streams are obtained by encoding the target video using different encoding methods; the device temperature of the target device where the target video is decoded can also be obtained, and a temperature threshold for encoding stream selection can be obtained; then, the device temperature can be compared with the temperature threshold, and a target encoding stream can be determined from the multiple encoding streams based on the comparison result; further, the target encoding stream can be decoded to obtain decoded data of the target video. In this way, the device temperature can be adjusted in real time during the decoding process to prevent the device from overheating during video playback. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0019] Figure 1 This is a schematic diagram of the architecture of a video decoding system provided by an embodiment of the present application;
[0020] Figure 2This is a flow chart of a video decoding method provided by an embodiment of the present application;
[0021] Figure 3 This is a flowchart of another video decoding method provided by an embodiment of the present application;
[0022] Figure 4 This is a schematic diagram of a structure in which a coded bitstream is decoded using a coded picture group, provided in an embodiment of the present application;
[0023] Figure 5 This is a schematic diagram of a structure for switching code streams during decoding provided by an embodiment of the present application;
[0024] Figure 6 This is a flowchart of another video decoding method provided by an embodiment of the present application;
[0025] Figure 7 1 is a schematic structural diagram of a video decoding device provided in an embodiment of the present application;
[0026] Figure 8 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application.
[0028] The present application provides a video decoding solution, the principles of which are as follows: multiple encoding streams for a target video can be obtained; different encoding streams are obtained by encoding the target video using different encoding methods; then, the target video can be decoded based on these multiple encoding streams to obtain decoded data of the target video. In one embodiment, the device temperature of the target device on which the target video is decoded can be obtained, and a temperature threshold for encoding stream selection can be obtained; then, a target encoding stream can be determined from the multiple encoding streams based on the device temperature and the temperature threshold. For example, the device temperature can be compared with the temperature threshold, and the target encoding stream can be determined from the multiple encoding streams based on the comparison result; finally, the target encoding stream can be decoded to obtain decoded data of the target video.
[0029] Through the above decoding method, the encoding code stream used by the video player can be dynamically switched during video playback. On the premise of ensuring the video quality and smoothness of the video playback on the playback end, it can prevent the target device from heating up too high (or being understood as excessive heat generation, excessive heat generation, etc.) during video playback, thereby improving the user's video viewing experience.
[0030] In a specific implementation, the execution subject of the above-mentioned video decoding solution may be a computer device, which may be a terminal. Or the computer device may specifically be a client with video decoding function or video playback function deployed on the terminal. It is understandable that video decoding can be implemented using a decoder, so the above-mentioned video decoding solution may also be executed by the computer device calling the decoder. It should be noted that the target device and the computer device mentioned in the embodiment of the present application may refer to the same device. Usually, after the target device decodes the target video, it can play the target video, so the target device may also be called a playback device. The terminal mentioned here may be a smart phone, tablet computer, laptop computer, desktop computer and other devices; the client may be a multimedia playback client, a browser client, an information stream client, and the like.
[0031] For example, when the computer device is a client, the embodiment of the present application provides a video decoding system, such as Figure 1 As shown, the video decoding system may include at least one client and at least one server. The server may first decode the target video using multiple encoding methods to obtain multiple encoded streams of the target video. When the client has a need to play the target video, it may send a stream pull request for the target video to the server to request that the multiple encoded streams of the target video be pulled from the server. Upon receiving the stream pull request, the server may respond to the stream pull request and send the multiple encoded streams of the target video to the client. After the client receives the multiple encoded streams of the target video, it may use a video decoding solution and decode the target video based on the multiple encoded streams to restore the target video, and then play the target video.
[0032] Among them, the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as big data and artificial intelligence platforms, etc.
[0033] It should be noted that the data related to user information in the embodiments of the present application are all data authorized by the user.
[0034] Based on the video decoding solution provided above, the embodiment of the present application provides a video decoding method, which can be executed by the computer device mentioned above. Figure 2 The video decoding method includes but is not limited to the following steps:
[0035] S201: Acquire multiple encoding streams for a target video.
[0036] The target video may be any type of video, such as film and television, education, sports, etc. The target video may also be any length of video, such as 20 seconds or 8 minutes.
[0037] Among them, different encoding streams are obtained by encoding the target video under different encoding methods. That is, in the embodiment of the present application, the support of the video encoding end is required. At the encoding end, it is necessary to encode the target video under multiple encoding methods respectively to obtain the encoding streams corresponding to the multiple encoding methods, so as to facilitate switching between multiple encoding streams at any time during the decoding process. For example, the encoding method may include the encoding method of the AV1 encoding standard (or simply referred to as the AV1 encoding method), the encoding method of the HEVC (High Efficiency Video Coding, high-efficiency video coding) encoding standard (or simply referred to as the HEVC encoding method), the encoding method of the H.264 encoding standard (or simply referred to as the H.264 encoding method), the encoding method of the VP9 encoding standard (or simply referred to as the VP9 encoding method), etc. Among them, the HEVC encoding standard can also be referred to as the H.265 encoding standard, that is, the HEVC encoding method can also be referred to as the H.265 encoding method. In the embodiment of the present application, the video decoding method is described by taking the encoding methods including the AV1 encoding method and the H.265 encoding method as an example. The multiple encoding streams here may include the stream under the AV1 encoding method (or simply referred to as the AV1 stream) and the stream under the H.265 encoding method (or simply referred to as the H.265 stream).
[0038] The following first introduces the H.265 encoding method and the AV1 encoding method.
[0039] In video encoding and decoding, H.265 encoding consumes less battery than AV1 encoding. Lower battery consumption means slower temperature rise on the target device. That is, when the device temperature is high, H.265 bitstream decoding can be prioritized to reduce battery consumption and thus mitigate device temperature increases. The target device refers to the device that decodes the target video, or the device used to play the target video.
[0040] In addition, compared to the H.265 (HEVC) encoding method, the AV1 encoding method can not only maintain the resolution, frame rate, and bit rate of the original video, but also reduce the video volume by about 20%, that is, under the same bandwidth, the AV1 encoding method can transmit higher-definition image quality. In other words, the compression rate of the AV1 encoding method is greater than that of the H.265 encoding method. Then, videos encoded in the AV1 encoding method can greatly reduce the network bandwidth required for the video, and can save a lot of bandwidth for video transmission in the network environment. In other words, while ensuring the same video quality and smooth video playback, the AV1 encoding method can save more transmission bandwidth than the H.265 encoding method. Therefore, when the device temperature is low, you can give priority to using the AV1 code stream for decoding to save transmission bandwidth.
[0041] It's important to understand that for the same video, the encoding and decoding methods are corresponding. For example, suppose a video is encoded using the AV1 encoding method, resulting in an AV1 bitstream; when decoding, the AV1 bitstream is decoded using the AV1 decoding method. Another example is that a video is encoded using the H.265 encoding method, resulting in an H.265 bitstream; when decoding, the H.265 bitstream is decoded using the H.265 decoding method. The advantages of the encoding methods described above in various aspects can also be considered advantages under the corresponding decoding methods.
[0042] It is understandable that for the encoding and decoding of a video, the video must first be encoded to obtain the corresponding encoded bitstream; then the encoded bitstream must be decoded to restore the original video. To obtain multiple encoded bitstreams for the target video, the target video must be encoded using multiple different encoding methods. As described above, the target video is encoded using the AV1 encoding method and the H.265 encoding method to obtain the AV1 bitstream and the H.265 bitstream.
[0043] In one implementation, step S201 may be specifically implemented as follows: first, multiple video files for the target video are obtained; different video files are encoded streams obtained by encoding the target video using different encoding methods, and the encoded streams are encapsulated; that is, one encoded stream corresponds to one video file. For example, the multiple video files here may include video files corresponding to AV1 streams and video files corresponding to H.265 streams. After obtaining the multiple video files, the multiple video files may be decapsulated separately to obtain multiple encoded streams of the target video. For example, after decapsulating the video file corresponding to the AV1 stream, the AV1 stream may be obtained, and after decapsulating the video file corresponding to the H.265 stream, the H.265 stream may be obtained.
[0044] Among them, the encapsulation process can refer to putting the already encoded and compressed video stream, audio stream, etc. for a video into a file (such as the video file mentioned here), so that the target device can use the video file to play the video; when encapsulating, it has a corresponding encapsulation format, and the corresponding encapsulation format can be mp4 format, flv (flash video, streaming media) format, etc. Usually, the suffix of the video file can represent the corresponding encapsulation format, such as the suffix of the video file can be mp4, flv, etc. Among them, the decapsulation process is the reverse process of the encapsulation process, that is, disassembling a video file into a video stream and an audio stream; and the encoded stream of the target video here can be understood as the video stream obtained after decapsulating the video file.
[0045] S202: Obtain the device temperature of the target device on which the target video is decoded, and obtain a temperature threshold for selecting an encoding stream.
[0046] It should be understood that, for video playback, a large amount of calculations will occur during the decoding process of the video, and the central processing unit (CPU) of the target device will continue to run at a high load, generating a large amount of heat, causing the device temperature of the target device to continue to rise. In addition, if multi-threading technology is used to accelerate decoding during the decoding process, the heating of the target device will be more serious, thereby affecting the user's viewing experience. However, in order to ensure the clarity of the video quality and the smoothness of video playback, these calculation processes and multi-threading technologies in video decoding are usually unavoidable. In order to avoid the target device from heating up too high during video playback, it is possible to consider a compromise between the smoothness of video playback, the clarity of video playback, and the heat generated by the target device to ensure the best user experience.
[0047] Different encoding standards offer different codec performance. As mentioned previously, H.265 consumes less battery than AV1. While maintaining the same video quality and playback smoothness, AV1 can save more bandwidth than H.265. To prevent the target device from overheating, different encoding streams can be switched based on the device's real-time temperature, ensuring video playback quality and smoothness while preventing overheating.
[0048] Based on this, it can be seen that during video playback, the device temperature of the target device where the target video is decoded can be obtained in real time to determine whether the corresponding decoding method needs to be adjusted based on the device temperature to avoid excessive temperature rise of the target device.
[0049] In one implementation, the temperature of the battery in the target device used to play the target video can be used as the device temperature; or, the temperature of the central processing unit (CPU) in the target device used to play the target video can be used as the device temperature; or, the device temperature can be determined based on the temperature of the battery and the temperature of the central processing unit (CPU) in the target device, for example, the average of the temperature of the battery and the temperature of the central processing unit in the target device used to play the target video can be used as the device temperature.
[0050] In one implementation, a temperature threshold for encoding stream selection can be set to adjust the heat generation of the target device based on the temperature threshold, so as to avoid excessive heat generation of the target device while ensuring the video playback quality and smoothness of the video playback, thereby improving the user experience. The temperature threshold can be an empirical value, and different thresholds can be set according to different target devices and user experience requirements. In one embodiment, the specific implementation of obtaining the temperature threshold for encoding stream selection can be: obtaining the video playback parameters for playing the target video, so as to determine the temperature threshold for encoding stream selection based on the video playback parameters. The video playback parameters can include: one or more of the heat dissipation level of the target device and the temperature sensitivity level of the object identifier to the device temperature; the object identifier can be used to indicate the object (user) using the target device.
[0051] The heat dissipation level can be obtained from the target device's own attribute information or other methods, and there is no limitation on this. The object identifier's temperature sensitivity level to the device temperature can be obtained based on information input by the object in a related operation interface; for example, when the object uses the target device, the target device can output an operation interface that facilitates the object to input information, so that relevant information about the object (such as the object's temperature sensitivity level to the device temperature, etc.) can be obtained on the operation interface, so as to better meet the object's usage needs and improve the user experience.
[0052] When the video playback parameters are different, the temperature threshold for selecting the encoding stream also varies. The following describes the specific implementation of determining the temperature threshold under various video playback parameters:
[0053] (1) When the video playback parameters include heat dissipation level.
[0054] The heat dissipation level characterizes the heat dissipation performance of the target device. Heat dissipation performance refers to the ability of the target device's internal heat to diffuse to the outside world. It is an indicator used to characterize the quality of heat dissipation. Generally, when a device has poor heat dissipation performance, it may affect the device's operating speed, leading to poor device operation, freezing, etc., or it may also cause device failures, hardware burnout, etc. Here, the higher the heat dissipation level of the target device, the better the heat dissipation performance of the target device, which can mitigate the increase in the target device's temperature, that is, the target device's temperature rises more slowly; conversely, the lower the heat dissipation level of the target device, the worse the heat dissipation performance of the target device, which can cause the target device's temperature to rise more quickly. Therefore, if the target device's temperature is low, it is not necessary to consider lowering the device's temperature for the time being, and instead, decode using a codec stream with better encoding and decoding effects whenever possible.
[0055] Based on this, it can be seen that the temperature threshold for encoding bitstream selection can be determined according to the setting rule that the temperature threshold is positively correlated with the heat dissipation level; that is, the higher the heat dissipation level, the higher the corresponding temperature threshold can be set, and the lower the heat dissipation level, the lower the corresponding temperature threshold can be set.
[0056] (2) When the video playback parameters include a temperature sensitivity level.
[0057] The temperature sensitivity level represents the object's sensitivity to device temperature. The higher the object's sensitivity to device temperature, the higher the temperature sensitivity level. Conversely, the lower the object's sensitivity to device temperature, the lower the temperature sensitivity level. The object's sensitivity to device temperature can represent the object's video viewing experience. It can be understood that when the object's sensitivity to device temperature is high, the object is more sensitive to changes in device temperature. For example, when the device temperature is high, the object's video viewing experience is poor. In this case, consideration can be given to mitigating the increase in the target device's temperature to prevent continued temperature increases that could affect the user's video viewing experience.
[0058] Based on this, it can be seen that the temperature threshold for encoding bitstream selection can be determined according to the setting rule that the temperature threshold is negatively correlated with the temperature sensitivity level; that is, the lower the temperature sensitivity level, the higher the corresponding temperature threshold can be set, and the higher the temperature sensitivity level, the lower the corresponding temperature threshold can be set.
[0059] S203 : Compare the device temperature with a temperature threshold, and determine a target encoding stream from a plurality of encoding streams based on the comparison result.
[0060] The multiple encoded code streams may include a first encoded code stream encoded using a first encoding method and a second encoded code stream encoded using a second encoding method; the power consumption of the decoding method corresponding to the first encoding method may be lower than the power consumption of the decoding method corresponding to the second encoding method. Power consumption can represent the consumption of the battery of the target device, and the lower the battery consumption, the slower the temperature of the target device rises, and the higher the battery consumption, the faster the temperature of the target device rises. In another embodiment, the bandwidth consumption of the decoding method corresponding to the second encoding method is lower than the bandwidth consumption of the decoding method corresponding to the first encoding method.
[0061] For example, the first encoding mode may be an H.265 encoding mode, and the second encoding mode may be an AV1 encoding mode. Then, the first encoding stream is an H.265 stream, and the second encoding stream is an AV1 stream.
[0062] In one implementation, determining a target code stream from multiple code streams based on the comparison result may be as follows: if the comparison result indicates that the device temperature is greater than or equal to a temperature threshold, indicating that the current target device temperature is too high, it is necessary to reduce battery consumption to alleviate the increase in device temperature. In this case, a decoding method with lower power consumption can be selected for decoding. Based on this, it can be seen that the first code stream from the multiple code streams can be selected as the target code stream. For example, if the multiple code streams include an H.265 code stream and an AV1 code stream, the target code stream can be the H.265 code stream, so that the H.265 code stream can be subsequently decoded using the H.265 decoding method.
[0063] If the comparison result is that the device temperature is less than the temperature threshold, it indicates that the temperature of the current target device is low, then you do not need to consider alleviating the increase in device temperature at this time. In this case, you can choose to decode in a decoding method with better decoding effect. Based on this, you can select a second encoding stream from multiple encoding streams as the target encoding stream. For example, in the case where multiple encoding streams include H.265 streams and AV1 streams, the target encoding stream can be an AV1 stream, so that the AV1 decoding method can be used to decode the AV1 stream later. Among them, AV1 decoding can effectively save bandwidth consumption for video playback compared to H.265 decoding. It can be seen that during the video playback process of the target device, the optimization of bandwidth and device heating can be effectively taken into account through the selection of encoding streams.
[0064] S204: Decode the target coded stream to obtain decoded data of the target video.
[0065] It should be understood that video decoding technology also includes soft decoding and hard decoding methods. Soft decoding relies on the CPU to decode the video bitstream (i.e., the encoded bitstream). It has good compatibility and can be used on various target devices. However, its disadvantages are that it has many computational steps, is slow, and generates high heat. Hard decoding relies on a dedicated chip in the target device (or so-called decoding hardware device, such as a graphics card) to decode the video. Because the dedicated chip is optimized for a specific encoding algorithm, hard decoding is faster and generates less heat, but its compatibility is poor and requires the support of a dedicated chip. It can be seen that compared with hard decoding, soft decoding causes the target device to generate more heat than hard decoding, but the decoding speed of soft decoding is faster than that of hard decoding. Therefore, when performing decoding operations, if the device temperature is high (such as the device temperature is above the temperature threshold), hard decoding can be given priority to alleviate the increase in device temperature. However, the prerequisite for using hard decoding is that the target device is equipped with corresponding decoding hardware.
[0066] Based on this, it can be seen that in order to minimize the heat generated by the target device, it is possible to further determine whether the target device has a decoding hardware device (such as a graphics card) that corresponds to the encoding method of the target code stream, so as to determine whether to use hardware decoding or software decoding to decode the target code stream. Specifically, if the target device has a decoding hardware device, the target code stream can be decoded using the decoding hardware device as the decoding method to obtain the decoded data of the target video; if the target device does not have a decoding hardware device, software decoding can be used as the decoding method to decode the target code stream to obtain the decoded data of the target video.
[0067] For example, assume that the first encoding stream is an H.265 stream and the second encoding stream is an AV1 stream; the target device has a graphics card for H.265 decoding, but does not have a graphics card for AV1 decoding, that is, the target device supports H.265 hard decoding but does not support AV1 hard decoding. In this case, if the device temperature is higher than the temperature threshold, the H.265 stream can be selected as the target encoding stream, and the graphics card can be called for hard decoding to reduce battery consumption and thus alleviate the increase in device temperature. If the device temperature is not higher than the temperature threshold, the AV1 stream can be selected as the target encoding stream, and decoded using a soft decoding method to save bandwidth consumption for video playback. It can be seen that through the video decoding method of the embodiment of the present application, during the decoding process, it is possible to switch between the AV1 stream and the H.265 stream at any time based on the device temperature, and to select a suitable decoding method in the strategy selection of soft decoding and hard decoding, thereby ensuring the global optimization of encoding efficiency and user experience.
[0068] It should be noted that the target video obtained by the decoding process here may be consistent with or different from the target video before the encoding process. In one embodiment, in the scenario of lossless compression, since lossless compression can achieve the purpose of complete restoration, the target video obtained by the decoding process is consistent with the target video before the encoding process. In the scenario of lossy compression, since some information is lost during the compression process, the original data cannot be completely restored during the decoding process, that is, the target video obtained by the decoding process cannot be completely restored to the target video before the encoding process; then, there will usually be some differences between the target video obtained by the decoding process and the target video before the encoding process. These differences may be differences in video clarity or video color, such as the video clarity of the target video obtained by the decoding process is worse than the video clarity of the target video before the encoding process.
[0069] In an embodiment of the present application, during the video playback process, the encoding code stream used by the video player can be dynamically switched. On the premise of ensuring the video quality and smoothness of the video playback on the playback end, the target device can be prevented from heating up too high during video playback, thereby improving the user's video viewing experience.
[0070] See also Figure 3 , Figure 3 This is a flow chart of another video decoding method provided by an embodiment of the present application. The video decoding method described in this embodiment can be applied to the above-mentioned computer device, such as Figure 3 As shown, the method may include:
[0071] S301: Acquire multiple encoding streams for a target video.
[0072] Among them, different encoding streams are obtained by encoding the target video in different encoding modes.
[0073] It should be understood that in video encoding (compression), a video frame sequence is typically divided into several GOPs (Group of Pictures), and each video frame in each GOP is encoded in units of GOPs, thereby achieving video encoding. A GOP is a set of pictures in a video frame sequence, and a GOP is a group of continuous video frames.
[0074] Based on this, it can be seen that any of the multiple coded streams can be obtained by encoding the target video using a coded picture group (i.e., GOP) as a unit and using a corresponding encoding method, that is, each coded stream can be divided into coded streams corresponding to multiple coded picture groups. For example, see Figure 4As shown, the target video can be divided into multiple coded picture groups (GOP1, GOP2, GOP3, GOP4...). In any encoding method, the target video can be encoded according to the coded picture group and using the encoding method, so as to obtain the encoding stream corresponding to GOP1, the encoding stream corresponding to GOP2, and so on under the encoding method.
[0075] Among them, when encoding the target video using multiple encoding methods, the division of the encoding image groups of the target video under each encoding method can be consistent, that is, for the target video, encoding under multiple encoding methods is performed according to the same GOP (GOP, i.e., Group of picture) structure to ensure that when switching between multiple encoding streams subsequently, the corresponding encoding image group is the same.
[0076] S302 , traversing the coded picture groups of the target video, and if the target coded picture group is currently traversed, obtaining the device temperature of the target device where the target coded picture group is decoded.
[0077] The target coded picture group may be any coded picture group among the coded picture groups included in the target video.
[0078] It can be understood that when encoding the target video, decoding is performed in units of coded picture groups; when decoding, decoding can also be performed in units of coded picture groups, that is, the decoding process is performed in units of coded picture groups. In order to achieve a more refined temperature control strategy, the switching of the encoding stream here is also performed in units of coded picture groups.
[0079] Based on this, we can select the appropriate encoding stream for decoding based on the device temperature before decoding each coded picture group. Then, we can traverse the coded picture groups in the target video. When we find a coded picture group that we want to decode, we can first obtain the device temperature of the target device where the coded picture group is being decoded.
[0080] S303 , obtaining a temperature threshold for encoding stream selection, comparing the device temperature with the temperature threshold, and determining a target encoding stream from a plurality of encoding streams based on the comparison result.
[0081] S304 , determining the coded stream corresponding to the target coded picture group from the target coded stream, decoding the coded stream corresponding to the target coded picture group, and obtaining decoded data for the target coded picture group in the target video.
[0082] For example, Figure 5For example, if the first coded picture group (such as GOP1) is currently being decoded, the device temperature of the target device can be obtained and compared with the temperature threshold. If the comparison result shows that the device temperature is higher than the temperature threshold, the coded stream corresponding to the GOP1 position in the first coded stream can be selected for decoding; when the second coded picture group (such as GOP2) needs to be decoded, the device temperature of the target device can be obtained again and compared with the temperature threshold. If the comparison result shows that the device temperature is not higher than the temperature threshold, the coded stream corresponding to the GOP2 position in the second coded stream can be selected for decoding; when the third coded picture group (such as GOP3) needs to be decoded, the device temperature of the target device can also be obtained again. The device temperature is compared with the temperature threshold. If the comparison result shows that the device temperature is not higher than the temperature threshold, the encoded code stream corresponding to the GOP3 position in the second encoded code stream can be selected for decoding; when the fourth encoded picture group (such as GOP4) needs to be decoded, the device temperature of the target device can be obtained again, and this device temperature is compared with the temperature threshold. If the comparison result shows that the device temperature is higher than the temperature threshold, the encoded code stream corresponding to the GOP4 position in the first encoded code stream can be selected for decoding; and so on. Based on the real-time device temperature, switching between the first and second encoded code streams can be carried out at any time, thereby ensuring the video playback quality and smoothness while avoiding excessive heating of the target device, thereby effectively improving the user's video viewing experience.
[0083] in, Figure 5 The coded picture group marked by the dotted box is the coded bitstream selected during decoding.
[0084] For example, Figure 5 For example, it is assumed that the target device is deployed with a decoding hardware device for the decoding method corresponding to the first encoder, but does not have a decoding method corresponding to the second encoder, that is, the target device supports the hard decoding of the decoding method corresponding to the first encoder, but does not support the hard decoding of the decoding method corresponding to the second encoder.
[0085] If GOP1 is currently being decoded, the device temperature of the current target device can be obtained and compared with a temperature threshold. If the device temperature is higher than the temperature threshold, the coded bitstream corresponding to the GOP1 position in the first coded bitstream can be selected for hard decoding. When GOP2 needs to be decoded, the device temperature of the target device can be obtained again. If the device temperature is not higher than the temperature threshold, the coded bitstream corresponding to the GOP2 position in the second coded bitstream can be selected for soft decoding. When GOP3 needs to be decoded, the device temperature of the target device can be obtained again. If the device temperature is not higher than the temperature threshold, the coded bitstream corresponding to the GOP3 position in the second coded bitstream can be selected for decoding. When GOP4 needs to be soft decoded, the device temperature of the target device can be obtained again. If the device temperature is higher than the temperature threshold, the coded bitstream corresponding to the GOP4 position in the first coded bitstream can be selected for hard decoding. By analogy, you can switch between the first and second encoded streams at any time based on the real-time device temperature. When choosing between soft decoding and hard decoding strategies, you can also choose the appropriate decoding method based on the device temperature. While ensuring the video playback quality and smoothness, it also avoids excessive heat generation on the target device. It can also ensure the global optimization of decoding efficiency and user experience, thereby effectively improving the user's video viewing experience.
[0086] It can be understood that the target encoding code stream required to decode each coded image group in the target video can be determined based on the above method, and the target encoding code stream of each coded image group can be decoded to obtain the decoding data of each coded image group in the target video, and these decoded data can constitute the target video, so that the target setting can play the target video.
[0087] Among them, other specific implementations of steps S301-S304 can refer to the relevant descriptions in the above steps S201-S204, which will not be repeated here.
[0088] To better understand the video decoding method proposed in the embodiment of the present application, the following Figure 6 Further explanation. It is assumed that the first encoded code stream is H.265 code stream, and the second encoded code stream is AV1 code stream; the decoding process is performed in units of GOP, that is, the code stream switching is in units of GOP; the target device has a graphics card for H.265 decoding, but does not have a graphics card for AV1 decoding, that is, the target device supports H.265 hard decoding, but does not support AV1 hard decoding. For example, see Figure 6 As shown, the implementation process of the video decoding method can be as follows:
[0089] 1. Open the video file for the AV1 stream and decapsulate it to obtain the AV1 stream.
[0090] 2. Open the video file for the H.265 stream and decapsulate it to obtain the H.265 stream.
[0091] Among them, it is important to understand that, at the encoding end, AV1 encoding and H.265 encoding should be performed separately for the target video according to the same GOP structure to obtain AV1 bitstream and H.265 bitstream, which makes it easier to switch between the two bitstreams at any time during the decoding process.
[0092] 3. Start decoding operation.
[0093] 4. Get the current device temperature.
[0094] Here, the device temperature of the target device is obtained before decoding the first coded image group; that is, before decoding a GOP each time, a suitable bitstream can be selected for decoding according to the device temperature.
[0095] 5. Compare the device temperature to the temperature threshold.
[0096] A temperature threshold needs to be preset, which can be an empirical value. Different thresholds can be set based on different devices and user experience requirements. For example, the setting of the temperature threshold can refer to the above description.
[0097] 6.1. If the device temperature is higher than the temperature threshold, select the target encoding stream as H.265 stream.
[0098] Among them, if the device temperature is high, you can select H.265 code stream as the current code stream, and you can select the GOP corresponding to the H.265 code stream for decoding. During decoding, you can call the graphics card for hardware decoding to reduce battery consumption and alleviate the increase in device temperature.
[0099] If the device temperature is not higher than the temperature threshold, select the target encoding stream as AV1 stream.
[0100] Among them, if the device temperature is low, the AV1 stream can be selected as the current stream, and the GOP at the corresponding position of the AV1 stream can be selected for decoding to save bandwidth consumption for video playback.
[0101] 7. Decode the corresponding coded picture group from the target coded bitstream.
[0102] 8. Check whether there are any remaining video frames that have not been decoded; if not, return to step 4; if completed, end.
[0103] From the above description, we can see that during the decoding process, you can switch between AV1 bitstream and H.265 bitstream at any time. When choosing between soft decoding and hard decoding strategies, you can also select the appropriate decoding method based on the device temperature. This allows you to optimize both bandwidth and device heating during video playback on the target device, ensuring smooth video playback while avoiding excessive heating of the target device, and ensuring the global optimization of decoding efficiency and user experience.
[0104] In an embodiment of the present application, a refined temperature control strategy is proposed during video playback. Specifically, the encoding stream used by the video player can be dynamically switched based on the encoded image group. While ensuring the video quality and smoothness of the video playback at the playback end, the target device can be prevented from overheating during video playback, thereby improving the user's video viewing experience.
[0105] See also Figure 7 , Figure 7 : is a schematic diagram of the structure of a video decoding device provided in an embodiment of the present application. The video decoding device described in this embodiment includes:
[0106] The acquisition unit 701 is used to acquire multiple encoding streams for the target video; different encoding streams are obtained by encoding the target video in different encoding modes;
[0107] The acquisition unit 701 is further configured to acquire the device temperature of the target device on which the target video is decoded, and to acquire a temperature threshold for encoding bitstream selection;
[0108] a determining unit 702, configured to compare the device temperature with the temperature threshold, and determine a target encoding stream from the multiple encoding streams based on the comparison result;
[0109] The decoding unit 703 is configured to decode the target coded stream to obtain decoded data of the target video.
[0110] In one implementation, any one of the plurality of coded streams is obtained by encoding the target video using a coded picture group as a unit and adopting a corresponding encoding method; the acquisition unit 701 is specifically configured to:
[0111] Traversing the coded picture groups of the target video, and if the target coded picture group is currently traversed, obtaining the device temperature of the target device where the target coded picture group is decoded;
[0112] The decoding unit 703 is specifically configured to:
[0113] The coding stream corresponding to the target coded picture group is determined from the target coding stream, and the coding stream corresponding to the target coded picture group is decoded to obtain decoded data for the target coded picture group in the target video.
[0114] In one implementation, the multiple encoded code streams include a first encoded code stream encoded using a first encoding method and a second encoded code stream encoded using a second encoding method; power consumption of a decoding method corresponding to the first encoding method is lower than power consumption of a decoding method corresponding to the second encoding method; the power consumption represents consumption of a battery of the target device; the determining unit 702 is specifically configured to:
[0115] If the comparison result shows that the device temperature is greater than or equal to the temperature threshold, selecting a first encoding stream from the multiple encoding streams as a target encoding stream;
[0116] If the comparison result shows that the device temperature is less than the temperature threshold, a second encoding stream is selected from the multiple encoding streams as the target encoding stream.
[0117] In one implementation, the decoding unit 703 is specifically configured to:
[0118] Determining whether the target device has a decoding hardware device corresponding to the encoding mode of the target encoding stream;
[0119] If the decoding hardware device exists, decoding the target coded stream using the decoding hardware device as a decoding method to obtain decoded data of the target video;
[0120] If the decoding hardware device does not exist, software decoding is used as a decoding method to decode the target coded stream to obtain decoded data of the target video.
[0121] In one implementation, the acquiring unit 701 is specifically configured to:
[0122] Obtaining video playback parameters for playing the target video; the video playback parameters include: one or more of a heat dissipation level of the target device and a temperature sensitivity level of the object identifier to the device temperature; the object identifier is used to indicate an object using the target device;
[0123] A temperature threshold for encoding bitstream selection is determined based on the video playback parameter.
[0124] In one implementation, the acquiring unit 701 is specifically configured to:
[0125] If the video playback parameter includes a heat dissipation level, determining a temperature threshold for encoding bitstream selection according to a setting rule that the temperature threshold is positively correlated with the heat dissipation level;
[0126] If the video playback parameter includes a temperature sensitivity level, the temperature threshold for encoding bitstream selection is determined according to a setting rule that the temperature threshold is negatively correlated with the temperature sensitivity level.
[0127] In one implementation, the acquiring unit 701 is specifically configured to:
[0128] using the temperature of a battery in a target device used to play the target video as the device temperature;
[0129] Alternatively, the temperature of a central processing unit in a target device used to play the target video is used as the device temperature;
[0130] Alternatively, the average of the temperature of the battery and the temperature of the central processing unit in the target device used to play the target video is used as the device temperature.
[0131] In one implementation, the acquiring unit 701 is specifically configured to:
[0132] Acquire multiple video files for the target video; different video files are encoded code streams obtained by encoding the target video using different encoding methods, and the encoded code streams are encapsulated into files;
[0133] The multiple video files are decapsulated respectively to obtain multiple encoded streams of the target video.
[0134] It is understood that the division of units in the embodiments of the present application is schematic and is merely a logical functional division. In actual implementation, other division methods may be used. The functional units in the embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0135] See also Figure 8 , Figure 8 8 is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device includes: a processor 801 and a memory 802. Optionally, the computer device may also include a network interface 803. The processor 801, memory 802, and network interface 803 can exchange data.
[0136] The processor 801 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor may be a microprocessor or any conventional processor.
[0137] The memory 802 may include a read-only memory and a random access memory, and provide program instructions and data to the processor 801. A portion of the memory 802 may also include a non-volatile random access memory. When the processor 801 calls the program instructions, it is used to execute:
[0138] Acquire multiple encoding streams for the target video; different encoding streams are obtained by encoding the target video in different encoding modes;
[0139] Obtaining a device temperature of a target device on which the target video is decoded, and obtaining a temperature threshold for encoding bitstream selection;
[0140] comparing the device temperature with the temperature threshold, and determining a target encoding stream from the plurality of encoding streams based on the comparison result;
[0141] The target coded code stream is decoded to obtain decoded data of the target video.
[0142] In one implementation, any one of the plurality of coded streams is obtained by encoding a target video using a coded picture group as a unit and adopting a corresponding encoding method; the processor 801 is specifically configured to:
[0143] Traversing the coded picture groups of the target video, and if the target coded picture group is currently traversed, obtaining the device temperature of the target device where the target coded picture group is decoded;
[0144] The coding stream corresponding to the target coded picture group is determined from the target coding stream, and the coding stream corresponding to the target coded picture group is decoded to obtain decoded data for the target coded picture group in the target video.
[0145] In one implementation, the multiple encoded code streams include a first encoded code stream encoded using a first encoding method, and a second encoded code stream encoded using a second encoding method; power consumption of a decoding method corresponding to the first encoding method is lower than power consumption of a decoding method corresponding to the second encoding method; the power consumption represents consumption of a battery of the target device; the processor 801 is specifically configured to:
[0146] If the comparison result shows that the device temperature is greater than or equal to the temperature threshold, selecting a first encoding stream from the multiple encoding streams as a target encoding stream;
[0147] If the comparison result shows that the device temperature is less than the temperature threshold, a second encoding stream is selected from the multiple encoding streams as the target encoding stream.
[0148] In one implementation, the processor 801 is specifically configured to:
[0149] Determining whether the target device has a decoding hardware device corresponding to the encoding mode of the target encoding stream;
[0150] If the decoding hardware device exists, decoding the target coded stream using the decoding hardware device as a decoding method to obtain decoded data of the target video;
[0151] If the decoding hardware device does not exist, software decoding is used as a decoding method to decode the target coded stream to obtain decoded data of the target video.
[0152] In one implementation, the processor 801 is specifically configured to:
[0153] Obtaining video playback parameters for playing the target video; the video playback parameters include: one or more of a heat dissipation level of the target device and a temperature sensitivity level of the object identifier to the device temperature; the object identifier is used to indicate an object using the target device;
[0154] A temperature threshold for encoding bitstream selection is determined based on the video playback parameter.
[0155] In one implementation, the processor 801 is specifically configured to:
[0156] If the video playback parameter includes a heat dissipation level, determining a temperature threshold for encoding bitstream selection according to a setting rule that the temperature threshold is positively correlated with the heat dissipation level;
[0157] If the video playback parameter includes a temperature sensitivity level, the temperature threshold for encoding bitstream selection is determined according to a setting rule that the temperature threshold is negatively correlated with the temperature sensitivity level.
[0158] In one implementation, the processor 801 is specifically configured to:
[0159] using the temperature of a battery in a target device used to play the target video as the device temperature;
[0160] Alternatively, the temperature of a central processing unit in a target device used to play the target video is used as the device temperature;
[0161] Alternatively, the average of the temperature of the battery and the temperature of the central processing unit in the target device used to play the target video is used as the device temperature.
[0162] In one implementation, the processor 801 is specifically configured to:
[0163] Acquire multiple video files for the target video; different video files are encoded code streams obtained by encoding the target video using different encoding methods, and the encoded code streams are encapsulated into files;
[0164] The multiple video files are decapsulated respectively to obtain multiple encoded streams of the target video.
[0165] The embodiment of the present application further provides a computer storage medium in which program instructions are stored. When the program is executed, the program may include: Figure 2 or Figure 3 Part or all of the steps of the video decoding method in the corresponding embodiment.
[0166] It should be noted that for the aforementioned various method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.
[0167] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0168] The present application also provides a computer program product or computer program, which includes program instructions that, when executed by a processor, implement some or all of the steps in the above-described method. For example, the program instructions are stored in a computer-readable storage medium. A processor of a computer device reads the program instructions from the computer-readable storage medium and executes the program instructions, causing the computer device to perform the steps performed in the above-described method embodiments.
[0169] The above is a detailed introduction to a video decoding method, device, computer equipment and medium provided in the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core ideas. At the same time, for those skilled in the art, according to the ideas of the present application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A video decoding method, characterized in that: The method comprises: Acquire multiple encoding streams for the target video; different encoding streams are obtained by encoding the target video in different encoding modes; Obtaining a device temperature of a target device on which the target video is decoded, and obtaining a temperature threshold for encoding bitstream selection; comparing the device temperature with the temperature threshold, and determining a target encoding stream from the plurality of encoding streams based on the comparison result; Decoding the target coded code stream to obtain decoded data of the target video; The multiple encoding streams include a first encoding stream encoded using a first encoding method and a second encoding stream encoded using a second encoding method; the power consumption of the decoding method corresponding to the first encoding method is lower than the power consumption of the decoding method corresponding to the second encoding method; the power consumption represents consumption of a battery of the target device; the compression rate of the first encoding method is lower than the compression rate of the second encoding method; and determining a target encoding stream from the multiple encoding streams based on the comparison result includes: if the comparison result shows that the device temperature is greater than or equal to the temperature threshold, selecting the first encoding stream from the multiple encoding streams as the target encoding stream; if the comparison result shows that the device temperature is less than the temperature threshold, selecting the second encoding stream from the multiple encoding streams as the target encoding stream.
2. The method according to claim 1, characterized in that Any of the multiple coded streams is obtained by encoding a target video using a coded picture group as a unit using a corresponding coding method; wherein, when encoding the target video using the multiple coding methods, the division of the coded picture groups for the target video is consistent under each coding method; and obtaining the device temperature of the target device where the target video is decoded includes: Traversing the coded picture groups of the target video, and if a target coded picture group is currently traversed, obtaining a device temperature of a target device where the target coded picture group is decoded; the target coded picture group is any coded picture group included in the target video; The decoding process of the target coded code stream to obtain decoded data of the target video includes: The coding stream corresponding to the target coded picture group is determined from the target coding stream, and the coding stream corresponding to the target coded picture group is decoded to obtain decoded data for the target coded picture group in the target video.
3. The method according to claim 1 or 2, characterized in that The decoding process of the target coded code stream to obtain decoded data of the target video includes: Determining whether the target device has a decoding hardware device corresponding to the encoding mode of the target encoding stream; If the decoding hardware device exists, decoding the target coded stream using the decoding hardware device as a decoding method to obtain decoded data of the target video; If the decoding hardware device does not exist, software decoding is used as a decoding method to decode the target coded stream to obtain decoded data of the target video.
4. The method according to claim 1, wherein The obtaining of the temperature threshold for selecting the encoding stream includes: Obtaining video playback parameters for playing the target video; the video playback parameters include: one or more of a heat dissipation level of the target device and a temperature sensitivity level of the object identifier to the device temperature; the object identifier is used to indicate an object using the target device; A temperature threshold for encoding bitstream selection is determined based on the video playback parameter.
5. The method according to claim 4, characterized in that The determining of a temperature threshold for encoding stream selection based on the video playback parameter includes: If the video playback parameter includes a heat dissipation level, determining a temperature threshold for encoding bitstream selection according to a setting rule that the temperature threshold is positively correlated with the heat dissipation level; If the video playback parameter includes a temperature sensitivity level, the temperature threshold for encoding bitstream selection is determined according to a setting rule that the temperature threshold is negatively correlated with the temperature sensitivity level.
6. The method according to claim 1 or 2, characterized in that The obtaining of the device temperature of the target device on which the target video is decoded includes: using the temperature of a battery in a target device used to play the target video as the device temperature; Alternatively, the temperature of a central processing unit in a target device used to play the target video is used as the device temperature; Alternatively, the average of the temperature of the battery and the temperature of the central processing unit in the target device used to play the target video is used as the device temperature.
7. The method according to claim 1, characterized in that The obtaining of multiple encoding streams for the target video includes: Acquire multiple video files for the target video; different video files are encoded code streams obtained by encoding the target video using different encoding methods, and the encoded code streams are encapsulated into files; The multiple video files are decapsulated respectively to obtain multiple encoded streams of the target video.
8. A video decoding device, characterized in that: include: An acquisition unit is used to acquire multiple encoding streams for a target video; different encoding streams are obtained by encoding the target video in different encoding modes; The acquisition unit is further configured to acquire a device temperature of a target device on which the target video is decoded, and to acquire a temperature threshold for encoding bitstream selection; a determining unit, configured to compare the device temperature with the temperature threshold, and determine a target encoding stream from the multiple encoding streams based on the comparison result; A decoding unit for decoding the target coded stream to obtain decoded data of the target video; The multiple encoding streams include a first encoding stream encoded using a first encoding method and a second encoding stream encoded using a second encoding method; the power consumption of the decoding method corresponding to the first encoding method is lower than the power consumption of the decoding method corresponding to the second encoding method; the power consumption represents consumption of a battery of the target device; the compression rate of the first encoding method is lower than the compression rate of the second encoding method; and determining a target encoding stream from the multiple encoding streams based on the comparison result includes: if the comparison result shows that the device temperature is greater than or equal to the temperature threshold, selecting the first encoding stream from the multiple encoding streams as the target encoding stream; if the comparison result shows that the device temperature is less than the temperature threshold, selecting the second encoding stream from the multiple encoding streams as the target encoding stream.
9. A computer device, characterized in that: The method comprises a processor and a memory, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 7.
11. A computer program product, characterized in that The computer program product comprises a computer program, and the computer program comprises program instructions. When the program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Video coding processing method and device suitable for multiple code streams
CN104506870A
Streaming media playing control method and device, medium and computer equipment
CN112822536A
Video transcoding method and device, equipment and medium
CN112954354A