Playback device and video playback method

By determining the frame number and extraction quantity of image groups during reverse video playback, and extracting and decoding only key frames, the stuttering and screen tearing issues in reverse video playback are resolved, achieving a highly efficient video playback effect.

CN115767180BActive Publication Date: 2026-06-02VIDAA INT HLDG (NETHERLANDS) CO

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
VIDAA INT HLDG (NETHERLANDS) CO
Filing Date
2022-11-16
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing videos suffer from stuttering, trailing, or screen tearing when played in reverse order, especially when played at double speed due to insufficient decoding speed, resulting in low playback efficiency.

Method used

By acquiring image groups of target video data, determining the number of frames and the number of frames to be extracted, extracting and decoding only key frames and necessary frames, playing them in reverse order of the video frame display order, and canceling transcoding processing, parallel decoding and playback of frames are achieved.

Benefits of technology

It improves the smoothness and decoding efficiency of reverse video playback, reduces the decoding computation load, avoids inefficiency caused by transcoding time, and enhances playback continuity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115767180B_ABST
    Figure CN115767180B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a playing device and a video playback method. The video playback method comprises the following steps: acquiring an image group in target video data, wherein the image group comprises a key frame; in response to a playback instruction for the target video data, determining the frame number of the image group, wherein the playback instruction comprises a playback speed; determining the extraction number and the extraction frame number of a target frame in the image group according to the playback speed and the determined frame number of the image group, wherein the target frame at least comprises the key frame in the image group; extracting the target frame in the target video data according to the determined extraction number and the extraction frame number; and decoding and playing the extracted target frame in the reverse order of the video frame display sequence in the target video data. The application can greatly improve the decoding utilization rate of the target video data and the fluency of the playback process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of video playback technology, and in particular to a playback device and a video rewinding method. Background Technology

[0002] As an important, intuitive, and rich medium for information transmission, multimedia is increasingly involved in the lives, work, and entertainment of the general public. To enhance the enjoyment of video playback and provide more efficient and flexible playback methods for scenarios such as online learning and video replay, functions such as reverse playback and speed-up playback have emerged.

[0003] Currently, when playing videos in reverse order, decoding and playback are typically performed sequentially in segments. This means the entire video is processed in segments from back to front, each frame in each segment is decoded, and then the decoded frames are played in reverse order. Therefore, the quality of reverse playback largely depends on the decoding speed. In particular, if playback at double speed is required during reverse playback, even higher decoding speeds are needed. Low decoding speeds can lead to various problems such as stuttering, ghosting, or screen tearing during playback.

[0004] To ensure smooth playback of videos in reverse order, pre-processing transcoding can be performed before decoding. Transcoding pre-processing primarily involves converting all P-frames and B-frames in the video into I-frames (keyframes), directly transcoding P-frames and B-frames to other simpler encoding types, or reducing the interval between I-frames in the video, thereby reducing stuttering during reverse playback.

[0005] However, transcoding preprocessing is time-consuming, and the transcoded video needs to be skipped before each decoding to achieve reverse playback, which increases the computational load of the system. Summary of the Invention

[0006] This application provides a playback device and a video rewind method to solve problems such as stuttering, trailing, or screen tearing that occur during video rewinding in traditional playback devices.

[0007] In a first aspect, this application provides a playback device, including: a display configured to display target video data;

[0008] A controller, communicatively connected to the display, is configured to: acquire an image group from target video data, the image group including keyframes; determine the frame number of the image group in response to a reverse playback command for the target video data, the reverse playback command including a reverse playback speed; determine the number of target frames to be extracted and the extracted frame number from the image group based on the reverse playback speed and the determined frame number of the image group, the target frames including at least the keyframes in the image group; extract the target frames from the target video data based on the determined number of extractions and the extracted frame number; and decode and play the extracted target frames in reverse order of the display order of the video frames in the target video data.

[0009] In some embodiments, the controller is further configured to: search for keyframes of the image group in response to the received rewind speed based on the target video data; determine the duration and frame rate of the image group based on the keyframes; and multiply the duration and the frame rate to obtain the number of frames of the image group.

[0010] In some embodiments, the controller is further configured to: determine the video frame corresponding to the current moment in the target video data, and the last frame in all image groups before the current image group as the tail frame of the corresponding image group; and search for key frames of the current image group frame by frame forward, starting from the tail frame of the current image group, in reverse order of the display order of the video frames in the target video data, and search for key frames in each adjacent image group frame by frame, starting from the tail frame of the adjacent image group before the current image group.

[0011] In some embodiments, the controller is further configured to: acquire the display timestamp (PTS) of the video frame corresponding to the current moment in the target video data, and determine the video frame corresponding to the current moment and the last frame of all image groups before the current image group as the tail frame of the corresponding image group; search for key frames of the current image group frame by frame forward starting from the tail frame of the current image group; for adjacent image groups before the current image group, search sequentially starting from the tail frame of the image group, and determine the video frame corresponding to the playback speed at half the reverse speed as the intermediate frame; using the intermediate frame as a node, search for key frames of each image group before the image group where the intermediate frame is located along the direction of decreasing PTS, or search for key frames of each image group before and after the image group where the intermediate frame is located along the directions of decreasing and increasing PTS respectively.

[0012] In some embodiments, the extraction quantity includes a pre-extraction quantity n and an actual extraction quantity N; the controller is further configured to: calculate the ratio m of the number of frames corresponding to each image group to the reverse playback speed; and determine the pre-extraction quantity n of the target frame in each image group based on the ratio m.

[0013] In some embodiments, the controller is further configured to: when m≥1 and m is an integer, n=m; when m>1 and m is a non-integer, n=m0+1, where m0 is the integer part of m; when m<1, determine whether the current image group is the first image group in the target video data; if yes, then n=1; if no, update m according to the frame number of the current image group and at least one preceding adjacent image group and the ratio to the reverse playback speed, and redetermine the pre-extraction quantity n of the target frame in each image group according to the updated ratio m.

[0014] In some embodiments, the controller is further configured to: when the number of pre-extracted target frames n ≤ 1 in any image group, the actual number of extracted target frames N = 1 in the image group, and determine the keyframe in each image group as the target frame; determine the extracted frame number of the target frame according to the reverse order of the display order of video frames in the target video data.

[0015] In some embodiments, the image group further includes non-keyframes, and the controller is further configured to: when the pre-extraction number n of the target frame in any image group is greater than 1, determine the actual extraction number N of the target frame in the image group according to the type of the last non-keyframe in the adjacent n-1 frames after the keyframe in the image group, wherein the actual extraction number N is not less than the pre-extraction number n; determine the extraction frame number of the target frame according to the reverse order of the display order of the video frames in the target video data and the determined actual extraction number N.

