Video processing methods and apparatus, storage media and electronic devices

By dividing the video seek operation into fine-tuning and coarse-tuning seek based on the time difference, and determining the target frame for decoding according to the time sequence, the problems of slow seek operation speed and high resource consumption in the prior art are solved, and faster video seek response and better user experience are achieved.

CN115408554BActive Publication Date: 2026-03-10HANGZHOU NETEASE CLOUD MUSIC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-26
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

In existing technologies, video seek operations suffer from slow response times and consume a lot of processing resources, especially when the GOP data is long. This requires decoding from the previous keyframes to the seek time point, resulting in a waste of resources and time.

Method used

By determining the time difference between the first seek request and the current playback time, seek requests are divided into fine-tuning seeks and coarse-tuning seeks. The target frame is determined based on the time difference and the playback time order, and decoding starts from the target frame to avoid starting decoding directly from the key frame before the first seek request.

Benefits of technology

It improves the processing speed of video seek operations, reduces unnecessary video frame decoding, and enhances the user experience, especially significantly shortening response time in fine-tuning and coarse-tuning seeks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115408554B_ABST
    Figure CN115408554B_ABST
Patent Text Reader

Abstract

This disclosure provides a video processing method, apparatus, storage medium, and electronic device, belonging to the field of video processing technology. The method includes: in response to a video playback progress seek request, obtaining a first time indicated by the seek request and the current playback time of the video; determining a first time difference between the first time and the current playback time; and in response to the first time difference being less than or equal to a preset first time threshold, determining a target frame based on the chronological order of the first time and the current playback time, and starting decoding from the target frame. This disclosure can improve the response speed of seek operations and reduce resource consumption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of video processing technology, and more specifically, embodiments of this disclosure relate to a video processing method and apparatus, a storage medium, and an electronic device. Background Technology

[0002] This section is intended to provide background or context for the embodiments of this disclosure as set forth in the claims. The description herein is not intended to be a prior art simply because it is included in this section.

[0003] With the development of video technology, users can perform selective playback of video data or edit video frames through video positioning seek operations.

[0004] In related technologies, after a user presses the time progress bar, the system typically seeks to a keyframe before the sought point and then decodes from that keyframe (I-frame) until the sought point. This method results in slow response times and consumes significant processing resources. Summary of the Invention

[0005] Embodiments of this disclosure provide a video processing method and apparatus, a storage medium, and an electronic device.

[0006] In a first aspect of this disclosure, a video processing method is provided, the method comprising: in response to a video playback progress seek request, obtaining a first time indicated by the seek request and the current playback time of the video; determining a first time difference between the first time and the current playback time; in response to the first time difference being less than or equal to a preset first time threshold, determining a target frame according to the order of the first time and the current playback time, and decoding the video starting from the target frame in the order of playback time.

[0007] Optionally, the method further includes: in response to the first time difference being greater than a preset first time threshold, obtaining and playing the first frame corresponding to the seek request from the video.

[0008] Optionally, determining the target frame based on the order of the first time and the current playback time includes: determining the first frame as the target frame in response to the first time being before the current playback time; determining the target frame based on the first time difference and the second time difference between the first time and the second time in response to the first time being after the current playback time; the second time being the time corresponding to the first frame.

[0009] Optionally, determining the target frame based on the first time difference and the second time difference includes: determining the current frame as the target frame in response to the first time difference being less than or equal to the second time difference; and determining the first frame as the target frame in response to the first time difference being greater than the second time difference.

[0010] Optionally, the video is a group of frames. Before determining the first time difference between the first time and the current playback time, the method further includes: obtaining the duration information of the group of frames, and, in response to the duration information being less than or equal to a preset second time threshold, determining the second frame corresponding to the seek request, and starting from the second frame, decoding the group of frames in the order of playback time, and playing the decoded video frames.

[0011] Optionally, the method further includes configuring the first time threshold based on the duration information.

[0012] Optionally, the method further includes: generating a corresponding playback progress seek request in response to a drag operation in the video playback progress operation area.

[0013] Optionally, the step of decoding the video starting from the target frame in playback time order includes: decoding the video starting from the target frame in playback time order according to the video data queue index of the video;

[0014] Optionally, the method further includes: obtaining a third time of the currently decoded video frame based on the video data queue index; and determining that the video frame corresponding to the seek request has been decoded in response to the third time being the same as the first time.

[0015] Optionally, obtaining the first frame corresponding to the seek request from the video includes: obtaining a target time index from the time index of the second frame, wherein the target time index is the time index of the second frame that is located before the first time and closest to the first time; and obtaining the first frame from the video according to the target time index and the video data queue index of the video.

