Video decoding methods, devices, electronic equipment and storage media

By calculating the number of threads to decode the video draft in parallel based on the image resolution of the footage clips during video editing, the problem of low efficiency in serial decoding of multi-track video data is solved, achieving efficient decoding and smooth display during video transitions.

CN119383344BActive Publication Date: 2025-10-31BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310919485.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-25
Publication Date
2025-10-31
Estimated Expiration
2043-07-25

AI Technical Summary

Technical Problem

In existing technologies, the serial decoding efficiency of multi-track video data is low, resulting in problems such as stuttering during video editing and the inability to display video smoothly.

Method used

By responding to jump commands, the target playback position of the video draft is determined, the target number of threads is calculated based on the image resolution of the target material segment, the video draft is decoded in parallel, and the decoded image is generated. A hybrid method of parallel decoding and serial decoding is adopted, and the number of threads is dynamically adjusted to match resource consumption.

Benefits of technology

It improves decoding efficiency during video transitions, reduces stuttering, ensures smooth video playback, and avoids system resource exhaustion caused by parallel decoding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119383344B_ABST
    Figure CN119383344B_ABST
Patent Text Reader

Abstract

This disclosure provides a video decoding method, apparatus, electronic device, and storage medium. In response to a jump command, a target playback position of a video draft displayed on a terminal device is determined. The video draft corresponds to at least two video editing tracks, and each video editing track includes at least one clip. A target thread count is obtained based on the image resolution of the at least two target clips corresponding to the target playback position. The target thread count is the number of threads used by the terminal device to decode the target clip at the target playback position in parallel. The target clip is then decoded in parallel based on the target thread count to generate a decoded image of the video draft at the target playback position. By determining the number of threads used for parallel decoding of clips on multiple video editing tracks based on the image resolution of the target clips corresponding to the target playback position, stuttering during video jumps is reduced, and video smoothness is improved.
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 in particular to a video decoding method, apparatus, electronic device, and storage medium. Background Technology

[0002] In audio and video non-linear editing scenarios, when it is necessary to edit video content on multiple video editing tracks in a video simultaneously, jumping to a specified position in the video will trigger the terminal device to centrally decode the video data at that specified position in the video.

[0003] In existing technologies, centralized decoding of multi-track video data in the above scenarios is usually achieved through serial decoding. However, serial decoding has low overall decoding efficiency, resulting in problems such as stuttering during video editing and unsmooth video display. Summary of the Invention

[0004] This disclosure provides a video decoding method, apparatus, electronic device, and storage medium to overcome problems such as stuttering during video editing and the inability to display video smoothly.

[0005] In a first aspect, embodiments of this disclosure provide a video decoding method, including:

[0006] In response to a jump command, a target playback position of a video draft displayed on a terminal device is determined, wherein the video draft corresponds to at least two video editing tracks, and each video editing track includes at least one clip; based on the image resolution of the at least two target clips corresponding to the target playback position, a target thread count is obtained, wherein the target thread count is the number of threads on the terminal device that decode the target clip at the target playback position in parallel; the target clip is then decoded in parallel based on the target thread count to generate a decoded image of the video draft at the target playback position.

[0007] In a second aspect, embodiments of this disclosure provide a video decoding apparatus, comprising:

[0008] A response module is used to respond to a jump command and determine the target playback position of the video draft displayed in the terminal device, wherein the video draft corresponds to at least two video editing tracks, and the video editing track includes at least one material segment;

[0009] The processing module is used to obtain the target thread number based on the image resolution of at least two target material segments corresponding to the target playback position, wherein the target thread number is the number of threads of the terminal device that decode the target material segments at the target playback position in parallel;

[0010] The generation module is used to perform parallel decoding of the target material segment based on the target number of threads, and generate the decoded image of the video draft at the target playback position.

[0011] Thirdly, embodiments of this disclosure provide an electronic device, including: a processor and a memory;

[0012] The memory stores computer-executed instructions;

[0013] The processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the video decoding method as described in the first aspect and various possible designs of the first aspect.

[0014] Fourthly, embodiments of this disclosure provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the video decoding method described in the first aspect and various possible designs of the first aspect.

[0015] Fifthly, embodiments of this disclosure provide a computer program product, including a computer program that, when executed by a processor, implements the video decoding method described in the first aspect and various possible designs of the first aspect.

[0016] The video decoding method, apparatus, electronic device, and storage medium provided in this embodiment determine the target playback position of a video draft displayed on a terminal device in response to a jump command. The video draft corresponds to at least two video editing tracks, and each video editing track includes at least one media clip. A target thread count is obtained based on the image resolution of the at least two target media clips corresponding to the target playback position. This target thread count is the number of threads used by the terminal device to decode the target media clip at the target playback position in parallel. The target media clip is then decoded in parallel based on the target thread count to generate a decoded image of the video draft at the target playback position. By determining the number of threads for parallel decoding of media clips on multiple video editing tracks based on the image resolution of the target media clip at the target playback position, the target thread count obtained based on the image resolution can achieve a decoding thread count that matches the amount of decoding data. This avoids system resource exhaustion caused by parallel decoding while achieving parallel decoding, reduces stuttering during video jumps, and improves video smoothness. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is an application scenario diagram of the video decoding method provided in the embodiments of this disclosure;

[0019] Figure 2 Flowchart of the video decoding method provided in the embodiments of this disclosure Figure 1 ;

[0020] Figure 3 for Figure 2 A flowchart illustrating the specific implementation of step S102 in the illustrated embodiment;

[0021] Figure 4 A schematic diagram illustrating an equivalent number of orbitals provided in an embodiment of this disclosure;

[0022] Figure 5 for Figure 3 A flowchart illustrating the specific implementation of step S1022 in the illustrated embodiment;

