Video jump playback method, device, electronic device and storage medium

By locating the target keyframe during video jump playback and skipping the texture processing of the intermediate frames, the stuttering problem during video jump playback is solved, achieving a smoother video playback experience.

CN115802104BActive Publication Date: 2025-09-26BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111061235.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-10
Publication Date
2025-09-26
Estimated Expiration
2041-09-10

AI Technical Summary

Technical Problem

During video playback, hardware decoding based on surface mode causes video freezes.

Method used

By receiving the jump play instruction, locating the target key frame, and obtaining the video frame starting from the target key frame, skipping the texture processing before the target video frame, generating texture data and rendering it to the display unit, avoiding invalid rendering of the intermediate frames.

Benefits of technology

It reduces the computing load, improves the smoothness of video jump playback, and reduces the lag phenomenon.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115802104B_ABST
    Figure CN115802104B_ABST
Patent Text Reader

Abstract

The disclosed embodiments provide a method, device, electronic device, and storage medium for video jump playback. The method receives a jump playback instruction, which is used to jump a target video to a target video frame for playback; locates a target key frame according to the jump playback instruction, where the target key frame is a key frame in the target video that is located before the target video frame; sequentially obtains each video frame in the target video starting from the target key frame, skips texture processing of each video frame before the target video frame, performs texture processing on each video frame starting from the target video frame, generates texture data, and renders the texture data to a display unit. Since each video frame before the target video frame does not need to be rendered and displayed, skipping the texture processing process of each video frame before the target video frame does not affect the normal playback of the video after the jump, while reducing the computing load, improving the smoothness of the video jump playback process, and reducing the jamming phenomenon.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of computer technology, and in particular to a method, device, electronic device, and storage medium for video jump playback. Background Art

[0002] MediaCodec is a class provided by Android for processing audio and video encoding and decoding. It supports audio and video files by accessing the underlying media codec framework. Under the Android system, faster video decoding speed can be achieved by hard decoding through Android's own MediaCodec. Among them, in the process of video decoding based on MediaCodec, a buffer is required to carry the decoded data, and then the decoded data is rendered to the surface to complete the display of subsequent video frames (ie, surface mode). During normal video playback, in surface mode, the terminal device will decode each frame through the buffer and obtain the decoded data, and then render and play the decoded data in turn.

[0003] However, in the prior art, when performing video seek playback, video hardware decoding based on the surface mode may cause video freeze, affecting the user's video viewing experience. Summary of the Invention

[0004] The embodiments of the present disclosure provide a video jump playback method, device, electronic device and storage medium to overcome the problem of freezing when jumping and playing a video.

[0005] In a first aspect, an embodiment of the present disclosure provides a video jump playback method, comprising:

[0006] Receive a jump play instruction, wherein the jump play instruction is used to jump the target video to the target video frame for playback; locate the target key frame according to the jump play instruction, wherein the target key frame is the key frame in the target video that is located before the target video frame; obtain each video frame in the target video starting from the target key frame, skip texture processing of each video frame before the target video frame, and start texture processing on each video frame in sequence starting from the target video frame to generate texture data, and render the texture data to a display unit.

[0007] In a second aspect, an embodiment of the present disclosure provides a video jump playback device, comprising:

[0008] A receiving module is used to receive a jump play instruction, wherein the jump play instruction is used to jump the target video to a target video frame for playing;

[0009] a positioning module, configured to locate a target key frame according to the jump play instruction, wherein the target key frame is a key frame in the target video that is located before the target video frame;

[0010] A generation module is used to obtain each video frame in the target video starting from the target key frame, skip texture processing of each video frame before the target video frame, perform texture processing on each video frame in sequence starting from the target video frame, generate texture data, and render the texture data to a display unit.

[0011] In a third aspect, an embodiment of the present disclosure provides an electronic device, including:

[0012] a processor, and a memory communicatively connected to the processor;

[0013] The memory stores computer-executable instructions;

[0014] The processor executes the computer-executable instructions stored in the memory to implement the video jump playback method described in the first aspect and various possible designs of the first aspect.

[0015] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the video jump playback method described in the first aspect and various possible designs of the first aspect is implemented.

[0016] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the video jump playback method described in the first aspect and various possible designs of the first aspect.