[0016] In a second aspect of the present invention, a video processing apparatus is provided, the apparatus comprising: an acquisition module, a determination module, and a processing module; wherein the acquisition module is configured to, in response to a video playback progress seek request, acquire a first time indicated by the seek request and the current playback time of the video; the determination module is configured to, determine a first time difference between the first time and the current playback time; and the processing module is configured to, in response to the first time difference being less than or equal to a preset first time threshold, determine a target frame according to the chronological order of the first time and the current playback time, and decode the video starting from the target frame in chronological order.

[0017] Optionally, the processing module is further configured to: in response to the first time difference being greater than a preset first time threshold, obtain and play the first frame corresponding to the seek request from the video.

[0018] Optionally, the processing module is further configured to: determine the first frame as the target frame in response to the first time being before the current playback time; and determine the target frame based on the first time difference and the second time difference between the first time and the second time in response to the first time being after the current playback time; wherein the second time is the time corresponding to the first frame.

[0019] Optionally, the processing module is further configured to: determine the current frame as the target frame in response to the first time difference being less than or equal to the second time difference; and determine the first frame as the target frame in response to the first time difference being greater than the second time difference.

[0020] Optionally, the video is a group of frames, and the acquisition module is further configured to acquire the duration information of the group of frames; the processing module is further configured to: in response to the duration information being less than or equal to a preset second time threshold, determine the second frame corresponding to the seek request, and starting from the second frame, decode the group of frames in the order of playback time, and play the decoded video frames.

[0021] Optionally, the device further includes a configuration module for configuring the first time threshold based on the duration information.

[0022] Optionally, the device further includes a request generation module, configured to generate a corresponding playback progress seek request in response to a drag operation in the video playback progress operation area.

[0023] Optionally, the processing module is further configured to: decode the video according to the video data queue index of the video, starting from the target frame and in playback time order; obtain the third time of the currently decoded video frame according to the video data queue index; and determine that the video frame corresponding to the seek request has been decoded in response to the third time being the same as the first time.

[0024] Optionally, the processing module is further configured to: obtain a target time index from the time index of the second frame, wherein the target time index is the time index of the second frame that is located before the first time and closest to the first time; and obtain the first frame from the video according to the target time index and the video data queue index of the video.

[0025] In a third aspect of the present invention, a storage medium is provided having a program stored thereon that, when executed by a processor, implements the video processing method as described in the above embodiments.

[0026] In a fourth aspect of the present invention, an electronic device is provided, comprising: a processor and a memory, the memory storing executable instructions, the processor being configured to invoke the executable instructions stored in the memory to execute the video processing method as described in the above embodiments.

[0027] According to the video processing method provided in this disclosure, on the one hand, by determining a first time difference between the first seek time and the current playback time, the user seek operation can be divided into fine-tuning seek and coarse-tuning seek based on this first time difference. Decoding can then be performed based on different seek types. The user's intent can be identified through the first time difference, thereby achieving fast decoding of different seek types. On the other hand, if the first time difference is less than or equal to a preset first time threshold, the decoding starting video frame (i.e., the target frame) can be further determined according to the order of the first time and the current playback time. This avoids the problems of long response time and resource consumption caused by decoding too many video frames directly starting from the key frame before the first seek time, further improving the processing speed of video seek and enhancing the user experience. Attached Figure Description

[0028] The above and other objects, features, and advantages of this disclosure will become readily apparent from the following detailed description of exemplary embodiments, taken in conjunction with the accompanying drawings. Several embodiments of this disclosure are illustrated in the drawings by way of example and not limitation, in which:

[0029] Figure 1 One of the schematic diagrams of a video processing method flow according to an embodiment of the present disclosure is illustrated.

[0030] Figure 2 The diagram illustrates the positional relationship between the seek frame, the current frame, and the first frame in a coarse-tuned seek according to an embodiment of the present disclosure.

[0031] Figure 3 The illustration shows a schematic diagram of the target frame determination process for fine-tuning seek according to an embodiment of the present disclosure.

[0032] Figure 4 The diagram illustrates the positional relationship between the seek frame, the current frame, and the first frame in different situations during fine-tuning seek according to an embodiment of the present disclosure.

[0033] Figure 5 The second schematic diagram illustrates an implementation flowchart of a video processing method according to an embodiment of the present disclosure.

[0034] Figure 6 A schematic block diagram of a video processing apparatus according to an embodiment of the present disclosure is shown.

[0035] Figure 7 The schematic diagram illustrates a structure of a storage medium suitable for implementing embodiments of the present invention.