[0023] Figure 6 This is a schematic diagram of decoding time data provided in an embodiment of the present disclosure;

[0024] Figure 7 A schematic diagram illustrating the process of determining a decoding strategy according to an embodiment of this disclosure;

[0025] Figure 8 Flowchart of the video decoding method provided in the embodiments of this disclosure Figure 2 ;

[0026] Figure 9 for Figure 8 A flowchart illustrating the specific implementation of step S202 in the illustrated embodiment;

[0027] Figure 10 This is a structural block diagram of a video decoding apparatus provided in an embodiment of the present disclosure;

[0028] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure;

[0029] Figure 12 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0030] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0031] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.

[0032] The application scenarios of the embodiments of this disclosure are explained below:

[0033] Figure 1 This diagram illustrates an application scenario of the video decoding method provided in this disclosure. The video decoding method can be applied to applications with video editing functions, and more specifically, to applications involving the editing of multi-track video. The executing entity in this embodiment can be a terminal device running the aforementioned application with video editing functions, a server running the server corresponding to the aforementioned application, or other electronic devices performing similar functions. (Reference) Figure 1As shown in the diagram, taking a terminal device as an example, the terminal device runs a target application for video editing. After loading the project file or draft file corresponding to the video draft through the target application, a multi-track editing page containing multiple video editing tracks is displayed in the video editing interface of the target application. The video draft is edited through this multi-track editing page. The video draft is the video data in the editing state. After the video draft is edited, the video draft can be generated into an output video. Specifically, each video editing track (e.g., Track_1, Track_2, and Track_3 shown in the diagram) contains one or more material clips that constitute the video draft (e.g., clips c1, c2, c3, and c4 shown in the diagram). The layer of the material clip located on the video editing track is determined according to the sequence number of the video editing track, so that each material clip is displayed sequentially in the final generated output video based on its layer. Furthermore, within this video editing interface, users can manually add, delete, and modify the various material segments that constitute the video draft on each video editing track as needed. The terminal device then synthesizes and encodes the material segments on each video editing track to obtain the final output video.

[0034] Furthermore, during the video editing process described above, when a user seeks the video to a specified playback position (e.g., position T_1 in the diagram) by operating the video editing interface, the terminal device will centrally decode all the material segments on the video editing track at that playback position. After all the material segments have been decoded, the device will render the corresponding preview video in the preview window based on the decoded image of each material segment, so that the user can view it.

[0035] In existing technologies, the centralized decoding of multi-track video data is typically achieved through serial decoding. For example, segments c1, c3, and c4 are sequentially decoded to obtain the video frame (decoded image) at the playback position of the video draft. However, the above-mentioned solutions in the existing technology suffer from low execution efficiency and slow speed, leading to increased decoding time. On the other hand, other related technical solutions decode each material segment in parallel, such as decoding segments c1, c3, and c4 in parallel. When the amount of data to be decoded is small, a faster decoding speed than serial decoding can be achieved. However, when the resource consumption of parallel decoding is large, such as when the number of parallel decoding threads is too large or the amount of data to be decoded is too large, the decoding speed will drop rapidly, even lower than the decoding speed of serial decoding, resulting in instability in the decoding process. Therefore, how to avoid the decrease in decoding speed due to excessive resource consumption of parallel decoding during the transition of multi-track video is a problem that urgently needs to be solved. This disclosure provides a method for detecting wearing deviation to solve the above problems.

[0036] refer to Figure 2 , Figure 2 Flowchart of the video decoding method provided in the embodiments of this disclosure Figure 1 The method of this embodiment can be applied in a terminal device. This video decoding method includes:

[0037] Step S101: In response to the jump command, determine the target playback position of the video draft displayed in the terminal device, wherein the video draft corresponds to at least two video editing tracks, and the video editing track includes at least one material clip.

[0038] For example, refer to Figure 1 The illustrated application scenario diagram shows that after the terminal device loads the video draft (project file or draft file) through the target application, multiple video editing tracks of the video draft are displayed in the video editing interface. Each video editing track contains at least one clip. See the attached diagram for details. Figure 1As shown, after receiving the user's jump command, the terminal device jumps the current playback position of the video draft to the target playback position corresponding to the jump command. The playback timestamp is the same as the playback timestamp of the video draft. Each video editing track corresponds to the same playback timestamp coordinate. Therefore, based on the target playback position, the playback timestamp of the video draft is determined simultaneously with the playback timestamp of each video editing track. Furthermore, at the target playback position, there are at least two clips. The terminal device decodes the clips on each video channel at the target playback position, generating corresponding decoded images, thereby enabling a preview of the video draft. This allows the user to observe the effect of the clips on each video editing track being superimposed in real time.

[0039] The specific implementation methods for loading multiple video editing tracks corresponding to the video draft through project files or draft files, as well as the specific implementation methods for determining the corresponding playback timestamp (target playback position) based on jump instructions, are existing technologies known to those skilled in the art and will not be elaborated here.

[0040] Step S102: Based on the image resolution of at least two target material segments corresponding to the target playback position, obtain the target thread count, which is the number of threads of the terminal device in parallel decoding the target material segments at the target playback position.

[0041] For example, after obtaining the target playback position, the media clip located at the target playback position is determined based on the target playback position. In one possible implementation, the target playback position corresponds to only one media clip; that is, among all video editing tracks in the video draft, only one video editing track has a media clip set at the target playback position, while other video editing tracks have no content at the target playback position. In this case, the media clip corresponding to the target playback position can be directly decoded using a single thread. In another possible implementation, the target playback position corresponds to at least two media clips; that is, at least two video editing tracks have media clips set at the target playback position. In this case, multiple threads are used to decode the media clips simultaneously; that is, at least two threads decode two media clips simultaneously at at least one moment (a one-to-one relationship between threads and media clips), i.e., parallel decoding. In one possible implementation, when the number of target media clips is less than a preset value, the corresponding number of target threads is determined based on the number of target media clips. For example, if the number of target media clips is 3, then the corresponding number of target threads is also determined to be 3, i.e., 3 threads decode 3 target media clips respectively. In another possible implementation, the amount of data to be decoded is obtained based on the resolution of the target material segment, thereby determining the number of target threads to match it, thus avoiding excessive decoding resource consumption and a decrease in decoding speed.

