Video playing method and device, electronic equipment, readable storage medium and product

By performing power consumption evaluation and dynamic adjustment of video files in electronic devices in power consumption evaluation and dynamic adjustment, selecting the decoding method with the lowest power consumption for video playback, solving the problem of large power consumption during video playback of electronic devices and achieving longer Battery life and higher energy efficiency.

CN119211643AActive Publication Date: 2024-12-27VIVO MOBILE COMM CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411259208.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-09
Publication Date
2024-12-27
Estimated Expiration
2044-09-09

AI Technical Summary

Technical Problem

Electronic devices consume a lot of power during video playback, resulting in shorter battery life and waste of energy.

Method used

By evaluating the power consumption of the video file using at least two decoding methods (software decoding and hardware decoding), selecting the decoding method with the lowest power consumption for decoding and playing of the video file, and switching to the low-power mode at non-decoding moments, dynamically Adjust the decoding method to adapt to different usage scenarios and device states.

Benefits of technology

It effectively reduces the power consumption of video playback, extends the battery life of electronic devices, and optimizes energy utilization efficiency and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119211643A_ABST
    Figure CN119211643A_ABST
Patent Text Reader

Abstract

The invention discloses a video playing method and device, electronic equipment, a readable storage medium and a product, and relates to the technical field of electronic equipment. The video playing method comprises the following steps: decoding a video file of a target video by using a first decoding mode to obtain a decoded video file; the first decoding mode is determined by decoding a video file of a first video clip of the target video by using at least two decoding modes; and playing the target video according to the decoded video file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of electronic equipment, and specifically relates to a video playback method, device, electronic equipment, readable storage medium and product. Background Art

[0002] Electronic devices have become one of the most commonly used consumer electronic products in people's daily lives. With the development of electronic devices, more and more users use electronic devices to play videos, but when using electronic devices to play videos, it often brings about large power consumption. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide a video playback method, device, electronic device, readable storage medium and product, which can reduce the power consumption of video playback.

[0004] In a first aspect, an embodiment of the present application provides a video playback method, which is applied to an electronic device, and the method includes:

[0005] Decoding a video file of a target video using a first decoding method to obtain a decoded video file; the first decoding method is determined by respectively decoding a video file of a first video segment of the target video using at least two decoding methods;

[0006] The target video is played according to the decoded video file.

[0007] In a second aspect, an embodiment of the present application provides a video playback device, which is applied to an electronic device, and the device includes:

[0008] A decoding module, configured to decode a video file of a target video using a first decoding method to obtain a decoded video file; the first decoding method is determined by respectively decoding a video file of a first video segment of the target video using at least two decoding methods;

[0009] A playing module is used to play the target video according to the decoded video file.

[0010] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.

[0011] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0012] In a fifth aspect, an embodiment of the present application provides a chip, the chip including a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the steps of the method described in the first aspect.

[0013] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the steps of the method described in the first aspect.

[0014] In an embodiment of the present application, a video file of a target video is decoded using a first decoding method to obtain a decoded video file, and the target video is played according to the decoded video file, wherein the first decoding method is determined by respectively decoding a video file of a first video segment of the target video using at least two decoding methods. For example, the first decoding method may be a decoding method with the lowest power consumption among at least two decoding methods, thereby reducing the power consumption of video playback. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 One of the flowcharts of the video playback method provided in the embodiment of the present application;

[0016] Figure 2 The second flowchart of the video playback method provided in the embodiment of the present application;

[0017] Figure 3 A schematic diagram of the principle of the video playback method provided in the embodiment of the present application;

[0018] Figure 4 A schematic diagram of the structure of a video playback device provided in an embodiment of the present application;

[0019] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0020] Figure 6 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0021] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0022] The terms "first", "second", etc. in the specification of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are usually a class, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0023] The embodiments of the present application provide a video playback method, device, electronic device, readable storage medium and product, which can solve the problem of high power consumption of electronic devices during video playback in the related art.

[0024] The video playback method provided in the embodiment of the present application is described below in conjunction with specific application scenarios and embodiments.

[0025] It should be noted that the video playback method provided in the embodiments of the present application can be executed by electronic devices such as mobile phones, tablet computers, laptop computers, PDAs, and vehicle-mounted electronic devices. In some embodiments of the present application, the video playback method provided in the embodiments of the present application is described by taking the electronic device as the execution subject to execute the video playback method as an example.

[0026] Figure 1 A flowchart of a video playback method provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the video playing method may include the following steps:

[0027] S110, decoding a video file of a target video using a first decoding method to obtain a decoded video file; the first decoding method is determined by respectively decoding a video file of a first video segment of the target video using at least two decoding methods.

[0028] In the embodiment of the present application, the target video refers to the video content that the user or system wants to display in the current playback environment. The target video can be a video stored in the local memory of the electronic device, or a video located on a network server and needs to be downloaded or streamed via the Internet.

[0029] In an embodiment of the present application, the first decoding method may refer to a decoding method that is determined to have the lowest power consumption under the current electronic device and playback conditions after preliminary power consumption evaluation or real-time testing among a given plurality of video decoding options.

[0030] At least two decoding methods may include software decoding and hardware decoding. Among them, software decoding refers to the use of general computing resources such as the central processing unit (CPU) or graphics processing unit (GPU) of an electronic device to decode video data through a software algorithm. Software decoding does not rely on a specific hardware decoder, but may consume more power due to high computational complexity. Hardware decoding refers to the use of a dedicated video decoder (such as a video processing unit (VPU)) integrated in an electronic device to decode video data.