[0036] Figure 8 The schematic diagram illustrates a structure of an electronic device suitable for implementing embodiments of the present invention.

[0037] In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts. Detailed Implementation

[0038] The principles and spirit of this disclosure will now be described with reference to several exemplary embodiments. It should be understood that these embodiments are given merely to enable those skilled in the art to better understand and implement this disclosure, and are not intended to limit the scope of this disclosure in any way. Rather, these embodiments are provided to make this disclosure more thorough and complete, and to fully convey the scope of this disclosure to those skilled in the art.

[0039] Those skilled in the art will recognize that embodiments of this disclosure can be implemented as a system, apparatus, device, method, or computer program product. Therefore, this disclosure can be specifically implemented in the following forms: entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.

[0040] According to embodiments of this disclosure, a video processing method, a video processing apparatus, a storage medium, and an electronic device are proposed. Invention Overview

[0042] Video seek, or video playback positioning for short, allows users to jump to a specific video frame at a given time point. Current mainstream video coding standards, such as H.264 or HEVC (High Efficiency Video Coding), encode video frames into I-frames, B-frames, and P-frames. I-frames, also known as keyframes, are fully coded frames and can be decoded without referencing other frames. P-frames, known as forward predictive coded frames, require reference to preceding I-frames and P-frames for decoding. P-frame data only encodes the differences between itself and the preceding I / P frames, thus reducing the amount of data encoded. B-frames, known as bidirectional predictive coded frames, are predicted using the preceding I / P frames and the following P-frames, significantly reducing the amount of data encoded.

[0043] In related technologies, video seek (i.e., jumping directly to a specific point in time for playback) first seeks to the preceding I-frame, then starts decoding from that I-frame and continues decoding until the desired seek time point is reached. For videos with a large GOP (Group of Pictures) duration, such as a 10-second GOP, the 0th second is one I-frame, the 10th second is another I-frame. If you want to precisely seek to the 9th second of the video, you need to start decoding from the 0th second I-frame and continue decoding until the 9th second. This requires decoding all the preceding 9 seconds of video frames, which consumes a significant amount of CPU resources and time.

[0044] The video processing method and apparatus disclosed herein are designed to address this situation and can be applied to various terminal devices with video players. This disclosure uses a communication device as an example for illustration.

[0045] Exemplary methods

[0046] The preferred embodiments of this disclosure are described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the invention. Furthermore, the embodiments and features described herein can be combined with each other without conflict.

[0047] The following is for reference. Figure 1 The present disclosure describes a video processing method according to an exemplary embodiment, including steps S110-S130.

[0048] Step S110: In response to the video playback progress seek request, obtain the first time indicated by the seek request and the current playback time of the video.

[0049] In this example implementation, the video playback progress seek request can be generated based on the user's dragging operation in the video playback progress operation area. The first moment is the seek time point. The video positioning seek operation can be performed during video playback or pause on the terminal player. In this example, the video can be a network video obtained by the terminal from a network server, or a local video shot by the terminal using its own camera; this example does not limit the choice.

[0050] Step S120: Determine the first time difference between the first time and the current playback time.

[0051] In this example implementation, a first time difference between the seek time point and the current playback time point can be calculated. The first time difference represents the time difference between the seek time point and the current playback time point. The user's intent can be determined based on the magnitude of this first time difference. For example, when the first time difference is small, it is considered a fine-tuning seek; when the first time difference is large, it is considered a coarse-tuning seek.

[0052] In step S130, in response to the first time difference being less than or equal to a preset first time threshold, the target frame is determined according to the order of the first time and the current playback time, and the video is decoded starting from the target frame in the order of playback time.

[0053] In this example implementation, the user's intent (i.e., fine-tuning seek or coarse-tuning seek) can be determined by comparing the first time threshold with the first time difference. For example, if the first time difference is less than or equal to the preset first time threshold, it can be assumed that the user is performing a fine-tuning video seek, that is, the user wants to obtain video frames at precise time points. In this case, a precise seek method can be used to locate the target frame, thereby achieving precise positioning of the video frame.

[0054] In this example implementation, the first time threshold can be adjusted according to the user's needs. For example, for a Group of Pictures (GOP) of video data, the first time threshold can be configured based on the duration information of the GOP data. For example, the first time threshold can be set to a multiple of the current GOP duration. GOP data is called group of pictures data; a GOP is a set of consecutive frames. A GOP is a set of images in a sequence used to assist random access. The first image of the GOP data must be an I-frame to ensure that the GOP does not need to reference other GOP images and can be decoded independently.