[0042] Specifically, in one possible implementation, such as Figure 3 As shown, the specific implementation of step S102 includes:

[0043] Step S1021: Based on the image resolution of the target material segment, obtain the equivalent number of tracks of the target material segment. The equivalent number of tracks represents the number of video frames in the target material segment that are equivalent to standard video frames with standard resolution.

[0044] For example, the target footage segment is a footage segment located at a target playback position on the video editing track. By locating the target playback position on the video editing track, the video data corresponding to the target footage segment can be obtained. Then, based on the descriptive information of the target footage segment's attributes in the video data, the image resolution of the target footage segment can be obtained, such as 3840×2160 (i.e., 4K), 1920×1080 (i.e., 1080p), etc. Next, an equivalent conversion is performed based on the image resolution of each target footage segment to obtain the equivalent track number. The equivalent track number represents the number of video frames in the target footage segment that are equivalent to standard video frames with standard resolution.

[0045] In one possible implementation, step S1021 is specifically implemented as follows:

[0046] Step S1021A: Obtain the standard resolution of the standard video frame.

[0047] Step S1021B: Based on the ratio of the image resolution of the target material segment to the standard resolution of the standard video frame, obtain the equivalent number of tracks for the target material segment.

[0048] For example, a standard video frame is an image based on the H.264 standard format, with a standard resolution of 1920×1080 (1080p). Based on the decoding data of one standard video frame, if the image resolution of the target material segment (the video frame corresponding to the target playback position) is 4k, then the equivalent number of tracks is 4, that is, (decoding the video frame corresponding to the target playback position) is equivalent to the decoding data of 4 standard video frames. Figure 4 A schematic diagram of an equivalent number of orbitals provided in an embodiment of this disclosure, such as... Figure 4As shown, at the target playback position P1 in the video draft, there are two target clips, namely target clip_1 and target clip_2 (shown as clip_1 and clip_2 in the figure). The image resolution of target clip_1 is 1080p, and the image resolution of target clip_2 is 4k. After equivalent conversion according to the standard resolution of 1080p, the equivalent number of tracks corresponding to target clip_1 is 1, and the equivalent number of tracks corresponding to target clip_2 is 4.

[0049] Furthermore, in one possible implementation, when the image resolution of the target footage segment is less than the standard resolution, it can be converted into a fraction or decimal. For example, if the image resolution is 480p, then based on the standard resolution of 1080p, its corresponding equivalent track number is 0.5. Then, the equivalent track numbers less than 1 are summed and rounded to obtain the corresponding merged equivalent track number, which participates in the subsequent calculation of the target thread number. Alternatively, in another possible implementation, when the image resolution of the target footage segment is less than the standard resolution, its corresponding equivalent track number is set to 1, thus participating in the subsequent calculation of the target thread number.

[0050] Step S1022: Obtain the target thread number based on the equivalent track number of at least one target material segment.

[0051] For example, after determining the equivalent number of tracks for each target material segment, the equivalent number of tracks for each target material segment can be summed to obtain the sum of equivalent track numbers. Then, based on the equivalent track numbers, a matching number of target threads can be allocated. In one possible implementation, when the sum of equivalent track numbers is less than a preset number of tracks, i.e., the amount of data to be decoded is small, the same number of target threads can be directly determined based on the sum of equivalent track numbers. For example, if the equivalent number of tracks is 3, then the corresponding number of target threads is determined to be 3, and subsequent parallel decoding is performed.

[0052] In another possible implementation, when the equivalent number of tracks exceeds the preset number of tracks, the target material segment is decoded using a hybrid decoding method that first performs parallel decoding and then serial decoding. Specifically, the optimal parallel decoding scheme can be obtained by obtaining pre-generated decoding time data and performing a lookup table. Figure 5 As shown, the specific implementation of step S1022 includes:

[0053] Step S1022A: Obtain the decoding time data corresponding to the terminal device. The decoding time data includes at least two mapping instances. The mapping instances are used to represent the mapping relationship between the number of threads and the decoding time of decoding a standard video frame in parallel based on the number of threads.

[0054] Step S1022B: Based on the sum of the equivalent track counts of each target material segment, query the decoding time data to obtain at least one optimized thread count, wherein the sum of at least one optimized thread count is equal to the sum of the equivalent track counts, and the sum of the decoding times corresponding to at least one optimized thread count is the shortest.

[0055] Step S1022C: Obtain the target number of threads based on at least one optimized thread count.

[0056] For example, Figure 6 This is a schematic diagram of decoding time data provided in an embodiment of the present disclosure, with reference to... Figure 6 As shown, the decoding time data includes mapping instances #1 to #9, which respectively represent the mapping relationship between the number of threads and the decoding time for decoding one standard video frame in parallel based on the number of threads. For example, in the figure, mapping instance #1 (shown as #1) indicates that the decoding time for decoding one standard video frame in parallel is T1; mapping instance #2 (shown as #2) indicates that the decoding time for decoding two standard video frames in parallel is T2; and so on, with mapping instance #9 (shown as #9) indicating that the decoding time for decoding nine standard video frames in parallel is T9. It should be noted that during the process of calling multiple threads for parallel decoding, due to the influence of factors such as the hardware parameters of the terminal device, the operating system, and the decoding algorithm, when the number of parallel decodes increases linearly, the corresponding decoding time does not increase synchronously and linearly, but varies based on the aforementioned hardware parameters, operating system, decoding algorithm, and other influencing factors. The decoding time data is used to record the mapping relationship between the number of threads and the decoding time for this terminal device. Decoding time data can be obtained through pre-sample detection or by recording the decoding time in the previous video decoding process. In this embodiment, the specific generation method of decoding time data will not be described.