[0031] In the embodiment of the present application, a video file refers to an electronic file storing video data, and a video file may include a series of image frames and an audio stream associated therewith (if the video contains audio). These image frames and audio streams are encoded according to a certain encoding format and compression algorithm to obtain a video file.

[0032] In the embodiment of the present application, the decoding process of the video file refers to converting the data encoded in the video file back to the original image frames and audio streams for real-time display and playback by the electronic device. Therefore, the decoded video file is the image frames and audio stream data generated during the decoding process and used by the electronic device.

[0033] In a feasible implementation of the present application, the electronic device may predefine a power consumption evaluation and selection mechanism. This mechanism will first preset or obtain in real time a variety of available video decoding methods, and prepare to test decode the video file of the first video clip of the target video. In order to find the decoding method with the lowest power consumption, the electronic device may start the power consumption evaluation process in a relatively low-load time period (such as when the device is idle or charging), or in a preprocessing stage before the user first requests to play the target video.

[0034] During the power consumption evaluation process, the electronic device will use each decoding method to decode the video file corresponding to a small portion of the video (such as the first few seconds or a few key frames), and use the power consumption monitoring tool to record the real-time power consumption of the electronic device under each decoding method. After completing the evaluation of all decoding methods, the electronic device will compare these power consumption data and select the decoding method with the lowest power consumption as the "first decoding method".

[0035] In addition, the electronic device can also implement a dynamic adjustment mechanism. Taking into account the characteristics of different videos (such as encoding format, resolution, frame rate, etc.) and the current state of the electronic device (such as power, heat dissipation, resources occupied by other applications, etc.), the decoding method with the lowest power consumption may change. Therefore, the electronic device can re-execute the above evaluation process every time a new video is played or the device state of the electronic device changes significantly to ensure that the decoding method with the lowest power consumption under the current conditions (i.e., the first decoding method) is always used.

[0036] S120: Play the target video according to the decoded video file.

[0037] In a feasible implementation of the present application, the electronic device can use a built-in media player or framework to play the decoded video file. Specifically, the decoded video file can be passed to the player, which is responsible for rendering it on the screen of the electronic device and synchronizing the audio output. In order to optimize the playback experience, the player can also implement functions such as cache management, playback control (such as pause, fast forward, fast rewind), volume adjustment, etc.

[0038] The electronic device can also select or configure the most suitable playback mode according to the characteristics of the decoded video file. For example, for high-resolution or high-frame-rate videos, the electronic device can enable hardware accelerated rendering to reduce the CPU burden and improve playback fluency.

[0039] In addition, the electronic device can also realize multi-screen interactive function, allowing users to project the decoded video content to other display devices (such as TVs, projectors, etc.). Specifically, Wi-Fi, Bluetooth or other wireless communication technologies can be used to transfer the decoded video file from the electronic device to the target display device and play it on the target display device.

[0040] In an embodiment of the present application, a video file of a target video is decoded using a first decoding method to obtain a decoded video file, and the target video is played according to the decoded video file, wherein the first decoding method is determined by respectively decoding a video file of a first video segment of the target video using at least two decoding methods. For example, the first decoding method may be a decoding method with the lowest power consumption among at least two decoding methods, thereby reducing the power consumption of video playback.

[0041] In one embodiment, before decoding the video file of the target video using the first decoding method to obtain the decoded video file, the method further includes:

[0042] When the usage scenario of the electronic device is a target scenario, extracting a video file of the first video segment from a video file of the target video;

[0043] Decoding the video file of the first video clip by using the at least two decoding methods respectively, and obtaining first power consumptions corresponding to the at least two decoding methods respectively;

[0044] The method of decoding the video file of the target video by using the first decoding method to obtain the decoded video file includes:

[0045] Decoding the video file of the target video using a decoding method corresponding to the first target power consumption to obtain a decoded video file;

[0046] The first target power consumption is the minimum power consumption among the first power consumptions respectively corresponding to the at least two decoding modes.

[0047] Optionally, the usage scenario of an electronic device refers to the specific environment or situation in which a user is in when using the electronic device. These usage scenarios may affect multiple aspects such as the performance, power consumption, and user experience of the electronic device. For example, usage scenarios may include charging scenarios, idle scenarios, game scenarios, video playback scenarios, etc. Among them, the charging scenario refers to the usage scenario when the electronic device is charging. The idle scenario refers to when the electronic device is not currently in any active use state.

[0048] Optionally, in the target scenario, the electronic device has sufficient time and resources to perform power consumption evaluation. For example, in an idle scenario, the electronic device is inactive, and using this time to perform power consumption evaluation can ensure that when the user needs to play the target video, the electronic device is ready with the optimal decoding method, thereby improving response speed and user experience.

[0049] Optionally, the video file of the first video segment is a file corresponding to at least one video segment pre-fetched from a video file. The first video segment may be a key frame, a key scene, or a randomly selected video segment in the video file, and is used for power consumption evaluation of decoding under multiple decoding modes. It should be noted that the target video file is a complete video resource, and the video file of the first video segment is a video file corresponding to a partial video segment pre-fetched from the complete video resource.