[0055] In this example implementation, the duration information of different GOP data can be the same or different; this example does not limit this. When the duration information of GOP data changes or changes significantly, the first time threshold can be adjusted accordingly.

[0056] In this example implementation, the target frame is the decoding start frame of the video seek. The target frame can be determined based on the order of the first time and the current playback time. For example, if the first time of the seek is before the current playback time, the nearest I-frame before the seek time can be determined as the target frame. If the first time of the seek is after the current playback time, either the current frame or the nearest I-frame before the seek time can be determined as the target frame; this example does not limit this.

[0057] The video processing method provided in this disclosure, on the one hand, can determine a first time difference between the first seek time and the current playback time, and based on this first time difference, divide the user seek operation into fine-tuning seek and coarse-tuning seek, and then perform decoding based on different seek types. The first time difference can be used to identify user intent, thereby achieving fast decoding of different seek types. On the other hand, if the first time difference is less than or equal to a preset first time threshold, the starting video frame (i.e., the target frame) for decoding can be further determined according to the order of the first time and the current playback time. This avoids the problems of long response time and resource consumption caused by decoding too many video frames directly starting from the key frame before the first seek time, further improving the processing speed of video seek and enhancing the user experience.

[0058] In some example embodiments, in this disclosure embodiment, in response to a first time difference greater than a preset first time threshold, the first frame corresponding to the seek request is obtained from the video and played.

[0059] In this example implementation, when the first time difference is greater than a preset first time threshold, it is considered that the user is performing a coarse seek, and a coarse positioning method can be used for video frame positioning. The coarse positioning method can be to directly seek to the nearest I-frame before the seek time point and decode and play that I-frame. The positions of the seek video frame, the currently playing video frame, and the first frame using this coarse positioning method are as follows: Figure 2 As shown, the first frame refers to the nearest I-frame before the seek time point (first time). This eliminates the need for decoding video frames between that I-frame and the seek time point, improving operation response speed.

[0060] In some example embodiments, references Figure 3In this embodiment of the disclosure, determining the target frame based on the chronological order of the first time and the current playback time may include the following steps S310 and S320.

[0061] Step S310: In response to the first time being before the current playback time, determine the first frame as the target frame.

[0062] In this example implementation, when the first seek time is before the current playback time, it means that the seek video frame is closer to the I-frame than the current playback frame. Therefore, the first frame (i.e., the nearest I-frame before the seek) can be used as the target frame for decoding. The positions of the seek video frame, the current frame, and the first frame in this example are as follows: Figure 4 As shown on the left.

[0063] Step S320: In response to the first time being after the current playback time, determine the target frame based on the first time difference and the second time difference between the first time and the second time; the second time is the time corresponding to the first frame.

[0064] In this example implementation, when the first seek time is after the current playback time, it is necessary to further determine whether the seek frame is closer to the first frame or closer to the currently playing video frame. For example, the target frame can be determined by comparing the magnitude of a first time difference (the time difference between the seek frame and the current frame) and a second time difference (the time difference between the seek video frame and the first frame).

[0065] For example, if the first time difference is less than or equal to the second time difference (meaning the seek frame is closer to the current frame than the first frame), then the current frame can be determined as the target frame. This means video decoding can begin from the current frame, avoiding the decoding process of the nearest I-frame before the seek frame and improving seek response speed. The positions of the seek video frame, the currently playing video frame, and the first frame in this case are as follows: Figure 4 As shown in the middle section, the order of the seek video frame, the currently playing video frame, and the first frame is clearly visible in the diagram. Furthermore, if the first time difference is greater than the second time difference (meaning the seek frame is closer to the first frame than the current frame), then the first frame can be identified as the target frame, and video decoding can begin from the current frame, reducing the number of video frames to be decoded.

[0066] from Figure 4 The order in which the seek video frame, the current frame, and the first frame are determined to be the target frame can be clearly seen in various situations.

[0067] In some example embodiments, the video in this disclosure is a group of video frames. Before determining the first time difference between the first time and the current playback time, the method further includes: obtaining the duration information of the group of video frames, and in response to the duration information being less than or equal to a preset second time threshold, determining the second frame corresponding to the seek request, and starting from the second frame, decoding the group of video frames in the order of playback time, and playing the decoded video frames.

[0068] In this example implementation, when the video is GOP data, which is a group of consecutive frames, the seek processing method can be determined by judging the duration of the GOP data. When the duration is short, for example, less than or equal to a preset second time threshold, the nearest I-frame before the first time frame to be sought can be determined as the second frame during each seek, and decoding can begin from the second frame until the desired video frame is reached.