[0016] In some embodiments, the controller is further configured to: after decoding the target frame, wait for a preset buffer duration before playing the decoded target frame.

[0017] Secondly, this application also provides a video rewinding method, comprising the following steps: acquiring an image group from target video data, the image group including keyframes; in response to a rewinding instruction for the target video data, determining the number of frames in the image group, the rewinding instruction including a rewinding speed; determining the number of target frames to be extracted and the extracted frame number from the image group based on the rewinding speed and the determined number of frames in the image group, the target frame including at least the keyframes in the image group; extracting the target frames from the target video data based on the determined number of extractions and the extracted frame number; and decoding and playing the extracted target frames in reverse order of the display order of video frames in the target video data.

[0018] Thirdly, this application also provides a computer-readable storage medium storing a computer program that, when executed by a controller in a playback device, can implement some or all of the steps of the video rewind method provided in this application.

[0019] Fourthly, this application also provides a computer program product, which includes a computer program that, when executed by a controller in a playback device, can implement some or all of the steps of the video rewind method provided in this application.

[0020] The technical solution provided in this application can achieve at least the following beneficial effects:

[0021] The playback device provided in this application can determine the number and frame number of target frames extracted from an image group based on the relationship between the reverse playback speed and the frame number of the image group. Then, it decodes and plays the determined target frames according to the reverse order of the video frames in the target video data. This approach, on the one hand, completely eliminates the transcoding process for the target video data, thus avoiding the problem of low efficiency in reverse playback caused by long transcoding times. On the other hand, since only target frames in the image group are extracted and decoded, the computational load of decoding is greatly reduced compared to existing technologies, improving decoding efficiency. Furthermore, given the limitation on the number of target frames extracted, the entire frame extraction process is very short, thus effectively allowing decoding and playback of the target video data to proceed in parallel, greatly reducing the impact of decoding speed limitations on playback efficiency. In addition, for non-target frames in the target video data that are not extracted, there is no need to decode them, which greatly improves the decoding utilization rate of the target video data and the smoothness of the playback process. Attached Figure Description

[0022] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a schematic diagram illustrating an operational scenario between a playback device and a control device, as shown in an exemplary embodiment of this application.

[0024] Figure 2 This is a hardware configuration block diagram of a playback device illustrated in an exemplary embodiment of this application;

[0025] Figure 3 This is a schematic diagram illustrating the principle of a prior art video rewinding method according to an exemplary embodiment of this application;

[0026] Figure 4 This is a schematic diagram illustrating a target video data decoding process in the prior art, as shown in an exemplary embodiment of this application;

[0027] Figure 5 This is a flowchart illustrating a video rewinding method according to an exemplary embodiment of this application;

[0028] Figure 6 This is a flowchart illustrating yet another video rewinding method according to an exemplary embodiment of this application;

[0029] Figure 7 This is a schematic flowchart illustrating another video rewinding method according to an exemplary embodiment of this application;

[0030] Figure 8 This is a schematic diagram illustrating a target frame extraction frame number and extraction quantity according to an exemplary embodiment of this application;

[0031] Figure 9 This is a schematic diagram illustrating another target frame extraction frame number and extraction quantity, as shown in an exemplary embodiment of this application;

[0032] Figure 10 This is a schematic diagram illustrating another target frame extraction frame number and extraction quantity, as shown in an exemplary embodiment of this application;

[0033] Figure 11 This is a schematic diagram illustrating another target frame extraction frame number and extraction quantity, as shown in an exemplary embodiment of this application;

[0034] Figure 12 This is a schematic diagram illustrating another target frame extraction frame number and extraction quantity, as shown in an exemplary embodiment of this application;

[0035] Figure 13This is a schematic diagram illustrating another target video data decoding process in an exemplary embodiment of this application. Detailed Implementation

[0036] To make the objectives and implementation methods of this application clearer, the exemplary implementation methods of this application will be clearly and completely described below with reference to the accompanying drawings of the exemplary embodiments of this application. Obviously, the exemplary embodiments described are only some embodiments of this application, and not all embodiments.

[0037] Before explaining the playback device and multimedia resource playback method provided in this application, the implementation environment of the embodiments of this application will be introduced first.

[0038] See Figure 1 In the interaction scenario between the playback device and the control device, the user can operate the playback device 200 through the terminal device 300 or the control device 100.

[0039] The playback device 200 can take many forms, such as a television, a smart television, a computer, a laser projection device, a monitor, an electronic bulletin board, an electronic table, etc.

[0040] In some embodiments, the control device 100 may be a remote control. Communication between the remote control and the playback device includes infrared protocol communication, Bluetooth protocol communication, and other short-range communication methods, controlling the playback device 200 wirelessly or via wired means. Users can input user commands through buttons on the remote control, voice input, control panel input, etc., to control the playback device 200.

[0041] In some embodiments, a terminal device 300 (such as a mobile terminal, tablet computer, computer, laptop computer, etc.) may be used to control the playback device 200. For example, an application running on the terminal device 300 may be used to control the playback device 200.

[0042] In some embodiments, the playback device 200 may also be controlled by the user via touch or gestures.

[0043] In some embodiments, the playback device 200 can also be controlled in ways other than the control device 100 and the terminal device 300. For example, it can directly receive the user's voice commands through a module configured inside the playback device 200 that acquires voice commands, or it can receive the user's voice commands through a voice control device set outside the playback device 200.

[0044] In some embodiments, the playback device 200 can also communicate with the server 400 via data. The playback device 200 can communicate via a local area network (LAN), wireless local area network (WLAN), or other networks. The server 400 can provide the playback device 200 with various display and interactive content.

[0045] As an example, server 400 can be a standalone server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.

[0046] Based on the above embodiments, Figure 2 A hardware configuration block diagram of the playback device 200 described above is shown. The playback device 200 includes at least one of the following: a tuner / demodulator 210, a communicator 220, a detector 230, an external device interface 240, a controller 250, a display 260, an audio output interface 270, a memory 280, a power supply, and a user interface.

[0047] In some embodiments, the tuner 210 receives broadcast television signals via wired or wireless reception and demodulates audio and video signals from multiple wireless or wired broadcast television signals. For example, Electronic Program Guide (EPG) data signals.

[0048] In some embodiments, the communicator 220 is a component for communicating with external devices or the server 400 according to various communication protocol types. For example, the communicator may include at least one of a Wi-Fi module, a Bluetooth module, a wired Ethernet module, other network communication protocol chips or near-field communication protocol chips, and an infrared receiver.

[0049] Specifically, the playback device 200 can establish the transmission and reception of control signals and data signals with the external control device 100 or the server 400 through the communicator 220.