[0057] After obtaining the decoding time data, based on the sum of the equivalent track counts of each target material segment, the decoding time data is queried to obtain a combination of target threads that minimizes the total decoding time for all the target material segments mentioned above, which is the optimal decoding strategy. Figure 7 A schematic diagram illustrating the process of determining a decoding strategy according to an embodiment of this disclosure is shown below. Figure 7 The process of determining the target number of threads described above will be further explained, such as... Figure 7As shown, after performing equivalent transformations on target clips clip_1, clip_2, and clip_3, the corresponding equivalent track numbers are track1_num = 1, track2_num = 3, and track3_num = 1, respectively. Summing these equivalent track numbers yields a total equivalent track number of track_sum = 5, which is the sum of the number of optimization threads. Next, by looking up the decoding time data based on `track_sum`, at least two decoding strategies can be obtained: Decoding strategy A, which uses 5 threads (i.e., `thread_num_1 = 5`) to process target clips `clip_1`, `clip_2`, and `clip_3`, with a decoding time of 0.5 seconds (i.e., `T = 0.5`); Decoding strategy B, which uses 2 threads (i.e., `thread_num_1 = 2`) to process target clips `clip_1` and `clip_3`, with a decoding time of 0.15 seconds, and then uses 2 threads (`thread_num_2 = 3`) to process target clip `clip_2`, with a decoding time of 0.2 seconds. Therefore, the total decoding time for decoding strategy B is 0.35 seconds (i.e., `T = 0.35`). Clearly, the decoding time of decoding strategy B is less than that of decoding strategy A. That is, the sum of decoding times corresponding to the optimized number of threads in decoding strategy B is less than the sum of decoding times corresponding to the optimized number of threads in decoding strategy A. Of course, it is understandable that other decoding strategies can be included by combining the number of threads, such as decoding strategy C, decoding strategy D, etc., which will not be elaborated on in this embodiment. In short, by combining different decoding methods based on the decoding time data of the production line, a decoding strategy with the shortest decoding time (shown in the figure as determined by the IF() conditional function) can be obtained. The combination of optimized thread numbers corresponding to this strategy is the target number of threads. Here, depending on the specific strategy, the target number of threads can be a specific numerical value or an array of multiple numerical values, thereby describing the number of decoding threads in the hybrid decoding process of "parallel decoding-serial decoding".

[0058] In this embodiment, by querying decoding time data, at least one number of optimized threads is obtained. With the goal of minimizing decoding time, different numbers of optimized threads are combined to obtain the optimal decoding strategy. Ultimately, the goal is to dynamically obtain the best decoding strategy based on different video drafts, thereby improving the speed of parallel decoding during the jump operation of video drafts for multiple video editing tracks.

[0059] Step S103: Perform parallel decoding on the target material segment based on the target number of threads to generate a decoded image of the video draft at the target playback position.

[0060] For example, after obtaining the target number of threads, the terminal device performs parallel decoding on the target material segment based on the target number of threads. Depending on the specific composition of the target number of threads, the terminal device can directly perform parallel decoding based on multiple threads that match the resolution (decoding data volume) of the target material segment to obtain the decoded image. Alternatively, it can perform multiple parallel decodings to achieve hybrid decoding based on the form of "parallel decoding-serial decoding" to obtain the decoded image. Since the target number of threads obtained in the previous steps corresponds to the optimal decoding strategy, the shortest total decoding time can be achieved. Therefore, performing parallel decoding on the target material segment based on the target number of threads can achieve the most efficient video decoding process, improve the generation speed of the decoded image at the target playback position, and reduce the stuttering caused by the decoding process.

[0061] In this embodiment, in response to a jump command, the target playback position of the video draft displayed on the terminal device is determined. The video draft corresponds to at least two video editing tracks, and each video editing track includes at least one clip. Based on the image resolution of the at least two target clips corresponding to the target playback position, a target thread count is obtained. This target thread count represents the number of threads on the terminal device that can decode the target clip at the target playback position in parallel. The target clip is then decoded in parallel based on the target thread count to generate a decoded image of the video draft at the target playback position. By determining the number of threads for parallel decoding of clips on multiple video editing tracks based on the image resolution of the target clip at the target playback position, the target thread count, which is based on the image resolution, ensures that the number of decoding threads matches the amount of decoding data. This achieves parallel decoding while avoiding system resource exhaustion caused by parallel decoding, reducing stuttering during video jumps, and improving video smoothness.

[0062] refer to Figure 8 , Figure 8 Flowchart of the video decoding method provided in the embodiments of this disclosure Figure 2 This embodiment is in Figure 2 Based on the illustrated embodiment, a step of generating decoding time data is further added, and step S102 is further refined. This video decoding method includes:

[0063] Step S201: Obtain a sample video that includes at least two video editing tracks, with each video editing track containing at least one source clip.

[0064] Step S202: Decode the sample video and update the number of parallel threads when decoding the sample video according to the decoding duration. The decoding duration represents the average decoding duration of a single track.

[0065] For example, combined Figure 2 The illustrated embodiment describes a process where, in determining the number of target threads used to decode a target media segment, pre-generated decoding time data is used as prior knowledge for table lookup, thereby achieving the goal of quickly determining the optimal decoding strategy. In this embodiment, in Figure 2 Based on the illustrated embodiment, a process for generating decoding time consumption data, namely steps S201-S203, is added. However, it should be noted that this process of generating decoding time consumption data can be executed independently and asynchronously with the subsequent process of using the decoding time consumption data.