[0017] The video jump playback method, device, electronic device and storage medium provided in this embodiment are as follows: the method receives a jump playback instruction, wherein the jump playback instruction is used to jump the target video to the target video frame for playback; locates the target key frame according to the jump playback instruction, wherein the target key frame is the key frame in the target video that is located before the target video frame; sequentially obtains each video frame in the target video starting from the target key frame, skips the texture processing of each video frame before the target video frame, performs texture processing on each video frame starting from the target video frame, generates texture data, and renders the texture data to the display unit. Since the video frames before the target video frame do not need to be rendered and displayed, skipping the texture processing process of the video frames before the target video frame does not affect the normal playback after the video jump, while reducing the computing load, improving the smoothness of the video jump playback process, and reducing the jamming phenomenon. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0019] Figure 1 A diagram of an application scenario of the video jump playback method provided in an embodiment of the present disclosure;

[0020] Figure 2 This is a schematic diagram of a video hardware decoding process based on surface mode in the prior art;

[0021] Figure 3 Schematic diagram of the process of the video jump playback method provided by the embodiment of the present disclosure Figure 1 ;

[0022] Figure 4 A schematic diagram of a target key frame and a target video frame provided in an embodiment of the present disclosure;

[0023] Figure 5 Schematic diagram of the process of the video jump playback method provided by the embodiment of the present disclosure Figure 2 ;

[0024] Figure 6 A schematic diagram of processing an output buffer to skip texture processing of intermediate frames provided by an embodiment of the present disclosure;

[0025] Figure 7 for Figure 5 A flowchart illustrating an implementation method of step S206 in the embodiment shown;

[0026] Figure 8 A structural block diagram of a video jump playback device provided in an embodiment of the present disclosure;

[0027] Figure 9 A schematic structural diagram of an electronic device provided in an embodiment of the present disclosure;

[0028] Figure 10 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0029] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present disclosure without making any creative efforts shall fall within the scope of protection of the present disclosure.

[0030] The following explains the application scenarios of the embodiments of the present disclosure:

[0031] Figure 1 This is an application scenario diagram of the video jump playback method provided by the embodiment of the present disclosure. The video jump playback method provided by the embodiment of the present disclosure can be applied to the video jump playback scenario under hardware decoding conditions. Specifically, Figure 1 As shown, the method provided in the embodiments of the present disclosure can be applied to a terminal device running a video application (Application, APP) for playing videos. The terminal device is provided with a touch screen. When a user performs a jump play operation through the touch screen (for example, clicking a play progress bar), the terminal device jumps the play progress of the target video being played to the play progress corresponding to the jump play operation (i.e., the play progress corresponding to the play progress bar) to play the target video.

[0032] In the prior art, faster video decoding speeds can be achieved by using Android's built-in MediaCodec for hardware decoding. MediaCodec video decoding operates on a producer / consumer model, requiring a buffer to hold decoded data. Specifically, the decoded data output by the decoder is loaded into the buffer, then the buffer containing the decoded data is retrieved, the decoded data is retrieved from the buffer for subsequent rendering, and the buffer is released.

[0033] More specifically, Figure 2 This is a schematic diagram of a video hardware decoding process based on the surface mode in the prior art. Figure 2 As shown, after the decoder decodes the video encoding data, the generated video decoding data is sequentially cached in the output buffer queue (data cache). The output buffer queue includes multiple output buffers loaded with video decoding data. When an output buffer is taken out (take out output buffer), the video decoding data therein is read (read data) and rendered to the surface for subsequent video display (render, display), and the output buffer is released (release output buffer).

[0034] However, when jumping to a video, decoding the video frame at the jump position requires the data before the video frame (the intermediate frames). Therefore, in the prior art, the video decoded data corresponding to the intermediate frames is usually read and processed from the output buffer queue and rendered to the surface accordingly. However, the video decoded data corresponding to these intermediate frames is not displayed, so the rendering of this video decoded data becomes invalid, resulting in a waste of computing resources, an increase in the computing load during video jump playback, and video freezes.

[0035] The embodiments of the present disclosure provide a video jump playback method to solve the above problems.