[0050] In some embodiments, detector 230 is used to acquire signals from the external environment or to interact with the outside world. For example, detector 230 includes a light receiver, a sensor for acquiring ambient light intensity; or, detector 230 includes an image acquisition device, such as a camera, which can be used to acquire external environmental scenes, user attributes, or user interaction gestures; or, detector 230 includes a sound acquisition device, such as a microphone, for receiving external sounds.

[0051] In some embodiments, the external device interface 240 may include, but is not limited to, one or more of the following: High Definition Multimedia Interface (HDMI), analog or high-definition component input interface (component), Composite Video Broadcast Signal (CVBS), Universal Serial Bus (USB) input interface, RGB port, etc. It may also be a composite input / output interface formed by multiple of the above interfaces.

[0052] In this embodiment, the external device interface 240 is used to connect to an external device so that the playback device can obtain multimedia resources from the external resource database in the external device.

[0053] In some embodiments, the controller 250 includes at least one of a central processing unit (CPU), a video processor, an audio processor, a graphics processing unit (GPU), a RAM (RandomAccess Memory), a ROM (Read-Only Memory), a first to an nth interface for input / output, a communication bus, etc.

[0054] In practice, the controller 250 controls the operation of the playback device 200 and responds to user operations through various software control programs stored in the memory 280. The controller 250 controls the overall operation of the playback device 200. For example, in response to receiving a user command to select a UI object to display on the display 260, the controller 250 can execute operations related to the object selected by the user command.

[0055] In addition, in this embodiment, the memory 280 is also used to store a local resource database so that the controller 250 can obtain multimedia resources from the local resource database in the memory 280 when implementing the multimedia resource playback method provided in this application.

[0056] It should be noted that the controller 250 and the tuner 210 can be located in different separate devices. That is, the tuner 210 can also be located in an external device of the main device where the controller 250 is located, such as an external set-top box.

[0057] In some embodiments, the display 260 includes a display screen component for presenting images, a driving component for driving image display, a component for receiving image signals output by the controller 250, and a user control UI interface for displaying video content, image content, menu control interface, and user control UI interface.

[0058] As an example, the display 260 may be a liquid crystal display, an OLED display, or a projection display, and may also be a projection device and a projection screen.

[0059] Users can input commands through a graphical user interface (GUI) displayed on the monitor 260, and the user input interface receives the user input commands through the graphical user interface (GUI). Alternatively, users can input commands by entering specific sounds or gestures, and the user interface receives the user input commands by recognizing the sounds or gestures through sensors.

[0060] The "user interface" is the medium through which an application or operating system interacts and exchanges information with the user. It converts the internal form of information into a form that the user can accept. For example, the user interface can be an icon, window, control, or other interface element displayed on the screen of the playback device 200. The control can include visual interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and widgets.

[0061] After introducing the control and interaction scenarios and specific hardware structure of the playback device, the following section explains some concepts involved in this application.

[0062] A Group of Pictures (GOP) is a sequence of consecutive images in a video coding queue. A GOP contains a number of video frames, specifically a sequence of video frames that start with a keyframe and end with the frame preceding the next keyframe. The first frame of the GOP is the keyframe. In MPEG coding, frames are divided into three types: I, P, and B. I stands for Internally Copied Frame, P for Forward Predicted Frame, and B for Bidirectional Interpolated Frame. Simply put, an I-frame is a keyframe and can be understood as a complete image, while P and B frames are non-keyframes that record changes relative to I-frames. A P-frame represents the difference from the previous frame, and a B-frame represents the difference between consecutive frames.

[0063] When playing a video in reverse order, if played at normal speed, the video is usually played frame by frame; if played at double speed, certain frames are usually selected to play in order to ensure smooth playback.

[0064] In one possible application scenario, the video playback interface provided by the playback device may include a video progress bar, speed selection buttons, fast forward buttons, and rewind buttons. When a user wants to rewatch a video that has already been played, they can select a suitable speed and click the rewind button to play the video in reverse order. However, when playing a video in reverse order, the decoding and playback of video data are usually sequential—that is, each frame in the video is decoded first, and then the decoded frames are played in reverse order. Especially when the user selects a speed-up option for reverse playback, the effect of the reverse playback largely depends on the decoding speed of the video data. When the decoding speed cannot keep up with the playback speed, the entire video playback process is prone to stuttering, thus greatly affecting the user's viewing experience.

[0065] As an example, refer to Figure 3 As shown, if the playback device is a smart TV, when a user plays video data in reverse order at speed a on the smart TV, the decoding and playback process of the video data is as follows:

[0066] Starting from the current frame (frame 5), the decoding module searches backwards by a distance of 'a' frames in reverse order of the video data. Once the search is complete, the decoding module decodes each found frame sequentially and sends one frame (which can be a keyframe or a non-keyframe) to the playback module for playback. Then, it searches backwards again by 'a' frames, decodes the frames again, and sends one frame to the playback module for playback… This cycle continues until all video data has been decoded or a command to stop the reverse playback is received. In other words, each time 'a' frames are searched, decoded, and then one frame is played.

[0067] It is understandable that when playing video data in reverse order using the above method, since it is necessary to search forward a frame each time, this distance is likely to be different from the length of the image group in the video data, thus affecting the decoding time and decoding efficiency.

[0068] Specifically, the following are the main different situations:

[0069] 1. When the length *b* of each image group in the video data is the same, there is only one scenario where the reverse playback speed *a* is the same as the image group length *b*, meaning the probability of *a* = *b* is much smaller than the probability of *a* ≠ *b*. When *a* = *b*, this is the ideal situation. Following the reverse playback order of the video data, the search proceeds forward a frame's distance, searching one image group at a time. The decoding module decodes the frames in the searched image groups sequentially and selects one frame for playback, such as a keyframe. However, when *a* ≠ *b*, when searching forward a frame's distance according to the reverse playback order of the video data, it is necessary to continue searching forward by (n*b* - a) frames (where *n* satisfies *n*b ≥ *a* ≥ *(n-1)*b) until the nearest keyframe that can be decoded for that *a*-th frame is found. Then, the (n*b* - a) frames before that *a*-th frame are decoded. This implies an almost inevitable waste, including wasted search time, decoding time, decoding buffer space, and the problem of some frames being decoded redundantly but not played; these frames can be called unused, over-decoded frames.

[0070] 2. When the lengths of the image groups in the video data are not equal, assuming the video contains a total of N image groups, and the length of the i-th image group is denoted as L(i). In this case, since the position of the current frame and the number of L(i) are uncertain, the probability that the position reached by searching backwards from the current frame by a frames is exactly the keyframe is smaller than the probability in the above method. After searching backwards from the current frame to find frame a, it is highly likely that it is necessary to continue searching backwards by (nb-a) frames to find the keyframe before it, and decode all the extra (nb-a) frames before the a-th frame can be decoded. However, these extra (nb-a) frames will not be used in the current decoding round.

