Video processing method and apparatus, and electronic device and storage medium
By determining the parallel decoding number and parallel decoding during the jump of the video draft, the problem of stuttering and preview images when the video draft jump is not smooth, and achieve a more efficient decoding and smooth preview effect.
Patent Information
- Application Number
- PCT/CN2024/107671
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-07-25
- Filing Date
- 2024-07-25
- Publication Date
- 2025-01-30
AI Technical Summary
When the specified editing position of the video draft jumps, the multimedia material on multiple tracks is centrally decoded, causing problems such as stuttering and preview images not to be displayed smoothly.
By responding to the jump instructions of the video draft, determine the jump time point, obtain the target media material group, and determine the appropriate parallel decoding number based on the group to obtain a parallel decoding image on the media materials.
Improved the decoding efficiency of the video draft in the designated editing position, reducing the phenomenon of stuttering, and improving the fluency of preview images.
Smart Images

Figure CN2024107671_30012025_PF_FP_ABST
Abstract
Description
Video processing method, device, electronic device and storage medium
[0001] This application claims priority to the Chinese invention patent application entitled “Video processing method, device, electronic device and storage medium.” and application number 202310922177.6, filed on July 25, 2023. The entire contents of that application are incorporated by reference into this application. Technical Field
[0002] The embodiments of the present disclosure relate to the field of video processing technology, and in particular to a video processing method, device, electronic device, and storage medium. Background Art
[0003] In the scenario of video editing, the edited video draft is composed of multimedia materials located on multiple different tracks. During the editing process of the video draft, the specific content of the video draft will be displayed in the video editor interface, thereby achieving the purpose of previewing the editing effect of the video draft.
[0004] In related technologies, when jumping to a specified editing position in a video draft, the terminal device will be triggered to centrally decode the multimedia materials on multiple tracks at the specified editing position, resulting in problems such as freezes and inability to smoothly display preview images.
[0005] Summary of the Invention
[0006] The embodiments of the present disclosure provide a video processing method, device, electronic device, and storage medium to overcome problems such as freezes and inability to smoothly display preview images when jumping to a designated editing position in a video draft.
[0007] In a first aspect, an embodiment of the present disclosure provides a video processing method, the method comprising: determining a jump time point in response to a jump instruction for a video draft; wherein the video draft corresponds to at least two video editing tracks, and the video editing track includes at least one segment of media material; obtaining a target media material group based on a target time period in which the jump time point is located, the target media material group representing a logical set of media material segments of the media materials on each of the video editing tracks within the target time period; determining a corresponding target parallel decoding number based on the target parallel decoding number, and performing parallel decoding on the media material corresponding to the jump time point based on the target parallel decoding number to obtain a decoded image.
[0008] In a second aspect, an embodiment of the present disclosure provides a video processing device, comprising: a receiving module for determining a jump time point in response to a jump instruction for a video draft; wherein the video draft corresponds to at least two video editing tracks, and the video editing track includes at least one segment of media material; a processing module for obtaining a target media material group according to a target time period in which the jump time point is located, the target media material group representing a logical set of media material segments of the media materials on each of the video editing tracks within the target time period; a decoding module for determining a corresponding target parallel decoding number according to the target media material group, and performing parallel decoding on the media material corresponding to the jump time point based on the target parallel decoding number to obtain a decoded image.
[0009] In a third aspect, an embodiment of the present disclosure provides an electronic device comprising: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the video processing method described in the first aspect and various possible designs of the first aspect.
[0010] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the video processing method described in the first aspect and various possible designs of the first aspect is implemented.
[0011] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the video processing method described in the first aspect and various possible designs of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or related technologies, the following is a brief introduction to the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0013] FIG1 is a diagram illustrating an application scenario of a video processing method provided by an embodiment of the present disclosure;
[0014] FIG2 is a flow chart of a video processing method according to an embodiment of the present disclosure;
[0015] FIG3 is a schematic diagram of a target media material group provided by an embodiment of the present disclosure;
[0016] FIG4 is a flowchart of a specific implementation of step S103 in the embodiment shown in FIG2 ;
[0017] FIG5 is a schematic diagram of a decoding mapping table provided in an embodiment of the present disclosure;
[0018] FIG6 is a second flow chart of a video processing method provided by an embodiment of the present disclosure;
[0019] FIG7 is a schematic diagram of a process for generating a time period sequence according to an embodiment of the present disclosure;
[0020] FIG8 is a flowchart of a specific implementation of step S206 in the embodiment shown in FIG6 ;
[0021] FIG9 is a schematic diagram of a process for calculating the time consumption for decoding a single frame of multiple tracks in real time provided by the present disclosure;
[0022] FIG10 is a structural block diagram of a video processing device provided by an embodiment of the present disclosure;
[0023] FIG11 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure;
[0024] FIG12 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0025] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present disclosure without making any creative efforts shall fall within the scope of protection of the present disclosure.
[0026] 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, stored data, displayed data, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0027] The following explains the application scenarios of the embodiments of the present disclosure:
[0028] FIG1 illustrates an application scenario of the video processing method provided by an embodiment of the present disclosure. The video processing method provided by an embodiment of the present disclosure can be applied to an application with video editing capabilities, more specifically, to an application scenario for multi-track video editing. The execution entity of this embodiment can be a terminal device running the aforementioned application with video editing capabilities, a server running the corresponding server of the aforementioned application, or other electronic devices performing similar functions. Referring to FIG1 , taking a terminal device as an example, a video editing application for video editing is running within the terminal device. Within the video editing application, a video draft is loaded by loading a project file or a draft file. Subsequently, multiple video editing tracks corresponding to the video drafts are displayed within the multi-track editor interface of the video editing application. Each video editing track (e.g., Track_1, Track_2, and Track_3 shown in the figure) contains one or more clips (e.g., Clips c1, c2, c3, and c4 shown in the figure). The layers of the clips located on the video editing track are determined based on the sequence number of the video editing track, so that each clip is displayed in the final preview video and output video based on its layer. Furthermore, within the multi-track editor interface, users can manually add, delete, and modify the clips that make up the video draft on each video editing track as needed. The terminal device then synthesizes and encodes the clips on each video editing track to produce an output video that meets the user's needs.
[0029] Furthermore, during the video editing process, when a user seeks the current editing position of the video draft to a designated editing position (e.g., position T_1 in the figure) by operating the multi-track editor interface, the terminal device collectively decodes the clips on all video editing tracks at that editing position. After decoding of the clips is complete, the terminal device renders the decoded image corresponding to each clip on the screen and displays the corresponding preview image in the preview window for the user to view the editing effect.
[0030] In the related art, centralized decoding of multi-track media material is typically achieved through serial decoding. For example, segments c1, c3, and c4 are sequentially decoded serially to obtain a decoded image of the video draft at the editing position. However, this solution in the related art suffers from low execution efficiency and slow speed, resulting in increased decoding time. On the other hand, other related art solutions decode each material segment in parallel, such as segments c1, c3, and c4. This can achieve faster decoding speeds compared to serial decoding when the amount of decoded data is small. However, when parallel decoding consumes a lot of resources, such as when the number of parallel decoding threads is too large or the amount of decoded data is too large, the decoding speed can drop rapidly, even falling below the speed of serial decoding, leading to instability in the decoding process. In other words, when media material on multiple video editing tracks is decoded in parallel, low decoding efficiency can occur if the number of parallel decoders is not appropriately selected. Therefore, how to obtain a reasonable number of parallel decoding operations when performing jump operations on video drafts of multiple video editing tracks, thereby improving overall decoding efficiency, is an urgent problem that needs to be solved. The present disclosure provides a wearing deviation detection solution to solve the above problem.
[0031] Referring to FIG2 , FIG2 is a flow chart of a video processing method according to an embodiment of the present disclosure. The method of this embodiment can be applied in a terminal device, and the video processing method includes:
[0032] Step S101: In response to a jump instruction for a video draft, a jump time point is determined; wherein the video draft corresponds to at least two video editing tracks, and the video editing track includes at least one media material.
[0033] Exemplarily, referring to the application scenario diagram shown in FIG1 , after loading the video draft (project file or draft file), the terminal device displays multiple video editing tracks of the video draft in the multi-track editor interface. Each video editing track contains at least one segment of media material, as shown in FIG1 . Afterwards, after the terminal device receives the jump instruction input by the user, it jumps the current editing time point of the video draft (for example, 0 minutes and 0 seconds) to the jump time point corresponding to the jump instruction (for example, 1 minute and 10 seconds). Among them, the jump time point is the playback timestamp corresponding to the output video generated based on the video draft, and each video editing track corresponds to the same playback timestamp coordinate. Therefore, according to the jump time point, while determining the corresponding playback timestamp of the video draft, the playback timestamp of each video editing track is also determined. Furthermore, at the jump time point, there are at least two corresponding material segments. The terminal device will load and decode the media materials on each video editing channel at the jump time point, generate the corresponding decoded image, and thus preview the editing effect of the output video corresponding to the video draft based on the generated decoded image, so that the user can observe the effect of the superimposed display of the media materials on each video editing track in real time.
[0034] Among them, the specific implementation method of loading the video draft through the project file or draft file to set the media material on multiple video editing tracks, and the specific implementation method of determining the corresponding jump time point based on the jump instruction are existing technologies known to technical personnel in this field and will not be repeated here.
[0035] Step S102: obtaining a target media material group according to the target time period of the jump time point, wherein the target media material group represents a logical set of media material segments on each video editing track within the target time period.
[0036] Exemplarily, after obtaining the jump time point corresponding to the jump instruction, the time period in which it is located, i.e., the target time period, is determined according to the jump time point. The time period is a pre-divided time interval, and the specific division rules are introduced in detail in the subsequent steps. After determining the target time period, the target media material group corresponding to the target time period can be obtained according to the time period identifier corresponding to the target time period. The media material group is a logical collection of media material segments, and the media material segments are slices obtained after dividing the media material based on the above-mentioned time period. The target media material group represents a logical collection of media material segments on each video editing track within the target time period. Figure 3 is a schematic diagram of a target media material group provided by an embodiment of the present disclosure. As shown in Figure 3, in the multi-track editor interface for the video draft video_1, there are 3 video editing tracks, namely Track_1, Track_2 and Track_3. Specifically, video editing track Track_1 is configured with media assets clip_1 and clip_2; video editing track Track_2 is configured with media assets clip_3 and clip_4; and video editing track Track_3 is configured with media assets clip_5 and clip_6. The playback times of these media assets are based on the same playback timeline, and the relationship between the playback times of these media assets is shown in the figure. Based on the target time period [T1-T2], each video editing track is vertically segmented to obtain media asset segments C1 corresponding to video editing track Track_1, C2 corresponding to Track_2, and C3 corresponding to Track_3. The logical collection of these media asset segments C1, C2, and C3 constitutes the target media asset group.
[0037] Furthermore, the target time period [T1-T2], i.e., the time period determined by the jump time point, may be implemented in a manner such that, for example, multiple time periods are preset in the terminal device, including, in addition to the target time period [T1-T2], a time period [T2-T3], a time period [T4-T5], and the like. The corresponding target time period is determined from the multiple preset time periods based on the jump time point.
[0038] Step S103: determining a corresponding target parallel decoding number according to the target media material group, and performing parallel decoding on the media material corresponding to the jump time point based on the target parallel decoding number to obtain a decoded image.
[0039] Exemplarily, after obtaining the target media material group, a target parallel decoding number that matches the target media material group is determined based on the target media material group. Exemplarily, the target parallel decoding number refers to the number of decoding threads used in parallel when decoding each media material corresponding to the target media material group. For example, if the target parallel decoding number is 3, it indicates that the media materials on each video editing track corresponding to the target media material group are decoded using 3 threads; and if the target parallel decoding number is 6, it indicates that the media materials on each video editing track corresponding to the target media material group are decoded using 6 threads. Exemplarily, the maximum target parallel decoding number does not exceed the number of media materials corresponding to the target media material group.
[0040] In one possible implementation, the target parallel decoding number can be determined based on the amount of decoded data corresponding to the target media material group. The more media material segments corresponding to the target media material group, the larger the decoded data volume. Therefore, based on a preset mapping relationship, a target parallel decoding number can be obtained that matches the number of media materials corresponding to the target media material group. More specifically, for example, in a request where the amount of decoded data is less than a threshold, the target parallel decoding number is equal to the number of media material segments corresponding to the target media material group. For example, when the number of media material segments corresponding to the target media material group is 6, the corresponding target parallel decoding number is also determined to be 6. Based on this target parallel decoding number, the corresponding decoding thread is invoked to decode the media material corresponding to the jump time point, thereby obtaining the corresponding decoded image, thereby enabling a subsequent preview of the video editing effect. In this embodiment, by obtaining the target parallel decoding number and performing parallel decoding of the media materials corresponding to the jump time point based on the target parallel decoding number, decoding efficiency can be improved to a certain extent compared to a single-thread serial decoding solution.
[0041] In another possible implementation, as shown in FIG4 , the specific implementation of determining the corresponding target number of parallel decoding according to the target media material group in step S103 includes:
[0042] Step S1031: Obtain a corresponding decoding mapping table according to the number of media material segments corresponding to the target media material group. The decoding mapping table includes at least one decoding time consumption record, which is used to represent the decoding time corresponding to the number of parallel decoding operations.
[0043] Step S1032: According to the decoding mapping table, the number of parallel decodings that consumes the shortest decoding time is determined as the target number of parallel decodings.
[0044] Exemplarily, after obtaining the target media material group and determining the number of media material segments corresponding to the target media material group, the corresponding decoding mapping table is obtained according to the number of media material segments. The decoding mapping table contains at least one decoding time record for characterizing the decoding time corresponding to the number of parallel decodings. The decoding time record in the decoding mapping table is the record information generated when the video draft was previously decoded. Figure 5 is a schematic diagram of a decoding mapping table provided by an embodiment of the present disclosure. As shown in Figure 5, the number of media material segments = M, and the corresponding decoding mapping table is determined to be decoding mapping table P1 (other examples include decoding mapping table P0, decoding mapping table P2, etc.). The decoding mapping table P1 contains multiple decoding time records, such as rec_1, rec_2, rec_3, etc. shown in the figure. Each decoding time record corresponds to at least one parallel decoding number and a corresponding decoding duration. For example, rec_1 has two cases: N=1 and N=2. Correspondingly, when N=1, the corresponding single-frame decoding duration is T=2 (preset units, e.g., 100 milliseconds, the same below); when N=2, the corresponding single-frame decoding duration is T=1.2. For the decoding time record rec_2, there are three cases: N=3, N=4, and N=5. Correspondingly, when N=3, the corresponding single-frame decoding duration is T=0.8; when N=4, the corresponding single-frame decoding duration is T=0.6; and when N=5, the corresponding single-frame decoding duration is T=0.9. The specific implementation of the decoding time record rec_3 is similar to that of the decoding time records rec_1 and rec_2 and will not be repeated here. According to the decoding mapping table that matches the number of media material segments corresponding to the target media material group, the number of parallel decodings with the shortest time consumption, ie, the number of parallel decodings N=4, is selected and determined as the target number of parallel decodings.
[0045] In this embodiment, the jump time point is determined by responding to the jump instruction for the video draft. The video draft corresponds to at least two video editing tracks, and the video editing track includes at least one media material. According to the target time period where the jump time point is located, a target media material group is obtained, and the target media material group represents a logical set of media material segments of the media materials on each video editing track within the target time period. According to the target media material group, the corresponding target parallel decoding number is determined, and based on the target parallel decoding number, the media material corresponding to the jump time point is decoded in parallel to obtain a decoded image. By obtaining the target media material group corresponding to the jump time point and determining the target parallel decoding number that matches it according to the target media material group, when the media material of the jump time point is decoded in parallel based on the target parallel decoding number, higher decoding efficiency can be achieved, the occurrence of freezes can be reduced, and the playback smoothness of the preview image generated after decoding can be improved.
[0046] Referring to FIG6 , FIG6 is a second flow chart of the video processing method provided by the embodiment of the present disclosure. Based on the embodiment shown in FIG2 , this embodiment further refines step S103 , and the video processing method includes:
[0047] Step S201: In response to a jump instruction for a video draft, a jump time point is determined; wherein the video draft corresponds to at least two video editing tracks, and the video editing track includes at least one media material.
[0048] Step S202: obtaining a pre-generated time period sequence, wherein the time period sequence includes at least two key time points, and two adjacent key time points in the time period sequence correspond to one time period.
[0049] Step S203: Obtain the target time period where the jump time point is located according to the position of the jump time point in the time period sequence.
[0050] Exemplarily, after receiving a jump instruction for a video draft and determining the jump time point, it is necessary to determine the target time period according to the jump time point, and then obtain the target media material group corresponding to the target time period. Specifically, first obtain a pre-generated time period sequence, which includes at least two key time points in the time period sequence, and the key time points in the time period sequence are arranged in a monotonically changing order (for example, from small to large, or from large to small). Two adjacent key time points in the time period sequence correspond to a time period. By taking any two adjacent key time points in the time period sequence, a time period and a media material group corresponding to the time period can be determined. Among them, the key time points in the time period sequence are determined by the start and end time points of the media material on the video editing track. Therefore, exemplarily, before step S202, it also includes:
[0051] Step S200A: Obtain the start and end time points of the media materials on each video editing track corresponding to the video draft.
[0052] Step S200B: Map the start and end time points of the media materials on each video editing track to the same time axis, and merge the overlapping start and end time points to obtain a time period sequence.
[0053] Exemplarily, FIG7 is a schematic diagram of a generation process of a time period sequence provided by an embodiment of the present disclosure. As shown in FIG7 , corresponding media materials are provided on the video editing tracks Track_1, Track_2, and Track_3 corresponding to the video draft, such as the media materials clip_1 to clip_5 shown in the figure, the video editing tracks where each media material is located, and the playback time relationship between each media material are shown in the reference figure. The 10 start and end time points (including the start time point and the end time point) corresponding to the media materials clip_1 to clip_5 are obtained, which are P1 to P10 shown in the figure respectively. Afterwards, the start and end time points P1 to P10 are mapped to the unified time axis corresponding to each video editing track, that is, the playback time axis of the video draft, and the overlapping start and end time points, that is, P3 and P7 are merged, and P4 and P8 (P9) are merged. The time period sequence [P3, P1, P4, P5, P2, P10, P6] is obtained.
[0054] Furthermore, the time point sequence corresponds to 6 media material groups, namely, media material group seg_1 (shown as seg_1 in the figure, the same below) corresponding to the time period [P3, P1], media material group seg_2 corresponding to the time period [P1, P4], media material group seg_3 corresponding to the time period [P4, P5], media material group seg_4 corresponding to the time period [P5, P2], media material group seg_5 corresponding to the time period [P2, P10], and media material group seg_6 corresponding to the time period [P10, P6].
[0055] Step S204: obtaining a target media material group according to the target time period where the jump time point is located. The target media material group represents a logical set of media material segments on each video editing track within the target time period.
[0056] Referring to the time period sequence shown in FIG7 , the time period to which the jump time point belongs, i.e., the target time period, can be determined based on the position of the jump time point on the playback timeline. Subsequently, based on the mapping relationship between the time period sequence and the media material group, the target time period can be obtained to obtain the corresponding target media material group.
[0057] Step S205: Obtain the initial number of parallel decoding operations.
[0058] For example, after obtaining the target media material group corresponding to the jump time point, it is necessary to decode the media material segments (or media materials) on the multiple video editing tracks corresponding to the target media material group so that the video content at the jump time point can be played (previewed) after the jump operation is performed. To improve the speed of centralized decoding of the media material segments on the multiple video editing tracks while avoiding the problem of improperly set parallel decoding parameters causing a decrease in decoding speed, this embodiment adopts a dynamic parallel decoding method, using a dynamic number of decoding threads to parallel decode the media material segments corresponding to the target media material group. Specifically, an initial parallel decoding number is first obtained. In one possible implementation, the initial parallel decoding number is a preset value, such as 1 (i.e., equivalent to single-thread serial decoding). That is, regardless of the number of media material segments included in the target media material, the media materials of the target media material group are decoded using a single decoding thread. Thereafter, through subsequent iterative cycles, the parallel decoding number is gradually increased until the parallel decoding number with the shortest time consumption, i.e., the optimal parallel decoding number (target parallel decoding number), is detected, and decoding is performed based on this optimal parallel decoding number.
[0059] In another possible implementation, the initial number of parallel decoding is dynamically determined based on the characteristics of the target media material group. For example, the specific implementation steps of step S205 include:
[0060] Step S2051: Obtain the cumulative number of media material segments in the target media material group;
[0061] Step S2052: Determine an initial number of parallel decoding operations according to the accumulated number and / or the resolution of each media material segment.
[0062] Exemplarily, the cumulative number of media material segments in the target media material group is obtained. The larger the cumulative number, the more media material segments in the target media material group, that is, the larger the amount of decoded data. In one possible implementation, the corresponding parallel decoding number is determined based on the cumulative number. For example, when the cumulative number is N, the corresponding initial parallel decoding number is f(N). More specifically, for example, when the cumulative number is N, the corresponding initial parallel decoding number is 2 / N. In another possible implementation, the parallel decoding number is determined based on the cumulative number and the resolution of each media material segment. Specifically, for example, the media material segments in the target media material group include media material segment cilp_1, media material segment cilp_2, and media material segment cilp_3. Among them, media material segment cilp_1 and media material segment cilp_2 have a resolution of 1080P; and media material segment cilp_3 has a resolution of 2K. Based on the resolution of each media material segment, after equivalent conversion, the media material segment cilp_1 and the media material segment cilp_2 correspond to one preset unit of decoding data volume, the media material segment cilp_3 corresponds to two preset units of decoding data volume, and the media material segment cilp_1, the media material segment cilp_2 and the media material segment cilp_3 correspond to a total of four preset units of decoding data volume. Accordingly, according to the decoding data volume of the four preset units, the corresponding parallel decoding number is determined, for example, 2. Compared to the solution of determining the parallel decoding number only by the cumulative number, combining the resolution of each media material segment can better express the specific required decoding data volume, and then determine the initial parallel decoding number that matches it, which can further improve the decoding efficiency.
[0063] In the steps of this embodiment, the initial parallel decoding number is determined based on the cumulative number of media material segments in the target media material group and / or the resolution of each media material segment. This can make the initial parallel decoding number closer to the optimal (shortest time-consuming) parallel decoding number obtained subsequently, thereby reducing the number and duration of parallel decoding number detections, and more quickly obtaining the optimal parallel decoding number (target parallel decoding number), thereby improving the decoding speed.
[0064] Step S206: Based on the number of parallel decoding, the target media material group is decoded in parallel to obtain the multi-track single-frame decoding time.
[0065] For example, based on the parallel decoding number obtained in the previous step, the media material segments corresponding to the target media material group are decoded in parallel, and during the decoding process, the multi-track single-frame decoding time is calculated. The multi-track single-frame decoding time can be the total decoding time consumed after decoding one frame of all the media material segments corresponding to the target media material group, or the average decoding time consumed after decoding one frame of all the media material segments corresponding to the target media material group.
[0066] Exemplarily, as shown in FIG8 , the specific implementation steps of step S206 include:
[0067] Step S2061: Obtain the video resolution of each media material segment corresponding to the target media material group.
[0068] Step S2062: sorting the media material segments corresponding to the target media material in ascending order according to the video resolution to obtain a segment sequence of length N, where N is the number of media material segments corresponding to the target media material group.
[0069] Step S2063: The first M media material segments in the material segment sequence are decoded in parallel, and the last NM media materials are decoded in series to obtain the multi-track single-frame decoding time consumption, where M is the current number of parallel decodings.
[0070] Exemplarily, during the decoding process of each media material segment corresponding to the target media material group, each media material segment needs to be decoded based on the current parallel decoding number. If the current parallel decoding number is less than the number of media material segments, a hybrid decoding process of first parallel decoding and then serial decoding is performed on each media material segment corresponding to the target media material group. For example, the first five of ten media material segments are divided into a first group, and the last five are divided into a second group. The first group is first decoded in parallel. After the first round of parallel decoding is completed, the second group is then decoded in parallel. Finally, the multi-track single-frame decoding time is calculated based on the sum of the decoding times corresponding to the first and second groups. In this embodiment, the media material segments corresponding to the target media material are sorted in ascending order based on their video resolution. Then, based on the current parallel decoding number M (an integer greater than 0), the first M media material segments with the lowest resolution are decoded in parallel. Then, serial decoding is performed on NM (N is an integer greater than 1) media materials to calculate the multi-track single-frame decoding time. The multi-track single-frame decoding time can reflect the efficiency of decoding a sequence of material clips with a queue length of N based on the parallel decoding number M. The longer the multi-track single-frame decoding time is, the lower the single-frame decoding efficiency is. Conversely, the shorter the multi-track single-frame decoding time is, the higher the single-frame decoding efficiency is.
[0071] FIG9 is a schematic diagram of a process for calculating the time consumption of multi-track single-frame decoding provided in real time by the present disclosure. The above process will be described in detail below in conjunction with FIG9 . Referring to FIG9 , the media material segments corresponding to the target media material group include media material segment clip_1 (shown as clip_1 in the figure, the same below), media material segment clip_2, media material segment clip_3 and media material segment clip_4. Among them, the resolution of media material segment clip_1 is 540P, the resolution of media material segment clip_2 is 1080P, the resolution of media material segment clip_3 is 2k, and the resolution of media material segment clip_4 is 720P. According to the video resolution, the media material segments corresponding to the target media material are sorted in order from small to large to obtain a material segment sequence cilp_list with a length of N=4. Then, based on the number of parallel decodes, when the number of parallel decodes M = 2, the first two media clips in the clip sequence cilp_list, clip_1 and clip_4, are decoded in parallel, and clip_2 and clip_3 are decoded serially. The corresponding time consumption is calculated to obtain the multi-track single-frame decoding time T1. When the number of parallel decodes M = 3, the first three media clips in the clip sequence cilp_list, clip_1, clip_4, and clip_2, are decoded in parallel, and clip_3 is decoded serially. The corresponding time consumption is calculated to obtain the multi-track single-frame decoding time T2. And so on, until the process of cyclically detecting the target number of parallel decodes ends.
[0072] Optionally, after step S206, the method further includes:
[0073] Step S206A: Generate a decoding time record based on the multi-track single-frame decoding time and the corresponding parallel decoding number, and add the decoding time record to the decoding mapping table.
[0074] For example, after decoding is performed based on a different number of parallel decodings each time and the corresponding calculated multi-track single-frame decoding time is obtained, the parallel decoding number and the corresponding multi-track single-frame decoding time are stored as a set of records in a decoding mapping table, and the decoding mapping table is saved synchronously with the video draft. When the video draft is subsequently edited and the video jumps, the optimal parallel decoding number (target parallel decoding number) can be directly determined based on the decoding mapping table and parallel decoding can be performed, thereby improving decoding efficiency. Among them, the relevant implementation method of the decoding mapping table has been introduced in detail in the embodiment shown in Figure 2 and will not be repeated here.
[0075] Step S207: If the number of parallel decoding or the multi-track single-frame decoding time meets the target condition, the target number of parallel decoding is obtained based on the number of parallel decoding, and step S209 is executed.
[0076] Step S208: If the number of parallel decoding and the multi-track single-frame decoding time do not meet the target conditions, the target step size is increased for the number of parallel decoding to update the number of parallel decoding, and the process returns to step S206.
[0077] For example, after each decoding operation based on the current parallel decoding number is completed, a determination is made based on the obtained multi-track single-frame decoding time to determine whether to terminate detection of the target parallel decoding number. In one possible implementation, if the parallel decoding number reaches a preset number, the loop is terminated. Based on the previously recorded multi-track single-frame decoding times corresponding to different parallel decoding numbers, the parallel decoding number with the shortest multi-track single-frame decoding time is determined as the target parallel decoding number.
[0078] In another possible implementation, if the multi-track single-frame decoding time meets the target condition, for example, the multi-track single-frame decoding time is less than the preset value, the loop is stopped. And the current number of parallel decoding is determined as the target number of parallel decoding. In the steps of this embodiment, the multi-track single-frame decoding time is judged in real time. If the requirement is met, that is, it is less than the preset time, the subsequent parallel decoding can be performed with its corresponding parallel decoding number, without pursuing the minimum multi-track single-frame decoding time. Since the scheme of this embodiment (compared to the scheme that pursues the minimum multi-track single-frame decoding time) can effectively retrieve the rounds of cyclic detection (parallel decoding number), the overall time consumption is shorter, and the decoding speed can be further improved in the absence of a decoding mapping table.
[0079] On the other hand, illustratively, if both the number of parallel decodings and the multi-track single-frame decoding time do not meet the target conditions, the target step size is increased for the number of parallel decodings, for example, by 1, and the process returns to step S206 to continue parallel decoding of the target media material group, obtain an updated multi-track single-frame decoding time, and repeat the above process until the loop ends.
[0080] Optionally, after step S208, the method further includes:
[0081] Step S208A: Update the target step size according to the multi-track single-frame decoding time.
[0082] For example, in another possible implementation, the target step size is a dynamic step size. After step S208, the target step size is updated based on the current multi-track single-frame decoding time. Specifically, when the multi-track single-frame decoding time is longer, indicating that the current number of parallel decodings is farther from the optimal number of parallel decodings (target number of parallel decodings), the target step size is increased to reach the target number of parallel decodings more quickly. When the multi-track single-frame decoding time is shorter, indicating that the current number of parallel decodings is closer to the optimal number of parallel decodings (target number of parallel decodings), the target step size is decreased to improve the accuracy of the target number of parallel decodings.
[0083] Step S209: Based on the target parallel decoding number, the media material corresponding to the jump time point is decoded in parallel to obtain a decoded image.
[0084] In this embodiment, the implementation of step S201 and step S209 is the same as the implementation of step S101 and step S103 in the embodiment shown in FIG. 2 of the present disclosure, and will not be described in detail here.
[0085] Corresponding to the video processing method of the above embodiment, Figure 10 is a structural block diagram of the video processing device provided by the embodiment of the present disclosure. For the convenience of explanation, only the parts related to the embodiment of the present disclosure are shown. Referring to Figure 10, the video processing device 3 includes: a receiving module 31, which is used to determine the jump time point in response to the jump instruction for the video draft; wherein the video draft corresponds to at least two video editing tracks, and the video editing track includes at least one media material. The processing module 32 is used to obtain the target media material group according to the target time period where the jump time point is located, and the target media material group represents a logical set of media material segments of the media materials on each video editing track within the target time period. The decoding module 33 is used to determine the corresponding target parallel decoding number according to the target media material group, and based on the target parallel decoding number, the media material corresponding to the jump time point is decoded in parallel to obtain a decoded image.
[0086] In one embodiment of the present disclosure, when the decoding module 33 determines the corresponding target parallel decoding number based on the target media material group, it is specifically used to: obtain the parallel decoding number; based on the parallel decoding number, perform parallel decoding on the target media material group to obtain the multi-track single-frame decoding time; if the parallel decoding number or the multi-track single-frame decoding time meets the target condition, obtain the target parallel decoding number based on the parallel decoding number; otherwise, increase the target step size for the parallel decoding number, and return to execute the step of obtaining the parallel decoding number.
[0087] In one embodiment of the present disclosure, the decoding module 33 performs parallel decoding on the target media material group based on the parallel decoding number to obtain the multi-track single-frame decoding time consumption, and is specifically used to: obtain the video resolution of each media material segment corresponding to the target media material group; sort the media material segments corresponding to the target media material in ascending order according to the video resolution to obtain a material segment sequence of length N, where N is the number of media material segments corresponding to the target media material group; and perform parallel decoding on the first M media material segments in the material segment sequence and serially decode the remaining NM media materials to obtain the multi-track single-frame decoding time consumption, where M is the current parallel decoding number.
[0088] In one embodiment of the present disclosure, before obtaining the initial number of parallel decodings, the decoding module 33 is further configured to: obtain the cumulative number of media material segments in the target media material group; and determine the initial number of parallel decodings based on the cumulative number and / or the resolution of each media material segment.
[0089] In one embodiment of the present disclosure, after performing parallel decoding on the target media material group based on the parallel decoding number to obtain the multi-track single-frame decoding time, the decoding module 33 is further used to: generate a decoding time record based on the multi-track single-frame decoding time and the corresponding parallel decoding number; and add the decoding time record to the decoding mapping table.
[0090] In one embodiment of the present disclosure, after performing parallel decoding on the target media material group based on the parallel decoding number to obtain the multi-track single-frame decoding time, the decoding module 33 is further configured to update the target step size according to the multi-track single-frame decoding time.
[0091] In one embodiment of the present disclosure, when the decoding module 33 determines the corresponding target parallel decoding number based on the target media material group, it is specifically used to: obtain a corresponding decoding mapping table based on the number of media material segments corresponding to the target media material group, the decoding mapping table containing at least one decoding time consumption record, and the decoding time consumption record is used to represent the decoding time corresponding to the parallel decoding number; according to the decoding mapping table, the parallel decoding number with the shortest decoding time consumption is determined as the target parallel decoding number.
[0092] In one embodiment of the present disclosure, before obtaining the target media material group based on the target time period where the jump time point is located, the processing module 32 is further used to: obtain a pre-generated time period sequence, the time period sequence includes at least two key time points, and two adjacent key time points in the time period sequence correspond to one time period; and obtain the target time period where the jump time point is located based on the position of the jump time point in the time period sequence.
[0093] In one embodiment of the present disclosure, before obtaining the pre-generated time period sequence, the processing module 32 is further used to: obtain the start and end time points of the media materials on each video editing track corresponding to the video draft; map the start and end time points of the media materials on each video editing track to the same time axis, and merge the overlapping start and end time points to obtain the time period sequence.
[0094] The receiving module 31, processing module 32 and decoding module 33 are connected in sequence. The video processing device 3 provided in this embodiment can implement the technical solution of the above method embodiment, and its implementation principle and technical effect are similar, which will not be described in detail in this embodiment.
[0095] Figure 11 is a structural diagram of an electronic device provided in an embodiment of the present disclosure. As shown in Figure 11, the electronic device 4 includes: a processor 41, and a memory 42 communicatively connected to the processor 41; the memory 42 stores computer-executable instructions; the processor 41 executes the computer-executable instructions stored in the memory 42 to implement the video processing method in the embodiments shown in Figures 2 to 9.
[0096] Optionally, the processor 41 and the memory 42 are connected via a bus 43 .
[0097] The relevant explanations can be understood by referring to the relevant descriptions and effects corresponding to the steps in the embodiments corresponding to Figures 2 to 9, and no further details will be given here.
[0098] An embodiment of the present disclosure provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the video processing method provided in any one of the embodiments corresponding to Figures 2 to 9 of the present disclosure.
[0099] In order to implement the above embodiment, the embodiment of the present disclosure further provides an electronic device.
[0100] Referring to FIG12 , there is shown a schematic diagram of the structure of an electronic device 900 suitable for implementing an embodiment of the present disclosure. The electronic device 900 may be a terminal device or a server. The terminal device may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), vehicle-mounted terminals (e.g., vehicle-mounted navigation terminals), and fixed terminals such as digital TVs and desktop computers. The electronic device shown in FIG12 is merely an example and should not limit the functionality and scope of use of the embodiments of the present disclosure.
[0101] As shown in Figure 12, the electronic device 900 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. Various programs and data required for the operation of the electronic device 900 are also stored in the RAM 903. The processing device 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0102] Typically, the following devices may be connected to the I / O interface 905: an input device 906 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 908 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 909. The communication device 909 may allow the electronic device 900 to communicate with other devices wirelessly or by wire to exchange data. Although FIG12 shows an electronic device 900 with various devices, it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
[0103] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication device 909, or installed from the storage device 908, or installed from the ROM 902. When the computer program is executed by the processing device 901, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0104] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0105] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0106] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.
[0107] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet Service Provider).
[0108] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0109] The units involved in the embodiments described in this disclosure may be implemented in software or hardware. In some cases, the name of a unit does not limit the unit itself. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses."
[0110] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0111] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0112] In a first aspect, according to one or more embodiments of the present disclosure, a video processing method is provided, the method comprising: determining a jump time point in response to a jump instruction for a video draft; wherein the video draft corresponds to at least two video editing tracks, and the video editing track includes at least one segment of media material; obtaining a target media material group according to the target time period in which the jump time point is located, the target media material group representing a logical set of media material segments of the media materials on each of the video editing tracks within the target time period; determining a corresponding target parallel decoding number according to the target media material group, and performing parallel decoding on the media material corresponding to the jump time point based on the target parallel decoding number to obtain a decoded image.
[0113] According to one or more embodiments of the present disclosure, determining a corresponding target parallel decoding number based on the target media material group includes: obtaining a parallel decoding number; performing parallel decoding on the target media material group based on the parallel decoding number to obtain a multi-track single-frame decoding time; if the parallel decoding number or the multi-track single-frame decoding time meets a target condition, obtaining the target parallel decoding number based on the parallel decoding number; otherwise, increasing a target step size for the parallel decoding number, and returning to the step of obtaining the parallel decoding number.
[0114] According to one or more embodiments of the present disclosure, the target media material group is decoded in parallel based on the parallel decoding number to obtain the multi-track single-frame decoding time consumption, including: obtaining the video resolution of each media material segment corresponding to the target media material group; sorting the media material segments corresponding to the target media material in ascending order according to the video resolution to obtain a material segment sequence of length N, wherein N is the number of media material segments corresponding to the target media material group; and decoding the first M media material segments in the material segment sequence in parallel and decoding the remaining NM media materials in serial order to obtain the multi-track single-frame decoding time consumption, wherein M is the current parallel decoding number.
[0115] According to one or more embodiments of the present disclosure, before obtaining the initial number of parallel decodings, the method further includes: obtaining a cumulative number of media material segments in the target media material group; and determining the initial number of parallel decodings based on the cumulative number and / or the resolution of each media material segment.
[0116] According to one or more embodiments of the present disclosure, after performing parallel decoding on the target media material group based on the parallel decoding number to obtain the multi-track single-frame decoding time consumption, the method further includes: generating a decoding time consumption record based on the multi-track single-frame decoding time consumption and the corresponding parallel decoding number; and adding the decoding time consumption record to a decoding mapping table.
[0117] According to one or more embodiments of the present disclosure, after performing parallel decoding on the target media material group based on the parallel decoding number to obtain the multi-track single-frame decoding time consumption, the method further includes: updating the target step size according to the multi-track single-frame decoding time consumption.
[0118] According to one or more embodiments of the present disclosure, determining a corresponding target number of parallel decodings based on the target media material group includes: obtaining a corresponding decoding mapping table based on the number of media material segments corresponding to the target media material group, the decoding mapping table containing at least one decoding time record, the decoding time record being used to represent the decoding duration corresponding to the parallel decoding number; and determining, based on the decoding mapping table, the parallel decoding number with the shortest decoding time as the target number of parallel decodings.
[0119] According to one or more embodiments of the present disclosure, before obtaining the target media material group based on the target time period where the jump time point is located, it also includes: obtaining a pre-generated time period sequence, the time period sequence including at least two key time points, and two adjacent key time points in the time period sequence correspond to one time period; and obtaining the target time period where the jump time point is located based on the position of the jump time point in the time period sequence.
[0120] According to one or more embodiments of the present disclosure, before obtaining the pre-generated time period sequence, it also includes: obtaining the start and end time points of the media materials on each video editing track corresponding to the video draft; mapping the start and end time points of the media materials on each video editing track to the same time axis, and merging the overlapping start and end time points to obtain the time period sequence.
[0121] In a second aspect, according to one or more embodiments of the present disclosure, a video processing device is provided, which includes: a receiving module for determining a jump time point in response to a jump instruction for a video draft; wherein the video draft corresponds to at least two video editing tracks, and the video editing track includes at least one segment of media material; a processing module for obtaining a target media material group according to the target time period in which the jump time point is located, and the target media material group represents a logical set of media material segments of the media materials on each of the video editing tracks within the target time period; a decoding module for determining a corresponding target parallel decoding number according to the target media material group, and based on the target parallel decoding number, performing parallel decoding on the media material corresponding to the jump time point to obtain a decoded image.
[0122] According to one or more embodiments of the present disclosure, when the decoding module determines the corresponding target parallel decoding number based on the target media material group, it is specifically used to: obtain the parallel decoding number; based on the parallel decoding number, perform parallel decoding on the target media material group to obtain the multi-track single-frame decoding time; if the parallel decoding number or the multi-track single-frame decoding time meets the target condition, obtain the target parallel decoding number based on the parallel decoding number; otherwise, increase the target step size for the parallel decoding number, and return to execute the step of obtaining the parallel decoding number.
[0123] According to one or more embodiments of the present disclosure, the decoding module performs parallel decoding on the target media material group based on the parallel decoding number to obtain the multi-track single-frame decoding time consumption, and is specifically used to: obtain the video resolution of each media material segment corresponding to the target media material group; sort the media material segments corresponding to the target media material in ascending order according to the video resolution to obtain a material segment sequence with a length of N, wherein N is the number of media material segments corresponding to the target media material group; perform parallel decoding on the first M media material segments in the material segment sequence, and perform serial decoding on the remaining NM media materials to obtain the multi-track single-frame decoding time consumption, wherein M is the current parallel decoding number.
[0124] According to one or more embodiments of the present disclosure, before obtaining the initial number of parallel decodings, the decoding module is further configured to: obtain a cumulative number of media material segments in the target media material group; and determine the initial number of parallel decodings based on the cumulative number and / or the resolution of each media material segment.
[0125] According to one or more embodiments of the present disclosure, after performing parallel decoding on the target media material group based on the parallel decoding number to obtain the multi-track single-frame decoding time consumption, the decoding module is further used to: generate a decoding time consumption record based on the multi-track single-frame decoding time consumption and the corresponding parallel decoding number; and add the decoding time consumption record to a decoding mapping table.
[0126] According to one or more embodiments of the present disclosure, after performing parallel decoding on the target media material group based on the parallel decoding number to obtain the multi-track single-frame decoding time consumption, the decoding module is further configured to update the target step size according to the multi-track single-frame decoding time consumption.
[0127] According to one or more embodiments of the present disclosure, when the decoding module determines the corresponding target parallel decoding number based on the target media material group, it is specifically used to: obtain a corresponding decoding mapping table based on the number of media material segments corresponding to the target media material group, the decoding mapping table containing at least one decoding time consumption record, and the decoding time consumption record is used to represent the decoding time corresponding to the parallel decoding number; according to the decoding mapping table, determine the parallel decoding number with the shortest decoding time as the target parallel decoding number.
[0128] According to one or more embodiments of the present disclosure, before obtaining the target media material group based on the target time period in which the jump time point is located, the processing module is further used to: obtain a pre-generated time period sequence, the time period sequence including at least two key time points, and two adjacent key time points in the time period sequence correspond to one time period; and obtain the target time period in which the jump time point is located based on the position of the jump time point in the time period sequence.
[0129] According to one or more embodiments of the present disclosure, before obtaining the pre-generated time period sequence, the processing module is further used to: obtain the start and end time points of the media materials on each video editing track corresponding to the video draft; map the start and end time points of the media materials on each video editing track to the same time axis, and merge the overlapping start and end time points to obtain the time period sequence.
[0130] In a third aspect, according to one or more embodiments of the present disclosure, an electronic device is provided, comprising: at least one processor and a memory; the memory stores computer-executable instructions; the at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the video processing method described in the first aspect and various possible designs of the first aspect.
[0131] In a fourth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the video processing method described in the first aspect and various possible designs of the first aspect is implemented.
[0132] In a fifth aspect, according to one or more embodiments of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the video processing method described in the first aspect and various possible designs of the first aspect is implemented.
[0133] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
[0134] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0135] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. A video processing method, comprising: In response to a jump instruction for a video draft, a jump time point is determined; wherein the video draft corresponds to at least two video editing tracks, and the video editing tracks include at least one media material; According to the target time period where the jump time point is located, a target media material group is obtained, wherein the target media material group represents a logical set of media material segments of the media materials on each of the video editing tracks within the target time period; According to the target media material group, a corresponding target parallel decoding number is determined, and based on the target parallel decoding number, the media material corresponding to the jump time point is decoded in parallel to obtain a decoded image.
2. The method according to claim 1, wherein determining the corresponding target parallel decoding number according to the target media material group comprises: Get the number of parallel decoding; Based on the parallel decoding number, the target media material group is decoded in parallel to obtain a multi-track single-frame decoding time consumption; If the number of parallel decoding or the multi-track single frame decoding time meets the target condition, then based on the number of parallel decoding, the target number of parallel decoding is obtained; Otherwise, increase the target step size for the parallel decoding number, and return to execute the step of obtaining the parallel decoding number.
3. The method according to claim 2, wherein: The method of decoding the target media material group in parallel based on the parallel decoding number to obtain the multi-track single-frame decoding time consumption includes: Obtaining the video resolution of each media material segment corresponding to the target media material group; According to the video resolution, sorting the media material segments corresponding to the target media material in ascending order to obtain a material segment sequence with a length of N, wherein N is the number of media material segments corresponding to the target media material group; The first M media material segments in the material segment sequence are decoded in parallel, and the last NM media materials are decoded in series to obtain the multi-track single-frame decoding time consumption, wherein M is the current parallel decoding number.
4. The method according to claim 2, wherein before obtaining the initial parallel decoding number, it also includes: Obtaining the cumulative number of media material segments in the target media material group; The initial number of parallel decoding is determined according to the accumulated number and / or the resolution of each of the media material segments.
5. The method according to claim 2, wherein after the target media material group is decoded in parallel based on the parallel decoding number to obtain the multi-track single-frame decoding time consumption, the method further comprises: Generate a decoding time consumption record according to the multi-track single frame decoding time consumption and the corresponding parallel decoding number; The decoding time-consuming record is added to the decoding mapping table.
6. The method according to claim 2, wherein after the target media material group is decoded in parallel based on the parallel decoding number to obtain the multi-track single-frame decoding time consumption, the method further comprises: The target step size is updated according to the multi-track single-frame decoding time consumption.
7. The method according to claim 1, wherein determining the corresponding target parallel decoding number according to the target media material group comprises: According to the number of media material segments corresponding to the target media material group, a corresponding decoding mapping table is obtained, wherein the decoding mapping table includes at least one decoding time consumption record, and the decoding time consumption record is used to represent the decoding time length corresponding to the number of parallel decodings; According to the decoding mapping table, the number of parallel decodings that consumes the shortest decoding time is determined as the target number of parallel decodings.
8. The method according to claim 1, wherein before obtaining the target media material group according to the target time period where the jump time point is located, the method further comprises: Acquire a pre-generated time period sequence, wherein the time period sequence includes at least two key time points, and two adjacent key time points in the time period sequence correspond to one time period; According to the position of the jump time point in the time period sequence, the target time period where the jump time point is located is obtained.
9. The method according to claim 8, wherein before acquiring the pre-generated time period sequence, it further comprises: Get the start and end time points of the media materials on each video editing track corresponding to the video draft; The start and end time points of the media materials on each video editing track are mapped to the same timeline, and the overlapping start and end time points are merged to obtain the time period sequence.
10. A video processing device, comprising: The receiving module is used to determine the jump time point in response to the jump instruction for the video draft; wherein the video draft corresponds to at least two video editing tracks, and the video editing track includes at least Include a piece of media material; A processing module, configured to obtain a target media material group according to a target time period where the jump time point is located, wherein the target media material group represents a logical set of media material segments of the media materials on each of the video editing tracks within the target time period; The decoding module is used to determine the corresponding target parallel decoding number according to the target media material group, and based on the target parallel decoding number, perform parallel decoding on the media material corresponding to the jump time point to obtain a decoded image.
11. An electronic device, comprising: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the video processing method according to any one of claims 1 to 9.
12. A computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when a processor executes the computer-executable instructions, the video processing method according to any one of claims 1 to 9 is implemented.
13. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the video processing method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Multimedia data processing method and device, electronic equipment and readable storage medium
CN111372035A
Video editing method, device and equipment and computer readable storage medium
CN113015005A
Video processing method, related device and equipment
CN115695903A
A System and Methods Thereof for Auto-playing Video Content on Mobile Devices
US20180324238A1