[0066] Specifically, firstly, a sample video is acquired on the terminal device. Similar to a video draft, the sample video also has multiple video editing tracks, each containing at least one clip. Then, decoding of the sample video is triggered by equally spaced jumps, and the time taken for each decoding process is recorded, i.e., the decoding duration. Simultaneously, based on factors such as the terminal device's hardware parameters, operating system, and decoding algorithm, using different numbers of threads for decoding will cause variations in the decoding duration. Correspondingly, the terminal device can also reverse-engineer and record the number of threads based on the decoding duration, thus obtaining the mapping relationship between the decoding duration and the corresponding number of parallel threads, i.e., the decoding time data.

[0067] For example, such as Figure 9 As shown, the specific implementation of step S202 includes:

[0068] Step S2021: Obtain at least one material segment corresponding to the current decoding position of the sample video.

[0069] Step S2022: Decode the current video frame of at least one material segment based on the current thread number to obtain the corresponding current decoding duration.

[0070] Step S2023: Based on the comparison between the current decoding time and the previous decoding time, update the number of parallel threads to reduce the decoding time corresponding to the next material segment.

[0071] Steps S2021 to S2023 can be executed cyclically until a preset termination condition, such as the end of sample video playback, is met. This embodiment only describes the specific implementation of one of the loop polling methods in detail. For example, in this loop polling, firstly, the decoding data volume of one or more material segments corresponding to the current decoding position (i.e., the current video playback position) of the sample video is obtained. The decoding data volume is, for example, [data missing]. Figure 2The equivalent number of tracks is shown in the embodiment. Then, based on the current number of threads, the current video frame of the corresponding number of clips with the corresponding amount of decoded data (the sum of the equivalent number of tracks) is decoded to obtain the corresponding current decoding duration. Next, the current decoding duration is compared with the previous decoding duration for the same clip. If the current decoding duration is longer than the previous decoding duration, the number of threads is reduced, for example, by 1; if the current decoding duration is shorter than the previous decoding duration, the number of threads is increased, for example, by 1. This adjusts the number of threads to reduce the decoding duration of the next clip. In this process, the number of parallel threads is continuously updated to achieve an optimal value for a specific amount of decoded data (equivalent number of tracks).

[0072] Step S203: Generate decoding time data based on the decoding duration and the corresponding number of parallel threads.

[0073] For example, after decoding video clips of varying quantities and amounts of data, the terminal device records the optimal (shortest-time) number of parallel threads for each clip with different data volumes, and stores this information in the decoding time data. Subsequently, based on this decoding time data, when processing combinations of video clips with different data volumes, the corresponding number of parallel threads can be invoked for decoding, achieving the shortest-time decoding strategy. Simultaneously, during the processing of the sample video, the decoding time used to decode one standard video frame in parallel for different numbers of parallel threads can also be recorded, generating corresponding mapping instances and storing them in the decoding time data, thereby realizing a hybrid decoding process based on the decoding time data.

[0074] It should also be noted that the process of generating decoding time data can be executed synchronously with the subsequent video decoding process based on the decoding time data. That is, the decoding time data can be dynamically updated based on the decoding time of the video decoding based on the decoding time data, thereby achieving continuous and dynamic updates to the decoding time data. This allows the decoding time data to more accurately represent the performance characteristics of the terminal device in the process of multi-track video decoding, and improves the efficiency of video decoding based on the decoding time data.

[0075] Step S204: In response to the jump command, determine the target playback position of the video draft displayed in the terminal device, wherein the video draft corresponds to at least two video editing tracks, and the video editing track includes at least one material clip.

[0076] Step S205: Based on the image resolution of the target material segment, obtain the equivalent number of tracks of the target material segment. The equivalent number of tracks represents the number of video frames in the target material segment that are equivalent to standard video frames with standard resolution.

[0077] Step S206: Obtain the operating status information of the terminal device.

[0078] Step S207: Based on the running status information, obtain the current available resources of the terminal device. The available resources include available thread resources and / or available memory resources.

[0079] Step S208: Obtain the target thread number based on the equivalent number of tracks and available resources of at least one target material segment.

[0080] For example, in one possible implementation, while the terminal device is running the target application for editing video drafts, it may also be dynamically running other applications and services simultaneously. This causes changes in the resources available for video decoding on the terminal device (the amount of available resources). Since the decoding strategy determined in previous steps is based on the available resources of the terminal device, it is also affected by changes in the amount of available resources. Therefore, in this embodiment, the terminal device's running status information is first obtained, such as the currently running applications and the number of active threads. Then, based on the running status information, the current amount of available resources on the terminal device is obtained. The available resources include available thread resources and / or available memory resources. For example, the available resources can be represented by identifiers indicating different resource levels, such as a first level indicating a large amount of available resources, a second level indicating a medium amount of available resources, and a third level indicating a large amount of available resources. Further, the terminal device stores multiple decoding time data, each corresponding to a different amount of available resources. After determining the current amount of available resources, the terminal device determines matching decoding time data based on the available resources, and then uses this matching decoding time data to determine the corresponding target thread count. The process of determining the target thread count using decoding time data is as follows: Figure 2 The embodiments shown have been described in detail and will not be repeated here.

[0081] In this embodiment, by obtaining the current operating status information of the terminal device, the current available resource quantity is determined, and a matching decoding strategy (target thread count) is determined based on the available resource quantity. Since the impact of the terminal device itself on resource consumption is taken into account, the efficiency and speed of video decoding can be further improved, and the stuttering during video transition can be reduced.

[0082] Step S209: Perform parallel decoding on the target material segment based on the target number of threads to generate a decoded image of the video draft at the target playback position.

[0083] In this embodiment, the implementation of step S209 is the same as that in this disclosure. Figure 2 The implementation of step S103 in the illustrated embodiment is the same, and will not be described in detail here.