[0071] Furthermore, since video frame decoding and playback are sequential, when the playback speed is 'a', the number of output frames in the same amount of time becomes 1 / 'a' of the normal playback speed, meaning that 'a' frames must be decoded before 1 frame can be played. This "one frame for every 'a' frames decoded" strategy means that the next round of decoding and playback will still not use these (nb-a) frames. This implies that these (nb-a) frames decoded in this round are multiple-decoded but unused frames, resulting in wasted decoding. Therefore, in this case, the continuity of both the decoding and playback processes cannot be well guaranteed, not only wasting decoding buffer space and time spent saving and restoring data, but also complicating the processing flow and requiring more keyframe jumps.

[0072] To better understand the problems that arise when playing videos at double speed in the different scenarios described above, we will illustrate this with another specific example below:

[0073] Reference Figure 4 As shown, taking a video with at least 11 frames in normal playback order as an example, in which, Figure 4Frames with a triangle symbol below their frame number are keyframes. If a reverse playback command of speed 3 is received when the current playback frame is frame 11, the decoding and playback process for that video segment is as follows:

[0074] In the first round of decoding, starting from the current frame (frame 11), the search proceeds backwards for three frames in reverse order, reaching frames 10, 9, and 8. Since the target decoding frame, {8, 9, 10}, is located in two adjacent image groups, a jump decoding is required. First, the keyframe 9 in the third image group and frame 10, which depends on 9, are decoded. Then, the search jumps from keyframe 9 to keyframe 6 in the second image group, and frames 7 and 8, which depend on 6, are decoded sequentially. In this way, all target decoding frames in the first round are decoded. Frame 9 is then used as the playback frame.

[0075] Similarly, in the second round of decoding, the current frame changes from frame 11 to frame 8. Starting from frame 8, the search proceeds backwards for 3 frames according to the reverse playback order, sequentially searching to frame 7, frame 6, and frame 5. Since the target decoding frame consisting of frames {5, 6, 7} is also located in two adjacent image groups, a jump decoding is also required. That is, first, frame 6, located in the second image group, and frame 7, which depends on frame 6, are decoded; then, the search jumps from the keyframe 7 to the keyframe 1 in the first image group, and then frames 1 and frames 2-5, which depend on frame 1, are decoded sequentially. In this way, all target decoding frames in the second round of decoding are decoded. Among them, frame 6 is used as the playback frame.

[0076] Following the above method, the third and fourth rounds of decoding are performed sequentially until all frames in the entire video are decoded. Ultimately, the frames played in reverse at double speed in this video are: 9, 6, 3, 1, played 4 times. However, each frame in this video is decoded 1 (3 times), 2 (2 times), 3 (2 times), 4 (2 times), 5 (1 time), 6 (2 times), 7 (2 times), 8 (1 time), 9 (1 time), 10 (1 time), 11 (0 times), for a total of 17 decoding times. It can be observed that the decoding utilization rate of this method is only 4 / 17 (approximately 23.5%).

[0077] This situation arises because the entire process follows a "decode-frame extraction-playback" sequence. In the first round of decoding, although frames 8, 9, and 10 are decoded, only one frame is used during final playback. This means that the decoded frames 8 and 10 do not contribute to the reverse playback of the video, resulting in wasted decoding during the entire reverse playback process. Furthermore, the keyframe jumps during decoding also cause some frames in the video to be decoded repeatedly, increasing the computational load and hindering decoding efficiency.

[0078] In view of the above-mentioned problems, this application provides a playback device and a video reverse playback method. Based on the relationship between the reverse playback speed and the frame number of the image group, the number of target frames to be extracted and the extracted frame number are determined. Then, according to the reverse order of the video frames in the target video data, the determined target frames are decoded and played. This method, on the one hand, completely eliminates the transcoding process of the target video data, thus avoiding the problem of low video reverse playback efficiency caused by long transcoding times. On the other hand, since only the target frames in the image group are extracted and decoded, the decoding computational load is greatly reduced compared to the prior art, improving decoding efficiency. Furthermore, given the limitation on the number of target frames extracted, the entire frame extraction process is very short, thus effectively making the decoding and playback of the target video data appear in parallel, greatly reducing the impact of decoding speed limitations on playback efficiency. In addition, for those non-target frames in the target video data that are not extracted, there is no need to decode them, which greatly improves the decoding utilization rate of the target video data and the smoothness of the playback process.

[0079] Next, the technical solutions of the embodiments of this application, and how the technical solutions of the embodiments of this application solve the above-mentioned technical problems, will be described in detail with reference to the accompanying drawings. The embodiments shown below can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0080] In one exemplary embodiment, such as Figure 5 As shown, when the playback device of this application executes the video rewind method, the controller in the playback device is configured to perform the following steps:

[0081] S510, Obtain the image group from the target video data.

[0082] Each image group may consist of only a keyframe, or it may include one keyframe and at least one non-keyframe. The target video data may contain multiple image groups, such as one, two, three, etc. This application does not limit the number of image groups in the target video data. Furthermore, there is no limit to the number of frames in each image group; it may consist of only one keyframe, or it may include one keyframe and two non-keyframes (such as two B-frames, two P-frames, or one B-frame and one P-frame), etc.

[0083] S520, in response to a rewind instruction for the target video data, determines the number of frames in the image group.

[0084] It should be noted that the reverse playback instruction may include the reverse playback speed, where the reverse playback speed can be an integer (such as 1x, 2x, etc.) or a non-integer (such as 0.5x, 1.5x, etc.). This application does not limit the specific value of the reverse playback speed.

[0085] In addition to including playback speed, the reverse playback command can also include a preset decoding length. Setting the decoding length can play a certain role in controlling the decoding process of the target video data, avoiding decoding waste by decoding all the target video data.

[0086] It is understood that the decoding length in this application can be the number of image groups between the current frame and the predetermined decoding frame, the number of frames between the current frame and the predetermined decoding frame, or the duration between the current frame and the predetermined decoding frame. There can be various definitions of the decoding length, and those skilled in the art can set it flexibly according to actual needs.

[0087] S530. Based on the reverse playback speed and the number of frames in the determined image group, determine the number of target frames to be extracted and the extracted frame number.

[0088] The target frame includes at least the keyframes in the image group. In other words, the target frame may include only the keyframes in the image group, or it may include both keyframes and non-keyframes in the image group. This application does not limit the type of the target frame. The extraction quantity includes the pre-extraction quantity n determined by the ratio of the number of frames in the image group to the playback speed, and the actual extraction quantity N determined by the pre-extraction quantity and the type of non-keyframes in the image group.

[0089] S540. Based on the determined extraction quantity and extraction frame number, extract the target frame from the target video data.