[0050] Optionally, in a feasible implementation of the present application, if the electronic device is in a preset charging scene or idle scene, the electronic device will automatically pre-fetch a video file of a first video segment from a video file of a target video to be played as a test sample. Subsequently, the electronic device can use multiple decoding methods including software decoding, hardware decoding, and hybrid decoding (such as hardware decoding for video and software decoding for audio, or vice versa) in parallel to decode the video file of the pre-fetched first video segment.

[0051] The average power consumption (i.e., first power consumption) of the electronic device during the decoding process under each decoding mode is collected and calculated in real time through a built-in power consumption detection module (e.g., a power meter chip of an electronic device or a power consumption sampling device in a circuit). After completing the power consumption evaluation of all decoding modes, the electronic device compares these first power consumptions and selects a decoding mode with the lowest power consumption (i.e., a decoding mode corresponding to the first target power consumption) as the best decoding mode for the video file of the target video.

[0052] In one example, the calculation formula of the first power consumption may be as follows:

[0053]

[0054] Wherein, P is the first power consumption of the electronic device when decoding the video file of the first video clip, V i is the voltage collected for the i-th time during the decoding process of the video file of the first video segment, I i is the current collected for the ith time during the decoding process of the video file of the first video segment, and n is the number of sampling times during the decoding process of the video file of the first video segment.

[0055] Optionally, in other embodiments of the present application, the first power consumption may be not only the average power consumption, but also the total power consumption, which refers to the total power consumption consumed in the entire process from the beginning to the end of decoding. Therefore, when selecting the first decoding method, the decoding method with the lowest total power consumption in the first power consumption may also be selected. Alternatively, the first power consumption may also be the peak power consumption, which refers to the maximum power consumption reached by an electronic device at a certain moment during the decoding process, so that the decoding method with the lowest peak power consumption may be selected as the first decoding method, which can ensure that the device will not be overheated or have performance bottlenecks due to excessive power consumption during the decoding process.

[0056] Optionally, in other embodiments of the present application, the first decoding mode may be selected according to the power consumption energy efficiency ratio corresponding to each decoding mode, where the energy efficiency ratio refers to the ratio between decoding performance (such as decoding speed, decoding quality) and power consumption. Selecting a decoding mode with the best energy efficiency ratio means that better decoding performance can be obtained at the same power consumption, or lower power consumption at the same decoding performance.

[0057] In these optional embodiments, by intelligently judging the usage scenario of the electronic device, power consumption tests of multiple decoding methods are performed in advance on at least part of the video segments of the video file, and the decoding method with the lowest power consumption is selected as the decoding method for the video file of the target video, thereby minimizing the power consumption of the electronic device.

[0058] In one embodiment, the video file of the target video includes a video data stream and an audio data stream;

[0059] Before decoding the video file of the target video using the first decoding method to obtain the decoded video file, the method further includes:

[0060] Decoding the video data stream of the first video clip by using the at least two decoding methods respectively, and obtaining second power consumptions corresponding to the at least two decoding methods respectively;

[0061] Decoding the audio data stream corresponding to the first video clip by using the at least two decoding methods respectively, to obtain third power consumptions corresponding to the at least two decoding methods respectively;

[0062] The method of decoding the video file of the target video by using the first decoding method to obtain the decoded video file includes:

[0063] Decoding the video data stream of the target video using a decoding method corresponding to the second target power consumption, and decoding the audio data stream of the target video using a decoding method corresponding to the third target power consumption to obtain a decoded video file;

[0064] The second target power consumption is the minimum power consumption of at least two second power consumptions, and the third target power consumption is the minimum power consumption of at least two third power consumptions.

[0065] Optionally, the video data stream is a part of the video file that contains video content and is responsible for presenting dynamic changes in the image. The video data stream contains all frame data that constitute the video screen, and these frame data are arranged in a certain time sequence. When they are played continuously, the video screen of the target video is formed.

[0066] Optionally, the audio data stream is the part of the video file that contains audio content and is responsible for playing the sound synchronized with the video picture. The audio data stream may include voice, music, ambient sound effects, etc. The audio data stream and the video data stream together constitute a complete video file.

[0067] Optionally, in a feasible implementation of the present application, for the video data stream of the first video clip, the electronic device adopts multiple decoding methods to decode it, and measures the second power consumption under each decoding method, and finally selects the decoding method with the lowest power consumption (that is, the decoding method corresponding to the second target power consumption) as the decoding strategy for the video data stream.

[0068] Similarly, for the audio data stream corresponding to the first video clip, the electronic device also uses multiple decoding methods to decode it, measures the third power consumption under each decoding method, and selects the decoding method with the lowest power consumption (that is, the decoding method corresponding to the third target power consumption) as the decoding strategy for the audio data stream.

[0069] Finally, the electronic device will decode the video data stream and the audio data stream respectively according to the decoding method corresponding to the selected second target power consumption and the decoding method corresponding to the third target power consumption, and then merge the decoded video data stream and audio data stream to generate and play the decoded complete video file. It should be noted that the second power consumption and the third power consumption can be one of the average power consumption, the total power consumption, and the peak power consumption. For the specific selection of the decoding method with the lowest power consumption, please refer to the description of the above embodiment, and this application will not repeat it here.