[0036] Figure 3 Schematic diagram of the process of the video jump playback method provided by the embodiment of the present disclosure Figure 1 The method of this embodiment can be applied in a terminal device. The video jump playback method includes:

[0037] Step S101: receiving a jump play instruction, where the jump play instruction is used to jump a target video to a target video frame for playing.

[0038] For example, refer to Figure 1 In the application scenario shown, when a user performs a jump play operation, the jump play operation is converted into a corresponding jump play instruction based on the interactive interface of the video application client running on the terminal device, so that the terminal device receives the corresponding jump play instruction. The jump play instruction is used to jump the currently playing target video from the current playback progress, that is, the currently playing video frame, to the progress corresponding to the jump play instruction, that is, the target video frame, thereby implementing the jump play process of the target video.

[0039] Among them, there may be multiple jump play operations corresponding to the jump play instruction, such as clicking the target progress point of the play progress bar, or dragging the progress slider of the play progress bar to the target progress point. The corresponding jump play instructions can be the same. The specific generation and playback of the jump play instruction will not be given here as an example.

[0040] Step S102: according to the jump play instruction, locate the target key frame, where the target key frame is the key frame in the target video that is located before the target video frame.

[0041] Exemplarily, the jump play instruction includes a play timestamp corresponding to the target video frame. According to the jump play instruction, the play timestamp of the target video frame can be determined, and then the target key frame within the key frame period (also called the group of pictures, GOP) where the play timestamp is located can be determined. More specifically, the target key frame is the instantaneous decoding refresh (IDR) frame of the key frame period where the target video frame is located, that is, the first frame within the key frame period. The IDR frame is used to clear the reference frame list, thereby achieving immediate refresh of the video and avoiding propagation errors during the decoding process. Therefore, when the video is jumped and played according to the jump play instruction, it is possible to jump directly to the IDR frame and start decoding backwards from the IDR frame to achieve the purpose of jump play of the video.

[0042] There are various ways to locate the target key frame. For example, based on the target video frame, the corresponding key frame period is determined according to preset information, and the first frame in the key frame period is determined as the target key frame. Alternatively, based on the target timestamp corresponding to the target video frame, the IDR frame that precedes the target timestamp and is closest to the target timestamp is determined as the target video frame.

[0043] Step S103: starting from the target key frame, sequentially obtain each video frame in the target video, skip texture processing of each video frame before the target video frame, sequentially perform texture processing on each video frame starting from the target video frame, generate texture data, and render the texture data to the display unit.

[0044] Figure 4 A schematic diagram of a target key frame and a target video frame provided by an embodiment of the present disclosure, such as Figure 4 As shown, the target key frame is an IDR frame within a key frame period of the target video frame, and there are also several intermediate frames between the IDR frame and the target video frame representing the video jump playback position. In the prior art, for the intermediate frames between the IDR frame and the target video frame, after obtaining the video decoding data corresponding to the intermediate frame, they will also be textured. However, after these intermediate frames are textured, subsequent rendering and display will not be performed, resulting in a waste of computing resources. In the steps of this embodiment, the texture processing process of the intermediate frames is skipped. Among them, exemplarily, the specific implementation method includes: sequentially obtaining the next video frame of the target key frame in the target video; if the obtained video frame is not the target video frame, discarding the video frame, and continuing to obtain the next video frame of the video frame for judgment, until the obtained video frame is the target video frame. Reference Figure 4As shown in the schematic diagram, after the IDR frame is determined, decoding is performed backward from the IDR frame to the target video frame to achieve the purpose of decoding the target video frame. However, for the intermediate frames between the IDR frame and the target video frame, since they do not need to be displayed, texture processing is not performed on the intermediate frames (that is, only decoding is performed, but surface data is not rendered). Specifically, according to the identifier corresponding to each video frame, after determining that the video decoded data obtained through the output buffer is the data of the intermediate frame, the output buffer is directly released and the video decoded data therein is discarded without texture processing; until the video decoded data in the output buffer is the data of the intermediate frame, texture processing is performed on the video decoded data therein, rendered to surface data, texture data is generated, and the texture data is rendered to a display unit, such as a display screen of a terminal device, thereby achieving display of the target video frame.