[0090] S550: Decode and play the extracted target frames in reverse order of the display order of the video frames in the target video data.

[0091] In some embodiments, refer to Figure 6 As shown, determining the frame number of an image group in response to a rewind instruction for the target video data may include the following steps:

[0092] S521, In response to the received rewind speed based on the target video data, search for key frames of the image group.

[0093] It should be noted that there are multiple ways to identify keyframes within an image group when searching for them. Specifically, see the following two different methods:

[0094] Method 1:

[0095] The video frame corresponding to the current moment in the target video data, as well as the last frame of all image groups before the current image group, are determined as the tail frame of the corresponding image group. Then, in reverse order of the display order of the video frames in the target video data, the key frames of the current image group are searched frame by frame from the tail frame of the current image group, and the key frames in each adjacent image group are searched frame by frame from the tail frame of the adjacent image group before the current image group.

[0096] It's important to note that when searching for keyframes in each image group frame by frame backward from the last frame of the current image group, following the reverse order of the video frames displayed in the target video data, it's necessary to search and determine the keyframes corresponding to that image group from within each image group's video frames. While this method ensures that no image group is missed, it can negatively impact the efficiency of keyframe searching to some extent.

[0097] Method 2:

[0098] Obtain the display timestamp (PTS) of the video frame corresponding to the current moment in the target video data, and determine the video frame corresponding to the current moment and the last frame of all image groups preceding the current image group as the tail frame of the corresponding image group; then, starting from the tail frame of the current image group, search for key frames of the current image group frame by frame backward. For adjacent image groups between the current image groups, it is also necessary to search for their key frames backward starting from the tail frame, and determine the video frame corresponding to the playback speed at half the reverse speed as the middle frame; using the middle frame as a node, search for key frames of each image group before the image group containing the middle frame along the direction of decreasing PTS; or search for key frames of each image group before and after the image group containing the middle frame along the directions of decreasing and increasing PTS respectively.

[0099] For Method 2, the concept of "intermediate frames" can be introduced to improve the search efficiency of keyframes in each image group. Specifically, an intermediate frame can be defined as the video frame corresponding to the current moment (the last frame) at half the reverse playback speed. Then, using the intermediate frame as a node, keyframes in the image groups preceding the image group containing the intermediate frame are searched unidirectionally in the direction of decreasing PTS, or keyframes in the image groups preceding and following the image group containing the intermediate frame are searched bidirectionally in the direction of decreasing and increasing PTS.

[0100] It's important to note that when searching for keyframes in image groups preceding the current intermediate frame in the direction of decreasing PTS, a special case exists: when an image group contains fewer than half the playback speed and is the preceding image group adjacent to the current image group; for example, if the image group has only two frames, with the first frame being the keyframe, and assuming a playback speed of 6x (half of which is 3x), searching for intermediate frames from the current moment backward will skip this two-frame image group and select the intermediate frame from the second image group preceding the current one. This results in the preceding image group adjacent to the current image group not being searched, and the keyframe in that group not being identified as the target frame, leading to a missed target frame.

[0101] To avoid this situation, keyframes in image groups that have already been searched can be marked (e.g., marked with a Used identifier). Then, keyframes that do not contain the Used identifier can be searched, especially keyframes in image groups with a small number of video frames. This will prevent keyframes in image groups from being missed and allow for a re-determination of the number of target frames and frame numbers to be extracted from each image group.

[0102] The intermediate frame can be set to the frame a / 2 positions before the current frame, where 'a' represents the playback speed; or it can be set to the frame a / 3 positions before the current frame. This application does not limit the method of setting the intermediate frame. Using the intermediate frame as a node and then searching unidirectionally along the direction of decreasing display timestamps in the target video data, or searching bidirectionally along both the direction of decreasing and increasing display timestamps, can greatly improve the search efficiency of keyframes. Furthermore, compared to unidirectional searching, bidirectional searching not only has a shorter search time but also avoids missing some frames due to a single direction.

[0103] S522. Determine the duration and frame rate of the image group based on the keyframes, and multiply the duration and frame rate to obtain the number of frames in the image group.

[0104] In step S522, the duration of the image group can be determined based on the timestamp information carried by the keyframes, and the frame rate can be obtained from the video parameters carried by the target video data. After the duration and frame rate of the image group are determined, the number of frames in the image group can be calculated based on the product of the duration and the frame rate.

[0105] In some embodiments, when determining the number of target frames to be extracted from an image group based on the playback speed and the number of frames in the determined image group, the extraction can be performed according to the following extraction strategy:

[0106] Understandably, if the playback speed of the target video data is *a* times, the total number of frames in the target video data is *Q* frames, and the number of frames in any image group is *q(i)* frames, then the ideal frame extraction ratio for the target video data is *ratio* = *Q* / *a*. However, since the target video data can usually only be transmitted sequentially in units of image groups, and the decoding of the target video data also depends on the keyframes in the image groups, obtaining the total number of frames in the target video data image groups often requires decoding and transmitting all image groups in the target video data. This largely leads to wasted decoding of the target video data, because there are always some frames that we don't need.

[0107] Therefore, to keep the number of target frames extracted from each image group within a suitable range, we can appropriately adjust the target frame extraction strategy. Specifically, for example, we can maintain the number of target frames extracted from each image group at a certain level, i.e., the extraction ratio of target frames in any image group is ratio = q / a. In this case, if we extract frames from the target video data according to the improved extraction strategy, since we only need to ensure the extraction ratio of target frames in each image group, the extraction ratio of the entire target video data is determined once the extraction ratio of each image group is determined.

[0108] In some specific examples, refer to Figure 7 As shown, when determining the number of target frames to be extracted from an image group based on the playback speed and the number of frames in the determined image group, the following steps may be included:

[0109] S531. Calculate the ratio m of the number of frames corresponding to each image group to the reverse playback speed.

[0110] Since the number of frames in an image group and the specific values ​​of the reverse playback speed can both vary, the ratio m can also have multiple different cases, such as m≥1 and m is an integer, or m>1 and m is a non-integer, or m<1. Furthermore, based on the different ratio m, the number n of target frames pre-extracted in each image group is also different.

[0111] S532. Determine the number of target frames n to be pre-extracted in each image group based on the ratio m.

[0112] Specifically, when m ≥ 1 and m is an integer, n = m. Here, m ≥ 1 means that the number of frames in any image group satisfies the frame extraction ratio ratio = q / a, that is, the number of frames in the image group is sufficient for the extraction of target frames; and when m is an integer, the pre-extraction quantity n can be directly determined to be the same as the ratio m, that is, for any image group, the extraction can be carried out according to the number of m target frames extracted from each image group.

