Video processing method and device, electronic equipment and storage medium
By determining the parallel decoding number and parallel decoding in the jumping operation of the video draft, the problem of the problem of not smooth and not smooth when the video draft jump is switched, and improves the efficiency and smoothness of the understanding.
Patent Information
- Application Number
- CN202310922177.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-25
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2043-07-25
AI Technical Summary
When jumping in the specified editing position of a video draft, the prior art will cause lag and preview images to not be displayed smoothly.
By responding to the jump instructions of the video draft, the jump time point is determined, and the target media material group is obtained according to the target time period where the time point is located. Then, determine the number of parallel decodes based on the target media material group and perform parallel decoding to obtain decoding images.
Improved the decoding efficiency of video draft during jump operations, reducing the phenomenon of stuttering, and increasing the fluency of the preview image.
Smart Images

Figure CN119383288A_ABST
Abstract
Description
Technical Field
[0001] 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
[0002] 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, so as to achieve the purpose of previewing the editing effect of the video draft.
[0003] In the prior art, 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 the inability to smoothly display the preview image. Summary of the invention
[0004] The embodiments of the present disclosure provide a video processing method, device, electronic device and storage medium to overcome the problems of freeze and inability to smoothly display preview images when jumping to a designated editing position in a video draft.
[0005] In a first aspect, an embodiment of the present disclosure provides a video processing method, including:
[0006] 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; 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 within the target time period of the media materials on each of the video editing tracks; 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.
[0007] In a second aspect, an embodiment of the present disclosure provides a video processing device, including:
[0008] A receiving module, configured to determine 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 tracks include at least one media material;
[0009] 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;
[0010] 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.
[0011] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: a processor and a memory;
[0012] The memory stores computer-executable instructions;
[0013] The processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the video processing method as described in the first aspect and various possible designs of the first aspect.
[0014] 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.
[0015] 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 as described in the first aspect and various possible designs of the first aspect.
[0016] The video processing method, device, electronic device and storage medium provided in this embodiment determine the jump time point by responding 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; 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 the 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, 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 the target media material group 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, a higher decoding efficiency can be achieved, the occurrence of jamming can be reduced, and the playback smoothness of the preview image generated after decoding can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. 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 creative labor.
[0018] Figure 1 An application scenario diagram of the video processing method provided by the embodiment of the present disclosure;
[0019] Figure 2 The video processing method provided by the present invention is shown in FIG. Figure 1 ;
[0020] Figure 3 A schematic diagram of a target media material group provided by an embodiment of the present disclosure;
[0021] Figure 4 for Figure 2 A flowchart of a specific implementation method of step S103 in the illustrated embodiment;
[0022] Figure 5 A schematic diagram of a decoding mapping table provided in an embodiment of the present disclosure;
[0023] Figure 6 The video processing method provided by the present invention is shown in FIG. Figure 2 ;
[0024] Figure 7 A schematic diagram of a generation process of a time period sequence provided in an embodiment of the present disclosure;
[0025] Figure 8 for Figure 6 A flowchart of a specific implementation method of step S206 in the illustrated embodiment;
[0026] Fig. 9 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;
[0027] Fig.10 A structural block diagram of a video processing device provided by an embodiment of the present disclosure;
[0028] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure;
[0029] Fig.12 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present 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, 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.
[0032] The application scenarios of the embodiments of the present disclosure are explained below:
[0033] Figure 1 This is an application scenario diagram of the video processing method provided by the embodiment of the present disclosure. The video processing method provided by the embodiment of the present disclosure can be applied to an application with a video editing function, and more specifically, can be applied to an application scenario for editing multi-track videos. The execution subject of this embodiment can be a terminal device running the above-mentioned application with a video editing function, or a server running the service end corresponding to the above-mentioned application, or other electronic devices with similar functions. Figure 1 As shown in , taking a terminal device as an example, a video editing application for video editing is running in the terminal device. In the video editing application, the video draft is loaded by loading a project file or a draft file. After that, in the multi-track editor interface of the video editing application, multiple video editing tracks corresponding to the video draft are displayed. Each video editing track (such as Track_1, Track_2 and Track_3 shown in the figure) contains one or more material clips (such as clips c1, c2, c3 and c4 shown in the figure). 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 sequentially displayed in the final generated preview video and output video based on the layer where it is located. Further, in the multi-track editor interface, the user can manually add, delete, and modify the material clips that constitute the video draft on each video editing track as needed. After that, the terminal device synthesizes and encodes the material clips on each edited video editing track to obtain an output video that meets the user's needs.
[0034] Furthermore, in the above-mentioned video editing process, when the user jumps (seeks) the current editing position of the video draft to the specified editing position (for example, the T_1 position in the figure) by operating the multi-track editor interface, the terminal device will centrally decode the material clips on all the video editing tracks at the editing position. After the above-mentioned material clips are decoded, they are rendered on the screen according to the decoded images corresponding to each material clip, and the corresponding preview images are displayed in the preview window for the user to view the editing effect.
[0035] In the prior art, the centralized decoding of the media materials for multiple tracks is usually implemented by serial decoding, for example, the above-mentioned segments c1, c3 and c4 are serially decoded in sequence, so as to obtain the decoded image of the video draft at the editing position. However, the above-mentioned scheme in the prior art has the problems of low execution efficiency and slow speed, which leads to an increase in the time consumption of the decoding process. On the other hand, in other related technical schemes, by decoding each material segment in parallel, for example, decoding the above-mentioned segments c1, c3 and c4 in parallel, when the amount of decoded data is small, a faster decoding speed can be achieved compared to serial decoding. However, when the resource consumption of parallel decoding is large, for example, when the number of parallel decoding threads is too large and the amount of decoded data is too large, the decoding speed will drop rapidly, and it will be lower than the decoding speed of serial decoding, thereby causing instability in the decoding process. That is, when media materials on multiple video editing tracks are decoded in parallel, if the number of parallel decoding is not selected reasonably, there will be a problem of low decoding efficiency. Therefore, how to obtain a reasonable number of parallel decoding when performing a jump operation on video drafts of multiple video editing tracks, thereby improving the overall decoding efficiency, is a problem that needs to be solved urgently. The disclosed embodiment provides a wearing deviation detection method to solve the above problem.
[0036] refer to Figure 2 , Figure 2 The video processing method provided by the present invention is shown in FIG. Figure 1 The method of this embodiment can be applied in a terminal device. The video processing method includes:
[0037] 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.
[0038] For example, reference Figure 1 As shown in the application scenario diagram, after the terminal device loads the video draft (project file or draft file), multiple video editing tracks of the video draft are displayed in the multi-track editor interface. Each video editing track contains at least one media material. For details, please refer to Figure 1As shown, after receiving the jump instruction input by the user, the terminal device jumps the current editing time point (e.g., 0 minutes and 0 seconds) of the video draft to the jump time point (e.g., 1 minute and 10 seconds) corresponding to the jump instruction, wherein 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 playback timestamp corresponding to the video draft, the playback timestamp of each video editing track is also determined. Furthermore, at the jump time point, corresponding to at least two material clips, the terminal device will load and decode the media materials on each video editing channel at the jump time point, generate a corresponding decoded image, and thereby implement a preview of 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 media materials on each video editing track after superimposition and display in real time.
[0039] Among them, the specific implementation method of loading the video draft through the project file or the 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 those skilled in the art, and will not be repeated here.
[0040] Step S102: obtaining a target media material group according to the target time period where the jump time point is located, wherein the target media material group represents a logical set of media material segments on each video editing track within the target time period.
[0041] Exemplarily, after obtaining the jump time point corresponding to the jump instruction, the time period in which the jump time point is located, i.e., the target time period, is determined according to the jump time point, wherein the time period is a pre-divided time interval, and the specific division rules are described in detail in the subsequent steps. After determining the target time period, according to the time period identifier corresponding to the target time period, the target media material group corresponding to it in time can be obtained. Among them, the media material group is a logical collection of media material fragments, and the media material fragments are slices obtained by dividing the media material based on the above time period. The target media material group represents the logical collection of media material fragments on each video editing track within the target time period. Figure 3 A schematic diagram of a target media material group provided by an embodiment of the present disclosure is shown in FIG. Figure 3As shown in the figure, in the multi-track editor interface for the video draft video_1, there are three video editing tracks, namely Track_1, Track_2 and Track_3, wherein the video editing track Track_1 is provided with media materials clip_1 and clip_2, the video editing track Track_2 is provided with media materials clip_3 and clip_4; and the video editing track Track_3 is provided with media materials clip_5 and clip_6. The play time between the above media materials is based on the same play time axis, and the relationship between the play time of each media material is shown in the figure. Among them, based on the target time period [T1-T2], each video editing track is divided vertically, and the media material segment C1 corresponding to the video editing track Track_1, the media material segment C2 corresponding to Track_2 and the media material segment C3 corresponding to Track_3 can be obtained. The logical set of the above media material segments C1, C2 and C3 is the target media material group.
[0042] Furthermore, the above-mentioned target time period [T1-T2] is a time period determined by the jump time point. In a possible implementation, for example, multiple time periods are preset in the terminal device, and in addition to the above-mentioned target time period [T1-T2], for example, the time period [T2-T3], the time period [T4-T5], etc. The corresponding target time period is determined from the above-mentioned multiple preset time periods according to the jump time point.
[0043] 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.
[0044] Exemplarily, after obtaining the target media material group, a target parallel decoding number that matches the target media material group is determined according to the target media material group, wherein, 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 means that the media materials on each video editing track corresponding to the target media material group are decoded by 3 threads; and if the target parallel decoding number is 6, it means that the media materials on each video editing track corresponding to the target media material group are decoded by 6 threads, wherein, exemplarily, the maximum target parallel decoding number does not exceed the number of media materials corresponding to the target media material group.
[0045] In a 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 the number of media material segments corresponding to the target media material group is, the larger the amount of decoded data is. Therefore, based on the preset mapping relationship, the target parallel decoding number that matches the number of media materials corresponding to the target media material group can be obtained. More specifically, exemplarily, under the request that the amount of decoded data is less than the 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. Afterwards, based on the target parallel decoding number, the corresponding decoding thread is called to decode the media material corresponding to the jump time point, and the corresponding decoded image can be obtained, thereby realizing the subsequent preview of the video editing effect. In this embodiment, by obtaining the target parallel decoding number and decoding the media material corresponding to the jump time point in parallel based on the target parallel decoding number, the decoding efficiency can be improved to a certain extent compared with the single-thread serial decoding solution.
[0046] In another possible implementation, Figure 4 As shown, the specific implementation method of determining the corresponding target parallel decoding number according to the target media material group in step S103 includes:
[0047] Step S1031: obtaining a corresponding decoding mapping table according to the number of media material segments corresponding to the target media material group, 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;
[0048] Step S1032: According to the decoding mapping table, the number of parallel decodings with the shortest decoding time is determined as the target number of parallel decodings.
[0049] Exemplarily, after obtaining the target media material group and determining the number of media material segments corresponding to the target media material group, a corresponding decoding mapping table is obtained according to the number of media material segments, wherein the decoding mapping table contains at least one decoding time record for representing the decoding time corresponding to the number of parallel decodings, and the decoding time record in the decoding mapping table is the record information generated when the video draft was previously decoded. Figure 5 A schematic diagram of a decoding mapping table provided in an embodiment of the present disclosure, such as Figure 5As shown, 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.), wherein decoding mapping table P1 contains multiple decoding time-consuming records, such as rec_1, rec_2, rec_3, etc. shown in the figure. Among them, each decoding time-consuming record corresponds to at least one parallel decoding number and a corresponding decoding duration, for example, rec_1 corresponds to two cases of parallel decoding number N = 1 and N = 2, that is, the parallel decoding number is 1 and the parallel decoding number is 2. Correspondingly, when the parallel decoding number N = 1, the corresponding single-frame decoding duration T = 2 (preset unit, for example, 100 milliseconds is a preset unit, the same below); when the parallel decoding number N = 2, the corresponding single-frame decoding duration T = 1.2. As for the decoding time record rec_2, there are three corresponding cases of parallel decoding numbers N=3, N=4, and N=5. Correspondingly, when the parallel decoding number N=3, the corresponding single-frame decoding time length T=0.8; when the parallel decoding number N=4, the corresponding single-frame decoding time length T=0.6; when the parallel decoding number N=5, the corresponding single-frame decoding time length T=0.9. The specific implementation of the decoding time record rec_3 is similar to the specific implementation of the decoding time records rec_1 and rec_2, and will not be repeated. According to the decoding mapping table that matches the number of media material fragments corresponding to the target media material group, the parallel decoding number with the shortest time is selected, that is, the parallel decoding number N=4, which is determined as the target parallel decoding number.
[0050] In this embodiment, the jump time point is determined by responding 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; 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 at the jump time point is decoded in parallel based on the target parallel decoding number, a 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.
[0051] refer to Figure 6 , Figure 6 The video processing method provided by the present invention is shown in FIG. Figure 2 In this embodiment Figure 2 On the basis of the illustrated embodiment, step S103 is further refined, and the video processing method includes:
[0052] 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.
[0053] 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.
[0054] 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.
[0055] 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, the time period sequence includes at least two key time points, 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. Through the time period sequence, taking any two adjacent key time points therein, 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:
[0056] Step S200A: Obtain the start and end time points of the media materials on each video editing track corresponding to the video draft.
[0057] Step S200B: Map the start and end time points of the media materials on each video editing track to the same timeline, and merge the overlapping start and end time points to obtain a time period sequence.
[0058] For example, Figure 7 A schematic diagram of a generation process of a time period sequence provided in an embodiment of the present disclosure is shown in FIG. Figure 7As shown, on the video editing tracks Track_1, Track_2, and Track_3 corresponding to the video draft, corresponding media materials are set, such as the media materials clip_1 to clip_5 shown in the figure, the video editing tracks where the media materials are located, and the playback time relationship between the media materials are shown in the reference figure. Get 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, which are P1 to P10 shown in the figure. Afterwards, map the start and end time points P1 to P10 to the unified time axis corresponding to each video editing track, that is, the playback time axis of the video draft, and merge the overlapping start and end time points, that is, P3 and P7, and merge P4 and P8 (P9). Get the time period sequence [P3, P1, P4, P5, P2, P10, P6].
[0059] 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].
[0060] Step S204: obtaining a target media material group according to the target time period where the jump time point is located, wherein the target media material group represents a logical set of media material segments on each video editing track within the target time period.
[0061] refer to Figure 7 The time period sequence shown can determine the time period to which the jump time point belongs, i.e., the target time period, according to the position of the jump time point on the play time axis. Then, 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.
[0062] Step S205: Obtain an initial number of parallel decodings.
[0063] Exemplarily, 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 realized. In order to improve the speed of centralized decoding of the media material segments on the multiple video editing tracks, and avoid the problem that the decoding speed is reduced due to unreasonable setting of the parameters of parallel decoding, the present embodiment adopts a dynamic parallel decoding method, and uses a dynamic number of decoding threads to perform parallel decoding on the media material segments corresponding to the target media material group. Specifically, firstly, the initial parallel decoding number is obtained. In a possible implementation method, the initial parallel decoding number is a preset value, for example, 1 (i.e., equivalent to single-thread serial decoding), that is, no matter how many media material segments are included in the target media material, the media material of the target media material group is decoded by 1 decoding thread. Afterwards, through the subsequent iterative cycle process, 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 the optimal parallel decoding number.
[0064] In another possible implementation, the initial number of parallel decoding is dynamically determined based on the characteristics of the target media material group. Exemplarily, the specific implementation steps of step S205 include:
[0065] Step S2051: Obtain the cumulative number of media material segments in the target media material group;
[0066] Step S2052: Determine an initial number of parallel decodings according to the accumulated number and / or the resolution of each media material segment.
[0067] 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 according to 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 together according to 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, the media material segments cilp_1 and media material segment cilp_2 have a resolution of 1080P; and the 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, and the media material segment cilp_3 corresponds to two preset units of decoding data. The media material segment cilp_1, the media material segment cilp_2 and the media material segment cilp_3 correspond to a total of 4 preset units of decoding data. Correspondingly, according to the decoding data volume of the 4 preset units, the corresponding parallel decoding number is determined, for example, 2. Compared with the solution of determining the parallel decoding number only by the cumulative number, combined with the resolution of each media material segment, the specific required decoding data volume can be better expressed, and then the initial parallel decoding number matching it can be determined, which can further improve the decoding efficiency.
[0068] In the steps of this embodiment, the initial parallel decoding number is determined by 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 detection, and obtaining the optimal parallel decoding number (target parallel decoding number) more quickly, thereby improving the decoding speed.
[0069] Step S206: Based on the number of parallel decodings, the target media material group is decoded in parallel to obtain the multi-track single-frame decoding time consumption.
[0070] Exemplarily, based on the number of parallel decodings obtained in the previous step, the media material fragments corresponding to the target media material group are decoded in parallel, and during the decoding process, the multi-track single-frame decoding time is counted, wherein the multi-track single-frame decoding time can be the total decoding time consumed after decoding one frame of all the media material fragments corresponding to the target media material group, or it can be the single-track average decoding time consumed after decoding one frame of all the media material fragments corresponding to the target media material group.
[0071] For example, Figure 8 As shown, the specific implementation steps of step S206 include:
[0072] Step S2061: Obtain the video resolution of each media material segment corresponding to the target media material group.
[0073] Step S2062: 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, where N is the number of media material segments corresponding to the target media material group.
[0074] 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.
[0075] Exemplarily, in the process of decoding each media material segment corresponding to the target media material group, it is necessary to decode each media material segment based on the current parallel decoding number. When the current parallel decoding number is less than the number of media material segments, it is necessary to implement a hybrid decoding of first parallel and then serial for each media material segment corresponding to the target media material group. For example, the first 5 of 10 media material segments are first divided into the first group and the last 5 are divided into the second group. The first group is first decoded in parallel. After the first round of parallel decoding is completed, the second group is decoded in parallel. Finally, the multi-track single-frame decoding time is obtained according to the sum of the decoding time corresponding to the first group and the second group. In the steps of this embodiment, the media material segments corresponding to the target media material are sorted in order from small to large according to the video resolution of each media material segment. Then, based on the current parallel decoding number M (an integer greater than 0), the first M media material segments with smaller resolution are decoded in parallel, and then NM (N is an integer greater than 1) media materials are serially decoded to obtain 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.
[0076] Fig. 9 This 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. Fig. 9 The above process is described in detail. Fig. 9 As shown, 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 fragments corresponding to the target media material are sorted in order from small to large to obtain a material fragment sequence cilp_list with a length of N=4. Then, based on the parallel decoding number, when the parallel decoding number M=2, the first two media material fragments clip_1 and clip_4 in the material fragment sequence cilp_list are decoded in parallel, clip_2 and clip_3 are decoded serially, and the corresponding time consumption is counted to obtain the multi-track single-frame decoding time consumption T1; when the parallel decoding number M=3, the first three media material fragments clip_1, clip_4 and clip_2 in the material fragment sequence cilp_list are decoded in parallel, clip_3 is decoded serially, and the corresponding time consumption is counted to obtain the multi-track single-frame decoding time consumption T2, and so on, until the process of cyclically detecting the target parallel decoding number is completed.
[0077] Optionally, after step S206, the method further includes:
[0078] Step S206A: Generate a decoding time consumption record according to the multi-track single frame decoding time consumption and the corresponding parallel decoding number, and add the decoding time consumption record to the decoding mapping table.
[0079] For example, after decoding is performed based on different parallel decoding numbers each time and the corresponding multi-track single-frame decoding time is calculated, 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. Figure 2 The illustrated embodiment has been described in detail and will not be described again here.
[0080] Step S207: If the number of parallel decoding or the time consumption of multi-track single frame decoding meets the target condition, the target number of parallel decoding is obtained based on the number of parallel decoding, and step S209 is executed.
[0081] 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.
[0082] Exemplarily, after each decoding based on the current parallel decoding number is completed, a judgment is made based on the obtained multi-track single-frame decoding time consumption to determine whether to end the detection of the target parallel decoding number. On the one hand, in a possible implementation, if the parallel decoding number reaches a preset number, the loop is stopped. And according to the multi-track single-frame decoding time consumption corresponding to different parallel decoding numbers recorded previously, the parallel decoding number with the smallest multi-track single-frame decoding time consumption is determined as the target parallel decoding number.
[0083] 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 decodings is determined as the target number of parallel decodings. In the steps of this embodiment, by making a real-time judgment on the multi-track single-frame decoding time, if the requirement is met, that is, it is less than the preset time, the corresponding parallel decoding number can be used for subsequent parallel decoding without pursuing the minimum multi-track single-frame decoding time. Since the scheme of this embodiment (compared with the scheme that pursues the minimum multi-track single-frame decoding time) can effectively retrieve the rounds of loop 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.
[0084] On the other hand, illustratively, if both 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, for example, the number of parallel decoding is increased by 1, and the process returns to step S206, and the target media material group is continuously decoded in parallel to obtain the updated multi-track single-frame decoding time, and the above process is repeated until the loop ends.
[0085] Optionally, after step S208, the method further includes:
[0086] Step S208A: Update the target step size according to the multi-track single frame decoding time consumption.
[0087] Exemplarily, in another possible implementation, the target step size is a dynamic step. After step S208, the target step size is updated according to the current multi-track single-frame decoding time. Specifically, when the multi-track single-frame decoding time is longer, it means that the current parallel decoding number is farther from the optimal parallel decoding number (target parallel decoding number), and the target step size is increased so that the target parallel decoding number can be reached faster; and when the multi-track single-frame decoding time is shorter, it means that the current parallel decoding number is closer to the optimal parallel decoding number (target parallel decoding number), and the target step size is reduced to improve the accuracy of the target parallel decoding number.
[0088] 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.
[0089] In this embodiment, the implementation method of step S201 and step S209 is the same as that of the present disclosure. Figure 2 The implementation methods of step S101 and step S103 in the illustrated embodiment are the same and will not be described in detail here.
[0090] Corresponding to the video processing method of the above embodiment, Fig.10 This is a structural block diagram of a video processing device provided by an embodiment of the present disclosure. For ease of description, only the parts related to the embodiment of the present disclosure are shown.
[0091] Reference Fig.10 , the video processing device 3 comprises:
[0092] The receiving module 31 is used to determine 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 media material;
[0093] A processing module 32 is used to obtain a target media material group according to the target time period where the jump time point is located, where the target media material group represents a logical set of media material segments on each video editing track within the target time period;
[0094] The decoding module 33 is used to determine the corresponding target parallel decoding number according to the target media material group, and perform parallel decoding on the media materials corresponding to the jump time point based on the target parallel decoding number to obtain a decoded image.
[0095] In one embodiment of the present disclosure, when the decoding module 33 determines the corresponding target parallel decoding number according to 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, then based on the parallel decoding number, obtain the target 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.
[0096] 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, which 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 order from small to large 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 last NM media materials to obtain the multi-track single-frame decoding time consumption, wherein M is the current parallel decoding number.
[0097] In one embodiment of the present disclosure, before obtaining the initial parallel decoding number, the decoding module 33 is further used to: obtain the cumulative number of media material segments in the target media material group; and determine the initial parallel decoding number according to the cumulative number and / or the resolution of each media material segment.
[0098] In one embodiment of the present disclosure, 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, the decoding module 33 is further used to: generate a decoding time record according to the multi-track single-frame decoding time and the corresponding parallel decoding number; and add the decoding time record to the decoding mapping table.
[0099] In one embodiment of the present disclosure, after decoding the target media material group in parallel based on the parallel decoding number to obtain the multi-track single-frame decoding time consumption, the decoding module 33 is further used to: update the target step size according to the multi-track single-frame decoding time consumption.
[0100] 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 characterize 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.
[0101] In one embodiment of the present disclosure, before obtaining the target media material group according to the target time period where the jump time point is located, the processing module 32 is also 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; according to the position of the jump time point in the time period sequence, obtain the target time period where the jump time point is located.
[0102] 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 timeline, and merge the overlapping start and end time points to obtain the time period sequence.
[0103] The receiving module 31, the processing module 32 and the 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.
[0104] Fig.11 A schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure is shown in FIG. Fig.11 As shown, the electronic device 4 includes:
[0105] A processor 41, and a memory 42 communicatively connected to the processor 41;
[0106] The memory 42 stores computer executable instructions;
[0107] The processor 41 executes the computer execution instructions stored in the memory 42 to implement the following Figure 2-Figure 9 The video processing method in the illustrated embodiment.
[0108] Optionally, the processor 41 and the memory 42 are connected via a bus 43 .
[0109] For related instructions, please refer to Figure 2-Figure 9 The relevant descriptions and effects corresponding to the steps in the corresponding embodiments can be understood, and no further elaboration is made here.
[0110] The present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, which are used to implement the present invention when executed by a processor. Figure 2-Figure 9 The video processing method provided by any one of the corresponding embodiments.
[0111] In order to implement the above embodiment, the embodiment of the present disclosure also provides an electronic device.
[0112] refer to Fig.12 , which shows a schematic diagram of the structure of an electronic device 900 suitable for implementing the embodiment of the present disclosure, and 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, notebook computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.12 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0113] like Fig.12 As shown, the electronic device 900 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 to a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the electronic device 900 are also stored. 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.
[0114] Typically, the following devices may be connected to the I / O interface 905: input devices 906 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 908 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 909. The communication device 909 may allow the electronic device 900 to communicate with other devices wirelessly or by wire to exchange data. Although Fig.12 The electronic device 900 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0115] 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 contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 909, or installed from a storage device 908, or installed from a 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 executed.
[0116] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, 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 containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit 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 of the above.
[0117] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0118] 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.
[0119] 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 an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0120] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square 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 square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0121] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".
[0122] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, 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 chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0123] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may 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 may 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.
[0124] In a first aspect, according to one or more embodiments of the present disclosure, a video processing method is provided, including:
[0125] 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; 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 within the target time period of the media materials on each of the video editing tracks; 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.
[0126] According to one or more embodiments of the present disclosure, determining the corresponding target parallel decoding number based on the target media material group includes: obtaining the parallel decoding number; based on the parallel decoding number, performing 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, obtaining the target parallel decoding number based on the parallel decoding number; otherwise, increasing the target step size for the parallel decoding number, and returning to execute the step of obtaining the parallel decoding number.
[0127] 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 an 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 serially decoding the last NM media materials to obtain the multi-track single-frame decoding time consumption, wherein M is the current parallel decoding number.
[0128] According to one or more embodiments of the present disclosure, before obtaining the initial parallel decoding number, the method further includes: obtaining the cumulative number of media material segments in the target media material group; and determining the initial parallel decoding number according to the cumulative number and / or the resolution of each of the media material segments.
[0129] According to one or more embodiments of the present disclosure, 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 includes: generating a decoding time consumption record according to 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.
[0130] According to one or more embodiments of the present disclosure, 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 includes: updating the target step size according to the multi-track single-frame decoding time consumption.
[0131] According to one or more embodiments of the present disclosure, determining the corresponding target parallel decoding number 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 consumption record, and the decoding time consumption record is used to characterize the decoding time corresponding to the parallel decoding number; according to the decoding mapping table, determining the parallel decoding number with the shortest decoding time as the target parallel decoding number.
[0132] According to one or more embodiments of the present disclosure, before obtaining the target media material group according to 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 according to the position of the jump time point in the time period sequence.
[0133] 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 timeline, and merging the overlapping start and end time points to obtain the time period sequence.
[0134] In a second aspect, according to one or more embodiments of the present disclosure, a video processing device is provided, including:
[0135] A receiving module, configured to determine 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 tracks include at least one media material;
[0136] 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;
[0137] 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.
[0138] According to one or more embodiments of the present disclosure, when the decoding module determines the corresponding target parallel decoding number according to the target media material group, it is specifically used to: obtain the parallel decoding number; based on the parallel decoding number, parallel decode 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, then based on the parallel decoding number, obtain the target 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.
[0139] 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, which is specifically used to: obtain the video resolution of each media material fragment corresponding to the target media material group; sort the media material fragments corresponding to the target media material in order from small to large according to the video resolution to obtain a material fragment sequence with a length of N, wherein N is the number of media material fragments corresponding to the target media material group; perform parallel decoding on the first M media material fragments in the material fragment sequence, and perform serial decoding on the last NM media materials to obtain the multi-track single-frame decoding time consumption, wherein M is the current parallel decoding number.
[0140] According to one or more embodiments of the present disclosure, before obtaining the initial parallel decoding number, the decoding module is further used to: obtain the cumulative number of media material segments in the target media material group; and determine the initial parallel decoding number according to the cumulative number and / or the resolution of each of the media material segments.
[0141] According to one or more embodiments of the present disclosure, 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 decoding module is further used to: generate a decoding time consumption record according to 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.
[0142] According to one or more embodiments of the present disclosure, 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 decoding module is further used to: update the target step size according to the multi-track single-frame decoding time consumption.
[0143] According to one or more embodiments of the present disclosure, when the decoding module determines the corresponding target parallel decoding number according to the target media material group, it is specifically used to: obtain a corresponding decoding mapping table according to the number of media material fragments 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 characterize 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.
[0144] According to one or more embodiments of the present disclosure, before obtaining the target media material group according to the target time period where the jump time point is located, the processing module is also 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 according to the position of the jump time point in the time period sequence.
[0145] 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 timeline, and merge the overlapping start and end time points to obtain the time period sequence.
[0146] In a third aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device, comprising: at least one processor and a memory;
[0147] The memory stores computer-executable instructions;
[0148] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the video processing method described in the first aspect and various possible designs of the first aspect.
[0149] In a fourth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer execution instructions. 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.
[0150] In a fifth aspect, according to one or more embodiments of the present disclosure, a computer program product is provided, including 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.
[0151] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. 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 a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0152] 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 are 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.
[0153] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, 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. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A video processing method, characterized in that: include: 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, characterized in that The step of determining a corresponding target parallel decoding number according to the target media material group includes: 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 parallel decoding number or the multi-track single-frame decoding time meets the target condition, the target parallel decoding number is obtained based on the parallel decoding number; otherwise, the target step size is increased for the parallel decoding number, and the step of obtaining the parallel decoding number is returned to be executed.
3. The method according to claim 2, characterized in that The decoding of the target media material group in parallel based on the number of parallel decoding 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, characterized in that: Before getting the initial number of parallel decoding, 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, characterized in that: 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 includes: 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, characterized in that 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 includes: The target step size is updated according to the multi-track single-frame decoding time consumption.
7. The method according to claim 1, characterized in that The step of determining a corresponding target parallel decoding number according to the target media material group includes: 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, characterized in that: Before obtaining the target media material group according to the target time period where the jump time point is located, the method further includes: 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, characterized in that Before obtaining the pre-generated time period sequence, the method further includes: 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, characterized in that: include: A receiving module, configured to determine 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 tracks include at least one 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, characterized in that: include: 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, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the 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, characterized in that 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 playing method and device and storage medium
CN111031354A
Information processing method and device, equipment and storage medium
CN111046198A
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