[0070] In these optional embodiments, through power consumption evaluation and the process of selecting the decoding method for the video data stream and the audio data stream, the electronic device can ensure that when playing the entire target video, the video data stream and the audio data stream can be decoded in a manner with the lowest power consumption, thereby effectively extending the battery life of the electronic device without sacrificing playback quality.

[0071] In one embodiment, if Figure 2 As shown, the method of decoding the video file of the target video by using the first decoding method to obtain the decoded video file includes:

[0072] S111, decoding the video files of the M video segments of the target video by using the first decoding method to obtain decoded video files; the M video segments are the video segments to be played;

[0073] The method further comprises:

[0074] S112, switching the processor of the electronic device to a low power consumption mode.

[0075] Optionally, in a feasible implementation of the present application, the electronic device first locates the video segment where the current playback progress is located, and obtains the video file corresponding to the video segment where the current playback progress is located. Then, the electronic device selects and decodes M video segments immediately following the video segment where the current playback progress is located according to the first decoding method. It should be noted that the target video can be pre-divided into N smaller video segments to facilitate segment-based decoding processing.

[0076] During the decoding process, the electronic device will monitor the decoding progress in real time. Once the decoding of the M video clips is completed, the decoded M video clips will be immediately sent to the cache for subsequent playback operations. At the same time, the electronic device will automatically switch the processor of the electronic device to a low power mode to reduce the energy consumption of the processor. This low power mode will be maintained until more video clips need to be decoded to continue playback, at which time the processor will be awakened and re-enter the working state.

[0077] In these optional embodiments, the video is divided into multiple segments, decoded on demand, and the decoding progress is monitored in real time and the processor is automatically switched to low power mode after decoding is completed, which effectively reduces the idle power consumption of the processor, thereby significantly improving the energy efficiency of the device. This dynamic power management strategy not only extends the battery life of the device, but also reduces unnecessary energy waste and reduces the power consumption of electronic devices during video playback.

[0078] S113, when the duration that the processor of the electronic device is in the low power consumption mode reaches the target duration and the M video segments have not been completely played, the video files of the Q video segments of the target video are decoded using the first decoding method to obtain a decoded video file; the Q video segments are the video segments after the M video segments in the target video.

[0079] Optionally, in a feasible implementation of the present application, when the electronic device completes decoding of the M video clips and switches the processor to the low power mode, a timer is simultaneously started to monitor the duration of the low power mode. If the M video clips are not completely played within the preset target duration, the electronic device will predict the subsequent playback needs and wake up the processor in advance.

[0080] Subsequently, the electronic device will continue to decode the Q video segments immediately following the M video segments in the target video according to the first decoding method. Here, the selection of the Q video segments is determined based on the current playback progress and the estimated playback speed to ensure that there is enough decoding time to decode the Q video segments within the remaining time of playing the M video segments.

[0081] After the decoding of the Q video clips is completed, these decoded Q video clips will also be sent to the cache area, and the processor will enter the low power mode again after completing the decoding task, waiting for the next wake-up and decoding needs. Through such pre-decoding and dynamic adjustment strategies, electronic devices can further optimize the energy efficiency of the device while ensuring the smoothness of video playback.

[0082] In these optional embodiments, the smoothness of video playback and the battery life of the device are significantly improved through pre-decoding and dynamic adjustment strategies.

[0083] In one embodiment, the method further comprises:

[0084] When the playback progress of the M video segments reaches the target progress, the video files of the R video segments in the target video are decoded using the first decoding method to obtain a decoded video file; the R video segments are the video segments after the M video segments in the target video.

[0085] Optionally, in a feasible implementation of the present application, during the playback of M video clips, the electronic device not only monitors the playback progress of the M video clips, but also maintains a decoding queue, which contains R video clips after the M video clips to be decoded. Once the M video clips are played to a preset target progress (such as a specific time point, percentage or key frame), the electronic device will immediately wake up the processor from the low power mode and quickly decode the R video clips in the decoding queue. After the decoding is completed, the decoded R video clips are sent to the cache area, and the processor immediately switches back to the low power mode again to save energy.

[0086] At the same time, the electronic device will continue to monitor the playback progress of the R video clips. When the R video clips play the preset target progress, the above process will be repeated: the processor is awakened, the video clip immediately following the R video clips is decoded, and the low power mode is entered again. This process is repeated until all the video clips in the video file are decoded. Each cycle decodes the next batch of video clips in advance to ensure the continuity and smoothness of the playback.

[0087] Optionally, in another feasible implementation of the present application, as Figure 3 As shown, the target video can be firstly divided into multiple video segments, for example, according to Figure 3 As shown, the target video is segmented into 12 independent video segments.

[0088] Next, the electronic device determines the current playback mode. If the current playback mode is the normal playback mode, the electronic device selects several video clips (i.e., M video clips) after the currently played video clip for decoding, and sends the decoded video clips to the cache of the display and audio playback device. After completing these operations, the processor enters a low power consumption mode. When the decoded video clip is played to a preset progress, the electronic device selects an adjacent video clip for decoding again.

[0089] If the current playback is in pause mode, the electronic device will stop the decoding unit. If the current video has exited playback, the electronic device will also stop the decoding unit and end the entire playback process. This method not only avoids the continuous operation of the processor and the decoding unit, but also saves power consumption when stopping or exiting video playback midway, because the unplayed video parts will not be decoded.