[0113] When m > 1 and m is not an integer, n = m0 + 1, where m0 is the integer part of m. Here, m > 1 means that the number of frames in any image group satisfies the frame extraction ratio ratio = q / a, meaning the number of frames in the image group is sufficient for extracting the target frame. However, since the ratio m is not an integer, meaning there is a remainder, in addition to extracting the target frame from the image group according to the integer part of the ratio m, an extra frame needs to be extracted separately from the image group as the target frame.

[0114] When m < 1, it means that the number of frames in any image group does not satisfy the frame extraction ratio ratio = q / a. To ensure that the number of target frames extracted remains within a suitable range, the target frames can be extracted by determining whether the sum of the number of frames in the current image group and the number of frames in the previous one or more image groups satisfies the frame extraction ratio. That is: when m < 1, we can first determine whether the current image group is the first image group in the target video data to determine whether there are image groups before the current image group. If not, it indicates that the current image group is the first image group in the target video data, and the pre-extraction number n of the target frames in that image group is determined to be 1; if so, m is updated according to the sum of the number of frames in the current image group and the number of frames in at least one of the previous adjacent image groups and the reverse playback speed ratio. That is, the updated m is the sum of the number of frames in the current image group and the sum of the number of frames in at least one of the previous adjacent image groups and the reverse playback speed ratio. Then, the pre-extraction number n of the target frames is re-determined based on the updated m. This process is repeated until the pre-extraction number n of the target frames in all image groups in the target video data is determined.

[0115] In a specific example, if the target video data packet contains a frame sequence of three image groups as {1 2 3 4 5 6 7 8 9 10 11}, where 1, 6, and 9 are keyframes, the first image group has 5 frames, the second image group has 3 frames, the third image group has 3 frames, the current frame is frame 11, and the playback speed a = 4, then according to the target frame extraction strategy described above, the number of target frames extracted from each image group can be referenced as follows:

[0116] First, starting from the 11th frame of the current frame, determine the ratio m of the target frame number to the reverse playback speed in the third, second, and first image groups in reverse order of the video frame display order in the target video data. Then, determine the pre-extraction quantity n based on the value of m.

[0117] For the third image group, since the playback speed 'a' is greater than the number of frames in the image group (3), the ratio 3 / 4 < 1. Furthermore, since the current image group is not the first image group, it is necessary to calculate the ratio of the sum of the frame numbers of the second and third image groups to the playback speed. Since (3+3) / 4 > 1, and 6 / 4 is not an integer, the number of target frames extracted from the common target frames of the second and third image groups is determined to be 2.

[0118] Next, the ratio of the first image group to the reverse playback speed is determined. Since 5 / 4 > 1 and 5 / 4 is not an integer, the number of target frames extracted from the first image group is determined to be 2. In summary, for the target video data with a total of 11 frames in this example, the total number of target frames extracted according to the above target frame extraction strategy is determined to be 4 frames.

[0119] It should be understood that after the number of target frames extracted from the target video data is determined, especially when there are multiple target frames extracted from an image group, it is also necessary to determine the extraction frame number of the target frames in each image group. The extraction frame number of the target frames can be referred to in the following different embodiments:

[0120] In some embodiments, when the number of pre-extracted target frames n≤1 in each image group, the actual number of extracted target frames N=1 in the image group, and the keyframes in each image group are determined as target frames; then, the extracted frame number of the target frame is determined in reverse order of the display order of video frames in the target video data.

[0121] In some embodiments, when the pre-extraction number n of the target frame in any image group is greater than 1, the actual extraction number N of the target frame in the image group is determined according to the type of the last non-key frame in the n-1 adjacent frames after the key frame in the image group, wherein the actual extraction number N is not less than the pre-extraction number n; then, the extraction frame number of the target frame is determined according to the reverse order of the display order of the video frames in the target video data and the determined actual extraction number N.

[0122] In other words, for image groups with a pre-extraction quantity n ≤ 1, the actual extraction quantity N = 1 can be directly determined, meaning the keyframes of the image group can be directly extracted as target frames. For image groups with a pre-extraction quantity n > 1, the actual extraction quantity N of the target frames needs to be further determined based on the type of each video frame in the image group. The specific determination method can be found in the following content:

[0123] Specifically, since the decoding of non-keyframes depends on keyframes—for example, the decoding of a P-frame depends on the decoding of at least one preceding frame, and the decoding of a B-frame depends on the decoding of the two frames before and after it—the frame number for extracting non-keyframes in an image group generally starts from the keyframes in that image group. This means that first, the keyframes in the image group are extracted, and then k non-keyframes are extracted consecutively starting from the first non-keyframe after the keyframe in the image group, where k = n-1. However, due to different types of non-keyframes, the extracted frame number and the number of non-keyframes can vary in the following ways:

[0124] Scenario 1: If the last of the k consecutive non-keyframes following the keyframe in the image group is a P-frame, then these k P-frames can be extracted according to their display timestamps. In this scenario, refer to... Figure 8 As shown, the k consecutive images following the keyframe in this image group can all be P-frames. Therefore, these k P-frames can be extracted according to the display timestamp sequence; or refer to... Figure 9 As shown, the k consecutive frames following the keyframe in this image group contain both B-frames and P-frames. However, regardless of how many B-frames exist before the last P-frame, since decoding a B-frame requires decoding the two frames before and after it, all B-frames in the non-keyframe group can be decoded. Furthermore, these B-frames do not actually affect the number or order of target frames extracted from the image group. That is, when the last frame in the k consecutive frames following the keyframe in the image group is not a B-frame, the actual number N of target frames extracted remains unchanged, i.e., k+1 frames.

[0125] Scenario 2: If the last of the k consecutive non-keyframes following the keyframe in the image group is a B-frame. In this case, since the decoding of the B-frame depends on the decoding of the frames before and after it, it is necessary to determine the type of the frame following the B-frame. (See reference...) Figure 10 As shown, when the frame following frame B is frame P, then frame P also needs to be decoded and extracted. The number of non-key frames extracted from this image group is k+1, meaning that a total of k+2 key and non-key frames need to be extracted from this image group; refer to Figure 11 As shown, when the frame following a B-frame is also a B-frame, and the frame following the second B-frame is a P-frame, then the P-frame following the second B-frame also needs to be decoded and extracted. The number of non-keyframes extracted in this image group is k+2, meaning that a total of k+3 keyframes and non-keyframes in this image group need to be extracted; refer to Figure 12 As shown, when the next s consecutive frames after a B frame are all B frames, and until the next frame after the s consecutive B frames is a P frame, since the P frames adjacent to the B frames always need to be decoded and extracted, the number of non-key frames extracted in this image group is k+s+1, and a total of k+s+2 key frames and non-key frames need to be extracted in the image group; when the next s consecutive frames after a B frame are all B frames, and there is no P frame after the s consecutive B frames, then the s B frames are decoded and extracted, the number of non-key frames extracted in this image group is k+s, and a total of k+s+1 key frames and non-key frames need to be extracted in the image group.