[0045] In this embodiment, a jump play instruction is received, which is used to jump the target video to the target video frame for playback; according to the jump play instruction, a target key frame is located, which is a key frame in the target video that is located before the target video frame; each video frame in the target video is sequentially acquired starting from the target key frame, and texture processing of each video frame before the target video frame is skipped. Texture processing is performed on each video frame starting from the target video frame to generate texture data, and the texture data is rendered to a display unit. Since the video frames before the target video frame do not need to be rendered and displayed, skipping the texture processing process for the video frames before the target video frame does not affect the normal playback of the video after the jump, while reducing the computing load, improving the smoothness of the video jump playback process, and reducing the phenomenon of lag.

[0046] refer to Figure 5 , Figure 5 Schematic diagram of the process of the video jump playback method provided by the embodiment of the present disclosure Figure 2 In this embodiment Figure 3 Based on the embodiment, step S103 is further refined, and the video jump playback method includes:

[0047] Step S201: receiving a jump play instruction, where the jump play instruction is used to jump a target video to a target video frame for playing.

[0048] Step S202: locate the target key frame according to the jump play instruction.

[0049] Step S203 : sequentially obtaining output buffers corresponding to video frames following the target key frame through an output buffer queue, wherein the output buffer queue is used to obtain output buffers storing video frames.

[0050] Exemplarily, the output buffer queue is a data structure for caching output buffers. After the decoder decodes the target video, the decoded video data generated is cached in the cache output buffer queue in the decoding order. After receiving the request, the output buffer loaded with the decoded video data is taken out from the output buffer queue in sequence. Exemplarily, each output buffer corresponds to a video frame. In a more specific implementation, an output buffer is obtained from the output buffer queue by calling the dequeueOutputBuffer() method in MediaCodec, and then the queue identifier is shifted back one position so that the queue identifier points to the position of the next video frame in the output buffer queue, thereby continuing to take out the output buffer corresponding to the next video frame.

[0051] Step S204 , when the output buffer release parameter is in the discard state, the video decoding data in the output buffer corresponding to the video frame is not read, the output buffer corresponding to the video frame is directly cleared and released to the output buffer queue.

[0052] For example, in the process of obtaining the output buffer corresponding to each video frame, a video frame identifier corresponding to each video frame can be obtained, thereby determining whether the video frame corresponding to the output buffer is an intermediate video frame. When the video frame corresponding to the output buffer is determined to be an intermediate frame, the output buffer release parameter is set to a discard state; when the video frame corresponding to the output buffer is determined to be a target video frame, the output buffer release parameter is set to an output state.

[0053] Furthermore, after obtaining the output buffer, the output buffer needs to be released and returned to the output buffer queue. Exemplarily, this step can be implemented by the releaseOutputBuffer() method in MediaCodec. Among them, the input parameter of the releaseOutputBuffer() method is the output buffer release parameter. Specifically, the output buffer release parameter includes two states: "ture" (output state) and "false" (discard state); when it is judged that the output buffer release parameter is in the discard state (false), the video decoding data in the output buffer corresponding to the video frame is not read, and the output buffer corresponding to the video frame is cleared and released to the output buffer queue. This step can be implemented by executing the method releaseOutputBuffer(false).

[0054] Step S205 : when the output buffer release parameter is in the output state, obtaining the video decoding data in the output buffer corresponding to the target video frame.

[0055] Step S206: Generate texture data according to the decoded video data in the output buffer.

[0056] Furthermore, when the output buffer release parameter is determined to be in the output state (true), the video decoded data in the output buffer corresponding to the target video frame is obtained. Since the buffer release parameter is always false in the intermediate frames before the target video frame, when the output buffer release parameter is true, the video decoded data in the output buffer corresponds to the target video frame, and the texture data is generated from the video decoded data for rendering and display in subsequent steps, and the output buffer is released. The above steps can be implemented by executing the method releaseOutputBuffer(true).