[0069] In this example implementation, the second time threshold can be adjusted according to the performance of the playback device. For example, when the CPU processing power of the playback device is high, the second time threshold can be slightly increased. Exemplarily, the second time threshold can be set to a value of 1 to 6 seconds (e.g., 2 seconds).

[0070] In this example, for videos with short GOP durations, since the duration is short, even if the seek time is always the nearest I-frame, it will not consume too much CPU resources and time, and will not affect the seek response time.

[0071] In some example embodiments, decoding the video from the target frame in the above embodiments according to the playback time sequence includes:

[0072] Based on the video data queue index, the video is decoded starting from the target frame and in chronological order of playback time.

[0073] In this example implementation, the video data queue index refers to the index used to locate video frames. Each video frame can correspond to an index number, which can be used to locate the video frame. For example, the target frame can be located using its index, and then the video can be decoded starting from that target frame in chronological order of playback.

[0074] Based on the video data queue index, obtain the third time of the currently decoded video frame; in response to the third time being the same as the first time, determine that the video frame corresponding to the seek request has been decoded.

[0075] In this example implementation, the video frame can be located by the index of the currently decoded video frame, the third time can be determined by the time index of the video frame, or the third time can be determined by the display timestamp of the video frame. When the third time of the decoded video is the same as the first time of the seek, it means that the seek video frame has been decoded and the decoding process is complete.

[0076] In some example embodiments, obtaining the first frame corresponding to the seek request from the video in the above embodiments includes: obtaining the target time index from the time index of the second frame, wherein the target time index is the time index of the second frame that is located before the first time and is closest to the first time.

[0077] The first frame is retrieved from the video based on the target time index and the video data queue index.

[0078] In this example implementation, the time index of the second frame can be a set of time indexes for I-frames. The time index that is closest to the first time point and occurs before the first time point is searched within this set. Based on this target time index and the video data queue index of the video frame, the nearest I-frame before the seek time point, i.e., the first frame, is obtained.

[0079] This disclosure addresses the frequently used video seek operation in video players and video editing tools. Based on user behavior scenarios, it categorizes user seek operations into two types: fine-tuning video seek and coarse-tuning video seek. For fine-tuning video seek, assuming users want to obtain video frames at precise times, a precise seek method is designed based on the order of the seek time point and the current playback time point. Different precise seek methods avoid unnecessary video frame decoding processes, reducing operation time and computational resource consumption, thus improving user experience. For coarse-tuning video seek, assuming users want video frames at a general time frame, a coarse seek method is used. This reduces the number of video frames decoded and improves the seek operation response speed.

[0080] The following is combined Figure 5 The specific process of a video processing method according to an embodiment of this application will be described.

[0081] Reference Figure 5 The specific process of the video processing method may include the following steps S501-S509.

[0082] Step S501: The duration of the GOP data is D, the current video playback time is C, the first time point corresponding to seek is S, and the time point corresponding to the nearest I-frame before the current playback time point is K.

[0083] Step S502: Determine whether the duration D of the GOP data is greater than the second time threshold (e.g., 2 seconds). If yes, proceed to step S503; otherwise, proceed to step S508.

[0084] Step S503: Determine whether the first time difference between the seek time point S and the current playback time point C is less than or equal to the first time threshold (e.g., 5D). If yes, it is considered that the user is making a fine-tuning seek, and proceed to step S504. Otherwise, it is considered that the user is making a coarse-tuning seek, and proceed to step S509.

[0085] Step S504: Determine whether the seek time point S is before the current playback time point C. If yes, proceed to step S505; otherwise, proceed to step S506.

[0086] Step S505: Determine the nearest I-frame preceding the seek video frame as the target frame, and start decoding from the target frame.

[0087] Step S506: Determine whether the first time difference between the seek time point S and the current playback time point C is less than or equal to the second time difference between the seek time point S and the previous nearest I-frame time point K. If yes, proceed to step S507; otherwise, proceed to step S505.

[0088] Step S507: Determine the current frame as the target frame and start decoding from the target frame.

[0089] In step S508, each seek starts decoding from the nearest I-frame before the seek request and continues decoding until the seek video frame is reached.

[0090] Step S509: Determine the nearest I-frame preceding the seek video frame as the target frame, and only decode the target frame.

[0091] The specific details of the above embodiments have been described in detail in the foregoing video processing method, and therefore will not be repeated here.

[0092] The following verification experiment was conducted to verify the effectiveness of this disclosure.

[0093] Using 1080P30 video with an I-frame interval of 10 seconds as the experimental object, the same seek operation (precise seek or coarse seek) was performed using both the traditional seek method (i.e., each seek starts from the nearest I-frame before the seek point and continues to the seek video frame) and the seek method disclosed in this paper. A total of 30 experiments were conducted, and the average response time of the seek operation was calculated. The results are shown in Table 1 below.