[0084] Corresponding to the video decoding method in the above embodiments, Figure 10 This is a structural block diagram of a video decoding apparatus provided in an embodiment of the present disclosure. For ease of explanation, only the parts relevant to the embodiments of the present disclosure are shown.

[0085] Reference Figure 10 The video decoding device 3 includes:

[0086] The response module 31 is used to respond to the jump command and determine the target playback position of the video draft displayed in the terminal device, wherein the video draft corresponds to at least two video editing tracks, and the video editing track includes at least one material segment;

[0087] Processing module 32 is used to obtain the target thread number based on the image resolution of at least two target material segments corresponding to the target playback position. The target thread number is the number of threads of the terminal device that decode the target material segments at the target playback position in parallel.

[0088] The generation module 33 is used to perform parallel decoding of the target material segment based on the target number of threads, and generate a decoded image of the video draft at the target playback position.

[0089] In one embodiment of this disclosure, the processing module 32 is specifically configured to: obtain the equivalent number of tracks of the target material segment based on the image resolution of the target material segment, wherein the equivalent number of tracks represents the number of video frames in the target material segment that are equivalent to standard video frames with standard resolution; and obtain the target number of threads based on the equivalent number of tracks of at least one target material segment.

[0090] In one embodiment of this disclosure, when the processing module 32 obtains the equivalent number of tracks of the target material segment based on the image resolution of the target material segment, it is specifically used to: obtain the standard resolution of the standard video frame; and obtain the equivalent number of tracks of the target material segment based on the ratio of the image resolution of the target material segment to the standard resolution of the standard video frame.

[0091] In one embodiment of this disclosure, when the processing module 32 obtains the target thread count based on the equivalent number of tracks of at least one target material segment, it is specifically configured to: obtain decoding time data corresponding to the terminal device, wherein the decoding time data includes at least two mapping instances, the mapping instances being used to characterize the mapping relationship between the thread count and the decoding time of decoding a standard video frame in parallel based on the thread count; query the decoding time data based on the sum of the equivalent number of tracks of each target material segment to obtain at least one optimized thread count, wherein the sum of at least one optimized thread count is equal to the sum of the equivalent number of tracks, and the sum of the decoding times corresponding to at least one optimized thread count is the shortest; and obtain the target thread count based on at least one optimized thread count.

[0092] In one embodiment of this disclosure, the processing module 32 is further configured to: obtain the operating status information of the terminal device; obtain the current available resource quantity of the terminal device based on the operating status information, wherein the available resource quantity includes available thread resources and / or available memory resources; when the processing module 32 obtains the target thread number based on the equivalent track number of at least one target material segment, it is specifically configured to: obtain the target thread number based on the equivalent track number of at least one target material segment and the available resource quantity.

[0093] In one embodiment of this disclosure, the standard video frame is an image based on the H.264 standard format, and the standard resolution corresponding to the standard video frame is 1080P.

[0094] In one embodiment of this disclosure, the processing module 32 is further configured to: acquire a sample video including at least two video editing tracks, each video editing track including at least one material segment; decode the sample video and update the number of parallel threads when decoding the sample video according to the decoding duration, the decoding duration representing the average decoding duration of a single track; and generate decoding time data according to the decoding duration and the corresponding number of parallel threads.

[0095] In one embodiment of this disclosure, when the processing module 32 decodes the sample video and updates the number of parallel threads for decoding the sample video according to the decoding duration, it is specifically used to: obtain at least one material segment corresponding to the current decoding position of the sample video; decode the current video frame of the at least one material segment based on the current number of threads to obtain the corresponding current decoding duration; and update the number of parallel threads according to the comparison result between the current decoding duration and the previous decoding duration to reduce the decoding duration corresponding to the next material segment.

[0096] The response module 31, processing module 32, and generation module 33 are connected sequentially. The video decoding device 3 provided in this embodiment can execute the technical solution of the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.

[0097] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure, such as... Figure 11 As shown, the electronic device 4 includes:

[0098] Processor 41, and memory 42 communicatively connected to processor 41;

[0099] Memory 42 stores instructions executed by the computer;

[0100] The processor 41 executes computer execution instructions stored in the memory 42 to achieve, for example, Figures 2-9 The video decoding method in the illustrated embodiment.

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

[0102] For relevant instructions, please refer to the corresponding text. Figures 2-9 The relevant descriptions and effects of the steps in the corresponding embodiments are understood, and will not be elaborated on here.

[0103] This disclosure provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement this disclosure. Figures 2-9 The video decoding method provided in any of the corresponding embodiments.

[0104] To implement the above embodiments, this disclosure also provides an electronic device.

[0105] refer to Figure 12 The diagram illustrates a structural schematic of an electronic device 900 suitable for implementing embodiments of the present disclosure. The electronic device 900 can be a terminal device or a server. The terminal device can include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, personal digital assistants (PDAs), portable Android devices (PADs), portable media players (PMPs), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 12 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0106] like Figure 12 As shown, the electronic device 900 may include a processing unit (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. The RAM 903 also stores various programs and data required for the operation of the electronic device 900. The processing unit 901, ROM 902, and RAM 903 are interconnected via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0107] Typically, the following devices can be connected to I / O interface 905: input devices 906 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 907 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 908 including, for example, magnetic tapes, hard disks, etc.; and communication devices 909. Communication device 909 allows electronic device 900 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 12 An electronic device 900 with various devices is shown; however, 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 alternatively.

[0108] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 909, or installed from a storage device 908, or installed from a ROM 902. When the computer program is executed by a processing device 901, it performs the functions defined in the methods of embodiments of this disclosure.

[0109] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-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 a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, 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 device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0110] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0111] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.