[0057] Figure 6 A schematic diagram of processing an output buffer to skip texture processing of intermediate frames provided by an embodiment of the present disclosure is shown in FIG. Figure 6 As shown, during video decoding in MediaCodec's surface mode, the decoder's output video decoding results, i.e., the output buffers containing the decoded video data corresponding to each video frame, are obtained using the dequeueOutputBuffer() method. After obtaining the decoded video data in these buffers, the releaseOutputBuffer() method is used to release each output buffer containing the decoded video data to the output buffer queue to load subsequent decoded video data. When the decoded video data in the buffer corresponds to an intermediate frame, the releaseOutputBuffer(false) method is executed; when the decoded video data in the buffer corresponds to the target video frame or a frame subsequent to the target video frame, the releaseOutputBuffer(true) method is executed. After executing the releaseOutputBuffer(false) method, the decoded video data in the buffer is directly discarded, releasing the buffer (shown as buffer(empty) in the figure). After executing the releaseOutputBuffer(true) method, the decoded video data in the buffer is read and texture processed to generate texture data. After reading the decoded video data in the buffer, the buffer is released (shown as buffer(empty) in the figure). Afterwards, the texture data is rendered and displayed, thereby realizing the display of the target video frame.

[0058] Alternatively, as Figure 7 As shown, step S206 includes three specific implementation steps: step S2061, S2062 and S2063:

[0059] S2061: Obtain pixel data in the video decoding data.

[0060] S2062: Update the content of the texture object in the preset surface texture structure to pixel data in the video decoding data, wherein the surface texture structure is a structure for representing the texture and surface structure of the video frame.

[0061] S2063: Generate texture data according to the surface texture structure.

[0062] For example, the pixel data in the decoded video data represents the pixel information of the target video frame; a surface texture is a structure used as an OpenGL OES texture, and a surface texture contains a texture object (surface). After executing the releaseOutputBuffer(ture) method, the pixel data in the decoded video data in the output buffer is updated to the surface data by triggering the surface texture's updateTexImage() method. The surface data representing the OES texture information is then updated to the surface texture data volume. The surface texture is then used as texture data and rendered using OpenGL to display the video frame.

[0063] In this embodiment, after determining that the decoded video data in the output buffer corresponds to an intermediate frame, the output buffer is directly released without performing subsequent texture processing. Therefore, the time-consuming and computational resource-wasting process of executing the updateTexImage() method on the pixel data corresponding to the intermediate frame and writing the texture information data to the surface texture are omitted. This improves the smoothness of video playback in surface mode and reduces the computational load.

[0064] Step S207: rendering the texture data to a display unit.

[0065] In this embodiment, the implementation method of steps S201-S202 and S207 is the same as Figure 3 In the illustrated embodiment, the implementation methods of rendering the texture data to the display unit in steps S101 , S102 and S103 are consistent and will not be described in detail here.

[0066] Corresponding to the video jump playback method of the above embodiment, Figure 8 This is a structural block diagram of a video jump playback device provided by an embodiment of the present disclosure. For ease of explanation, only the parts related to the embodiment of the present disclosure are shown. Figure 8 , the video jump playback device 3 includes:

[0067] The receiving module 31 is used to receive a jump play instruction, where the jump play instruction is used to jump the target video to a target video frame for playing;

[0068] A positioning module 32 is used to locate a target key frame according to the jump play instruction, where the target key frame is a key frame in the target video that is located before the target video frame;

[0069] The generation module 33 is used to obtain each video frame in the target video starting from the target key frame, skip the texture processing of each video frame before the target video frame, perform texture processing on each video frame in sequence starting from the target video frame, generate texture data, and render the texture data to the display unit.

[0070] In one embodiment of the present disclosure, when the generation module 33 executes the steps of sequentially acquiring each video frame starting from the target key frame in the target video and skipping the texture processing of each video frame before the target video frame, it is specifically used to: sequentially acquire the next video frame after the target key frame in the target video; if the acquired video frame is not the target video frame, discard the video frame, and continue to acquire the next video frame after the video frame for judgment until the acquired video frame is the target video frame.

[0071] In one embodiment of the present disclosure, when the generation module 33 sequentially obtains the subsequent video frame of the target key frame in the target video, it is specifically used to: sequentially obtain the output buffer corresponding to the video frame after the target key frame through the output buffer queue, wherein the output buffer queue is used to obtain the output buffer for storing the video frame; when the generation module 33 discards the video frame, it is specifically used to: when the output buffer release parameter is in the discard state, not read the video decoding data in the output buffer corresponding to the video frame, directly clear the output buffer corresponding to the video frame, and release it to the output buffer queue.