[0094] Table 1 Average response time of seek operation

[0095] seek method Traditional methods This method is publicly available. Fine-tuning seek Approximately 1-2 seconds Approximately 100 milliseconds coarse seek Approximately 1-2 seconds Approximately 10 milliseconds

[0096] In this example, a precise seek refers to a time difference of less than or equal to 50 seconds between the seek time point and the current playback time point. A coarse seek refers to a time difference of more than 50 seconds between the seek time point and the current playback time point. As can be seen from the statistical results in Table 1, for the precise seek method, the method disclosed herein can reduce the operation response time from approximately 1-2 seconds to approximately 100 milliseconds; for the coarse seek method, the method disclosed herein can reduce the operation response time from approximately 1-2 seconds to approximately 10 milliseconds. The above experiments demonstrate that this disclosure can significantly shorten the response time of seek operations.

[0097] The video processing method of this disclosure, based on the characteristics and intentions of users using seek, divides user video seek usage scenarios into coarse-tuning seek and fine-tuning seek, and applies different processing methods to different types of seek, which greatly shortens the response time of seek operation, improves response speed and enhances user experience while meeting user needs.

[0098] Exemplary device

[0099] It should be noted that the video processing method provided in this disclosure can be executed by a video processing device or a control module within that video processing device for executing the loading video processing method. This disclosure uses the execution of the loading video processing method by a video processing device as an example to illustrate the video processing method provided in this disclosure. Next, refer to... Figure 6 The video processing apparatus according to exemplary embodiments of the present disclosure will be described.

[0100] Figure 6 A block diagram of a video processing apparatus according to an embodiment of the present invention is shown schematically.

[0101] Reference Figure 6 As shown, a video processing apparatus 600 according to an embodiment of the present invention may include: an acquisition module 610, a determination module 620, and a processing module 630; wherein, the acquisition module 610 is configured to acquire, in response to a video playback progress seek request, a first time indicated by a seek request and the current playback time of the video; the determination module 620 is configured to determine a first time difference between the first time and the current playback time; the processing module 630 is configured to, in response to the first time difference being less than or equal to a preset first time threshold, determine a target frame according to the order of the first time and the current playback time, and decode the video starting from the target frame according to the playback time order.

[0102] In some embodiments of this disclosure, based on the foregoing scheme, the processing module 630 is further configured to: in response to a first time difference being greater than a preset first time threshold, obtain and play the first frame corresponding to the seek request from the video.

[0103] In some embodiments of this disclosure, based on the foregoing scheme, the processing module 630 is further configured to: determine the first frame as the target frame in response to the first time being before the current playback time; and determine the target frame based on the first time difference and the second time difference between the first time and the second time in response to the first time being after the current playback time; wherein the second time is the time corresponding to the first frame.

[0104] In some embodiments of this disclosure, based on the foregoing scheme, the processing module 630 is further configured to: determine the current frame as the target frame in response to a first time difference being less than or equal to a second time difference; and determine the first frame as the target frame in response to a first time difference being greater than the second time difference.

[0105] In some embodiments of this disclosure, based on the foregoing scheme, the video is a group of video frames. The acquisition module 610 is further configured to acquire the duration information of the group of video frames. The processing module 630 is further configured to: in response to the duration information being less than or equal to a preset second time threshold, determine the second frame corresponding to the seek request, and starting from the second frame, decode the group of video frames in the order of playback time, and play the decoded video frames.

[0106] In some embodiments of this disclosure, based on the foregoing scheme, the device 600 further includes: a configuration module, configured to configure a first time threshold according to duration information.

[0107] In some embodiments of this disclosure, based on the foregoing scheme, the device 600 further includes: a request generation module, used to generate a corresponding playback progress seek request in response to a drag operation in the video playback progress operation area.

[0108] In some embodiments of this disclosure, based on the foregoing scheme, the processing module 630 is further configured to: decode the video according to the video data queue index, starting from the target frame and in the order of playback time; obtain the third time of the currently decoded video frame according to the video data queue index; and determine that the video frame corresponding to the seek request has been decoded in response to the third time being the same as the first time.

[0109] In some embodiments of this disclosure, based on the foregoing scheme, the processing module 630 is further configured to: obtain a target time index from the time index of the second frame, wherein the target time index is the time index of the second frame that is located before the first time and closest to the first time; and obtain the first frame from the video according to the target time index and the video data queue index of the video.