[0090] Optionally, the target video is in normal play mode, which means that the video is played continuously from the beginning to the end in a user or preset time sequence. In normal play mode, the target video is decoded and played one by one in the order of the segments into which it is divided, until the entire video is played. In contrast to the normal play mode is the pause mode or the exit play mode, wherein the pause mode temporarily stops the decoding and playing of the video, while the exit play mode completely stops the decoding and playing of the video and ends the play process.

[0091] In these optional embodiments, when M video clips are played to a preset target progress, the electronic device can decode the subsequent R video clips in advance, ensuring the continuity of video playback and avoiding the jamming phenomenon caused by decoding delay. At the same time, this strategy also optimizes the energy management of the electronic device, by switching the processor to a low-power mode at non-decoding times, effectively reducing the overall power consumption of the device. In addition, the decoding plan is dynamically adjusted according to the actual progress of video playback, achieving efficient use of resources and further reducing power consumption during video playback.

[0092] In one embodiment, the method further comprises:

[0093] When the playback state of the target video is the target state, decoding of the video file of the target video is stopped.

[0094] Optionally, the play state of the target video refers to a specific state that the currently playing target video is in. The play state may include a normal play state, a pause state, a fast forward / fast rewind state, a silent play state, a background play state, and the like.

[0095] Optionally, the target state refers to a specific state in which the electronic device is defined as needing to stop decoding in these playback states. The target state may include scenarios such as the user actively pausing playback, the user stopping playback, the video entering the background playback and the user not interacting with it for a long time, etc.

[0096] Optionally, in a feasible implementation of the present application, the electronic device monitors the playback state of the target video in real time, and identifies whether the current playback state is a preset "target state" through a state detection mechanism built into the electronic device. Once it is detected that the playback state of the target video is the target state, the electronic device will immediately trigger an instruction to stop decoding. This instruction will notify the decoding unit to stop further decoding operations on the current video file, and can also put the decoding unit into standby or low power consumption mode.

[0097] In these optional embodiments, by monitoring the video playback status in real time and stopping decoding when a specific target state is reached, unnecessary computing resource consumption and energy waste are effectively reduced, thereby improving the operating efficiency and battery life of the electronic device.

[0098] In one embodiment, the video file of the target video includes a video data stream; the target state is a background playback state;

[0099] When the playback state of the target video is the target state, stopping decoding the video file of the target video includes:

[0100] When the target video is in a background playback state, a first decoding unit of the electronic device is controlled to be in a non-working state, and the first decoding unit is used to decode the video data stream.

[0101] Optionally, when the playback state is background playback, the electronic device has switched to other applications or screens, but the target video continues to play (perhaps in another window or tab). In this state, the user may not be able to directly see the video screen, but can still hear the audio (if it is not muted).

[0102] Optionally, when the electronic device is in the screen-off state, the user cannot directly watch the video content, and continuing to decode the video file will consume unnecessary power. Therefore, when the electronic device is in the screen-off state, stopping the decoding operation of the first decoding unit can significantly reduce the power consumption of the device, thereby extending the battery life.

[0103] Optionally, in a feasible implementation of the present application, when it is detected that the target video is in the background playing state, or the electronic device is in the screen-off state, the electronic device will stop the operation of the first decoding unit responsible for decoding the video data stream, and put the display path component related to the first decoding unit into a low power consumption mode. This decision not only avoids or reduces unnecessary decoding operations of the video data stream when the user cannot directly watch the video screen, but also significantly reduces the overall energy consumption by putting the first decoding unit and its related display path components into a low power consumption mode.

[0104] In these optional embodiments, by stopping the first decoding unit from decoding the video data stream in a specific state, it is not only possible to effectively reduce unnecessary computing resource consumption, reduce device power consumption, extend battery life, but also improve the overall energy efficiency of the electronic device.

[0105] In one embodiment, the video file of the target video includes an audio data stream; the target state is a silent playback state;

[0106] When the playback state of the target video is the target state, stopping decoding the video file of the target video includes:

[0107] When the target video is in a silent playback state, a second decoding unit of the electronic device is controlled to be in a non-working state, and the second decoding unit is used to decode the audio data stream.

[0108] Optionally, when the target video is in a silent playback state, the user turns off the audio portion of the video, but still wants to watch the video content. In this state, although the decoding of the audio data stream is no longer necessary, the decoding of the video data stream still needs to continue to ensure smooth playback of the picture.

[0109] Optionally, in an embodiment of the present application, when it is detected that the target video is in a silent playback state, the electronic device will turn off the audio decoding unit (i.e., the second decoding unit) and power-consuming devices on the audio path, such as audio amplifiers and headphones, thereby further reducing the power consumption of the electronic device.

[0110] In these optional embodiments, when the target video is in a silent playback state, the processing burden and energy consumption of the electronic device can be effectively reduced by stopping the decoding of the audio data stream and controlling the second decoding unit to enter a non-working state.

[0111] It should be noted that the various optional implementations introduced in the embodiments of the present application can be implemented in combination with each other or separately if they do not conflict with each other, and the embodiments of the present application are not limited to this.

[0112] The video playing method provided in the embodiment of the present application can be executed by a video playing device. In the embodiment of the present application, a video playing device executing the video playing method is taken as an example to illustrate the wireless network connection device provided in the embodiment of the present application.

[0113] Figure 4 A schematic diagram of the structure of a video playback device provided in an embodiment of the present application.