[0072] In one embodiment of the present disclosure, when the generation module 33 performs texture processing on each video frame in sequence starting from the target video frame to generate texture data, it is specifically used to: when the output buffer release parameter is in the output state, obtain the video decoding data in the output buffer corresponding to the target video frame; and generate texture data based on the video decoding data in the output buffer.

[0073] In one embodiment of the present disclosure, when the generation module 33 generates texture data based on the video decoding data in the output buffer, it is specifically used to: obtain pixel data in the video decoding data; update the content of the texture object in the preset surface texture structure to the pixel data in the video decoding data, wherein the surface texture structure is a structure used to represent the texture and surface structure of the video frame; and generate texture data based on the surface texture structure.

[0074] In one embodiment of the present disclosure, the jump play instruction includes a target timestamp, which is used to indicate the play position of the target video frame. The positioning module 32 is specifically used to: obtain the target timestamp; and locate the target key frame according to the target timestamp.

[0075] In one embodiment of the present disclosure, when the positioning module 32 locates the target key frame according to the target timestamp, it is specifically used to: determine the identifier of the corresponding target video frame according to the target timestamp; determine the target frame group in which the target video frame is located according to the identifier of the target video frame; and locate the target key frame according to the first video frame in the target frame group.

[0076] The receiving module 31, positioning module 32 and generating module 33 are connected in sequence. The video jump playback device 3 provided in this embodiment can implement the technical solution of the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.

[0077] Figure 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure is shown in FIG. Figure 9 As shown, the electronic device 4 includes:

[0078] A processor 41, and a memory 42 communicatively connected to the processor 41;

[0079] Memory 42 stores computer-executable instructions;

[0080] The processor 41 executes the computer execution instructions stored in the memory 42 to implement the following Figure 2-Figure 7 The video jump playback method in the illustrated embodiment.

[0081] Optionally, the processor 41 and the memory 42 are connected via a bus 43 .

[0082] For related instructions, please refer to Figure 3-Figure 7 The relevant descriptions and effects corresponding to the steps in the corresponding embodiments can be understood, and no further details are given here.

[0083] refer to Figure 10, which shows a schematic structural diagram of an electronic device 900 suitable for implementing the embodiments of the present disclosure. The electronic device 900 may be a terminal device or a server. The terminal device may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 10 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.

[0084] like Figure 10 As shown, the electronic device 900 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. Various programs and data required for the operation of the electronic device 900 are also stored in the RAM 903. The processing device 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0085] Typically, the following devices may be connected to the I / O interface 905: an input device 906 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 908 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 909. The communication device 909 may allow the electronic device 900 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 10 The electronic device 900 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.

[0086] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication device 909, or installed from the storage device 908, or installed from the ROM 902. When the computer program is executed by the processing device 901, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.

[0087] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.

[0088] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0089] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.

[0090] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0091] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0092] The units involved in the embodiments described in this disclosure may be implemented in software or hardware. In some cases, the name of a unit does not limit the unit itself. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses."

[0093] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.

[0094] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0095] In a first aspect, according to one or more embodiments of the present disclosure, a video jump playback method is provided, comprising:

[0096] Receive a jump play instruction, wherein the jump play instruction is used to jump the target video to the target video frame for playback; locate the target key frame according to the jump play instruction, wherein the target key frame is the key frame in the target video that is located before the target video frame; obtain each video frame in the target video starting from the target key frame, skip texture processing of each video frame before the target video frame, and start texture processing on each video frame in sequence starting from the target video frame to generate texture data, and render the texture data to a display unit.

[0097] According to one or more embodiments of the present disclosure, each video frame in the target video is sequentially acquired starting from the target key frame, and texture processing of each video frame before the target video frame is skipped, including: sequentially acquiring the subsequent video frame of the target key frame in the target video; if the acquired video frame is not the target video frame, discarding the video frame, and continuing to acquire the subsequent video frame of the video frame for judgment until the acquired video frame is the target video frame.