[0126] That is, when the last frame of the k consecutive frames following the keyframe in an image group is a B-frame, and the last frame of the image group is not a B-frame, the actual number of target frames extracted, N, is k+s+2, where s is the number of consecutive B-frames after the k consecutive frames; when the last frame of the k consecutive frames following the keyframe in an image group is a B-frame, and the last frame of the image group is a B-frame, the actual number of target frames extracted, N, is k+s+1, where s is the number of consecutive B-frames after the k consecutive frames.

[0127] In other words, for scenario two, after determining the number of target frames to be extracted based on the ratio of the number of frames in the image group to the playback speed, the final number of non-critical frames to be extracted needs to be flexibly adjusted according to the specific order of the non-critical frames in the image group. It should be understood that the above description of the number and method of extracting target frames in the image group is only an optional implementation of this application and does not constitute a complete limitation on this part of the application.

[0128] In some embodiments, when extracting target frames from target video data according to the determined extraction quantity and extraction frame number, the extracted target frames can be recorded in a two-dimensional extraction matrix according to the frame number of the target frame and the sequence number of the image group in the target video data. That is, the two-dimensional extraction matrix records the target frames that need to be extracted for each image group.

[0129] In this system, the sequence number of the image group in the target video data can be determined according to either reverse playback order or forward playback order. The sequence number of the image group corresponds to the row in the two-dimensional frame extraction matrix; the frame number of the target frame corresponds to the column in the two-dimensional frame extraction matrix, and the first column of the two-dimensional frame extraction matrix is ​​the keyframe column. It is understandable that, since the two-dimensional frame extraction matrix records information about all target frames extracted from the first image group in the target video data up to the current frame's image group, with each image group occupying one row, and the number of target frames extracted in each image group may be different, for ease of calculation of the two-dimensional frame extraction matrix, 0 can be used to replace the data in image groups with a smaller number of target frames.

[0130] Since the two-dimensional frame extraction matrix makes it very easy to count the target frames whether viewed from top to bottom or bottom to top, this method can greatly improve the subsequent decoding efficiency of the target frames. Specifically, since the above-mentioned two-dimensional frame extraction matrix only records the target frames, it does not need to be decoded during the generation of the matrix. Therefore, when a rewind command is received, the two-dimensional frame extraction matrix can be generated quickly, thus providing good logical guidance and acceleration for the two-dimensional decoding matrix described below. In addition, when recording the extracted target frames, besides using a two-dimensional frame extraction matrix, two-dimensional arrays, queue groups, or two-dimensional linked lists can also be used, and this application does not limit this method.

[0131] In some embodiments, when decoding and playing the extracted target frames in reverse order of the display order of the video frames in the target video data, the target frames can be decoded based on the generated two-dimensional decoding matrix. The two-dimensional decoding matrix corresponds to the two-dimensional frame extraction matrix. As the decoding process progresses, the two-dimensional decoding matrix can decode the two-dimensional frame extraction matrix row by row, and only decode the target frames recorded in the two-dimensional frame extraction matrix. This approach ensures a continuous and orderly decoding process while largely avoiding decoding waste.

[0132] It is understandable that, in addition to using a two-dimensional decoding matrix, two-dimensional arrays, queue groups, or two-dimensional linked lists can also be used when decoding the extracted target frames, and this application does not limit this method.

[0133] In some embodiments, the rewind instruction may further include a preset decoding length. The preset decoding length setting can control the decoding process of the target video data, preventing the complete decoding of the target video data and thus avoiding wasted decoding time.

[0134] It should be noted that the decoding length in this application can be the number of image groups between the current frame and the predetermined decoding frame, the number of frames between the current frame and the predetermined decoding frame, or the duration between the current frame and the predetermined decoding frame. There are various definitions of the decoding length, and those skilled in the art can set it flexibly according to actual needs.

[0135] For example, if the preset decoding length is L=2 and the target video data contains 35 image groups, then if the target video data is decoded using a two-dimensional decoding matrix, then each round of decoding will only decode 2 image groups, or each round of decoding will only decode the target video data corresponding to 2 seconds, or each round of decoding will only decode the target video data corresponding to 2 frames.

[0136] In some embodiments, after decoding the target frame, a preset buffer duration can be waited before playing the decoded target frame. The buffer duration can be the same as or different from the decoding length L mentioned above; this application does not limit this.

[0137] For example, when the buffer duration l = 2, it means that the playback start time of the target video data is 2 image groups, 2 seconds, or 2 frames later than the decoding start time. This setting, by reserving a certain buffer time for the two-dimensional decoding matrix, makes the playback process of the target video data more continuous and reduces the possibility of stuttering during playback.

[0138] In a specific example, refer to Figure 13As shown, taking a video with at least 11 frames in normal playback order as an example, in which... Figure 13 Frames with a triangle symbol below their frame number are keyframes. If a 3x speed-up command is received when the current playback frame is frame 11, based on the above methods for determining the number of target frames and their numbers, the total number of target frames to be extracted is four: frames 1, 3, 6, and 9. Since all other frames in the video do not need to be extracted or decoded, when playing the video at 3x speed-up, only frames 9, 6, 3, and 1 need to be played in reverse order.

[0139] It can be seen that, compared with the existing video playback schemes mentioned above in the embodiments of this application, the video playback method provided by this application has higher decoding and playback efficiency, and the decoding utilization rate of the target frame has reached a very high level.

[0140] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0141] In addition, this application also provides a multimedia resource playback method, which can be applied to the aforementioned playback device or other electronic devices. The method includes: acquiring an image group from target video data, the image group including keyframes; determining the frame number of the image group in response to a reverse playback command for the target video data, the reverse playback command including a reverse playback speed; determining the number of target frames to be extracted and the extracted frame number from the image group based on the reverse playback speed and the determined frame number of the image group, the target frame including at least the keyframes in the image group; extracting the target frame from the target video data based on the determined number of extractions and the extracted frame number; and decoding and playing the extracted target frame in reverse order of the display order of the video frames in the target video data.

[0142] In an exemplary embodiment of this application, the playback device can determine the number of target frames to be extracted and the extracted frame number in the image group based on the relationship between the reverse playback speed and the number of frames in the image group. Then, it decodes and plays the determined target frames according to the reverse order of the video frames displayed in the target video data. This approach, on the one hand, completely eliminates the transcoding process for the target video data, thus avoiding the problem of low efficiency in reverse playback caused by long transcoding times. On the other hand, since only the target frames in the image group are extracted and decoded, the computational load of decoding is greatly reduced compared to the prior art, improving decoding efficiency. Furthermore, given the limitation on the number of target frames extracted, the entire frame extraction process is very short, thus effectively making the decoding and playback of the target video data appear in parallel, greatly reducing the impact of decoding speed limitations on playback efficiency. In addition, for those non-target frames in the target video data that are not extracted, there is no need to decode them, which greatly improves the decoding utilization rate of the target video data and the smoothness of the playback process.