[0114] like Figure 4 As shown, the video playback device is applied to an electronic device, and the video playback device 400 may include:

[0115] A decoding module 401 is used to decode the video file of the target video using a first decoding method to obtain a decoded video file; the first decoding method is determined by respectively decoding the video file of the first video segment of the target video using at least two decoding methods;

[0116] The playing module 402 is used to play the target video according to the decoded video file.

[0117] In some embodiments, the video playback device 400 further includes an acquisition module:

[0118] The acquisition module is used to extract the video file of the first video segment from the video file of the target video when the usage scenario of the electronic device is the target scenario;

[0119] The decoding module 401 is further configured to respectively decode the video file of the first video clip using the at least two decoding methods to obtain first power consumptions corresponding to the at least two decoding methods respectively;

[0120] The decoding module 401 decodes the video file of the target video using the first decoding method, and obtains the decoded video file specifically including:

[0121] The decoding module 401 is further configured to decode the video file of the target video using a decoding method corresponding to the first target power consumption to obtain a decoded video file;

[0122] The first target power consumption is the minimum power consumption among the first power consumptions respectively corresponding to the at least two decoding modes.

[0123] In some embodiments, the video file includes a video data stream and an audio data stream;

[0124] The decoding module 401 is further configured to respectively decode the video data stream of the first video clip using the at least two decoding methods to obtain second power consumptions corresponding to the at least two decoding methods respectively;

[0125] The decoding module 401 is further configured to respectively decode the audio data stream corresponding to the first video clip using the at least two decoding methods to obtain third power consumptions respectively corresponding to the at least two decoding methods;

[0126] The decoding module 401 decodes the video file of the target video using the first decoding method, and obtains the decoded video file specifically including:

[0127] The decoding module 401 is further configured to decode the video data stream of the target video using a decoding method corresponding to the second target power consumption, and decode the audio data stream of the target video using a decoding method corresponding to the third target power consumption, to obtain a decoded video file;

[0128] The second target power consumption is the minimum power consumption of at least two second power consumptions, and the third target power consumption is the minimum power consumption of at least two third power consumptions.

[0129] In some embodiments, the video playback device further includes a switching module;

[0130] The decoding module 401 decodes the video file of the target video using the first decoding method, and obtains the decoded video file specifically including:

[0131] The decoding module 401 is further used to decode the video files of the M video segments of the target video using the first decoding method to obtain decoded video files; the M video segments are the video segments to be played;

[0132] The switching module is used to switch the processor of the electronic device to a low power consumption mode.

[0133] In some embodiments, the decoding module 401 is also used to decode the video file of the Q video segments of the target video using the first decoding method to obtain a decoded video file when the duration that the processor of the electronic device is in the low power consumption mode reaches a target duration and the M video segments have not been played completely; the Q video segments are the video segments after the M video segments in the target video.

[0134] In some embodiments, the decoding module 401 is also used to decode the video files of the R video segments in the target video using the first decoding method to obtain a decoded video file when the playback progress of the M video segments reaches the target progress; the R video segments are the video segments after the M video segments in the target video.

[0135] In some embodiments, the video playback device further includes:

[0136] The processing module is used to stop decoding the video file of the target video when the playback state of the target video is the target state.

[0137] In some embodiments, the video file of the target video includes a video data stream; the target state is a background playback state;

[0138] When the playback state of the target video is the target state, the processing module stops decoding the video file of the target video and specifically includes:

[0139] The processing module is further used to control the first decoding unit of the electronic device to be in a non-working state when the playback state of the target video is a background playback state, and the first decoding unit is used to decode the video data stream.

[0140] In some embodiments, the video file of the target video includes an audio data stream; the target state is a silent playback state;

[0141] When the playback state of the target video is the target state, the processing module stops decoding the video file of the target video and specifically includes:

[0142] The processing module is further used to control the second decoding unit of the electronic device to be in a non-working state when the playback state of the target video is a silent playback state, and the second decoding unit is used to decode the audio data stream.

[0143] The video playback device in the embodiment of the present application can be an electronic device or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices other than a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a car electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc. The non-mobile electronic device can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0144] The video playback device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0145] The video playback device provided in the embodiment of the present application can implement each process implemented in the embodiment of the video playback method. To avoid repetition, they will not be described here.

[0146] Alternatively, if Figure 5 As shown, an embodiment of the present application also provides an electronic device 500, including a processor 501, and a memory 502, wherein the memory 502 stores a program or instruction that can be executed on the processor 501. When the program or instruction is executed by the processor 501, the various process steps of the above-mentioned video playback method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0147] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0148] Figure 6 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.

[0149] The electronic device 600 includes but is not limited to: a radio frequency unit 601, a network module 602, an audio output unit 603, an input unit 604, a sensor 605, a display unit 606, a user input unit 607, an interface unit 608, a memory 609, and a processor 610.

[0150] Those skilled in the art will appreciate that the electronic device 600 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 610 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 6 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0151] The processor 610 is configured to decode the video file of the target video using a first decoding method to obtain a decoded video file; the first decoding method is determined by respectively decoding the video file of the first video segment of the target video using at least two decoding methods;

[0152] The target video is played according to the decoded video file.

[0153] In some embodiments, the processor 610 is further configured to: extract a video file of the first video segment from a video file of the target video when the usage scenario of the electronic device is a target scenario;