[0098] According to one or more embodiments of the present disclosure, obtaining the subsequent video frames of the target key frame in the target video in sequence includes: obtaining the output buffers corresponding to the video frames after the target key frame in sequence through the output buffer queue, wherein the output buffer queue is used to obtain the output buffer for storing the video frame; discarding the video frame includes: when the output buffer release parameter is in the discard state, not reading the video decoding data in the output buffer corresponding to the video frame, directly clearing the output buffer corresponding to the video frame, and releasing it to the output buffer queue.

[0099] According to one or more embodiments of the present disclosure, texture processing is performed on each video frame in sequence starting from the target video frame to generate texture data, including: when the output buffer release parameter is in the output state, obtaining the video decoding data in the output buffer corresponding to the target video frame; and generating texture data based on the video decoding data in the output buffer.

[0100] According to one or more embodiments of the present disclosure, texture data is generated based on video decoding data in an output buffer, including: obtaining pixel data in the video decoding data; updating the content of a texture object in a preset surface texture structure to the pixel data in the video decoding data, wherein the surface texture structure is a structure for representing the texture and surface structure of a video frame; and generating texture data based on the surface texture structure.

[0101] According to one or more embodiments of the present disclosure, the jump playback instruction includes a target timestamp, and the target timestamp is used to indicate the playback position of the target video frame. According to the jump playback instruction, the target key frame is positioned, including: obtaining the target timestamp; according to the target timestamp, the target key frame is positioned.

[0102] According to one or more embodiments of the present disclosure, locating the target key frame according to the target timestamp includes: determining the identifier of the corresponding target video frame according to the target timestamp; determining the target frame group in which the target video frame is located according to the identifier of the target video frame; and locating the target key frame according to the first video frame in the target frame group.

[0103] In a second aspect, according to one or more embodiments of the present disclosure, a video jump playback device is provided, comprising:

[0104] A receiving module is used to receive a jump play instruction, wherein the jump play instruction is used to jump the target video to a target video frame for playing;

[0105] a positioning module, configured to locate a target key frame according to the jump play instruction, wherein the target key frame is a key frame in the target video that is located before the target video frame;

[0106] A generation module is used to obtain each video frame in the target video starting from the target key frame, skip texture processing of each video frame before the target video frame, perform texture processing on each video frame in sequence starting from the target video frame, generate texture data, and render the texture data to a display unit.

[0107] According to one or more embodiments of the present disclosure, when the generation module executes the steps of sequentially acquiring each video frame in the target video starting from the target key frame and skipping texture processing of each video frame before the target video frame, it is specifically used to: sequentially acquire the subsequent video frame of the target key frame in the target video; if the acquired video frame is not the target video frame, discard the video frame, and continue to acquire the subsequent video frame of the video frame for judgment until the acquired video frame is the target video frame.

[0108] According to one or more embodiments of the present disclosure, when the generation module sequentially obtains the subsequent video frame of the target key frame in the target video, it is specifically used to: sequentially obtain the output buffer corresponding to the video frame after the target key frame through the output buffer queue, wherein the output buffer queue is used to obtain the output buffer for storing the video frame; when the generation module 33 discards the video frame, it is specifically used to: when the output buffer release parameter is in the discard state, not read the video decoding data in the output buffer corresponding to the video frame, directly clear the output buffer corresponding to the video frame, and release it to the output buffer queue.

[0109] According to one or more embodiments of the present disclosure, when the generation module performs texture processing on each video frame in sequence starting from the target video frame to generate texture data, it is specifically used to: when the output buffer release parameter is in the output state, obtain the video decoding data in the output buffer corresponding to the target video frame; and generate texture data based on the video decoding data in the output buffer.

[0110] According to one or more embodiments of the present disclosure, when the generation module generates texture data based on the video decoding data in the output buffer, it is specifically used to: obtain pixel data in the video decoding data; update the content of the texture object in the preset surface texture structure to the pixel data in the video decoding data, wherein the surface texture structure is a structure used to represent the texture and surface structure of the video frame; and generate texture data based on the surface texture structure.

[0111] According to one or more embodiments of the present disclosure, the jump playback instruction includes a target timestamp, which is used to indicate the playback position of the target video frame. The positioning module is specifically used to: obtain the target timestamp; and locate the target key frame according to the target timestamp.