[0110] The specific details of each module or unit in the aforementioned video processing device have been described in detail in the corresponding video processing methods, so they will not be repeated here.

[0111] Exemplary media

[0112] After introducing the method of the exemplary embodiments of the present invention, the medium of the exemplary embodiments of the present invention will be described next.

[0113] In some possible implementations, refer to Figure 7 Various aspects of the present invention can also be implemented as a storage medium 700 storing program code that, when executed by the processor of a device, implements the steps of the video processing methods according to various exemplary embodiments of the present invention described in the "Exemplary Methods" section above.

[0114] Specifically, the device's processor executes program code to implement the following steps:

[0115] In response to a video playback progress seek request, obtain the first time indicated by the seek request and the current playback time of the video; determine the first time difference between the first time and the current playback time; in response to the first time difference being less than or equal to a preset first time threshold, determine the target frame according to the order of the first time and the current playback time, and decode the video starting from the target frame in the order of playback time.

[0116] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the video processing method described above belong to the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the video processing method described above.

[0117] It should be noted that the storage medium described above can be a readable storage medium. A readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections with one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0118] The program code contained on the readable storage medium can be transmitted using any suitable medium, including but not limited to: wireless, wired, optical fiber, RF, or any suitable combination thereof.

[0119] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's electronic device, partially on the user's electronic device and partially on a remote electronic device, or entirely on a remote electronic device or server. In cases involving remote electronic devices, the remote electronic device can be connected to the user's electronic device via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external electronic device (e.g., via the Internet using an Internet service provider).

[0120] Exemplary electronic devices

[0121] Having described the methods, media, and apparatus of exemplary embodiments of the present disclosure, we will now describe an electronic device according to another exemplary embodiment of the present disclosure.

[0122] Those skilled in the art will understand that various aspects of the present invention can be implemented as systems, methods, or program products. Therefore, various aspects of the present invention can be specifically implemented in the following forms: entirely hardware implementations, entirely software implementations (including firmware, microcode, etc.), or implementations combining hardware and software aspects, collectively referred to herein as “circuits,” “modules,” or “systems.”

[0123] The following reference Figure 8 To describe an electronic device 800 according to this embodiment of the present invention. Figure 8 The electronic device 800 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0124] like Figure 8 As shown, the electronic device 800 is presented in the form of a general-purpose electronic device. The components of the electronic device 800 may include, but are not limited to: at least one processing unit 810, at least one storage unit 820, and a bus 830 connecting different system components (including storage unit 820 and processing unit 810).

[0125] The storage unit stores program code, which can be executed by the processing unit 810, causing the processing unit 810 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of the present invention.

[0126] Storage unit 820 may include a readable medium in the form of a volatile storage unit, such as random access memory (RAM) 8201 and / or cache memory 8202, and may further include a read-only memory (ROM) 8203.

[0127] The storage unit 820 may also include a program / utility 8204 having a set (at least one) of program modules 8205, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.

[0128] Bus 830 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.

[0129] Electronic device 800 can also communicate with one or more external devices (e.g., keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with electronic device 800, and / or any device that enables electronic device 800 to communicate with one or more other electronic devices (e.g., router, modem, etc.). This communication can be performed through display unit 840 and input / output (I / O) interface 850 connected to display unit 840. Furthermore, electronic device 800 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public network, such as the Internet) via network adapter 860. As shown, network adapter 860 communicates with other modules of electronic device 800 via bus 830. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0130] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause an electronic device (such as a personal computer, server, terminal device, or network device, etc.) to execute the method according to the embodiments of this disclosure.

[0131] The above is an illustrative scheme of an electronic device 800 according to this embodiment. It should be noted that the technical solution of this electronic device 800 and the technical solution of the video processing method described above belong to the same concept. For details not described in detail in the technical solution of the electronic device, please refer to the description of the technical solution of the video processing method described above.

[0132] It should be noted that although several modules or sub-modules of the video processing apparatus have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of the present invention, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0133] Furthermore, although the operations of the method of the present invention are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0134] While the spirit and principles of the invention have been described with reference to several specific embodiments, it should be understood that the invention is not limited to the specific embodiments described, and the division of aspects does not imply that features in these aspects cannot be combined for benefit; such division is merely for ease of description. The invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims

1. A method of video processing, the method comprising: The method comprises: in response to a video playback progress seek request, obtaining a first time indicated by the seek request and a current playback time of the video; determining a first time difference between the first time and the current playback time; in response to the first time difference being less than or equal to a preset first time threshold, determining a target frame according to the order of the first time and the current playback time, and decoding the video in playback time order starting from the target frame; wherein the determining of the target frame according to the order of the first time and the current playback time comprises: in response to the first time being before the current playback time, determining a first frame corresponding to the seek request as the target frame; the first frame is the nearest I frame before the first time; the time corresponding to the first frame is a second time; in response to the first time being after the current playback time, if the first time difference is less than or equal to a second time difference between the first time and the second time, determining a current frame as the target frame, and if the first time difference is greater than the second time difference, determining the first frame as the target frame.