[0154] Decoding the video file of the first video clip by using the at least two decoding methods respectively, and obtaining first power consumptions corresponding to the at least two decoding methods respectively;

[0155] Decoding the video file of the target video using a decoding method corresponding to the first target power consumption to obtain a decoded video file;

[0156] The first target power consumption is the minimum power consumption among the first power consumptions respectively corresponding to the at least two decoding modes.

[0157] In some embodiments, the video file of the target video includes a video data stream and an audio data stream; the processor 610 is further configured to: decode the video data stream of the first video clip using the at least two decoding methods respectively, and obtain second power consumptions corresponding to the at least two decoding methods respectively;

[0158] The audio data stream corresponding to the first video clip is decoded respectively by using the at least two decoding methods to obtain third power consumptions corresponding to the at least two decoding methods respectively.

[0159] In some embodiments, the processor 610 is further configured to: decode the video data stream of the target video using a decoding method corresponding to the second target power consumption, and decode the audio data stream of the target video using a decoding method corresponding to the third target power consumption to obtain a decoded video file;

[0160] The second target power consumption is the minimum power consumption of at least two second power consumptions, and the third target power consumption is the minimum power consumption of at least two third power consumptions.

[0161] In some embodiments, the processor 610 is further configured to: decode the video files of the M video segments of the target video using the first decoding method to obtain decoded video files; the M video segments are the video segments to be played;

[0162] The processor of the electronic device is switched to a low power consumption mode.

[0163] In some embodiments, the processor 610 is also used to: when the duration of time that the processor of the electronic device is in the low power consumption mode reaches the target duration and the M video clips have not been played completely, use the first decoding method to decode the video file of the Q video clips of the target video to obtain a decoded video file; the Q video clips are the video clips after the M video clips in the target video.

[0164] In some embodiments, the processor 610 is also used to: when the playback progress of the M video segments reaches the target progress, use the first decoding method to decode the video files of the R video segments in the target video to obtain a decoded video file; the R video segments are the video segments after the M video segments in the target video.

[0165] In some embodiments, the processor 610 is further configured to: when the playback state of the target video is the target state, stop decoding the video file of the target video.

[0166] In some embodiments, the video file of the target video includes a video data stream; the target state is a background playback state; the processor 610 is also used to: when the playback state of the target video is a background playback state, control the first decoding unit of the electronic device to be in a non-working state, and the first decoding unit is used to decode the video data stream.

[0167] In some embodiments, the video file of the target video includes an audio data stream; the target state is a silent playback state; the processor 610 is also used to: when the playback state of the target video is a silent playback state, control the second decoding unit of the electronic device to be in a non-working state, and the second decoding unit is used to decode the audio data stream.

[0168] It should be understood that in the embodiment of the present application, the input unit 604 may include a graphics processor (GPU) 6041 and a microphone 6042, and the graphics processor 6041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 606 may include a display panel 6061, and the display panel 6061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 607 includes a touch panel 6071 and at least one of other input devices 6072. The touch panel 6071 is also called a touch screen. The touch panel 6071 may include two parts: a touch detection device and a touch controller. Other input devices 6072 may include, but are not limited to, a physical keyboard, function keys (such as a volume control button, a switch button, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0169] The memory 609 can be used to store software programs and various data, including but not limited to application programs and operating systems. The memory 609 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instruction required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 609 may include a volatile memory or a non-volatile memory, or the memory 609 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 609 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0170] The processor 610 may include one or more processing units; optionally, the processor 610 integrates an application processor and a modem processor, wherein the application processor mainly processes operations involving an operating system, a user interface, and an application program, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understood that the above-mentioned modem processor may not be integrated into the processor 610. The application processor and the modem processor may be integrated, wherein the application processor mainly processes an operating system, a user interface, and an application program, and the modem processor mainly processes wireless communication. It is understood that the above-mentioned modem processor may not be integrated into the processor 610.

[0171] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned video playback method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0172] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0173] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned video playback method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0174] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0175] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned video playback method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0176] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0177] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0178] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A video playback method, applied to an electronic device, characterized in that: include: Decoding the video file of the target video using a first decoding method to obtain a decoded video file; The first decoding mode is determined by respectively decoding the video file of the first video segment of the target video using at least two decoding modes; The target video is played according to the decoded video file.

2. The method according to claim 1, characterized in that Before decoding the video file of the target video using the first decoding method to obtain the decoded video file, the method further includes: When the usage scenario of the electronic device is a target scenario, extracting a video file of the first video segment from a video file of the target video; Decoding the video file of the first video clip by using the at least two decoding methods respectively, and obtaining first power consumptions corresponding to the at least two decoding methods respectively; The method of decoding the video file of the target video by using the first decoding method to obtain the decoded video file includes: Decoding the video file of the target video using a decoding method corresponding to the first target power consumption to obtain a decoded video file; The first target power consumption is the minimum power consumption among the first power consumptions respectively corresponding to the at least two decoding modes.

