Video playback method, device and electronic equipment
By decoding only video frames with large displacement and inserting the third frame during video playback, the power consumption increase caused by CPU processing video is solved, improving device performance and ensuring video quality.
Patent Information
- Application Number
- CN202110803088.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-15
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2041-07-15
AI Technical Summary
The CPU will increase power consumption when processing video, reducing device system performance.
By acquiring video frame data and displacement data, decode only when the target object displacement is greater than or equal to a preset value in the first video frame and the second video frame of the target video, and insert the third video frame according to the preset rules, thereby Reduce CPU processing burden and improve performance.
It reduces CPU power consumption, improves device system performance, and compensates for the losses caused by undecoded frames by inserting the third video frame, ensuring the playback quality of the video.
Smart Images

Figure CN113691756B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of communication technology, and specifically relates to a video playback method, device and electronic equipment. Background Art
[0002] With the development of communication technology, video playback has become an important function of electronic devices.
[0003] Typically, the video is processed by the central processing unit (CPU) of the electronic device. Specifically, after the user selects a video to be played, the CPU obtains the video to be played according to the user's operation, decodes the video to be played to obtain a video frame, and then sends the video frame to the independent display chip so that the video frame can be displayed.
[0004] However, since the video to be played is composed of multiple video frames, if the CPU repeats the above operations, it will cause high CPU power consumption, thereby reducing the device system performance. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a video playback method, device and electronic device, which can solve the problem that video processing by the CPU will reduce the system performance of the device.
[0006] In a first aspect, an embodiment of the present application provides a video playback method. The method includes: obtaining video frame data of a target video and displacement data of a target object in the video frame; when the displacement data indicates that the displacement of the target object in the first video frame and the second video frame of the target video is greater than or equal to a preset value, decoding the video frame data to obtain the first video frame and the second video frame, and inserting a third video frame according to a preset rule; and playing the first video frame, the second video frame, and the third video frame.
[0007] In a second aspect, an embodiment of the present application provides a video playback device. The device includes: an acquisition module, a first processing module, a second processing module, and a playback module. The acquisition module is used to acquire the video frame data of the target video and the displacement data of the target object in the video frame; the first processing module is used to decode the video frame data to obtain the first video frame and the second video frame when the displacement data indicates that the displacement of the target object in the first video frame and the second video frame of the target video is greater than or equal to a preset value; the second processing module is used to insert the third video frame according to a preset rule; the playback module is used to play the first video frame, the second video frame, and the third video frame.
[0008] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, and when the program or instruction is executed by the processor, the steps of the method provided in the first aspect are implemented.
[0009] 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 provided in the first aspect are implemented.
[0010] 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 is coupled to the processor, and the processor is used to run programs or instructions to implement the method provided in the first aspect.
[0011] In an embodiment of the present application, the video frame data of the target video and the displacement data of the target object in the video frame can be obtained first; then, when the displacement data indicates that the displacement of the target object in the first video frame and the second video frame of the target video is greater than or equal to a preset value, the video frame data is decoded to obtain the first video frame and the second video frame, and a third video frame is inserted according to a preset rule; then the first video frame, the second video frame, and the third video frame are played. Through this scheme, when the displacement of the target object in the first video frame and the second video frame of the target video is large, since only the first video frame and the second video frame need to be decoded, and there is no need to decode the video frame with a smaller displacement of the target object, the CPU can be temporarily released from the task of processing the video, thereby reducing the CPU power consumption and improving the device system performance; in addition, by inserting the third video frame, the loss caused by not decoding the video frame with a smaller displacement of the target object can be compensated, thereby ensuring the playback quality of the video. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 It is a schematic diagram of the architecture of an electronic device provided in an embodiment of the present application;
[0013] Figure 2 One of the flowcharts of a video playback method provided in an embodiment of the present application;
[0014] Figure 3 A schematic diagram of a target object in two video frames provided in an embodiment of the present application;
[0015] Figure 4 A second flowchart of a video playback method provided in an embodiment of the present application;
[0016] Figure 5 One of the schematic diagrams of the frame insertion operation provided in the embodiment of the present application;
[0017] Figure 6A second schematic diagram of a frame insertion operation provided in an embodiment of the present application;
[0018] Figure 7 A schematic diagram of the structure of a video playback device provided in an embodiment of the present application;
[0019] Figure 8 One of the hardware schematic diagrams of the electronic device provided in the embodiment of the present application;
[0020] Fig. 9 The second hardware schematic diagram of the electronic device provided in the 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 and claims 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 generally of one type, 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 and claims 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] It should be noted that the logo in the embodiments of the present application is used to indicate text, symbols, images, etc. of information, and controls or other containers can be used as carriers for displaying information, including but not limited to text logos, symbol logos, and image logos.
[0024] The embodiment of the present application provides a video playback method, device and electronic device, which can first obtain the video frame data of the target video and the displacement data of the target object in the video frame; then, when the displacement data indicates that the displacement of the target object in the first video frame and the second video frame of the target video is greater than or equal to a preset value, decode the video frame data to obtain the first video frame and the second video frame, and insert the third video frame according to a preset rule; then play the first video frame, the second video frame and the third video frame. Through this scheme, when the displacement of the target object in the first video frame and the second video frame of the target video is large, since only the first video frame and the second video frame need to be decoded, and there is no need to decode the video frame with a smaller displacement of the target object, the CPU can be temporarily released from the task of processing the video, thereby reducing the CPU power consumption and improving the device system performance; in addition, by inserting the third video frame, the loss caused by not decoding the video frame with a smaller displacement of the target object can be compensated, thereby ensuring the playback quality of the video.
[0025] The video playback method, device and electronic device provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.
[0026] like Figure 1 FIG. 1 is a schematic diagram of the architecture of an electronic device provided in an embodiment of the present application. The electronic device includes a CPU, a discrete graphics chip, and a display screen.
[0027] In the embodiment of the present application, the CPU not only has traditional functions such as recording videos, playing videos, video chatting, Bluetooth pairing, calls, alarms, etc., but can also be used to obtain video frame data and displacement data, decode video frame data, and send the displacement data and decoded video frames to the independent display chip.
[0028] The independent graphics chip includes a position controller, a zoom controller, a frame processor, and a video memory. The position controller can be used to control the position of the image; the zoom controller can be used to control the zoom of the image; the frame processor can be used to perform frame insertion; the video memory is also called a frame buffer, which can be used to store the rendering data that has been processed or is about to be extracted by the graphics chip.
[0029] like Figure 2 As shown, the embodiment of the present application provides a video playback method. The video playback method may include the following steps 201 to 203. The following is the execution body of the video playback method as follows Figure 1 The electronic device shown is used as an example for explanation.
[0030] Step 201: The electronic device obtains video frame data of a target video and displacement data of a target object in the video frame.
[0031] In the embodiment of the present application, the video frame data is the data obtained after compressing the video frame of the target video. The displacement data is the data obtained after analyzing the target object in the video frame of the target video, and the displacement data can be used to indicate the position vector of the target object in the video frame, such as the position in the video frame, the relative displacement between adjacent video frames, etc.
[0032] Optionally, the video frame data and displacement data may be two independent sets of data and packaged into one set of data; or, the displacement data may be encoded data included in the video frame data. This may be determined according to actual use requirements and is not limited in the embodiments of the present application.
[0033] Optionally, the target video may be a video shot by the electronic device, a video received by the electronic device and shared by other devices, or a video downloaded by the electronic device from a server.
[0034] For example, the target video is a video shot by a mobile phone. After the user triggers the mobile phone to shoot the target video, the mobile phone can start recording the target video, analyze the position vector (also called motion vector) of the moving object in each recorded video frame, and then record the obtained displacement data into the video frame data. In this way, when the user wants to watch the target video, the mobile phone can respond to the user input and play the target video according to the video frame data and displacement data. The specific playback method can refer to the description in the following embodiment, which will not be repeated here.
[0035] Optionally, the target object may be an image of a moving object, and the moving object may be any moving object such as a running horse, a flying bird, a falling leaf, a waving arm, a flowing spring, a flashing neon light, etc. It is understandable that when an electronic device shoots a video, if an object moves, the relative position of the object in the video frame will also change, that is, the position vector of the target object in the video frame will change.
[0036] Optionally, since the target object is represented by color in the video frame, the displacement data of the target object may be color data of the video frame.
[0037] Furthermore, the color data of the video frame may be pixel values of pixels in the video frame.
[0038] For example, Figure 3As shown, one circle represents one pixel, and the image width and image height of the first video frame and the second video frame are both 10 pixels. The coordinates of the four vertices of region 011 of the first video frame are (2, 2), (4, 2), (2, 4), (4, 4), and the pixel values of the pixels of region 011 are all a1; the coordinates of the four vertices of region 012 of the second video frame are (5, 6), (7, 6), (5, 8), (7, 8), and the pixel values of the pixels of region 012 are also all a1. Assuming that region 011 of the first video frame is the target object, since the region 011 of the first video frame and the region 012 of the second video frame have the same area size, and the pixel values of the pixels contained in region 011 of the first video frame and region 012 of the second video frame are the same, it can be determined that compared with the first video frame, the target object moves to region 012 in the second video frame, that is, the target object moves from region 011 to region 012.
[0039] It should be noted that the above Figure 3 The example in which the pixel values of all pixels in region 011 and region 012 are a1 is used for explanation, and does not limit the embodiments of the present application. It is understood that the pixel values of the pixels in region 011 and region 012 may be different from each other, but the pixel values of the pixels corresponding to region 011 and region 012 must be the same, for example, the pixel values of the pixel point (2, 2) in region 011 and the pixel point (5, 6) in region 012 must be the same.
[0040] Step 202: When the displacement data indicates that the displacement of the target object in the first video frame and the second video frame of the target video is greater than or equal to a preset value, the electronic device decodes the video frame data to obtain the first video frame and the second video frame, and inserts a third video frame according to a preset rule.
[0041] In the embodiment of the present application, the execution subject is as follows Figure 1 In the case of the electronic device shown, the above step 202 can be specifically implemented through the following (1) to (4).
[0042] (1) The CPU determines, based on the displacement data, that the displacement of the target object in the first video frame and the second video frame is greater than or equal to a preset value.
[0043] (2) The CPU decodes the video frame data to obtain the first video frame and the second video frame.
[0044] (3) The CPU sends the first video frame, the second video frame, and the displacement of the target object in the first video frame and the second video frame to the independent display chip.
[0045] (4) The independent display chip obtains a third video frame according to the first video frame, the second video frame, and the displacement of the target object in the first video frame and the second video frame.
[0046] For example, the above Figure 3 Take the example. Assume that the preset value is 3 pixels. Since the target object moves 3 pixels on the horizontal axis and 4 pixels on the vertical axis, the motion vector of the target object is 5 pixels. Therefore, the CPU can determine that the displacement of the target object in the first video frame and the second video frame is greater than the preset value, then it can be considered that the target object has a large displacement. If the displacement of the target object in the first video frame and the second video frame is less than 3 pixels, it is considered that the target object has not been displaced.
[0047] It is understandable that, on the one hand, when it is determined that the displacement of the target object in the first video frame and the second video frame is greater than the preset value, since the CPU only needs to decode the first video frame and the second video frame, and does not need to decode the video frame with a smaller displacement of the target object, the CPU is temporarily released from the task of processing the video, and the CPU can handle other tasks such as calls and alarms. On the other hand, after the independent graphics chip receives the first video frame, the second video frame, and the displacement of the target object in the first video frame and the second video frame initiated by the CPU, the independent graphics chip can perform interpolation processing to obtain a third video frame, thereby compensating for the loss caused by not decoding the video frame with a smaller displacement of the target object, thereby ensuring the video playback quality.
[0048] It should be noted that, for the specific implementation of the independent display chip obtaining the third video frame, reference may be made to the two video frame insertion methods provided in the following embodiments, which will not be described in detail here.
[0049] Step 203: The electronic device plays the first video frame, the second video frame, and the third video frame.
[0050] Optionally, the first video frame and the second video frame may be one video frame respectively, and the third video frame may be one video frame or multiple video frames.
[0051] Optionally, the first video frame and the second video frame may be adjacent video frames or non-adjacent video frames. Specifically, if the first video frame and the second video frame are adjacent video frames, the electronic device may adopt an interpolation method of inserting video frames after the first video frame and the second video frame to replace the video frames after the second video frame; if the first video frame and the second video frame are non-adjacent video frames, for example, there is a fourth video frame between the first video frame and the second video frame, an interpolation method of inserting video frames between the first video frame and the second video frame may be adopted to replace the fourth video frame. It should be noted that when different interpolation methods are adopted, the playback order of the video frames is also different. For details, please refer to the description in the following embodiments, which will not be repeated here.
[0052] An embodiment of the present application provides a video playback method. When the displacement of a target object in a first video frame and a second video frame of a target video is large, since only the first video frame and the second video frame need to be decoded, and there is no need to decode the video frame with a smaller displacement of the target object, the CPU can be temporarily released from the task of processing the video, thereby reducing CPU power consumption and improving device system performance. In addition, by inserting a third video frame, the loss caused by not decoding the video frame with a smaller displacement of the target object can be compensated, thereby ensuring the playback quality of the video.
[0053] Optionally, the target video may include M groups of video frame data, each group of video frame data is data of N video frames. Specifically, each group of video frame data is data obtained after compressing N video frames. Wherein, M is a positive integer, and N is an integer greater than or equal to 2. Figure 2 ,like Figure 4 As shown, the above step 202 can be implemented by the following steps 202a and 202b, and the above step 203 can also include the following steps 204 and 205.
[0054] Step 202a: When the displacement data indicates that the displacement of the target object in the first video frame and the second video frame of the i-th group of video frame data is greater than or equal to a preset value, the electronic device decodes the i-th group of video frame data to obtain the first video frame and the second video frame.
[0055] In the embodiment of the present application, i is a positive integer less than or equal to M, and i takes values of 1, 2, ..., M in sequence.
[0056] Step 202b: The electronic device inserts the third video frame according to a preset rule.
[0057] Step 204: When the displacement data indicates that the displacement of the target object in the fifth video frame and the sixth video frame of the i+1th group of video frame data is greater than or equal to a preset value, decode the i+1th group of video frame data to obtain the fifth video frame and the sixth video frame, and insert the seventh video frame according to a preset rule.
[0058] Step 205: The electronic device plays the fifth video frame, the sixth video frame, and the seventh video frame.
[0059] For the specific implementation of step 204 and step 205, reference may be made to step 202 and step 203, which will not be described in detail here.
[0060] The following is an example in which the target video includes 10 groups of video frame data, and each group of video frame data is data obtained by compressing 5 frames of video, to exemplify the video playback method provided in the present application.
[0061] When the user wants to watch the target video, 5 frames of data of the first group of video frame data are stored in the video cache area, and the CPU detects these 5 frames of data. If it is detected that the displacement of the second frame data, the third frame data, and the fourth frame data of the first group of video frame data with the target object in the first frame data is less than the preset value, and the displacement of the target object in the fifth frame data with the first frame data is greater than or equal to the preset value, then the CPU only needs to decode the first frame data and the fifth frame data to obtain the first video frame and the fifth video frame, and send the displacement of the target object in the first video frame, the fifth video frame, the first video frame, and the fifth video frame to the independent display chip. Then, the independent display chip can perform interpolation processing on the displacement of the target object in the first video frame and the fifth video frame according to a certain algorithm and displacement ratio, and insert the second video frame, the third video frame, and the fourth video frame between the first video frame and the fifth video frame. In this way, the display screen can display the first video frame, the second video frame, the third video frame, the fourth video frame, and the fifth video frame in sequence.
[0062] After the display screen finishes playing the 5th video frame of the 1st group of video frame data, the CPU can be notified that the video interpolation and playback tasks have been completed. The CPU can continue to process the 5 frames of data of the 2nd group of video frame data stored in the video cache area. For example, if the CPU detects that the displacement of the target object in the 2nd frame data and the 1st frame data of the 2nd group of video frame data is greater than or equal to the preset value, the CPU does not need to detect and decode the 3rd frame data, the 4th frame data and the 5th frame data, but only needs to decode the 1st frame data and the 1st frame data to obtain the 1st video frame and the 2nd video frame, and send the displacement of the target object in the 1st video frame, the 2nd video frame, the 1st video frame and the 2nd video frame to the independent display chip. Then, the independent display chip can interpolate the displacement of the target object in the 1st video frame and the 2nd video frame according to a certain algorithm and displacement ratio according to the 1st video frame and the 2nd video frame, and insert the 3rd video frame, the 4th video frame and the 5th video frame after the 1st video frame and the 2nd video frame. In this way, the display screen can sequentially display the first video frame, the second video frame, the third video frame, the fourth video frame, and the fifth video frame.
[0063] After the display screen finishes playing the fifth video frame of the second group of video frame data, the CPU can be notified that the video frame insertion and playing tasks have been completed. In this way, the CPU can continue to process the remaining 8 groups of video frame data in the above manner until all frames are played.
[0064] The video playback method provided in the embodiment of the present application is applied to the scenario of video group processing. By dividing the target video into multiple groups of video frame data, the CPU can perform processing operations such as decompression on the video frames in batches, and after processing each group of video frame data, the CPU is temporarily released from the task of processing the video to process other routine tasks such as calls, text messages, emails, Bluetooth, etc., thereby further improving device performance.
[0065] Optionally, the present application provides two video frame insertion methods:
[0066] The first video frame insertion method
[0067] The first video frame and the second video frame are adjacent video frames, and a frame insertion method of inserting a video frame after the first video frame and the second video frame is adopted. The above step 202 can be implemented by the following steps A1 and A2. Correspondingly, the above step 203 can be implemented by the following step A3.
[0068] Step A1: When the displacement data indicates that the displacement of the target object in the first video frame and the second video frame of the target video is greater than or equal to a preset value, the electronic device decodes the video frame data to obtain the first video frame and the second video frame.
[0069] Step A2: The electronic device inserts a third video frame after the second video frame according to the displacement of the target object in the first video frame and the second video frame.
[0070] Optionally, the displacement of the target object in the third video frame and the second video frame is greater than or equal to a preset value. It can be understood that since the displacement of the target object in the first video frame and the second video frame of the target video is greater than or equal to the preset value, it is more likely that the target object will have a larger displacement in the video frame after the second video frame. Setting the displacement of the target object in the third video frame and the second video frame to be greater than or equal to the preset value can more accurately predict the movement trend of the target object in the video frame after the second video frame.
[0071] Step A3: The electronic device plays the first video frame, the second video frame and the third video frame in sequence.
[0072] An optional implementation method is that after the electronic device decodes the video frame data to obtain the first video frame and the second video frame, the first video frame and the second video frame are played immediately; during the process of playing the first video frame and the second video frame, a third video frame is inserted after the second video frame according to the displacement of the target object in the first video frame and the second video frame, so that the third video frame is played after the second video frame is played.
[0073] Another optional implementation is that after the electronic device decodes the video frame data to obtain the first video frame and the second video frame, the third video frame is inserted after the second video frame according to the displacement of the target object in the first video frame and the second video frame, and then the first video frame, the second video frame and the third video frame are played.
[0074] For example, the target video includes 10 sets of video frame data, and each set of video frame data is the data obtained by compressing 5 frames of video. Assume that the preset value is 3 pixels. Figure 5 As shown, the CPU can detect 5 frames of data of the first group of video frame data stored in the video cache area. If the CPU detects that the displacement of the target object in the second frame data of the first group of video frame data and the first frame data is 5 pixels, the CPU does not need to detect and decode other frame data, but only needs to decode the first frame data and the second frame data to obtain the first video frame and the second video frame, and send the first video frame, the second video frame, the displacement of the target object in the first video frame and the second video frame to the independent graphics chip to notify the independent graphics chip to perform video playback and frame insertion processing. In this way, the CPU can release the video playback task to handle other things such as calls, text messages, emails, Bluetooth, etc.
[0075] After the independent display chip receives the first video frame and the second video frame, it can directly display the first video frame and the second video frame. At the same time, the independent display chip can perform interpolation processing on the displacement of the target objects in the first video frame and the second video frame according to a certain algorithm and displacement ratio. For example, the target object in the second video frame is further displaced by 5 pixels to obtain the third video frame, and then the target object in the third video frame is further displaced by 5 pixels to obtain the fourth video frame, and then the target object in the fourth video frame is further displaced by 5 pixels to obtain the fifth video frame. In this way, after the second video frame is played, the display screen can continue to play the third video frame, the fourth video frame, and the fifth video frame.
[0076] The video playback method provided in the embodiment of the present application is applied to a scenario in which a large displacement of the target object in the first two video frames is detected. Based on the displacement of the target object in these two video frames, the displacement trend of the target object after these two frames can be estimated. Therefore, a video frame can be inserted after the adjacent video frame, so that the CPU does not need to decode the video frame after two video frames, and the CPU is temporarily released from the task of processing the video to process other routine tasks such as calls, text messages, emails, Bluetooth, etc.
[0077] The second video frame insertion method
[0078] The first video frame and the second video frame are non-adjacent video frames, and a frame insertion method of inserting a video frame between the first video frame and the second video frame is adopted. The above step 202 can be implemented by the following steps B1 and B2. Correspondingly, the above step 203 can be implemented by the following step B3.
[0079] Step B1: When the displacement data indicates that the displacement of the target object in the first video frame and the second video frame of the target video is greater than or equal to a preset value, and the displacement of the target object in the first video frame and the fourth video frame is less than the preset value, the electronic device decodes the video frame data to obtain the first video frame and the second video frame.
[0080] Step B2: The electronic device inserts a third video frame between the first video frame and the second video frame according to the displacement of the target object in the first video frame and the second video frame.
[0081] Optionally, the displacement of the target object in the first video frame and the third video frame is less than a preset value. It is understandable that, since the displacement of the target object in the first video frame and the fourth video frame is less than the preset value, the third video frame is used as a replacement frame for the fourth video frame, and if the displacement of the target object in the third video frame and the first video frame is less than the preset value, the position vector of the target object in the fourth video frame is more accurate.
[0082] Step B3: The electronic device plays the first video frame, the third video frame and the second video frame in sequence.
[0083] An optional implementation is that after the electronic device decodes the video frame data to obtain the first video frame and the second video frame, the first video frame is played immediately; during the process of playing the first video frame, a third video frame is inserted between the first video frame and the second video frame according to the displacement of the target object in the first video frame and the second video frame, so that after the first video frame is played, the third video frame is played, and then the second video frame is played.
[0084] Another optional implementation method is, after the electronic device decodes the video frame data to obtain the first video frame and the second video frame, insert a third video frame between the first video frame and the second video frame according to the displacement of the target object in the first video frame and the second video frame, and then play the first video frame, the third video frame and the second video frame in sequence.
[0085] For example, the target video includes 10 sets of video frame data, and each set of video frame data is the data obtained by compressing 5 frames of video. Assume that the preset value is 4 pixels. Figure 6 As shown, the CPU can detect 5 frames of data of the first group of video frame data stored in the video cache area. If the CPU detects that the displacement of the target object in the first frame data and the second frame data, the third frame data, and the fourth frame data of the first group of video frame data is less than 4 pixels, and the displacement of the target object in the first frame data and the fifth frame data is 4 pixels, then the CPU does not need to decode the second frame data, the third frame data, and the fourth frame data, but only needs to decode the first frame data and the fifth frame data to obtain the first video frame and the fifth video frame, and send the displacement of the target object in the first video frame, the fifth video frame, the first video frame, and the fifth video frame to the independent graphics chip to notify the independent graphics chip to perform video playback and frame insertion processing. In this way, the CPU can release the video playback task to handle other things such as calls, text messages, emails, Bluetooth, etc.
[0086] After the independent display chip receives the first video frame and the fifth video frame, the first video frame can be directly displayed. At the same time, the independent display chip can perform interpolation processing on the displacement of the target objects in the first video frame and the fifth video frame according to a certain algorithm and displacement ratio. For example, based on the first video frame, the target object in the first video frame is further displaced by 1 pixel to obtain the second video frame, and then the target object in the second video frame is further displaced by 1 pixel to obtain the third video frame, and then the target object in the third video frame is further displaced by 1 pixel to obtain the fourth video frame. In this way, after the first video frame is played, the display screen can continue to play the second video frame, the third video frame, the fourth video frame, and the fifth video frame in sequence.
[0087] The video playback method provided in the embodiment of the present application is applied to a scenario in which a large displacement of a target object is detected in an interval of video frames. Based on the displacement of the target object in the two video frames, the displacement trend of the target object between the two frames can be estimated. Therefore, a video frame can be inserted between the two video frames, so that the CPU does not need to decode the video frames between the two video frames, and the CPU is temporarily released from the task of processing the video to process other routine tasks such as calls, text messages, emails, Bluetooth, etc.
[0088] It should be noted that the video playback method provided in the embodiment of the present application can be executed by a video playback device or a control module in the video playback device for executing the video playback method. In the embodiment of the present application, the video playback device provided in the embodiment of the present application is described by taking the video playback device executing the video playback method as an example.
[0089] like Figure 7 As shown, the embodiment of the present application provides a video playback device 700. The video playback device 700 includes an acquisition module 701, a first processing module 702, a second processing module 703 and a playback module 704.
[0090] The acquisition module 701 can be used to acquire the video frame data of the target video and the displacement data of the target object in the video frame. The first processing module 702 can be used to decode the video frame data to obtain the first video frame and the second video frame when the displacement data indicates that the displacement of the target object in the first video frame and the second video frame of the target video is greater than or equal to a preset value. The second processing module 703 can be used to insert the third video frame according to a preset rule. The playback module 704 can be used to play the first video frame, the second video frame, and the third video frame.
[0091] Optionally, the first video frame and the second video frame are adjacent video frames. The second processing module 703 can be specifically configured to insert a third video frame after the second video frame according to the displacement of the target object in the first video frame and the second video frame. The playing module 704 can be specifically configured to play the first video frame, the second video frame, and the third video frame in sequence.
[0092] Optionally, there is a fourth video frame between the first video frame and the second video frame. The first processing module 702 can be specifically used to decode the video frame data to obtain the first video frame and the second video frame when the displacement data indicates that the displacement of the target object in the first video frame and the second video frame is greater than or equal to a preset value, and the displacement of the target object in the first video frame and the fourth video frame is less than a preset value. The second processing module 703 can be specifically used to insert a third video frame between the first video frame and the second video frame according to the displacement of the target object in the first video frame and the second video frame. The playback module 704 can be specifically used to play the first video frame, the third video frame and the second video frame in sequence.
[0093] Optionally, the first processing module 702 may be specifically configured to determine, based on the displacement data, that the displacement of the target object in the first video frame and the second video frame is greater than or equal to a preset value; and decode the video frame data to obtain the first video frame and the second video frame; and send the first video frame, the second video frame, and the displacement of the target object in the first video frame and the second video frame to the second processing module 703. The second processing module 703 may be specifically configured to obtain a third video frame based on the first video frame, the second video frame, and the displacement of the target object in the first video frame and the second video frame.
[0094] Optionally, the target video includes M groups of video frame data, each group of video frame data is data of N video frames, M is a positive integer, and N is an integer greater than or equal to 2. The first processing module 702 can be specifically configured to decode the i-th group of video frame data to obtain the first video frame and the second video frame when the displacement data indicates that the displacement of the target object in the first video frame and the second video frame of the i-th group of video frame data is greater than or equal to a preset value, where i is a positive integer less than or equal to M.
[0095] The first processing module 702 can also be used to decode the i+1th group of video frame data to obtain the fifth video frame and the sixth video frame after playing the first video frame, the second video frame and the third video frame, when the displacement data indicates that the displacement of the target object in the fifth video frame and the sixth video frame of the i+1th group of video frame data is greater than or equal to a preset value.
[0096] The second processing module 703 may also be configured to insert the seventh video frame according to a preset rule.
[0097] The playing module 704 may also be used to play the fifth video frame, the sixth video frame and the seventh video frame.
[0098] An embodiment of the present application provides a video playback device. When the displacement of a target object in a first video frame and a second video frame of a target video is large, since the device only needs to decode the first video frame and the second video frame without decoding the video frame with a smaller displacement of the target object, the CPU can be temporarily released from the task of processing the video, thereby reducing CPU power consumption and improving device system performance. In addition, by inserting a third video frame, the loss caused by not decoding the video frame with a smaller displacement of the target object can be compensated, thereby ensuring the playback quality of the video.
[0099] The video playback device in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in 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, an in-vehicle electronic device, 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., and the non-mobile electronic device can 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.
[0100] 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.
[0101] The video playback device provided in the embodiment of the present application can achieve Figures 1 to 6 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0102] Alternatively, if Figure 8 As shown, an embodiment of the present application also provides an electronic device 800, including a processor 801, a memory 802, and a program or instruction stored in the memory 802 and executable on the processor 801. When the program or instruction is executed by the processor 801, 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.
[0103] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
[0104] Fig. 9 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.
[0105] The electronic device 100 includes but is not limited to components such as a radio frequency unit 101, a network module 102, an audio output unit 103, an input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, and a processor 110.
[0106] Those skilled in the art will appreciate that the electronic device 100 may also include a power source (such as a battery) for supplying power to various components, and the power source may be logically connected to the processor 110 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Fig. 9 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.
[0107] Among them, the processor 110 can be used to obtain video frame data of the target video and displacement data of the target object in the video frame, and when the displacement data indicates that the displacement of the target object in the first video frame and the second video frame of the target video is greater than or equal to a preset value, decode the video frame data to obtain the first video frame and the second video frame.
[0108] The independent display chip 1061 can be used to insert the third video frame according to a preset rule.
[0109] The display panel 1062 may be used to play the first video frame, the second video frame, and the third video frame.
[0110] Optionally, the first video frame and the second video frame are adjacent video frames. The independent display chip 1061 can be specifically used to insert the third video frame after the second video frame according to the displacement of the target object in the first video frame and the second video frame. The display panel 1062 can be specifically used to play the first video frame, the second video frame and the third video frame in sequence.
[0111] Optionally, there is a fourth video frame between the first video frame and the second video frame. The processor 110 can be specifically used to decode the video frame data to obtain the first video frame and the second video frame when the displacement data indicates that the displacement of the target object in the first video frame and the second video frame is greater than or equal to a preset value, and the displacement of the target object in the first video frame and the fourth video frame is less than a preset value. The independent display chip 1061 can be specifically used to insert a third video frame between the first video frame and the second video frame according to the displacement of the target object in the first video frame and the second video frame. The display panel 1062 can be specifically used to play the first video frame, the third video frame and the second video frame in sequence.
[0112] Optionally, the processor 110 may be specifically configured to determine, based on the displacement data, that the displacement of the target object in the first video frame and the second video frame is greater than or equal to a preset value; and decode the video frame data to obtain the first video frame and the second video frame; and send the first video frame, the second video frame, and the displacement of the target object in the first video frame and the second video frame to the independent display chip 1061. The independent display chip 1061 may be specifically configured to obtain a third video frame based on the first video frame, the second video frame, and the displacement of the target object in the first video frame and the second video frame.
[0113] Optionally, the target video includes M groups of video frame data, each group of video frame data is data of N video frames, M is a positive integer, and N is an integer greater than or equal to 2. The processor 110 may be specifically configured to decode the i-th group of video frame data to obtain the first video frame and the second video frame when the displacement data indicates that the displacement of the target object in the first video frame and the second video frame of the i-th group of video frame data is greater than or equal to a preset value, where i is a positive integer less than or equal to M.
[0114] The processor 110 can also be used to decode the i+1th group of video frame data to obtain the fifth video frame and the sixth video frame after playing the first video frame, the second video frame and the third video frame, when the displacement data indicates that the displacement of the target object in the fifth video frame and the sixth video frame of the i+1th group of video frame data is greater than or equal to a preset value.
[0115] The independent display chip 1061 can also be used to insert the seventh video frame according to preset rules.
[0116] The display panel 1062 may also be used to play the fifth video frame, the sixth video frame, and the seventh video frame.
[0117] An embodiment of the present application provides an electronic device. When the displacement of a target object in a first video frame and a second video frame of a target video is large, the device only needs to decode the first video frame and the second video frame without decoding the video frame with a smaller displacement of the target object. Therefore, the CPU can be temporarily released from the task of processing the video, thereby reducing CPU power consumption and improving device system performance. In addition, by inserting a third video frame, the loss caused by not decoding the video frame with a smaller displacement of the target object can be compensated, thereby ensuring the video playback quality.
[0118] It should be understood that in the embodiment of the present application, the input unit 104 may include a graphics processing unit (GPU) 1041 and a microphone 1042, and the graphics processor 1041 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 106 may include a separate display chip 1061 and a display panel 1062, and the display panel 1062 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 107 includes a touch panel 1071 and other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include two parts: a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here. The memory 109 may be used to store software programs and various data, including but not limited to applications and operating systems. The processor 110 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 110.
[0119] 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.
[0120] 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.
[0121] 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.
[0122] 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.
[0123] 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.
[0124] 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, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0125] 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, characterized in that: The method comprises: Acquire video frame data of a target video and displacement data of a target object in the video frame, wherein the displacement data is data obtained after analyzing the target object in the video frame of the target video during recording of the target video; When the displacement data indicates that the displacement of the target object in the first video frame and the second video frame of the target video is greater than or equal to a preset value, decoding the video frame data to obtain the first video frame and the second video frame, and inserting a third video frame according to a preset rule; Play the first video frame, the second video frame and the third video frame; Wherein, in the case where the target video includes M groups of video frame data, each group of video frame data is data of N video frames, if the first video frame and the second video frame are two video frames in the i-th group of video frames, the displacement data of which is greater than or equal to a preset value, then the third video frame is N-2 video frames, M is a positive integer, N is an integer greater than 2, and i is a positive integer less than or equal to M; The decoding of the video frame data to obtain the first video frame and the second video frame, when the displacement data indicates that the displacement of the target object in the first video frame and the second video frame of the target video is greater than or equal to a preset value, comprises: The central processing unit determines, based on the displacement data, that the displacement of the target object in the first video frame and the second video frame is greater than or equal to a preset value; The central processing unit decodes the video frame data to obtain the first video frame and the second video frame.
2. The method according to claim 1, characterized in that The first video frame and the second video frame are adjacent video frames; The inserting the third video frame according to a preset rule includes: inserting the third video frame after the second video frame according to the displacement of the target object in the first video frame and the second video frame; The playing of the first video frame, the second video frame, and the third video frame includes: The first video frame, the second video frame and the third video frame are played in sequence.
3. The method according to claim 1, characterized in that There is a fourth video frame between the first video frame and the second video frame; The method comprises: decoding the video frame data to obtain the first video frame and the second video frame, and inserting the third video frame according to a preset rule, when the displacement data indicates that the displacement of the target object in the first video frame and the second video frame of the target video is greater than or equal to a preset value. When the displacement data indicates that the displacement of the target object in the first video frame and the second video frame is greater than or equal to a preset value, and the displacement of the target object in the first video frame and the fourth video frame is less than a preset value, decoding the video frame data to obtain the first video frame and the second video frame, and inserting the third video frame between the first video frame and the second video frame according to the displacement of the target object in the first video frame and the second video frame; The playing of the first video frame, the second video frame, and the third video frame includes: The first video frame, the third video frame and the second video frame are played in sequence.
4. The method according to any one of claims 1 to 3, characterized in that After the central processor decodes the video frame data to obtain the first video frame and the second video frame, the method further includes: The central processor sends the first video frame, the second video frame, and the displacement of the target object in the first video frame and the second video frame to the independent graphics chip; The inserting the third video frame according to a preset rule includes: The independent display chip obtains the third video frame according to the first video frame, the second video frame, and the displacement of the target object in the first video frame and the second video frame.
5. The method according to any one of claims 1 to 3, characterized in that The target video includes M groups of video frame data, each group of video frame data is data of N video frames, M is a positive integer, and N is an integer greater than 2; The decoding of the video frame data to obtain the first video frame and the second video frame, when the displacement data indicates that the displacement of the target object in the first video frame and the second video frame of the target video is greater than or equal to a preset value, comprises: When the displacement data indicates that the displacement of the target object in the first video frame and the second video frame of the i-th group of video frame data is greater than or equal to a preset value, decoding the i-th group of video frame data to obtain the first video frame and the second video frame, where i is a positive integer less than or equal to M; After playing the first video frame, the second video frame, and the third video frame, the method further includes: In a case where the displacement data indicates that the displacement of the target object in the fifth video frame and the sixth video frame of the (i+1)th group of video frame data is greater than or equal to a preset value, decoding the (i+1)th group of video frame data to obtain the fifth video frame and the sixth video frame, and inserting the seventh video frame according to a preset rule; The fifth video frame, the sixth video frame and the seventh video frame are played.
6. A video playback device, characterized in that: The device comprises an acquisition module, a first processing module, a second processing module and a playback module; The acquisition module is used to acquire video frame data of a target video and displacement data of a target object in the video frame, wherein the displacement data is data obtained after analyzing the target object in the video frame of the target video during the process of recording the target video; The first processing module is configured to decode the video frame data to obtain the first video frame and the second video frame when the displacement data indicates that the displacement of the target object in the first video frame and the second video frame of the target video is greater than or equal to a preset value; The second processing module is used to insert the third video frame according to a preset rule; The playing module is used to play the first video frame, the second video frame and the third video frame; Wherein, in the case where the target video includes M groups of video frame data, each group of video frame data is data of N video frames, if the first video frame and the second video frame are two video frames in the i-th group of video frames, the displacement data of which is greater than or equal to a preset value, then the third video frame is N-2 video frames, M is a positive integer, N is an integer greater than 2, and i is a positive integer less than or equal to M; The first processing module is specifically used to determine, based on the displacement data, that the displacement of the target object in the first video frame and the second video frame is greater than or equal to a preset value; and decode the video frame data to obtain the first video frame and the second video frame.
7. The device according to claim 6, characterized in that The first video frame and the second video frame are adjacent video frames; The second processing module is specifically configured to insert the third video frame after the second video frame according to the displacement of the target object in the first video frame and the second video frame; The playback module is specifically configured to sequentially play the first video frame, the second video frame, and the third video frame.
8. The device according to claim 6, characterized in that There is a fourth video frame between the first video frame and the second video frame; The first processing module is specifically configured to decode the video frame data to obtain the first video frame and the second video frame when the displacement data indicates that the displacement of the target object in the first video frame and the second video frame is greater than or equal to a preset value, and the displacement of the target object in the first video frame and the fourth video frame is less than a preset value; The second processing module is specifically configured to insert the third video frame between the first video frame and the second video frame according to the displacement of the target object in the first video frame and the second video frame; The playback module is specifically configured to sequentially play the first video frame, the third video frame, and the second video frame.
9. The device according to any one of claims 6 to 8, characterized in that The first processing module is further configured to send the first video frame, the second video frame, and the displacement of the target object in the first video frame and the second video frame to the second processing module after decoding the video frame data to obtain the first video frame and the second video frame; The second processing module is specifically configured to obtain the third video frame according to the first video frame, the second video frame, and the displacement of the target object in the first video frame and the second video frame.
10. The device according to any one of claims 6 to 8, characterized in that The target video includes M groups of video frame data, each group of video frame data is data of N video frames, M is a positive integer, and N is an integer greater than 2; The first processing module is specifically configured to decode the i-th group of video frame data to obtain the first video frame and the second video frame when the displacement data indicates that the displacement of the target object in the first video frame and the second video frame of the i-th group of video frame data is greater than or equal to a preset value, where i is a positive integer less than or equal to M; The first processing module is further configured to, after playing the first video frame, the second video frame and the third video frame, decode the (i+1)th group of video frame data to obtain the fifth video frame and the sixth video frame if the displacement data indicates that the displacement of the target object in the fifth video frame and the sixth video frame of the (i+1)th group of video frame data is greater than or equal to a preset value; The second processing module is further used to insert the seventh video frame according to a preset rule; The playing module is further used to play the fifth video frame, the sixth video frame and the seventh video frame.
11. An electronic device, characterized in that: The method comprises a processor, a memory and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the video playback method as claimed in any one of claims 1 to 5.
12. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the video playback method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Image frame prediction method and device as well as avatar display equipment
CN109672886A
Video file playing method and related equipment
CN110996170A
Method and apparatus for decoding subscreen in portable terminal
US20080101463A1