Video processing method and device, electronic equipment and storage medium
By generating media material groups to quickly preview the editing results of the video editing track, the problems of slow preview video generation speed and high resource utilization in the prior art are solved, and faster and smoother video editing preview is achieved.
Patent Information
- Application Number
- CN202311269832.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-27
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2043-09-27
AI Technical Summary
In the prior art, the preview video clip generation speed of the video editing track is slow and the resource occupancy is high, resulting in slow response of the preview video clip and stuttering of the preview video clip.
By receiving editing instructions for video editing tracks, a media material group is generated, which characterizes a logical set of media material fragments located in the same target time period on multiple video editing tracks, thereby quickly generating preview video fragments.
It improves the generation speed of preview video clips, reduces the use of computing resources, and solves the problems of slow and stuttering response of preview videos.
Smart Images

Figure CN119729153A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of computer technology, and in particular to a video processing method, device, electronic device, and storage medium. Background Art
[0002] Currently, in video processing scenarios such as editing and synthesizing audio and video data, media materials are usually set on multiple video editing tracks and edited accordingly. Then, multiple video editing tracks are synthesized in real time to generate preview video clips, thereby realizing the real-time preview function in the video editing process.
[0003] However, the solutions in the prior art have the problems of slow preview video segment generation speed and high resource usage, resulting in slow preview video segment response and preview video segment freeze. 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 slow preview video clip generation speed and high resource usage.
[0005] In a first aspect, an embodiment of the present disclosure provides a video processing method, including:
[0006] A first editing instruction for a video editing track is received, wherein at least one media material is arranged on the video editing track, and the first editing instruction is used to edit the start and end time of the media material on the video editing track, wherein the start and end time represent the starting time point and the ending time point of the media material on the video editing track; in response to the first editing instruction, a first media material group is generated, wherein the first media material group represents a logical set of media material segments on at least two video editing tracks that are located within the same target time period, and the target time period is determined by the start and end time of the media material edited by the first editing instruction; and according to the first media material group, at least one frame of a first video image is generated, and the first video image is used to preview the editing result corresponding to the first editing instruction.
[0007] In a second aspect, an embodiment of the present disclosure provides a video processing device, including:
[0008] A receiving module, configured to receive a first editing instruction for a video editing track, wherein at least one media material is arranged on the video editing track, and wherein the first editing instruction is configured to edit the start and end time of the media material on the video editing track, wherein the start and end time represent the start and end time points of the media material on the video editing track;
[0009] A processing module, configured to generate a first media material group in response to the first editing instruction, wherein the first media material group represents a logical set of media material segments located within a same target time period on at least two video editing tracks, wherein the target time period is determined by the start and end time of the media material edited by the first editing instruction;
[0010] The generating module is used to generate at least one frame of first video image according to the first media material group, where the first video image is used to preview the editing result corresponding to the first editing instruction.
[0011] In a third aspect, an embodiment of the present disclosure provides an electronic device, including:
[0012] A processor, and a memory communicatively connected to the processor;
[0013] The memory stores computer-executable instructions;
[0014] The processor executes the computer-executable instructions stored in the memory to implement the video processing method as described in the first aspect and various possible designs of the first aspect.
[0015] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the video processing method described in the first aspect and various possible designs of the first aspect is implemented.
[0016] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the video processing method as described in the first aspect and various possible designs of the first aspect.
[0017] The video processing method, device, electronic device and storage medium provided in this embodiment receive a first editing instruction for a video editing track, wherein at least one media material is set on the video editing track, and the first editing instruction is used to edit the start and end time of the media material on the video editing track, wherein the start and end time represent the starting time point and the ending time point of the media material on the video editing track; in response to the first editing instruction, generate a first media material group, wherein the first media material group represents a logical set of media material segments located in the same target time period on at least two video editing tracks, wherein the target time period is determined by the start and end time of the media material edited by the first editing instruction; and generate at least one frame of a first video image according to the first media material group, wherein the first video image is used to preview the editing result corresponding to the first editing instruction. By responding to the first editing instruction, a media material group corresponding to the media material edited by the first editing instruction is generated, and the corresponding preview video segment is quickly generated by using the media material group containing the content of the entire track, without generating all the media materials on all video editing tracks, thereby improving the generation speed of the preview video segment and reducing the computing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, 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.
[0019] Figure 1 A schematic diagram of a video editing interface provided by an embodiment of the present disclosure;
[0020] Figure 2 The video processing method provided by the embodiment of the present disclosure is shown in FIG. Figure 1 ;
[0021] Figure 3 A schematic diagram of a target media material corresponding to a first editing instruction provided in an embodiment of the present disclosure;
[0022] Figure 4 A schematic diagram of generating a first media material group provided by an embodiment of the present disclosure;
[0023] Figure 5 The video processing method provided by the embodiment of the present disclosure is shown in FIG. Figure 2 ;
[0024] Figure 6 A schematic diagram of a data structure of editing sequence data provided by an embodiment of the present disclosure;
[0025] Figure 7 for Figure 5 A flowchart of a possible implementation of step S203 in the illustrated embodiment;
[0026] Figure 8 for Figure 5 A flowchart of another possible implementation of step S203 in the illustrated embodiment;
[0027] Fig. 9 for Figure 5 A flowchart of a specific implementation method of step S204 in the illustrated embodiment;
[0028] Fig.10 Another schematic diagram of generating a first media material group provided by an embodiment of the present disclosure;
[0029] Fig.11 A structural block diagram of a video processing device provided by an embodiment of the present disclosure;
[0030] Fig.12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure;
[0031] Fig.13 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0032] 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.
[0033] 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.
[0034] The application scenarios of the embodiments of the present disclosure are explained below:
[0035] The video processing method provided by the embodiment of the present disclosure can be applied to the application scenario of video editing. Specifically, the method provided by the embodiment of the present disclosure can be applied to a terminal device or a server, wherein, when the execution subject of the method provided by the present embodiment is a terminal device, the video processing method can be executed by the terminal device, and the execution result can be displayed on the terminal device; when the execution subject of the method provided by the present embodiment is a server, it can be based on executing the video processing method by the server, and sending the execution result to the terminal device for display. In this embodiment, the application scenario is introduced with the terminal device as the execution subject. Exemplarily, a video editing software for editing videos is running on one side of the terminal device, and the video editing software uses the video processing method provided by the present embodiment to implement functions such as video editing, synthesis, and preview. Specifically, the method provided by the present embodiment is stored in the terminal device in the form of an SDK, and the video editing software executes the corresponding function by calling the SDK corresponding to the method of the present embodiment.
[0036] Figure 1 A schematic diagram of a video editing interface provided by an embodiment of the present disclosure, referring to Figure 1 As shown, in the video editing interface of the video editing software, there is a material window for selecting and loading media materials, a preview window for displaying preview videos, and a video editing window, wherein there are multiple video editing tracks in the video editing window, and on each video editing track, there are media materials such as video clips, music clips, special effects, etc. The user can perform editing operations such as adding, deleting, and modifying the media materials on the video editing track based on needs. Each video editing track corresponds to the same timeline, and by editing the media materials on each video editing track, the picture content of the composite video at a specific moment can be designed; at the same time, after the content on the video editing track changes, the video editing software can generate a corresponding preview video in real time, that is, a video with the same content as the final output composite video but with a lower resolution, thereby enabling the user to preview the editing results. For example Figure 1 As shown in , video clip #1 and video clip #2 are set on the video editing track Track_1, video clip #3 is set on the video editing track Track_2, and music clip #4 is set on the video editing track Track_3. After the contents of the above-mentioned multiple video editing tracks are configured, a preview video generated based on the above-mentioned multiple video editing tracks is displayed in the preview window of the video editing interface. At the T_1th moment of the preview video, the video screen of video clip #1 and the video screen of video clip #3 are displayed at the same time according to the media materials on the video editing tracks, and the audio clip #4 is played.
[0037] Since the generation of preview videos requires the content on the entire video editing track, in the prior art, after editing the video editing track, the terminal device needs to synthesize all media materials on each video editing track through the running video editing software, resulting in the need to process all media materials on the entire track even if the user only makes a minor change to individual media materials on a certain video editing track, leading to problems such as slow preview video generation speed, poor real-time response, and preview video freezes. The disclosed embodiments provide a video processing method to solve the above problems.
[0038] refer to Figure 2 , Figure 2 The video processing method provided by the embodiment of the present disclosure is shown in FIG. Figure 1 The method of this embodiment can be applied in a terminal device or an electronic device with similar functions. The video processing method includes:
[0039] Step S101: Receive a first editing instruction for a video editing track, on which at least one media material is set. The first editing instruction is used to edit the start and end time of the target media material on the video editing track, where the start and end time represent the starting time point and the ending time point of the media material on the video editing track.
[0040] For example, reference Figure 1 The schematic diagram of the video editing interface shown in the figure shows that after the video editing software is started, based on the specific operation of the user, a new video processing task / project is created, or an existing video processing task / project is loaded, thereby displaying the video editing interface. Wherein, in the case of a new processing task / project, the displayed video editing interface may not include a video editing track, or there may be only one or a few empty video editing tracks, and an empty video editing track refers to a video editing track on which no media material is set. Afterwards, based on the track editing instructions input by the user, the video editing track is increased or decreased, and at least one media material is set on the video editing track, thereby generating a valid video editing track (non-empty video editing track); and in the case of loading an existing video processing task / project, after the video editing software loads the existing video processing task / project, at least two valid video editing tracks are displayed in the video editing page, and each valid video editing track is set with at least one media material.
[0041] Afterwards, the terminal device receives a first editing instruction input by the user, wherein the editing instruction refers to an instruction obtained by the terminal device through the human-computer interaction interface to convert the user operation, and is used to edit the media material in the above-mentioned video editing track, for example, adding media material, deleting media material, and changing the position of the media material on the video editing track, that is, the start and end time of the media material on the video editing track, wherein the start and end time represent the starting time point and the ending time point of the media material on the video editing track. Furthermore, the first editing instruction is an editing instruction for editing the target media material, wherein the target media material includes a piece of media material or multiple pieces of media, that is, the media material whose start and end time are changed due to the first editing instruction is the target media material. Figure 3 A schematic diagram of a target media material corresponding to a first editing instruction provided in an embodiment of the present disclosure, such as Figure 3 As shown, exemplarily, the first editing instruction includes instruction Op_1 and instruction Op_2, wherein instruction Op_1 is an instruction for editing video segments P1 and P2 on video editing track Track_1. More specifically, as shown in the figure, instruction Op_1 shifts the end time point t1 of video segment P1 to the right (increases the playback duration of video segment P1), and synchronously shifts the start time point t2 (coinciding with the end time point t1) and the end time point t3 of video segment P2 to the right. Instruction Op_2 is an instruction for editing music segments M1 and M2 on video editing track Track_2. More specifically, as shown in the figure, instruction Op_2 inserts a new music segment M2 on video editing track Track_2, and synchronously shifts the start time point t4 and the end time point t5 of music segment M1 to the right. Based on the above instructions Op_1 and Op_2, the terminal device can determine that the target media elements indicated by the first editing instruction are the video clips P1 and P2 on the video editing track Track_1, and the music clips M1 and M2 on the video editing track Track_2.
[0042] Step S102: In response to the first editing instruction, a first media material group is generated, wherein the first media material group represents a logical set of media material segments on at least two video editing tracks that are located within the same target time period, and the target time period is determined by the start and end time of the target media material.
[0043] Exemplarily, further, after the terminal device responds to the first editing instruction, it edits the target media material corresponding to the first editing instruction, thereby updating the data of the video editing track, and then, based on intercepting the media materials on each updated video editing track within the same target time period, a data for carrying media material segments of multiple tracks, namely, a media material group, is obtained. The first media material group represents a logical set of media material segments on at least two video editing tracks within the same target time period, and the target time period is determined by the start and end time of the target media material. Figure 4 A schematic diagram of generating a first media material group provided by an embodiment of the present disclosure is as follows: Figure 4 As shown, in response to the first editing instruction, the terminal device moves the media material #1 on the video editing track Track_1 to the right along the time axis by a distance of T1, and the starting time point t1 of the media material #1 changes from a to a+T1; the ending time point t2 changes from b to b+T1. Afterwards, according to the start and end time of the moved media material #1, i.e., the starting time point t1 and the ending time point t2, the target time period, i.e., [t1, t2], is determined. Furthermore, based on the target time period [t1, t2], the media materials on each video editing track are intercepted to obtain the media material segment P1 (i.e., the media material #1 itself) on the video editing track Track_1, the media material segment P2 on the video editing track Track_2, and the media material segment P3 on the video editing track Track_3. Afterwards, the set of the above three video material segments P1, P2 and P3 constitutes the first media material group.
[0044] Furthermore, in a possible implementation, the data of each video editing track displayed in the video editing interface is generated based on the editing sequence data, wherein the editing sequence data is a data structure that can be used to describe the complex organization form of multimedia data, and the editing sequence data includes at least one track data for describing the content of the video editing track, and each track data includes at least one slice data, and the slice data is used to describe a section of media material on the video editing track. The editing sequence data also includes a plurality of media material groups divided based on different time intervals, and the meaning of the media material group can refer to the above introduction to the first media material group. When the track data and slice data in the editing sequence data change in response to the first editing instruction, the media material group in the editing sequence data also changes accordingly. Afterwards, the terminal device obtains the media material group that changes in response to the first editing instruction, i.e., the first media material group, by reading the editing sequence data. The specific implementation method and structure of the editing sequence data can be set based on needs, and will not be repeated here.
[0045] Step S103: generating at least one frame of a first video image according to the first media material group, where the first video image is used to preview an editing result corresponding to the first editing instruction.
[0046] Exemplarily, after obtaining the first media material group, the media material segments on each video editing track represented by the first media material group are synthesized to generate preview video segments, that is, multi-track data synthesis and rendering are performed on the media material segments on different tracks to generate all the first video images. Among them, the preview video is generated based on the first media material group, and the first media material group is generated based on the start and end time corresponding to the target media material set by the first editing instruction. Therefore, the first video image can show the editing result corresponding to the first editing instruction. The first video image is a preview video for previewing the editing result corresponding to the first editing instruction. As for other media material segments of the media materials in each video editing track, since they have not changed, the preview video synthesis can be temporarily not performed, thereby reducing the amount of data processing.
[0047] Optionally, thereafter, the first video image is displayed in a preview window in the video editing interface, so that the user can quickly preview the editing result corresponding to the first editing instruction.
[0048] In this embodiment, by receiving a first editing instruction for a video editing track, at least one media material is set on the video editing track, and the first editing instruction is used to edit the start and end time of the media material on the video editing track, and the start and end time represent the starting time point and the ending time point of the media material on the video editing track; in response to the first editing instruction, a first media material group is generated, wherein the first media material group represents a logical set of media material segments located in the same target time period on at least two video editing tracks, and the target time period is determined by the start and end time of the media material edited by the first editing instruction; according to the first media material group, at least one frame of the first video image is generated, and the first video image is used to preview the editing result corresponding to the first editing instruction. By responding to the first editing instruction, a media material group corresponding to the media material edited by the first editing instruction is generated, and the corresponding preview video segment is quickly generated by using the media material group containing the content of the entire track, without the need to generate all the media materials on all video editing tracks, thereby improving the generation speed of the preview video segment and reducing the problem of computing efficiency.
[0049] refer to Figure 5 , Figure 5 The video processing method provided by the embodiment of the present disclosure is shown in FIG. Figure 2 In this embodiment Figure 2Based on the embodiment shown, step S102 is further refined, and steps of generating a composite video and setting the editing status of the media material segment are added. The video processing method includes:
[0050] Step S201: Receive a first editing instruction for a video editing track.
[0051] Among them, at least one media material is set on the video editing track, and the first editing instruction is used to edit the start and end time of the target media material on the video editing track, and the start and end time represent the starting time point and the ending time point of the media material on the video editing track.
[0052] Step S202: Acquire editing sequence data corresponding to the video editing task.
[0053] The editing sequence data includes at least two track data representing video editing tracks and a media time sequence corresponding to the video editing track, wherein the start and end time point media time sequence represents the time axis position of at least one media material on the video editing track, and the start and end time points represent the start time point or end time point of the time line occupied by the media material on the corresponding video editing track. Figure 2 In the illustrated embodiment, the editing sequence data includes at least track data, a media time sequence corresponding to the track data, and a combination of [track data, media time sequence], which is used to describe the content on a video editing track. The media time sequence is determined based on each slice data in the track data, and the slice data can be used to represent the start time point and the end time point of a media material. Figure 6 A schematic diagram of a data structure of editing sequence data provided by an embodiment of the present disclosure, such as Figure 6As shown, the editing sequence data includes multiple track data corresponding to the video editing tracks, which are shown as Track1, Track2, etc. in the figure. Each track data also includes or corresponds to a number of slice data for storing the start and end time points of the media material. Each slice data stores two start and end time points, namely the start time point and the end time point, such as clip_11, clip_12, clip_13, clip_14, etc. shown in the figure. Among them, the correspondence between the track data and the slice data may be only a logical relationship, that is, the slice data is not actually stored in the track data. Furthermore, the media time sequence corresponding to the track data (video editing track) is determined based on the slice data such as clip_11, clip_12, clip_13, clip_14, that is, the track data Track1 corresponds to the media time sequence Array_1, and the track Track2 corresponds to the media time sequence Array_2. For example, clip_11 = [a, b], where a is the start time point of the media resource corresponding to clip_11, and b is the end time point of the media resource corresponding to clip_11 (the same below, no further description). clip_12 = [c, d], clip_13 = [e, f], clip_14 = [g, h], then the media time sequence is [a, b, c, d, e, f]. The above track data and the corresponding media time sequence can be pre-generated as part of the editing sequence data.
[0054] Step S203: according to the first editing instruction, edit the media time sequence of the target video editing track in the editing sequence data to obtain updated editing sequence data.
[0055] For example, reference Figure 6 As shown in the data structure diagram of the edit sequence data, after the terminal device responds to the first edit instruction, the slice data in the edit sequence data is edited. After the slice data is updated, the media time sequence is synchronously updated to obtain the updated edit sequence data.
[0056] In a possible implementation, the first editing instruction includes a first starting time and a first ending time, wherein the first starting time represents a starting time point of the target media material on the target video editing track; and the first ending time represents an ending time point of the target media material on the target video editing track. Figure 7 As shown, a possible implementation of step S203 includes:
[0057] Step S2031: according to the first starting time and the first ending time, the start and end time points of the target media material in the target video editing track are set.
[0058] Step S2032: According to the start and end time points of the target media material, at least the start and end time points of other media materials adjacent to the target media material in the target video editing track are adjusted to obtain an updated target video editing track.
[0059] Step S2033: Generate updated editing sequence data according to the updated target video editing track.
[0060] Exemplarily, according to the first start time and the first end time in the first editing instruction, the slice data corresponding to the target media material is modified, that is, the start and end time points of the target media material in the target video editing track are set. In a possible implementation, when the start and end time points of the target media material change, the start and end time points of other media materials adjacent to the target media material also change accordingly. For example, when a target media material is deleted (for example, by setting the start and end time points of the target media material to 0) or a target media material is added, other media materials on the video editing track will be dynamically moved based on the interval between the first start time and the first end time, so as to fill the blank interval after deleting the target media material, or insert a blank interval to set the target media material. Afterwards, according to the slice data (media time sequence) corresponding to the updated target video editing track, the editing sequence data is updated to generate the updated editing sequence data. In this embodiment, by dynamically adjusting the start and end time points of other media materials adjacent to the target media material in the target video editing track, the overlap of video materials is avoided, and no additional editing instructions are required for configuration, thereby improving the interaction efficiency in the video editing process.
[0061] In this embodiment, the update of the editing sequence data is implemented based on the media time sequence, that is, when editing the content on each video editing channel, only the start and end time of the media resources on each video editing channel are modified, and the actual material files (such as images, videos) are not copied or moved within or between tracks, thereby reducing the execution cost and improving the execution efficiency during the editing process.
[0062] Furthermore, in another possible implementation, the first editing instruction further includes a second start time and a second end time, wherein the second start time represents a media start timestamp of the target media material; and the second end time represents a media end timestamp of the target media material. Figure 8 As shown, another possible implementation of step S203 includes:
[0063] Step S2034: setting the media content interval of the target media material in the target video editing track according to the start time point and the end time point;
[0064] Step S2035: According to the media content interval of the target media material, the media time sequence of the target video editing track in the editing sequence data is edited to obtain updated editing sequence data.
[0065] Exemplarily, in a possible implementation, the target media material has a media content interval, and the media content interval refers to when the playback duration of the target media material is less than the video duration, a portion of the target media material is intercepted for display, and the above-mentioned intercepted internal interval is the media content interval. In this embodiment, the media content interval can be further set by the second start time and the second end time included in the first editing instruction, wherein the second start time represents the video timestamp corresponding to the left boundary of the media content interval, that is, the media start timestamp; correspondingly, the second end time represents the video timestamp corresponding to the right boundary of the media content interval, that is, the media end timestamp. Specifically, for example, the target media material is set on the video editing track Track_1, and the start and end times corresponding to the target media material are [10,20], that is, the total playback duration of the target media material on the video editing track is 10 seconds. The target media material is a 30-second video file. Based on the first editing instruction, the start and end points of the video file can be set, for example, starting from 15 seconds (media start timestamp) of the video file and stopping at 25 seconds (media end timestamp) of the video file, with a total play time of 10 seconds. Afterwards, the media content interval is stored as an additional parameter in the corresponding media time sequence. In the subsequent process of generating the first media material group based on the media time sequence, the content of the media material is determined based on the media content interval, thereby achieving accurate acquisition of the content in the media material.
[0066] Step S204: Generate a first media material group according to the updated editing sequence data.
[0067] Exemplarily, after the edit sequence data is updated, the first media material group is further generated based on the data in the edit sequence data. Exemplarily, Fig. 9 As shown, the specific implementation of step S204 includes:
[0068] Step S2041: Sequence-merge the media time sequences of each video editing track in the editing sequence data to obtain a merged media time sequence.
[0069] Step S2042: obtaining at least one time period to be selected according to two adjacent start and end time points in the merged media time sequence.
[0070] Step S2043: determine the candidate time period corresponding to the target media material as the target time period, and obtain identification marks of the media material segments of each video editing track within the target time period to obtain a first media material group.
[0071] Fig.10 Another schematic diagram of generating a first media material group provided by an embodiment of the present disclosure is as follows. Fig.10 The above process is introduced as follows: Fig.10 As shown, exemplarily, the editing sequence data includes a media time sequence Array_1 (shown as Array_1 in the figure) corresponding to the video editing track Track_1 and a media time sequence Array_2 (shown as Array_2 in the figure) corresponding to the video editing track Track_2, wherein the media time sequence Array_1 = [0, 10.15, 10.15, 20.12]; the media time sequence Array_2 = [8.20, 14.18]. Afterwards, based on the sequential timing of each start and end time point in the media time sequence, the merged media time sequence Array_3 (shown as Array_3 in the figure) is obtained, and the merged media time sequence Array_3 = [0, 8.20, 10.15, 14.18, 20.12]. Further, based on every two adjacent start and end time points of the merged media time sequence, multiple candidate time periods are obtained, namely, time period T_1 = [0, 8.20], time period T_2 = [8.20, 10.15], time period T_3 = [10.15, 14.18], and time period T_4 = [14.18, 20.12]. Afterwards, in a possible implementation, for example, slice data corresponding to the target media material is obtained from the edit sequence data, wherein the target media material is, for example, media material #1 on Track_2, and its corresponding start and end time points are [8.20, 14.18]. Therefore, the union of time periods T_2 and T_3, T_5 = [8.20, 14.18], is used as the target time period. In another possible implementation, the union of the start and end time points of the target media material before responding to the first editing instruction and the start and end time points after responding to the first editing instruction is taken as the target time period. For example, the target media material is media material #1 on Track_2. Before the media material is edited by the first editing instruction, the start and end time on the video editing track is T_1 = [0, 8.20], and after the media material is edited by the first editing instruction, the start and end time on the video editing track is T_2 = [8.20, 14.18]. Then the union of time periods T_1 and T_2, T_6 = [0, 14.18], is taken as the target time period, that is, the time period in which all video content occurs.
[0072] Furthermore, after determining the target time period, the media material segments on each video editing track within the target time period are read through the editing sequence data to obtain a first media material group, which is synthesized and rendered to obtain a first video image. Thereafter, the first video image is previewed and displayed to achieve the purpose of previewing the editing result corresponding to the first editing instruction. The specific implementation method will not be repeated here.
[0073] Exemplarily, the edit sequence data is pre-generated data in a specific data format. By editing the media time sequence corresponding to each track data in the edit sequence data, the first media material group corresponding to the first edit instruction can be obtained. Therefore, before using the edit sequence data to obtain the first media material group, the method also includes a step of generating a media time sequence in the edit sequence data. Optionally, before step S202, the method also includes:
[0074] Step S2001: Detecting the start time point and the end time point of the media material on each video editing track in the editing sequence data;
[0075] Step S2002: Generate a media time sequence corresponding to each video editing track according to the start time point and the end time point of the media material on each video editing track.
[0076] Exemplarily, after setting the track data in the editing sequence data (i.e., setting ordered media materials on the video editing track), the track data includes corresponding slice data corresponding to each segment of the media material. Based on the slice data, detection can be performed to obtain the start time point and end time point of the media material on each video editing track in the editing sequence data. Afterwards, the start time point and end time point of the media material on each video editing track are arranged in time sequence to generate a media time sequence corresponding to the video editing track, in which the start time point and end time point corresponding to each media material in the media time sequence are arranged alternately. Afterwards, the above operations are performed for each track data in the editing sequence data to obtain the media time sequence corresponding to each video editing track.
[0077] Exemplarily, the specific implementation of step S2001 includes:
[0078] Step S2001A: traverse the track identifiers corresponding to each video editing track, and obtain at least one slice data corresponding to each video editing track, wherein the slice data includes a material file of a segment of media material and the start time point and the end time point corresponding to the media material.
[0079] Step S2001B: Obtain the start time point and the end time point of the media material on each video editing track according to the slice data corresponding to each video editing track.
[0080] Exemplarily, first, based on the track identifier corresponding to each video editing track, the track data is read in sequence to obtain the slice data corresponding to each media material contained in the track data, wherein the slice data includes a material file of a segment of media material and the start time point and the end time point corresponding to the media material. Then, the start time point and the end time point of the media material are obtained according to the slice data.
[0081] Step S205: generating at least one frame of a first video image according to the first media material group, where the first video image is used to preview the editing result corresponding to the first editing instruction.
[0082] Optionally, this embodiment also includes the following steps of asynchronous execution:
[0083] Step S206: receiving a second editing instruction for the first media material group, and editing the movement state of the target media material segment corresponding to the first media material group, or the display level of the target media material segment in the first media material group according to the second editing instruction.
[0084] Exemplarily, before or after receiving the first editing instruction, the terminal device may also receive a second editing instruction input by the user, wherein the second editing instruction is used to set parameters of a target media material segment in the first media material group, wherein, in a possible implementation, the second editing instruction is used to edit the movement state of the target media material segment corresponding to the first media material group. Specifically, for example, when the target media material segment is set to a movable state (a possible movement state) through the second editing instruction, the target media material segment can be moved between video editing tracks or within a video editing track in response to the first editing instruction; when the target media material segment is set to an immovable state (another possible movement state) through the second editing instruction, the target media material segment may not be able to move between video editing tracks or within a video editing track in response to the first editing instruction, thereby realizing media resource locking based on the media material group dimension to meet diverse video editing needs.
[0085] In another possible implementation, the second editing instruction is used to edit the display level of the target media material segment in the first media material group, wherein the display level is information that characterizes the display priority of multiple media materials when they are displayed together, and the media materials of the high display level are displayed in the upper layer, while the media materials of the low display level are displayed in the lower layer, and the media materials of the upper layer will block the media materials of the lower layer. Through the second editing instruction, the display level of different media material segments in the same media material group can be set, which is equivalent to setting the display level of the entire media material. The scheme of this embodiment realizes a more precise hierarchical display effect and improves the flexibility of video editing.
[0086] Optionally, after step S205, the method further includes:
[0087] Step S207: Acquire a second media material group in the edit sequence data, and generate a second video image according to the second media material group.
[0088] Step S208: Generate a composite video according to the first video image and the second video image.
[0089] Exemplarily, after generating the first video image, the final output composite video can be directly generated based on the first video image and in combination with other already generated second video images, wherein the second video image is generated based on the second media material group, and the second media material group is pre-generated data based on the media time sequence in the editing sequence data. When the second media material group does not change, the second media material group can always be in a cached state, thereby achieving rapid generation of the second video image and thereby improving the speed of generating the composite video.
[0090] In this embodiment, step S205 is consistent with step S103 in the above embodiment. For a detailed discussion, please refer to the discussion of step S103, which will not be repeated here.
[0091] Corresponding to the video processing method of the above embodiment, Fig.11 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.
[0092] Reference Fig.11 , the video processing device 3 comprises:
[0093] The receiving module 31 is used to receive a first editing instruction for a video editing track, where at least one media material is set on the video editing track, and the first editing instruction is used to edit the start and end time of the target media material on the video editing track, where the start and end time represent the start time point and end time point of the media material on the video editing track;
[0094] The processing module 32 is configured to generate a first media material group in response to the first editing instruction, wherein the first media material group represents a logical set of media material segments located in the same target time period on at least two video editing tracks, and the target time period is determined by the start and end time of the target media material;
[0095] The generating module 33 is used to generate at least one frame of first video image according to the first media material group, where the first video image is used to preview the editing result corresponding to the first editing instruction.
[0096] In one embodiment of the present disclosure, when the processing module 32 generates the first media material group in response to the first editing instruction, it is specifically used to: obtain editing sequence data corresponding to the video editing task, the editing sequence data including at least two track data representing the video editing track, and the media time sequence corresponding to the video editing track, wherein the start and end time point media time sequence represents the time axis position of at least one media material on the video editing track, and the start and end time points represent the starting time point or the ending time point of the timeline occupied by the media material on the corresponding video editing track; according to the first editing instruction, edit the media time sequence of the target video editing track in the editing sequence data to obtain updated editing sequence data; according to the updated editing sequence data, generate the first media material group.
[0097] In one embodiment of the present disclosure, the first editing instruction includes a first starting moment and a first ending moment, the first starting moment representing the starting time point of the target media material on the target video editing track; the first ending moment representing the ending time point of the target media material on the target video editing track; when the processing module 32 edits the media time sequence of the target video editing track in the editing sequence data according to the first editing instruction and obtains the updated editing sequence data, it is specifically used to: set the start and end time points of the target media material in the target video editing track according to the first starting moment and the first ending moment; according to the start and end time points of the target media material, at least adjust the start and end time points of other media materials adjacent to the target media material in the target video editing track to obtain the updated target video editing track; generate the updated editing sequence data according to the updated target video editing track.
[0098] In one embodiment of the present disclosure, when the processing module 32 generates the first media material group based on the updated editing sequence data, it is specifically used to: sequence-merge the media time sequences of each video editing track in the editing sequence data to obtain a merged media time sequence; obtain at least one candidate time period based on two adjacent start and end time points in the merged media time sequence; determine the candidate time period corresponding to the target media material as the target time period, and obtain the identification mark of the media material segment of each video editing track within the target time period to obtain the first media material group.
[0099] In one embodiment of the present disclosure, before obtaining the editing sequence data corresponding to the video editing task, the processing module 32 is also used to: detect the starting time point and the ending time point of the media material on each video editing track in the editing sequence data; and generate a media time sequence corresponding to the video editing track according to the starting time point and the ending time point of the media material on each video editing track.
[0100] In one embodiment of the present disclosure, when the processing module 32 detects the start time point and the end time point of the media material on each video editing track in the editing sequence data, it is specifically used to: traverse the track identifier corresponding to each video editing track, obtain at least one slice data corresponding to each video editing track, the slice data including a material file of a segment of media material and the start time point and the end time point corresponding to the media material; according to the slice data corresponding to each video editing track, obtain the start time point and the end time point of the media material on each video editing track.
[0101] In one embodiment of the present disclosure, the first editing instruction includes a second start time and a second end time, the second start time represents the media start timestamp of the target media material; the second end time represents the media end timestamp of the target media material; when the processing module 32 edits the media time sequence of the target video editing track in the editing sequence data according to the first editing instruction to obtain the updated editing sequence data, it is specifically used to: set the media content interval of the target media material in the target video editing track according to the start time point and the end time point; edit the media time sequence of the target video editing track in the editing sequence data according to the media content interval of the target media material to obtain the updated editing sequence data.
[0102] In one embodiment of the present disclosure, the receiving module 31 is further used to: receive a second editing instruction for the first media material group; the processing module 32 is further used to: edit the movement state of the target media material segment corresponding to the first media material group, or the display level of the target media material segment in the first media material group according to the second editing instruction.
[0103] In one embodiment of the present disclosure, the generation module 33 is specifically used to: synthesize the media material segments on each video editing track represented by the first media material group to generate at least one frame of the first video image; the generation module 33 is also used to: obtain the second video image generated based on the second media material group; and generate a synthesized video based on the first video image and the second video image.
[0104] The receiving module 31, the processing module 32 and the generating module 33 are connected in sequence. The video processing 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.
[0105] Fig.12 A schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure is shown in FIG. Fig.12 As shown, the electronic device 4 includes:
[0106] A processor 41, and a memory 42 communicatively connected to the processor 41;
[0107] The memory 42 stores computer executable instructions;
[0108] The processor 41 executes the computer execution instructions stored in the memory 42 to implement the following Figure 2-Figure 10 The video processing method in the illustrated embodiment.
[0109] Optionally, the processor 41 and the memory 42 are connected via a bus 43 .
[0110] For related instructions, please refer to Figure 2-Figure 10 The relevant descriptions and effects corresponding to the steps in the corresponding embodiments can be understood, and no further elaboration is made here.
[0111] 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 10 The video processing method provided by any one of the corresponding embodiments.
[0112] The present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements Figure 2-Figure 10 The video processing method in the illustrated embodiment,
[0113] refer to Fig.13 , 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.13 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.
[0114] like Fig.13As 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.
[0115] 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.13 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.
[0116] 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.
[0117] 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.
[0118] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0119] 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.
[0120] 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).
[0121] 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.
[0122] 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".
[0123] 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 chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0124] 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.
[0125] In a first aspect, according to one or more embodiments of the present disclosure, a video processing method is provided, including:
[0126] A first editing instruction for a video editing track is received, wherein at least one media material is arranged on the video editing track, and the first editing instruction is used to edit the start and end time of the target media material on the video editing track, wherein the start and end time represent the starting time point and the ending time point of the media material on the video editing track; in response to the first editing instruction, a first media material group is generated, wherein the first media material group represents a logical set of media material segments on at least two video editing tracks that are located within the same target time period, and the target time period is determined by the start and end time of the target media material; and according to the first media material group, at least one frame of a first video image is generated, and the first video image is used to preview the editing result corresponding to the first editing instruction.
[0127] According to one or more embodiments of the present disclosure, the response to the first editing instruction to generate the first media material group includes: obtaining editing sequence data corresponding to the video editing task, the editing sequence data including at least two track data representing the video editing track, and a media time sequence corresponding to the video editing track, wherein the start and end time point media time sequence represents the timeline position of at least one media material on the video editing track, and the start and end time points represent the starting time point or the ending time point of the timeline occupied by the media material on the corresponding video editing track; according to the first editing instruction, editing the media time sequence of the target video editing track in the editing sequence data to obtain updated editing sequence data; according to the updated editing sequence data, generating the first media material group.
[0128] According to one or more embodiments of the present disclosure, the first editing instruction includes a first starting moment and a first ending moment, the first starting moment representing the starting time point of the target media material on the target video editing track; the first ending moment representing the ending time point of the target media material on the target video editing track; the editing of the media time sequence of the target video editing track in the editing sequence data according to the first editing instruction to obtain updated editing sequence data includes: setting the start and end time points of the target media material in the target video editing track according to the first starting moment and the first ending moment; adjusting at least the start and end time points of other media materials adjacent to the target media material in the target video editing track according to the start and end time points of the target media material to obtain an updated target video editing track; generating the updated editing sequence data according to the updated target video editing track.
[0129] According to one or more embodiments of the present disclosure, generating a first media material group based on the updated editing sequence data includes: merging the media time sequences of each video editing track in the editing sequence data to obtain a merged media time sequence; obtaining at least one candidate time period based on two adjacent start and end time points in the merged media time sequence; determining the candidate time period corresponding to the target media material as the target time period, and obtaining identification identifiers of the media material segments of each video editing track within the target time period to obtain the first media material group.
[0130] According to one or more embodiments of the present disclosure, before obtaining the editing sequence data corresponding to the video editing task, the method also includes: detecting the starting time point and the ending time point of the media material on each of the video editing tracks in the editing sequence data; and generating a media time sequence corresponding to the video editing track according to the starting time point and the ending time point of the media material on each of the video editing tracks.
[0131] According to one or more embodiments of the present disclosure, the detecting the starting time point and the ending time point of the media material on each of the video editing tracks in the editing sequence data includes: traversing the track identifiers corresponding to each of the video editing tracks, obtaining at least one slice data corresponding to each of the video editing tracks, the slice data including a material file of a segment of media material and the starting time point and the ending time point corresponding to the media material; obtaining the starting time point and the ending time point of the media material on each of the video editing tracks according to the slice data corresponding to each of the video editing tracks.
[0132] According to one or more embodiments of the present disclosure, the first editing instruction includes a second starting time and a second ending time, the second starting time representing the media start timestamp of the target media material; the second ending time representing the media end timestamp of the target media material; the editing of the media time sequence of the target video editing track in the editing sequence data according to the first editing instruction to obtain updated editing sequence data includes: setting the media content interval of the target media material in the target video editing track according to the starting time point and the ending time point; editing the media time sequence of the target video editing track in the editing sequence data according to the media content interval of the target media material to obtain updated editing sequence data.
[0133] According to one or more embodiments of the present disclosure, the method further includes: receiving a second editing instruction for the first media material group; and editing, according to the second editing instruction, a moving state of a target media material segment corresponding to the first media material group, or a display level of the target media material segment in the first media material group.
[0134] According to one or more embodiments of the present disclosure, generating at least one frame of the first video image based on the first media material group includes: synthesizing the media material segments on each video editing track represented by the first media material group to generate the first video image; the method also includes: acquiring a second video image generated based on the second media material group; and generating a synthesized video based on the first video image and the second video image.
[0135] In a second aspect, according to one or more embodiments of the present disclosure, a video processing device is provided, including:
[0136] A receiving module, configured to receive a first editing instruction for a video editing track, wherein at least one media material is arranged on the video editing track, and wherein the first editing instruction is configured to edit the start and end time of the target media material on the video editing track, wherein the start and end time represent the start and end time points of the media material on the video editing track;
[0137] a processing module, configured to generate a first media material group in response to the first editing instruction, wherein the first media material group represents a logical set of media material segments on at least two video editing tracks that are located within a same target time period, wherein the target time period is determined by the start and end time of the target media material;
[0138] The generating module is used to generate at least one frame of first video image according to the first media material group, where the first video image is used to preview the editing result corresponding to the first editing instruction.
[0139] According to one or more embodiments of the present disclosure, when the processing module generates the first media material group in response to the first editing instruction, it is specifically used to: obtain editing sequence data corresponding to the video editing task, the editing sequence data including at least two track data representing the video editing track, and a media time sequence corresponding to the video editing track, wherein the start and end time point media time sequence represents the timeline position of at least one media material on the video editing track, and the start and end time points represent the starting time point or the ending time point of the timeline occupied by the media material on the corresponding video editing track; according to the first editing instruction, edit the media time sequence of the target video editing track in the editing sequence data to obtain updated editing sequence data; according to the updated editing sequence data, generate the first media material group.
[0140] According to one or more embodiments of the present disclosure, the first editing instruction includes a first starting moment and a first ending moment, the first starting moment representing the starting time point of the target media material on the target video editing track; the first ending moment representing the ending time point of the target media material on the target video editing track; when the processing module edits the media time sequence of the target video editing track in the editing sequence data according to the first editing instruction to obtain the updated editing sequence data, it is specifically used to: set the start and end time points of the target media material in the target video editing track according to the first starting moment and the first ending moment; according to the start and end time points of the target media material, at least adjust the start and end time points of other media materials adjacent to the target media material in the target video editing track to obtain the updated target video editing track; generate the updated editing sequence data according to the updated target video editing track.
[0141] According to one or more embodiments of the present disclosure, when the processing module generates the first media material group based on the updated editing sequence data, it is specifically used to: sequence-merge the media time sequences of each video editing track in the editing sequence data to obtain a merged media time sequence; obtain at least one candidate time period based on two adjacent start and end time points in the merged media time sequence; determine the candidate time period corresponding to the target media material as the target time period, and obtain the identification identifier of the media material segment of each video editing track within the target time period to obtain the first media material group.
[0142] According to one or more embodiments of the present disclosure, before obtaining the editing sequence data corresponding to the video editing task, the processing module is also used to: detect the starting time point and the ending time point of the media material on each of the video editing tracks in the editing sequence data; and generate a media time sequence corresponding to the video editing track according to the starting time point and the ending time point of the media material on each of the video editing tracks.
[0143] According to one or more embodiments of the present disclosure, when the processing module detects the starting time point and the ending time point of the media material on each of the video editing tracks in the editing sequence data, it is specifically used to: traverse the track identifiers corresponding to each of the video editing tracks, and obtain at least one slice data corresponding to each of the video editing tracks, wherein the slice data includes a material file of a segment of media material and the starting time point and the ending time point corresponding to the media material; and obtain the starting time point and the ending time point of the media material on each of the video editing tracks according to the slice data corresponding to each of the video editing tracks.
[0144] According to one or more embodiments of the present disclosure, the first editing instruction includes a second starting time and a second ending time, the second starting time representing the media start timestamp of the target media material; the second ending time representing the media end timestamp of the target media material; when the processing module edits the media time sequence of the target video editing track in the editing sequence data according to the first editing instruction to obtain the updated editing sequence data, it is specifically used to: set the media content interval of the target media material in the target video editing track according to the starting time point and the ending time point; edit the media time sequence of the target video editing track in the editing sequence data according to the media content interval of the target media material to obtain the updated editing sequence data.
[0145] According to one or more embodiments of the present disclosure, the receiving module is further used to: receive a second editing instruction for the first media material group; the processing module is further used to: edit the movement state of the target media material segment corresponding to the first media material group, or the display level of the target media material segment in the first media material group according to the second editing instruction.
[0146] According to one or more embodiments of the present disclosure, the generation module is specifically used to: synthesize the media material segments on each video editing track represented by the first media material group to generate the first video image; the generation module is also used to: obtain the second video image generated based on the second media material group; and generate a composite video based on the first video image and the second video image.
[0147] In a third aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device, comprising: a processor, and a memory communicatively connected to the processor;
[0148] The memory stores computer-executable instructions;
[0149] The processor executes the computer-executable instructions stored in the memory to implement the video processing method as described in the first aspect and various possible designs of the first aspect.
[0150] 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.
[0151] 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.
[0152] 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.
[0153] 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.
[0154] 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: Receive a first editing instruction for a video editing track, where at least one media material is set on the video editing track, and the first editing instruction is used to edit the start and end time of the target media material on the video editing track, where the start and end time represent the starting time point and the ending time point of the media material on the video editing track; In response to the first editing instruction, a first media material group is generated, wherein the first media material group represents a logical set of media material segments on at least two video editing tracks that are located within a same target time period, and the target time period is determined by the start and end time of the target media material; At least one frame of first video image is generated according to the first media material group, where the first video image is used to preview an editing result corresponding to the first editing instruction.
2. The method according to claim 1, characterized in that The step of generating a first media material group in response to the first editing instruction includes: Obtaining editing sequence data corresponding to the video editing task, wherein the editing sequence data includes at least two track data representing the video editing track, and a media time sequence corresponding to the video editing track, wherein the media time sequence represents a set of start and end time points of each media material on the video editing track, and the start and end time points represent the start time point or end time point of the timeline occupied by the media material on the corresponding video editing track; According to the first editing instruction, editing the media time sequence of the target video editing track in the editing sequence data to obtain updated editing sequence data; A first media material group is generated according to the updated editing sequence data.
3. The method according to claim 2, characterized in that The first editing instruction includes a first starting time and a first ending time, wherein the first starting time represents a starting time point of the target media material on the target video editing track; The first termination time represents the termination time point of the target media material on the target video editing track; The step of editing the media time sequence of the target video editing track in the editing sequence data according to the first editing instruction to obtain updated editing sequence data includes: According to the first starting time and the first ending time, setting the start and end time points of the target media material in the target video editing track; According to the start and end time points of the target media material, at least the start and end time points of other media materials adjacent to the target media material in the target video editing track are adjusted to obtain an updated target video editing track; The updated editing sequence data is generated according to the updated target video editing track.
4. The method according to claim 2, characterized in that: Generating a first media material group according to the updated edit sequence data includes: Merging the media time sequences of the video editing tracks in the editing sequence data to obtain a merged media time sequence; Obtaining at least one time period to be selected according to two adjacent start and end time points in the combined media time sequence; The candidate time period corresponding to the target media material is determined as the target time period, and identification marks of the media material segments of each video editing track within the target time period are obtained to obtain a first media material group.
5. The method according to claim 2, characterized in that: Before acquiring the editing sequence data corresponding to the video editing task, the method further includes: Detecting the start time point and the end time point of the media material on each of the video editing tracks in the editing sequence data; According to the starting time point and the ending time point of the media material on each of the video editing tracks, a media time sequence corresponding to the video editing track is generated.
6. The method according to claim 5, characterized in that The detecting the starting time point and the ending time point of the media material on each of the video editing tracks in the editing sequence data comprises: Traversing the track identifiers corresponding to the video editing tracks, obtaining at least one slice data corresponding to each video editing track, wherein the slice data includes a material file of a segment of media material and a start time point and an end time point corresponding to the media material; According to the slice data corresponding to each of the video editing tracks, the starting time point and the ending time point of the media material on each of the video editing tracks are obtained.
7. The method according to claim 2, characterized in that: The first editing instruction includes a second starting time and a second ending time, and the second starting time represents a media starting timestamp of the target media material; The second end time represents a media end timestamp of the target media material; The step of editing the media time sequence of the target video editing track in the editing sequence data according to the first editing instruction to obtain updated editing sequence data includes: According to the starting time point and the ending time point, setting the media content interval of the target media material in the target video editing track; According to the media content interval of the target media material, the media time sequence of the target video editing track in the editing sequence data is edited to obtain updated editing sequence data.
8. The method according to claim 1, characterized in that: The method further comprises: receiving a second editing instruction for the first media material group; According to the second editing instruction, the moving state of the target media material segment corresponding to the first media material group, or the display level of the target media material segment in the first media material group is edited.
9. The method according to claim 1, characterized in that: The step of generating at least one frame of first video image according to the first media material group includes: Synthesizing the media material segments on each video editing track represented by the first media material group to generate at least one frame of the first video image; The method further comprises: Acquire a second video image generated based on a second media material group; A composite video is generated based on the first video image and the second video image.
10. A video processing device, characterized in that: include: A receiving module, configured to receive a first editing instruction for a video editing track, wherein at least one media material is arranged on the video editing track, and wherein the first editing instruction is configured to edit the start and end time of the target media material on the video editing track, wherein the start and end time represent the start and end time points of the media material on the video editing track; a processing module, configured to generate a first media material group in response to the first editing instruction, wherein the first media material group represents a logical set of media material segments on at least two video editing tracks that are located within a same target time period, wherein the target time period is determined by the start and end time of the target media material; The generating module is used to generate at least one frame of first video image according to the first media material group, where the first video image is used to preview the editing result corresponding to the first editing instruction.
11. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the 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, characterized in that The invention comprises a computer program, which implements the video processing method according to any one of claims 1 to 9 when being executed by a processor.
Citation Information
Patent Citations
Method for editing three-dimensional graph and image in real time by using timeline
CN114710704A
Multi-track video editing method, graphical user interface and electronic equipment
CN116055799A
Video processing method and device, electronic equipment and computer readable storage medium
CN116471451A
Content editing and generating system with content clip absorption function
JP2011244361A
Multi-Take Compositing of Digital Media Assets
US20080255687A1