[0143] The implementation principle of the video rewinding method provided in the above embodiments can be found in the specific limitations of the various embodiments regarding the controller configuration content in the playback device mentioned above, and will not be repeated here.

[0144] In addition, when implementing the above-described video rewind method, this application also provides a computer-readable storage medium. This computer-readable storage medium may store a computer program, which, when invoked and executed by a controller in a playback device or other electronic device, can implement some or all of the steps in the video rewind method provided in this application.

[0145] As an example, the computer-readable storage medium can be a magnetic disk, optical disk, read-only memory, or random access memory, etc.

[0146] It should be understood that the technical solutions in the embodiments of this application can be implemented using software plus the necessary general-purpose hardware platform. Therefore, the technical solutions in the embodiments of this application, in essence or in part that contributes to the prior art, can be embodied in the form of a software product, which can be stored in a computer-readable storage medium.

[0147] In addition to implementing the above-described video rewinding method, this application also provides a computer program product. This computer program product includes a computer program that is invoked and executed by a controller in a playback device or other electronic device, and can implement some or all of the steps in the video rewinding method provided in this application.

[0148] The above are merely specific implementations of the embodiments of this application and are not intended to limit the protection scope of the embodiments of this application. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solutions of the embodiments of this application should be included within the protection scope of the embodiments of this application.

Claims

1. A playback device, characterized by comprising: include: The monitor is configured to display the target video data; A controller, configured to communicate with the display, is configured to: Acquire a group of images from the target video data, the group of images including keyframes; In response to a rewind instruction for the target video data, the frame number of the image group is determined, the rewind instruction including rewind speed; Calculate the ratio m between the number of frames corresponding to each image group and the reverse playback speed, and determine the number of target frames extracted and the extracted frame number in the image group based on the ratio m. The number of extractions includes the pre-extraction number n and the actual extraction number N. The target frames include at least the keyframes in the image group. When m ≥ 1 and m is an integer, n = m; When m > 1 and m is not an integer, n = m0 + 1, where m0 is the integer part of m; When m < 1, determine whether the current image group is the first image group in the target video data; If so, then n=1; If not, then update m based on the number of frames in the current image group and at least one previous adjacent image group and the ratio to the reverse playback speed, and redetermine the number n of the target frames in each image group based on the updated ratio m; When the number of pre-extracted target frames n ≤ 1 in any of the image groups, the actual number of target frames N extracted in the image group is 1, and the keyframe in each of the image groups is determined as the target frame. The extracted frame number of the target frame is determined according to the reverse order of the display order of the video frames in the target video data; When the number of pre-extractions of target frames in any of the image groups is greater than 1, the actual number of extractions of target frames in the image group is determined according to the type of the last non-key frame in the n-1 adjacent frames after the key frame in the image group, wherein the actual number of extractions N is not less than the number of pre-extractions n. The extraction frame number of the target frame is determined by reversing the display order of the video frames in the target video data and the determined actual extraction quantity N. Based on the determined actual extraction quantity N and the extraction frame number, the target frame is extracted from the target video data; The extracted target frames are decoded and played in reverse order of the display order of the video frames in the target video data.

2. The playback device of claim 1, wherein, The controller is further configured to: In response to the received rewind speed based on the target video data, keyframes of the image group are searched; The duration and frame rate of the image group are determined based on the keyframes, and the duration and frame rate are multiplied to obtain the number of frames in the image group.

3. The playback device of claim 2, wherein, The controller is further configured to: The video frame corresponding to the current moment in the target video data, and the last frame of all image groups before the current image group are determined as the tail frame of the corresponding image group; Following the reverse order of the video frames displayed in the target video data, the keyframes of the current image group are searched frame by frame forward, starting from the last frame of the current image group, and the keyframes in each adjacent image group are searched frame by frame, starting from the last frame of the adjacent image group before the current image group.

4. The playback device of claim 2, wherein, The controller is further configured to: Obtain the display timestamp (PTS) of the video frame corresponding to the current moment in the target video data, and determine the video frame corresponding to the current moment and the last frame of all image groups before the current image group as the tail frame of the corresponding image group; Search for the keyframes of the current image group frame by frame, starting from the last frame of the current image group; For adjacent image groups before the current image group, search sequentially starting from the last frame of the image group, and determine the video frame corresponding to the one played once at half the reverse playback speed as the middle frame; Using the intermediate frame as a node, search for keyframes in each image group preceding the image group containing the intermediate frame along the direction of decreasing PTS, or search for keyframes in each image group before and after the image group containing the intermediate frame along the directions of decreasing and increasing PTS, respectively.

5. The playback device according to claim 1, characterized in that, The controller is further configured to: After decoding the target frame, wait for a preset buffering time before playing the decoded target frame.

6. A method for rewinding video playback, characterized in that, Includes the following steps: Acquire a group of images from the target video data, the group of images including keyframes; In response to a rewind instruction for the target video data, the frame number of the image group is determined, the rewind instruction including rewind speed; Calculate the ratio m between the number of frames corresponding to each image group and the reverse playback speed, and determine the number of target frames extracted and the extracted frame number in the image group based on the ratio m. The number of extractions includes the pre-extraction number n and the actual extraction number N. The target frames include at least the key frames in the image group. When m ≥ 1 and m is an integer, n = m; When m > 1 and m is not an integer, n = m0 + 1, where m0 is the integer part of m; When m < 1, determine whether the current image group is the first image group in the target video data; If so, then n=1; If not, then update m based on the number of frames in the current image group and at least one previous adjacent image group and the ratio to the reverse playback speed, and redetermine the number n of the target frames in each image group based on the updated ratio m; When the number of pre-extracted target frames n ≤ 1 in any of the image groups, the actual number of target frames N extracted in the image group is 1, and the keyframe in each of the image groups is determined as the target frame. The extracted frame number of the target frame is determined according to the reverse order of the display order of the video frames in the target video data; When the number of pre-extractions of target frames in any of the image groups is greater than 1, the actual number of extractions of target frames in the image group is determined according to the type of the last non-key frame in the n-1 adjacent frames after the key frame in the image group, wherein the actual number of extractions N is not less than the number of pre-extractions n. The extraction frame number of the target frame is determined by reversing the display order of the video frames in the target video data and the determined actual extraction quantity N. Based on the determined actual extraction quantity N and the extraction frame number, the target frame is extracted from the target video data; The extracted target frames are decoded and played in reverse order of the display order of the video frames in the target video data.