3. The method according to claim 1, characterized in that The video file of the target video includes a video data stream and an audio data stream; Before decoding the video file of the target video using the first decoding method to obtain the decoded video file, the method further includes: Decoding the video data stream of the first video clip by using the at least two decoding methods respectively, and obtaining second power consumptions corresponding to the at least two decoding methods respectively; Decoding the audio data stream corresponding to the first video clip by using the at least two decoding methods respectively, to obtain third power consumptions corresponding to the at least two decoding methods respectively; The method of decoding the video file of the target video by using the first decoding method to obtain the decoded video file includes: Decoding the video data stream of the target video using a decoding method corresponding to the second target power consumption, and decoding the audio data stream of the target video using a decoding method corresponding to the third target power consumption to obtain a decoded video file; The second target power consumption is the minimum power consumption of at least two second power consumptions, and the third target power consumption is the minimum power consumption of at least two third power consumptions.

4. The method according to claim 1, characterized in that: The method of decoding the video file of the target video by using the first decoding method to obtain the decoded video file includes: Decoding the video files of the M video segments of the target video using the first decoding method to obtain decoded video files; the M video segments are the video segments to be played; The method further comprises: The processor of the electronic device is switched to a low power consumption mode.

5. The method according to claim 4, characterized in that The method further comprises: When the duration that the processor of the electronic device is in the low power consumption mode reaches the target duration and the M video clips have not been completely played, the video files of the Q video clips of the target video are decoded using the first decoding method to obtain a decoded video file; the Q video clips are the video clips after the M video clips in the target video.

6. The method according to claim 4, characterized in that The method further comprises: When the playback progress of the M video segments reaches the target progress, the video files of the R video segments in the target video are decoded using the first decoding method to obtain a decoded video file; the R video segments are the video segments after the M video segments in the target video.

7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: When the playback state of the target video is the target state, decoding of the video file of the target video is stopped.

8. The method according to claim 7, characterized in that The video file of the target video includes a video data stream; the target state is a background playback state; When the playback state of the target video is the target state, stopping decoding the video file of the target video includes: When the target video is in a background playback state, a first decoding unit of the electronic device is controlled to be in a non-working state, and the first decoding unit is used to decode the video data stream.

9. The method according to claim 7, characterized in that: The video file of the target video includes an audio data stream; the target state is a silent playback state; When the playback state of the target video is the target state, stopping decoding the video file of the target video includes: When the target video is in a silent playback state, a second decoding unit of the electronic device is controlled to be in a non-working state, and the second decoding unit is used to decode the audio data stream.

10. A video playback device, characterized in that: Applied to electronic equipment, the device comprises: A decoding module, configured to decode a video file of a target video using a first decoding method to obtain a decoded video file; the first decoding method is determined by respectively decoding a video file of a first video segment of the target video using at least two decoding methods; A playing module is used to play the target video according to the decoded video file.

11. The device according to claim 10, characterized in that The device also includes an acquisition module: The acquisition module is used to extract the video file of the first video segment from the video file of the target video when the usage scenario of the electronic device is the target scenario; The decoding module is further configured to respectively decode the video file of the first video clip using the at least two decoding methods to obtain first power consumptions corresponding to the at least two decoding methods respectively; The decoding module decodes the video file of the target video using the first decoding method, and obtains the decoded video file specifically including: The decoding module is further used to decode the video file of the target video using a decoding method corresponding to the first target power consumption to obtain a decoded video file; The first target power consumption is the minimum power consumption among the first power consumptions respectively corresponding to the at least two decoding modes.

12. The device according to claim 10, characterized in that The video file includes a video data stream and an audio data stream; The decoding module is further configured to respectively decode the video data stream of the first video clip using the at least two decoding methods to obtain second power consumptions corresponding to the at least two decoding methods respectively; The decoding module is further configured to respectively decode the audio data stream corresponding to the first video clip using the at least two decoding methods to obtain third power consumptions respectively corresponding to the at least two decoding methods; The decoding module decodes the video file of the target video using the first decoding method, and obtains the decoded video file specifically including: The decoding module is further used to decode the video data stream of the target video using a decoding method corresponding to the second target power consumption, and to decode the audio data stream of the target video using a decoding method corresponding to the third target power consumption, to obtain a decoded video file; The second target power consumption is the minimum power consumption of at least two second power consumptions, and the third target power consumption is the minimum power consumption of at least two third power consumptions.

13. The device according to claim 10, characterized in that The device also includes a switching module; The decoding module decodes the video file of the target video using the first decoding method, and obtains the decoded video file specifically including: The decoding module is further used to decode the video files of the M video segments of the target video using the first decoding method to obtain decoded video files; the M video segments are the video segments to be played; The switching module is used to switch the processor of the electronic device to a low power consumption mode.

14. The device according to claim 13, characterized in that The decoding module is also used to decode the video files of the Q video segments of the target video using the first decoding method to obtain a decoded video file when the duration that the processor of the electronic device is in the low power consumption mode reaches the target duration and the M video segments have not been completely played; the Q video segments are the video segments after the M video segments in the target video.

15. The device according to claim 13, characterized in that The decoding module is also used to decode the video files of the R video segments in the target video using the first decoding method to obtain a decoded video file when the playback progress of the M video segments reaches the target progress; the R video segments are the video segments after the M video segments in the target video.

Citation Information

Patent Citations

  • Decoding method and apparatus, and device

    CN109309879A

  • Application program running method and device and storage medium

    CN112463335A

  • Video playing control method, device and equipment and computer storage medium

    CN113395592A

  • Video decoding method and device, electronic equipment and readable storage medium

    CN114390336A

  • Video decoding method and device, equipment and storage medium

    CN117119199A