[0112] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone 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 remote computers, the remote computer can 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 can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0113] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0114] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".

[0115] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0116] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer 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 of the foregoing.

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

[0118] In response to a jump command, a target playback position of a video draft displayed on a terminal device is determined, wherein the video draft corresponds to at least two video editing tracks, and each video editing track includes at least one clip; based on the image resolution of the at least two target clips corresponding to the target playback position, a target thread count is obtained, wherein the target thread count is the number of threads on the terminal device that decode the target clip at the target playback position in parallel; the target clip is then decoded in parallel based on the target thread count to generate a decoded image of the video draft at the target playback position.

[0119] According to one or more embodiments of this disclosure, obtaining the target thread number based on the image resolution of at least two target material segments corresponding to the target playback position includes: obtaining the equivalent track number of the target material segment based on the image resolution of the target material segment, wherein the equivalent track number represents the number of video frames in the target material segment that are equivalent to standard video frames with standard resolution; and obtaining the target thread number based on the equivalent track number of at least one of the target material segments.

[0120] According to one or more embodiments of this disclosure, obtaining the equivalent number of tracks of the target material segment based on the image resolution of the target material segment includes: obtaining the standard resolution of a standard video frame; and obtaining the equivalent number of tracks of the target material segment based on the ratio of the image resolution of the target material segment to the standard resolution of the standard video frame.

[0121] According to one or more embodiments of this disclosure, obtaining the target thread count based on the equivalent track count of at least one of the target material segments includes: acquiring decoding time data corresponding to the terminal device, wherein the decoding time data includes at least two mapping instances, the mapping instances being used to characterize the mapping relationship between the thread count and the decoding time of decoding one standard video frame in parallel based on the thread count; querying the decoding time data based on the sum of the equivalent track counts of each of the target material segments to obtain at least one optimized thread count, wherein the sum of the at least one optimized thread count is equal to the sum of the equivalent track counts, and the sum of the decoding times corresponding to the at least one optimized thread count is the shortest; and obtaining the target thread count based on the at least one optimized thread count.

[0122] According to one or more embodiments of this disclosure, the method further includes: obtaining the operating status information of the terminal device; obtaining the current available resource quantity of the terminal device based on the operating status information, the available resource quantity including available thread resources and / or available memory resources; the step of obtaining the target thread number based on the equivalent track number of at least one target material segment includes: obtaining the target thread number based on the equivalent track number of at least one target material segment and the available resource quantity.

[0123] According to one or more embodiments of this disclosure, the standard video frame is an image based on the H.264 standard format, and the standard resolution corresponding to the standard video frame is 1080P.

[0124] According to one or more embodiments of this disclosure, the method further includes: acquiring a sample video comprising at least two video editing tracks, each video editing track comprising at least one source clip; decoding the sample video and updating the number of parallel threads used in decoding the sample video according to the decoding duration, the decoding duration representing the average decoding duration per track; and generating decoding time data according to the decoding duration and the corresponding number of parallel threads.

[0125] According to one or more embodiments of this disclosure, the step of decoding the sample video and updating the number of parallel threads when decoding the sample video based on the decoding duration includes: obtaining at least one material segment corresponding to the current decoding position of the sample video; decoding the current video frame of the at least one material segment based on the current number of threads to obtain the corresponding current decoding duration; and updating the number of parallel threads based on the comparison result between the current decoding duration and the previous decoding duration to reduce the decoding duration corresponding to the next material segment.

[0126] Secondly, according to one or more embodiments of this disclosure, a video decoding apparatus is provided, comprising:

[0127] A response module is used to respond to a jump command and determine the target playback position of the video draft displayed in the terminal device, wherein the video draft corresponds to at least two video editing tracks, and the video editing track includes at least one material segment;

[0128] The processing module is used to obtain the target thread number based on the image resolution of at least two target material segments corresponding to the target playback position, wherein the target thread number is the number of threads of the terminal device that decode the target material segments at the target playback position in parallel;

[0129] The generation module is used to perform parallel decoding of the target material segment based on the target number of threads, and generate the decoded image of the video draft at the target playback position.

[0130] According to one or more embodiments of this disclosure, the processing module is specifically configured to: obtain the equivalent number of tracks of the target material segment based on the image resolution of the target material segment, wherein the equivalent number of tracks represents the number of video frames in the target material segment that are equivalent to standard video frames with standard resolution; and obtain the target number of threads based on at least one equivalent number of tracks of the target material segment.

[0131] According to one or more embodiments of this disclosure, when the processing module obtains the equivalent number of tracks of the target material segment based on the image resolution of the target material segment, it is specifically used to: obtain the standard resolution of a standard video frame; and obtain the equivalent number of tracks of the target material segment based on the ratio of the image resolution of the target material segment to the standard resolution of the standard video frame.

[0132] According to one or more embodiments of this disclosure, when the processing module obtains the target thread count based on the equivalent track count of at least one of the target material segments, it is specifically configured to: obtain decoding time data corresponding to the terminal device, wherein the decoding time data includes at least two mapping instances, the mapping instances being used to characterize the mapping relationship between the thread count and the decoding time of decoding one standard video frame in parallel based on the thread count; query the decoding time data based on the sum of the equivalent track counts of each of the target material segments to obtain at least one optimized thread count, wherein the sum of the at least one optimized thread count is equal to the sum of the equivalent track counts, and the sum of the decoding times corresponding to the at least one optimized thread count is the shortest; and obtain the target thread count based on the at least one optimized thread count.

[0133] According to one or more embodiments of this disclosure, the processing module is further configured to: obtain the operating status information of the terminal device; obtain the current available resource quantity of the terminal device based on the operating status information, wherein the available resource quantity includes available thread resources and / or available memory resources; when the processing module obtains the target thread number based on the equivalent track number of at least one target material segment, it is specifically configured to: obtain the target thread number based on the equivalent track number of at least one target material segment and the available resource quantity.