2. The video processing method of claim 1, wherein, The method further comprises: in response to the first time difference being greater than the first time threshold, obtaining and playing the first frame from the video.

3. The video processing method of any of claims 1-2, wherein, The video is a group of pictures data, and before determining the first time difference between the first time and the current playback time, the method further comprises: obtaining duration information of the group of pictures data, and in response to the duration information being less than or equal to a preset second time threshold, determining a second frame corresponding to the seek request, decoding the group of pictures data in playback time order starting from the second frame, and playing the decoded video frame; the second frame is the nearest I frame before the first time.

4. The video processing method of claim 3, wherein, The method further comprises: configuring the first time threshold according to the duration information.

5. The video processing method of claim 1, wherein, The method further comprises: in response to a drag operation of a video playback progress operation area, generating a corresponding playback progress seek request.

6. The video processing method of claim 1, wherein, The decoding of the video in playback time order starting from the target frame comprises: decoding the video in playback time order starting from the target frame according to a video data queue index of the video; The method further comprises: obtaining a third time of a currently decoded video frame according to the video data queue index; in response to the third time being the same as the first time, determining that the video frame corresponding to the seek request has been decoded.

7. The video processing method of claim 2, wherein, The obtaining and playing of the first frame from the video comprises: in a time index of the second frame, obtaining a target time index, which is the time index of the second frame located before the first time and closest to the first time; obtaining and playing the first frame from the video according to the target time index and a video data queue index of the video.

8. A video processing apparatus, comprising: The device comprises: an obtaining module configured to, in response to a video playback progress seek request, obtain a first time indicated by the seek request and a current playback time of the video; determining a first time difference between the first time and the current playing time; the processing module is configured to, in response to the first time difference being less than or equal to a preset first time threshold, determine a target frame according to a sequence of the first time and the current playing time, and decode the video in a playing time sequence starting from the target frame; the processing module is further configured to: in response to the first time being before the current playing time, determine a first frame corresponding to the seek request as the target frame, the first frame being an I frame closest to the first time, and a time corresponding to the first frame being a second time; in response to the first time being after the current playing time, if the first time difference is less than or equal to a second time difference between the first time and the second time, determine a current frame as the target frame, and if the first time difference is greater than the second time difference, determine the first frame as the target frame.

9. The video processing apparatus of claim 8, wherein, the processing module is further configured to: in response to the first time difference being greater than the preset first time threshold, acquire and play the first frame from the video.

10. The video processing apparatus of claim 8 or 9, wherein, the video is a group of pictures data, and the acquiring module is further configured to acquire time length information of the group of pictures data; the processing module is further configured to, in response to the time length information being less than or equal to a preset second time threshold, determine a second frame corresponding to the seek request, decode the group of pictures data in a playing time sequence starting from the second frame, and play the decoded video frame, the second frame being an I frame closest to the first time.

11. The video processing apparatus of claim 10, wherein, The apparatus further comprises: a configuration module configured to configure the first time threshold according to the time length information.

12. The video processing apparatus of claim 8, wherein, The apparatus further comprises: a request generation module configured to generate a corresponding playing progress seek request in response to a drag operation of a video playing progress operation region.

13. The video processing apparatus of claim 8, wherein, the processing module is further configured to: decode the video in a playing time sequence starting from the target frame according to a video data queue index of the video; acquire a third time of a currently decoded video frame according to the video data queue index, and determine that the video frame corresponding to the seek request has been decoded in response to the third time being the same as the first time.

14. The video processing apparatus of claim 9, wherein, the processing module is further configured to: acquire a target time index in a time index of a second frame, the target time index being a time index of a second frame closest to the first time and located before the first time; acquire and play the first frame from the video according to the target time index and the video data queue index of the video.

15. A storage medium having a program stored thereon, the program being executed by a processor to implement the method of any one of claims 1 to 7.

16. An electronic device comprising: a processor and a memory, the memory storing executable instructions, and the processor being configured to invoke the executable instructions stored in the memory to execute the method of any one of claims 1 to 7.

Citation Information

Patent Citations

  • Media playing method and apparatus, and storage medium

    CN108737908A

  • Streaming media seek method and device, computing equipment and computer storage medium

    CN113726778A