[0112] In one embodiment of the present disclosure, when the positioning module locates the target key frame according to the target timestamp, it is specifically used to: determine the identifier of the corresponding target video frame according to the target timestamp; determine the target frame group in which the target video frame is located according to the identifier of the target video frame; and locate the target key frame according to the first video frame in the target frame group.

[0113] In a third aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device, comprising: a processor, and a memory communicatively connected to the processor;

[0114] The memory stores computer-executable instructions;

[0115] The processor executes the computer-executable instructions stored in the memory to implement the video jump playback method described in the first aspect and various possible designs of the first aspect.

[0116] In a fourth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the video jump playback method described in the first aspect and various possible designs of the first aspect is implemented.

[0117] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the video jump playback method described in the first aspect and various possible designs of the first aspect.

[0118] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.

[0119] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0120] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.

Claims

1. A video jump playback method, characterized in that: include: Receive a jump play instruction, wherein the jump play instruction is used to jump the target video to a target video frame for playback; Locating a target key frame according to the jump play instruction, where the target key frame is a key frame in the target video that is located before the target video frame; Sequentially acquiring each video frame in the target video starting from the target key frame, skipping texture processing of each video frame before the target video frame, sequentially performing texture processing on each video frame starting from the target video frame to generate texture data, and rendering the texture data to a display unit; Sequentially acquiring each video frame in the target video starting from the target key frame and skipping texture processing of each video frame before the target video frame, including: Sequentially acquiring output buffers corresponding to video frames following the target key frame through an output buffer queue, wherein the output buffer queue is used to acquire output buffers storing the video frames; When the output buffer release parameter is in a discard state, the video decoding data in the output buffer corresponding to the video frame is not read, the output buffer corresponding to the video frame is directly cleared and released to the output buffer queue; When the output buffer release parameter is in the output state, the video decoding data in the output buffer corresponding to the target video frame is obtained, and the pixel data in the video decoding data is obtained, and then the content of the texture object in the preset surface texture structure is updated to the pixel data in the video decoding data, wherein the surface texture structure is a structure used to characterize the texture and surface structure of the video frame.

2. The method according to any one of claim 1, characterized in that The jump play instruction includes a target timestamp, and the target timestamp is used to indicate the play position of the target video frame. Positioning the target key frame according to the jump play instruction includes: Obtaining the target timestamp; The target key frame is located according to the target timestamp.

3. The method according to any one of claim 2, characterized in that Positioning the target key frame according to the target timestamp includes: Determining an identifier of a corresponding target video frame according to the target timestamp; Determining a target frame group in which the target video frame is located according to an identifier of the target video frame; The target key frame is located according to the first video frame in the target frame group.

4. A video jump playback device, characterized in that: include: A receiving module is used to receive a jump play instruction, wherein the jump play instruction is used to jump the target video to a target video frame for playing; a positioning module, configured to locate a target key frame according to the jump play instruction, wherein the target key frame is a key frame in the target video that is located before the target video frame; a generating module, configured to sequentially acquire each video frame in the target video starting from the target key frame, skip texture processing of each video frame before the target video frame, perform texture processing on each video frame starting from the target video frame, generate texture data, and render the texture data to a display unit; When the generation module sequentially acquires each video frame starting from the target key frame in the target video and skips texture processing of each video frame before the target video frame, the generation module is specifically configured to: sequentially acquire output buffers corresponding to video frames after the target key frame through an output buffer queue, wherein the output buffer queue is used to acquire the output buffer storing the video frame; when an output buffer release parameter is in a discard state, directly clear the output buffer corresponding to the video frame without reading the video decoding data in the output buffer corresponding to the video frame, and release the output buffer to the output buffer queue; When the output buffer release parameter is in the output state, the video decoding data in the output buffer corresponding to the target video frame is obtained, and the pixel data in the video decoding data is obtained, and then the content of the texture object in the preset surface texture structure is updated to the pixel data in the video decoding data, wherein the surface texture structure is a structure used to characterize the texture and surface structure of the video frame.

5. An electronic device, characterized in that: include: a processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions. When the processor executes the computer-executable instructions, the video jump playback method according to any one of claims 1 to 3 is implemented.

7. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the video jump playback method according to any one of claims 1 to 3 is implemented.

Citation Information

Patent Citations

  • Video playing method and device, equipment and storage medium

    CN112822522A