[0134] According to one or more embodiments of this disclosure, the standard video frame is an image based on the H.264 standard format, and the standard resolution corresponding to the standard video frame is 1080P.

[0135] According to one or more embodiments of this disclosure, the processing module is further configured to: acquire a sample video including at least two video editing tracks, each video editing track including at least one source clip; decode the sample video, and update the number of parallel threads when decoding the sample video according to the decoding duration, the decoding duration representing the average decoding duration per track; and generate decoding time data according to the decoding duration and the corresponding number of parallel threads.

[0136] According to one or more embodiments of this disclosure, when the processing module decodes the sample video and updates the number of parallel threads for decoding the sample video based on the decoding duration, it is specifically configured to: obtain at least one material segment corresponding to the current decoding position of the sample video; decode the current video frame of the at least one material segment based on the current thread count to obtain the corresponding current decoding duration; and update the number of parallel threads based on the comparison result between the current decoding duration and the previous decoding duration to reduce the decoding duration corresponding to the next material segment.

[0137] Thirdly, according to one or more embodiments of the present disclosure, an electronic device is provided, comprising: at least one processor and a memory;

[0138] The memory stores computer-executed instructions;

[0139] The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the video decoding method as described in the first aspect and various possible designs of the first aspect.

[0140] Fourthly, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, wherein computer-executable instructions are stored therein, which, when executed by a processor, implement the video decoding method described in the first aspect and various possible designs of the first aspect.

[0141] Fifthly, according to one or more embodiments of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the video decoding method described in the first aspect and various possible designs of the first aspect.

[0142] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

[0143] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0144] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

Claims

1. A video decoding method, characterized in that, include: In response to a jump command, the target playback position of the video draft displayed on the terminal device is determined, wherein the video draft corresponds to at least two video editing tracks, and the video editing track includes at least one material clip; The target thread count is obtained based on the image resolution of at least two target material segments corresponding to the target playback position. The target thread count is the number of threads of the terminal device that decode the target material segments at the target playback position in parallel. Based on the target number of threads, the target material segment is decoded in parallel to generate the decoded image of the video draft at the target playback position.

2. The method according to claim 1, characterized in that, The step of obtaining the target thread number based on the image resolution of at least two target material segments corresponding to the target playback position includes: Based on the image resolution of the target material segment, the equivalent number of tracks of the target material segment is obtained. The equivalent number of tracks represents the number of video frames in the target material segment that are equivalent to standard video frames with standard resolution. The target thread number is obtained based on the equivalent number of tracks of at least one of the target material segments.

3. The method according to claim 2, characterized in that, The step of obtaining the equivalent number of tracks for the target material fragment based on its image resolution includes: Obtain the standard resolution of a standard video frame; The equivalent number of tracks for the target material segment is obtained based on the ratio of the image resolution of the target material segment to the standard resolution of the standard video frame.

4. The method according to claim 2, characterized in that, The step of obtaining the target thread number based on the equivalent track number of at least one of the target material segments includes: Obtain decoding time data corresponding to the terminal device. The decoding time data includes at least two mapping instances. The mapping instances are used to represent the mapping relationship between the number of threads and the decoding time of decoding a standard video frame in parallel based on the number of threads. Based on the sum of the equivalent track counts of each target material segment, the decoding time data is queried to obtain at least one optimized thread count, wherein the sum of the at least one optimized thread count is equal to the sum of the equivalent track counts, and the sum of the decoding times corresponding to the at least one optimized thread count is the shortest. The target number of threads is obtained based on the at least one optimized number of threads.

5. The method according to claim 2, characterized in that, The method further includes: Obtain the operating status information of the terminal device; Based on the operating status information, the current available resources of the terminal device are obtained, including available thread resources and / or available memory resources; The step of obtaining the target thread number based on the equivalent track number of at least one of the target material segments includes: The target thread number is obtained based on the equivalent number of tracks of at least one of the target material segments and the amount of available resources.

6. The method according to claim 2, characterized in that, The standard video frame is an image based on the H.264 standard format, and the standard resolution corresponding to the standard video frame is 1080P.

7. The method according to claim 1, characterized in that, The method further includes: Obtain a sample video comprising at least two video editing tracks, each of which includes at least one source clip; The sample video is decoded, and the number of parallel threads during the decoding of the sample video is updated according to the decoding duration, wherein the decoding duration represents the average decoding duration per track. Based on the decoding duration and the corresponding number of parallel threads, decoding time data is generated.

8. The method according to claim 7, characterized in that, The process of decoding the sample video and updating the number of parallel threads during decoding based on the decoding duration includes: Obtain at least one source clip corresponding to the current decoding position of the sample video; Based on the current number of threads, the current video frame of the at least one material segment is decoded to obtain the corresponding current decoding duration; Based on the comparison between the current decoding time and the previous decoding time, the number of parallel threads is updated to reduce the decoding time for the next footage segment.

9. A video decoding device, characterized in that, include: A response module is used to respond to a jump command and determine the target playback position of the video draft displayed in the terminal device, wherein the video draft corresponds to at least two video editing tracks, and the video editing track includes at least one material segment; The processing module is used to obtain the target thread number based on the image resolution of at least two target material segments corresponding to the target playback position, wherein the target thread number is the number of threads of the terminal device that decode the target material segments at the target playback position in parallel; The generation module is used to perform parallel decoding of the target material segment based on the target number of threads, and generate the decoded image of the video draft at the target playback position.

10. An electronic device, characterized in that, include: Processor and memory; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the video decoding method as described in any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the video decoding method as described in any one of claims 1 to 8.

12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the video decoding method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Video playing method and device, electronic equipment and storage medium

    CN113038276A

  • Panoramic video transmission method and device

    CN113766235A