Video processing method and apparatus, electronic device, and storage medium
By receiving editing instructions for video editing tracks, generating media material groups and previewing video images, the problems of slow preview video generation speed and high resource utilization in the prior art are solved, and the preview effect of fast response and low lag is achieved.
Patent Information
- Application Number
- PCT/CN2024/121846
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-09-27
- Filing Date
- 2024-09-27
- Publication Date
- 2025-04-03
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 to the preview video and prone to lag.
Fast preview is achieved by receiving editing instructions for the video editing track, generating a media material group, and generating a preview video image based on the component.
It improves the generation speed of preview video clips, reduces resource usage, enhances the response speed of preview videos, and reduces lag.
Smart Images

Figure CN2024121846_03042025_PF_FP_ABST
Abstract
Description
Video processing method, device, electronic device and storage medium
[0001] This application claims priority to Chinese Patent Application No. 202311269832.9 filed on September 27, 2023, and the contents of the above-mentioned Chinese patent application disclosure are hereby incorporated by reference in their entirety as a part of this application. Technical Field
[0002] The embodiments of the present disclosure relate to a video processing method, device, electronic device, and storage medium. Background Art
[0003] 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, preview video clips are generated by real-time synthesis of multiple video editing tracks to achieve real-time preview function during the video editing process.
[0004] However, the solutions in the prior art have the problems of slow preview video segment generation speed and high resource usage, which results in slow preview video segment response and preview video segment freeze.
[0005] Summary of the Invention
[0006] The embodiments of the present disclosure provide a video processing method, apparatus, electronic device, and storage medium to overcome the problems of slow preview video clip generation and high resource usage.
[0007] In a first aspect, an embodiment of the present disclosure provides a video processing method, including:
[0008] A first editing instruction for a video editing track is received, 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 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, where the first media material group represents a logical set of media material segments on at least two video editing tracks that are within the same target time period, and the target time period is determined by the start and end times of the media material edited by the first editing instruction; and at least one frame of a first video image is generated based on the first media material group, where the first video image is used to preview the editing result corresponding to the first editing instruction.
[0009] In a second aspect, an embodiment of the present disclosure provides a video processing device, including:
[0010] a receiving module, configured to receive a first editing instruction for a video editing track, wherein the video editing track has at least one media material, and wherein the first editing instruction is configured to edit the start and end times of the media material on the video editing track, wherein the start and end times represent the start and end time points of the media material on the video editing track;
[0011] 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 within a same target time period, where the target time period is determined by the start and end times of the media material edited by the first editing instruction;
[0012] The generating module is configured to generate 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.
[0013] In a third aspect, an embodiment of the present disclosure provides an electronic device, including:
[0014] a processor, and a memory communicatively connected to the processor;
[0015] The memory stores computer-executable instructions;
[0016] The processor executes the computer-executable instructions stored in the memory to implement the video processing method described in the first aspect and various possible designs of the first aspect.
[0017] 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.
[0018] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the video processing method described in the first aspect and various possible designs of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0020] FIG1 is a schematic diagram of a video editing interface provided by an embodiment of the present disclosure;
[0021] FIG2 is a flow chart of a video processing method according to an embodiment of the present disclosure;
[0022] FIG3 is a schematic diagram of a target media material corresponding to a first editing instruction provided by an embodiment of the present disclosure;
[0023] FIG4 is a schematic diagram of generating a first media material group according to an embodiment of the present disclosure;
[0024] FIG5 is a second flow chart of the video processing method provided by an embodiment of the present disclosure;
[0025] FIG6 is a schematic diagram of a data structure of edit sequence data provided by an embodiment of the present disclosure;
[0026] FIG7 is a flow chart of a possible implementation of step S203 in the embodiment shown in FIG5 ;
[0027] FIG8 is a flowchart of another possible implementation of step S203 in the embodiment shown in FIG5 ;
[0028] FIG9 is a flowchart of a specific implementation of step S204 in the embodiment shown in FIG5 ;
[0029] FIG10 is a schematic diagram of another embodiment of the present disclosure for generating a first media material group;
[0030] FIG11 is a structural block diagram of a video processing device provided by an embodiment of the present disclosure;
[0031] FIG12 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure;
[0032] FIG13 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0033] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present disclosure without making any creative efforts shall fall within the scope of protection of the present disclosure.
[0034] 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.
[0035] The following explains the application scenarios of the embodiments of the present disclosure:
[0036] 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 this 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 this embodiment is a server, it can be based on executing the video processing method through 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. For example, 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 this embodiment to implement functions such as video editing, synthesis, and preview. Specifically, the method provided by this 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 this embodiment.
[0037] FIG1 is a schematic diagram of a video editing interface provided by an embodiment of the present disclosure. Referring to FIG1 , within the video editing interface of the video editing software, a material window for selecting and loading media materials, a preview window for displaying preview videos, and a video editing window are provided. The video editing window includes multiple video editing tracks, and each video editing track includes media materials such as video clips, music clips, and special effects. Users can perform editing operations such as adding, deleting, and modifying the media materials on the video editing tracks as needed. Each video editing track corresponds to the same timeline. By editing the media materials on each video editing track, the design of the screen content of the composite video at a specific moment can be achieved. 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 users to preview the editing results. For example, as shown in Figure 1, 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 configuring the contents of the above multiple video editing tracks, the preview video generated based on the above multiple video editing tracks is displayed in the preview window of the video editing interface. At the T_1 moment of the preview video, according to the media materials on the video editing tracks, the video screen of video clip #1 and the video screen of video clip #3 will be displayed at the same time, and the audio clip #4 will be played.
[0038] Because the generation of preview videos requires the content of all video editing tracks, in the prior art, after editing a video editing track, the terminal device needs to use the running video editing software to synthesize all media materials on each video editing track. As a result, even if the user only makes minor changes to individual media materials on a certain video editing track, all media materials on the entire track need to be processed. This leads to problems such as slow preview video generation speed, poor real-time response, and preview video freezes. The present disclosure provides a video processing method to solve the above problems.
[0039] Referring to FIG2 , FIG2 is a flow chart of a video processing method according to an embodiment of the present disclosure. The method of this embodiment can be applied in a terminal device or an electronic device with similar functions. The video processing method includes:
[0040] Step S101: Receive a first editing instruction for a video editing track, where at least one media material is set on the video editing track. 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.
[0041] Exemplarily, with reference to the schematic diagram of the video editing interface shown in FIG1 , 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 may only have one or a few empty video editing tracks, where 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, each valid video editing track being provided with at least one media material.
[0042] 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 by converting 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. FIG3 is a schematic diagram of a target media material corresponding to a first editing instruction provided in an embodiment of the present disclosure. As shown in FIG3 , exemplarily, the first editing instruction includes instructions Op_1 and 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 (increasing 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.
[0043] Step S102: generating a first media material group in response to a 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 within the same target time period, where the target time period is determined by the start and end times of the target media material.
[0044] Exemplarily, further, after responding to the first editing instruction, the terminal device edits the target media material corresponding to the first editing instruction, thereby updating the data of the video editing track. Subsequently, based on the interception of the media material on each updated video editing track within the same target time period, a data type 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 that are located within the same target time period, and the target time period is determined by the start and end times of the target media material. Figure 4 is a schematic diagram of generating a first media material group provided by an embodiment of the present disclosure. As shown in Figure 4, in response to the first editing instruction, the terminal device moves media material #1 on the video editing track Track_1 to the right along the timeline by a distance of T1, and the starting time point t1 of media material #1 changes from a to a+T1; the ending time point t2 changes from b to b+T1. Subsequently, based on the start and end times of the moved media material #1, namely the starting time point t1 and the ending time point t2, the target time period, namely [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 media material segment P1 (i.e., media material #1 itself) on video editing track Track_1, media material segment P2 on video editing track Track_2, and media material segment P3 on video editing track Track_3. The three video material segments P1, P2, and P3 are then combined to form the first media material group.
[0045] Furthermore, in one possible implementation, the data for each video editing track displayed within the video editing interface is generated based on edit sequence data. Edit sequence data is a data structure that can be used to describe complex multimedia data organization. The edit sequence data includes at least one track data element for describing the content of the video editing track. Each track data element includes at least one slice data element, which is used to describe a segment of media material on the video editing track. The edit sequence data also includes multiple media material groups divided based on different time intervals. The meaning of the media material groups can be found in the above description of the first media material group. When the track data and slice data within the edit sequence data change in response to the first editing instruction, the media material group within the edit sequence data also changes accordingly. The terminal device then reads the edit sequence data to obtain the media material group that has changed in response to the first editing instruction, i.e., the first media material group. The specific implementation and structure of the edit sequence data can be set as needed and will not be further described here.
[0046] 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 the editing result corresponding to the first editing instruction.
[0047] For example, 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 the entire first video image. The preview video is generated based on the first media material group, which is in turn generated based on the start and end times corresponding to the target media material set by the first editing instruction. Therefore, the first video image can display 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 the other media material segments of the media materials in each video editing track, since they have not changed, preview video synthesis can be temporarily omitted, thereby reducing the amount of data processing.
[0048] Optionally, the first video image is then 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.
[0049] In this embodiment, a first editing instruction for a video editing track is received, wherein at least one media material is provided on the video editing track, and the first editing instruction is used to edit the start and end times of the media material on the video editing track, wherein the start and end times represent the starting and ending time points 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 within the same target time period, wherein the target time period is determined by the start and end times of the media material edited by the first editing instruction; and based on the first media material group, at least one frame of a first video image is generated, 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 media material group containing the entire track content is used to quickly generate a corresponding preview video segment without having to generate all the media materials on all video editing tracks, thereby improving the generation speed of the preview video segment and reducing the computational efficiency.
[0050] Referring to FIG5 , FIG5 is a second flow chart of the video processing method provided by an embodiment of the present disclosure. Based on the embodiment shown in FIG2 , this embodiment further refines step S102 and adds steps for generating a composite video and setting the editing status of a media material segment. The video processing method includes:
[0051] Step S201: Receive a first editing instruction for a video editing track.
[0052] 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.
[0053] Step S202: Acquire editing sequence data corresponding to the video editing task.
[0054] Wherein, the editing sequence data includes 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. Exemplarily, in combination with the introduction to the editing sequence data in the embodiment shown in FIG2 , the editing sequence data includes at least track data, the media time sequence corresponding to the track data, and a group of [track data, media time sequence] consisting of a combination for describing the content on a video editing track. Wherein, 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 starting time point and the ending time point of a segment of media material. FIG6 is a data structure diagram of an editing sequence data provided by an embodiment of the present disclosure. As shown in FIG6 , the editing sequence data includes a plurality of track data corresponding to the video editing track, which are shown as Track1, Track2, etc. Each track data also contains 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 can 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 details will be given). 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 may be pre-generated as part of the editing sequence data.
[0055] Step S203: According to the first editing instruction, the media time sequence of the target video editing track in the editing sequence data is edited to obtain updated editing sequence data.
[0056] Exemplarily, referring to the data structure diagram of the editing sequence data shown in Figure 6, after the terminal device responds to the first editing instruction, it edits the slice data in the editing sequence data. After the slice data is updated, the media time sequence is synchronously updated to obtain the updated editing sequence data.
[0057] In one possible implementation, the first editing instruction includes a first start time and a first end time. The first start time represents a start time point of the target media material on the target video editing track; the first end time represents an end time point of the target media material on the target video editing track. As shown in FIG7 , a possible implementation of step S203 includes:
[0058] 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.
[0059] 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.
[0060] Step S2033: Generate updated editing sequence data according to the updated target video editing track.
[0061] Exemplarily, based on 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 one 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, the 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, thereby filling the blank interval after the deletion of the target media material, or inserting a blank interval to set the target media material. Afterwards, based on the slice data (media time sequence) corresponding to the updated target video editing track, the editing sequence data is updated to generate 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 without the need for additional editing instructions to be configured, thereby improving the interaction efficiency during the video editing process.
[0062] 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 the track or between tracks, thereby reducing the execution cost and improving the execution efficiency during the editing process.
[0063] Furthermore, in another possible implementation, the first editing instruction further includes a second start time and a second end time, where 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. As shown in FIG8 , another possible implementation of step S203 includes:
[0064] 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;
[0065] Step S2035: 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 updated editing sequence data.
[0066] Exemplarily, in one possible implementation, the target media material has a media content interval. The media content interval refers to a portion of the target media material that is intercepted for display when the playback duration of the target media material is less than the video duration. The 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, i.e., the media start timestamp; correspondingly, the second end time represents the video timestamp corresponding to the right boundary of the media content interval, i.e., 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], i.e., 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, playback starts at 15 seconds (the media start timestamp) and ends at 25 seconds (the media end timestamp), for a total playback time of 10 seconds. The media content interval is then stored as an additional parameter in the corresponding media time sequence. Later, when 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 accurately capturing the content of the media material.
[0067] Step S204: Generate a first media material group according to the updated editing sequence data.
[0068] 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, as shown in FIG9 , the specific implementation of step S204 includes:
[0069] Step S2041: merging the media time sequences of the video editing tracks in the editing sequence data to obtain a merged media time sequence.
[0070] Step S2042: Obtain at least one time period to be selected according to two adjacent start and end time points in the merged media time sequence.
[0071] 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.
[0072] FIG10 is a schematic diagram of another method for generating a first media material group according to an embodiment of the present disclosure. The above process will be described below in conjunction with FIG10. As shown in FIG10, for example, the editing sequence data includes a media time sequence Array_1 (shown as Array_1) corresponding to the video editing track Track_1 and a media time sequence Array_2 (shown as Array_2) corresponding to the video editing track Track_2, where the media time sequence Array_1 = [0, 10.15, 10.15, 20.12]; and the media time sequence Array_2 = [8.20, 14.18]. Subsequently, the media time sequences are merged based on the sequential timing of the start and end time points, and duplicate trigger points are removed to obtain a merged media time sequence Array_3 (shown as Array_3). The merged media time sequence Array_3 = [0, 8.20, 10.15, 14.18, 20.12]. Furthermore, 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]. Subsequently, in one possible implementation, for example, slice data corresponding to a target media material is obtained from the edit sequence data. 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.
[0073] 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. The first video image is then previewed and displayed to achieve the purpose of previewing the editing results corresponding to the first editing instruction. The specific implementation method will not be repeated here.
[0074] Exemplarily, the edit sequence data is pre-generated data in a specific data format. By using 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 further includes the step of generating the media time sequence in the edit sequence data. Optionally, before step S202, the method further includes:
[0075] 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;
[0076] Step S2002: Generate a media time sequence corresponding to each video editing track according to the start time point and end time point of the media material on each video editing track.
[0077] For example, 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 for each 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 according to the timing sequence to generate a media time sequence corresponding to the video editing track. 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.
[0078] Exemplarily, the specific implementation of step S2001 includes:
[0079] 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. The slice data includes a material file of a media material and the start time point and end time point corresponding to the media material.
[0080] Step S2001B: Obtain the start time point and end time point of the media material on each video editing track according to the slice data corresponding to each video editing track.
[0081] For example, first, based on the track identifier corresponding to each video editing track, the track data of each track is read in sequence to obtain the slice data corresponding to each media material contained in the track data. The slice data includes the material file of a segment of the media material and the corresponding start and end time points of the media material. Then, the start and end time points of the media material are obtained based on the slice data.
[0082] 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.
[0083] Optionally, this embodiment further includes the following steps of asynchronous execution:
[0084] 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.
[0085] 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 the parameters of a target media material segment in the first media material group. In one possible implementation, the second editing instruction is used to edit the movement status 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.
[0086] In another possible implementation, a second editing instruction is used to edit the display hierarchy of the target media clip within the first media clip group. The display hierarchy represents the display priority of multiple media clips when displayed together. Media clips with higher display hierarchies are displayed in the upper layer, while those with lower display hierarchies are displayed in the lower layer. The upper layer obscures the lower layer's media clips. This second editing instruction allows for the display hierarchy of different media clips within the same media clip group, effectively setting the display hierarchy for the entire media clip group. This embodiment achieves a more precise hierarchical display effect and enhances video editing flexibility.
[0087] Optionally, after step S205, the method further includes:
[0088] Step S207: Acquire a second media material group in the edit sequence data, and generate a second video image based on the second media material group.
[0089] Step S208: Generate a composite video based on the first video image and the second video image.
[0090] 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.
[0091] In this embodiment, step S205 is consistent with step S103 in the above embodiment. For detailed discussion, please refer to the discussion of step S103, which will not be repeated here.
[0092] Corresponding to the video processing method of the above embodiment, FIG11 is a structural block diagram of a video processing device provided by an embodiment of the present disclosure. For ease of explanation, only the parts related to the embodiment of the present disclosure are shown. Referring to FIG11, the video processing device 3 includes:
[0093] A receiving module 31 is configured to receive a first editing instruction for a video editing track, wherein the video editing track includes at least one media material, and wherein the first editing instruction is configured to edit the start and end times of the target media material on the video editing track, wherein the start and end times represent the start and end time points 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 on at least two video editing tracks that are within a same target time period, where the target time period is determined by the start and end times of the target media material;
[0095] The generating module 33 is configured to generate 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.
[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; and generate the first media material group according to the updated editing sequence data.
[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; adjust 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 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: sequentially 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.
[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 detecting the start time point and end time point of the media material on each video editing track in the editing sequence data, the processing module 32 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, and the slice data includes a material file of a section of media material and the start time point and 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 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 and obtains 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 configured to receive a second editing instruction for the first media material group; and the processing module 32 is further configured to edit, according to the second editing instruction, 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.
[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 composite video based on the first video image and the second video image.
[0104] The receiving module 31, processing module 32 and 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, so this embodiment will not be repeated here.
[0105] FIG12 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. As shown in FIG12 , the electronic device 4 includes:
[0106] A processor 41, and a memory 42 communicatively connected to the processor 41;
[0107] Memory 42 stores computer-executable instructions;
[0108] The processor 41 executes the computer-executable instructions stored in the memory 42 to implement the video processing method in the embodiments shown in FIG. 2 to FIG. 10 .
[0109] Optionally, the processor 41 and the memory 42 are connected via a bus 43 .
[0110] The relevant explanations can be understood by referring to the relevant descriptions and effects corresponding to the steps in the embodiments corresponding to Figures 2 to 10, and no further details will be given here.
[0111] An embodiment of the present disclosure provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by a processor, they are used to implement the video processing method provided in any of the embodiments corresponding to Figures 2 to 10 of the present disclosure.
[0112] The present disclosure provides a computer program product, including a computer program. When the computer program is executed by a processor, the video processing method in the embodiments shown in FIG. 2 to FIG. 10 is implemented.
[0113] Referring to FIG13 , a schematic diagram of the structure of an electronic device 900 suitable for implementing an embodiment of the present disclosure is shown. The electronic device 900 may be a terminal device or a server. The terminal device may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), vehicle-mounted terminals (e.g., vehicle-mounted navigation terminals), and fixed terminals such as digital TVs and desktop computers. The electronic device shown in FIG13 is merely an example and should not limit the functionality and scope of use of the embodiments of the present disclosure.
[0114] As shown in FIG13 , the electronic device 900 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. Various programs and data required for the operation of the electronic device 900 are also stored in the RAM 903. The processing device 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0115] Typically, the following devices can be connected to the I / O interface 905: an input device 906 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 908 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 909. The communication device 909 can allow the electronic device 900 to communicate with other devices wirelessly or by wire to exchange data. Although FIG13 shows an electronic device 900 with various devices, it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
[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 includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication device 909, or installed from the storage device 908, or installed from the ROM 902. When the computer program is executed by the processing device 901, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0117] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[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 a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet Service Provider).
[0121] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0122] The units involved in the embodiments described in this disclosure may be implemented in software or hardware. In some cases, the name of a unit does not limit the unit itself. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses."
[0123] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0124] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[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, 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, where the first media material group represents a logical set of media material segments on at least two video editing tracks that are within the same target time period, and the target time period is determined by the start and end times of the target media materials; and at least one frame of a first video image is generated based on the first media material group, where 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; and generating the first media material group according to the updated editing sequence data.
[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; 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: 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 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: sequentially 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 a 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 further 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 of 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; and 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 movement 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 further includes: obtaining 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 apparatus is provided, including:
[0136] a receiving module, configured to receive a first editing instruction for a video editing track, wherein the video editing track has at least one media material, the first editing instruction being configured to edit the start and end times of the target media material on the video editing track, wherein the start and end times 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 within a same target time period, where the target time period is determined by the start and end times of the target media materials;
[0138] The generating module is configured to generate 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.
[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; and generate the first media material group according to the updated editing sequence data.
[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 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; adjust 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 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: sequentially 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 based on 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 identifier corresponding to each of the video editing tracks, obtain at least one slice data corresponding to each of the video editing tracks, and the slice data includes a material file of a section of media material and the starting time point and the ending time point corresponding to the media material; according to the slice data corresponding to each of the video editing tracks, obtain the starting time point and the ending time point of the media material on 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 represents the media start timestamp of the target media material; the second ending time represents 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 and obtains 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 configured to receive a second editing instruction for the first media material group; and the processing module is further configured to edit, according to the second editing instruction, 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.
[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 a 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 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, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the video processing method described in the first aspect and various possible designs of the first aspect is implemented.
[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 described in the first aspect and various possible designs of the first aspect.
[0152] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
[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 have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0154] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. A video processing method, 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 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; The 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 or 3, characterized in that: Generating a first media material group according to the updated edit sequence data includes: The media time sequence of each video editing track in the editing sequence data is sequentially merged to obtain a merged media time sequence. Inter-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 the first media material group.
5. The method according to any one of claims 2 to 4, 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 any one of claims 1 to 7, 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 any one of claims 1 to 8, characterized in that: The step of generating at least one frame of first video image according to the first media material group includes: The media material segments on each video editing track represented by the first media material group are synthesized to generate One less 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 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
Video processing method and device, electronic equipment and computer readable storage medium
CN111629252A
Audio and video editing method and device and computer readable storage medium
CN112333536A
Information display method and device, electronic equipment and storage medium
CN113473204A
Video processing method and device, electronic equipment and computer readable storage medium
CN116471451A
Media track organizing system and method therefore
US20160259788A1