Video processing method and device, electronic equipment and storage medium

By updating the time parameters of preview videos in real time, the problem of low preview efficiency during video editing is solved, real-time preview effect during editing is achieved, and operation efficiency and user experience are improved.

CN119110127APending Publication Date: 2024-12-10BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411050293.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-01
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

During the video editing process, users need to frequently click the preview button or export the video file to view the editing effect, resulting in cumbersome and inefficient operations.

Method used

By detecting user editing operations, the time parameters of preview videos are updated in real time, allowing users to adjust the preview videos instantly, thereby previewing the clip effects in real time in the same display interface and reducing repeated operations.

Benefits of technology

Improve the efficiency and user experience of video editing, reduce the number of export and re-editing, and optimize the operation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119110127A_ABST
    Figure CN119110127A_ABST
Patent Text Reader

Abstract

The invention discloses a video processing method and device, electronic equipment and a storage medium, and belongs to the technical field of video processing. The method comprises the following steps: in response to a detected editing operation of a user on an initial video, updating a time parameter of a preview video based on the editing operation; and playing the preview video based on the updated time parameter. Thus, when the user edits the video, the corresponding preview effect can be provided in real time for the operation, the user does not need to export the video file, and the video editing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of video processing technology, and in particular to a video processing method, device, electronic equipment and storage medium. Background Art

[0002] When users are currently editing videos, if they want to view the editing effect, they need to click the preview button or export the video file to see the editing effect. If you are not satisfied with the editing, you need to return to the editing interface to start editing again. Exporting video files multiple times takes up memory, which is complicated and inefficient. Summary of the invention

[0003] The embodiments of the present application provide a video processing method, device, electronic device and storage medium to solve the technical problem of low efficiency of video clip preview.

[0004] According to one aspect of an embodiment of the present application, a video processing method is provided, comprising: in response to detecting an editing operation of an initial video by a user, updating a time parameter of a preview video based on the editing operation; and playing the preview video based on the updated time parameter.

[0005] Further, playing the preview video based on the updated time parameters includes: loading the preview video in a preview area, the preview area and the editing area of ​​the initial video are in the same display interface; playing the preview video in the preview area based on the updated time parameters.

[0006] Furthermore, when the editing operation is a cropping operation or a splicing operation, updating the time parameters of the preview video based on the editing operation includes: determining one or more video clips corresponding to the cropping operation or the splicing operation, and determining the playback position of each video clip in the preview video; and updating the time parameters of the preview video based on the start time point, the end time point and the corresponding playback position of the one or more video clips in the initial video.

[0007] Furthermore, when the editing operation is a splicing operation and there are multiple video clips, playing the preview video based on the updated time parameters includes: setting timers for the multiple video clips respectively based on the starting time point and the ending time point corresponding to the video clips; playing the multiple video clips in sequence starting from the playback position and starting the corresponding timers in sequence; the preview video includes the multiple video clips; and stopping playing the current video clip after one of the timers expires, starting playing the next video clip and starting the corresponding timer.

[0008] Furthermore, when the editing operation is a sequential adjustment operation, the updating of the time parameters of the preview video based on the editing operation includes: locating the start time point and the end time point of the target video segment after the sequential adjustment based on the timeline; based on the start time point and the end time point of the target video segment, updating the start time point and the end time point of the preview video, and the playback positions of multiple video segments in the preview video.

[0009] Further, when the editing operation is a duration adjustment operation, updating the time parameters of the preview video based on the editing operation includes: determining the adjusted duration based on the duration adjustment operation; and updating the starting time point and the ending time point of at least one video segment in the preview video based on the adjusted duration.

[0010] Furthermore, after playing the preview video based on the updated time parameter, the method further includes: if the next editing operation is not detected, loopingly playing the preview video based on the updated time parameter.

[0011] According to another aspect of an embodiment of the present application, a video processing device is also provided, including: an update module for updating time parameters of a preview video based on the editing operation detected by a user on an initial video in response to the editing operation; and a playback module for playing the preview video based on the updated time parameters.

[0012] Furthermore, the playback module is specifically used to: load the preview video in a preview area, the preview area and the editing area of ​​the initial video are in the same display interface; and play the preview video in the preview area based on the updated time parameter.

[0013] Furthermore, when the editing operation is a cropping operation or a splicing operation, the updating module is specifically used to: determine one or more video segments corresponding to the cropping operation or the splicing operation, and determine the playback position of each video segment in the preview video; based on the starting time point, the ending time point and the corresponding playback position of the one or more video segments in the initial video, update the time parameters of the preview video.

[0014] Furthermore, when the editing operation is a splicing operation and there are multiple video clips, the playback module is specifically used to: set timers for the multiple video clips based on the starting time point and the ending time point corresponding to the video clips; start playing the multiple video clips in sequence according to the playback position and start the corresponding timers in sequence; the preview video includes the multiple video clips; stop playing the current video clip after one of the timers expires, start playing the next video clip, and start the corresponding timer.

[0015] Furthermore, when the editing operation is a sequential adjustment operation, the update module is specifically used to: locate the start time point and the end time point of the target video segment after the sequential adjustment based on the timeline; based on the start time point and the end time point of the target video segment, update the start time point and the end time point of the preview video, and the playback positions of multiple video segments in the preview video.

[0016] Further, when the editing operation is a duration adjustment operation, the updating module is specifically used to: determine the adjusted duration based on the duration adjustment operation; and update the starting time point and the ending time point of at least one video segment in the preview video based on the adjusted duration.

[0017] Furthermore, the playback module is also used for: after playing the preview video based on the updated time parameter, if the next editing operation is not detected, loopingly playing the preview video based on the updated time parameter.

[0018] According to another aspect of an embodiment of the present application, a storage medium is further provided, which includes a stored program, and the above steps are executed when the program is run.

[0019] According to another aspect of an embodiment of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; wherein: the memory is used to store computer programs; and the processor is used to execute the steps in the above method by running the program stored in the memory.

[0020] The embodiment of the present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the steps in the above method.

[0021] The embodiments of the present application propose a video processing method, device, electronic device and storage medium, which responds to detecting a user's editing operation on an initial video, updates the time parameters of a preview video based on the editing operation; and plays the preview video based on the updated time parameters. In this way, when a user edits a video, the preview video time parameters can be adjusted instantly following the user's editing operation, thereby displaying the preview effect in real time during the user's editing process for the user's reference, without the need for complex operations such as exporting video files, and thus the user can adjust the editing method at any time during the real-time preview process, reducing repeated operations, thereby improving editing efficiency and optimizing user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0023] Figure 1 is a hardware structure block diagram of a computer according to an embodiment of the present application;

[0024] Figure 2 is a flow chart of a video processing method according to an embodiment of the present application;

[0025] Figure 3 is a flow chart of a video processing method according to an embodiment of the present application;

[0026] Figure 4 is a structural block diagram of a video processing device according to an embodiment of the present application;

[0027] Figure 5 It is a structural diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only embodiments of a part of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present application. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.

[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0030] The method embodiment provided in the first embodiment of the present application can be executed in a mobile phone, a computer, a tablet or a similar computing device. Taking running on a computer as an example, Figure 1 is a hardware structure block diagram of a computer in an embodiment of the present application. Figure 1 As shown, the computer may include one or more ( Figure 1Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the computer may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0031] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to a video processing method in an embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0032] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0033] In this embodiment, a video processing method is provided. Figure 2 is a flow chart of a video processing method according to an embodiment of the present application. Figure 2 As shown, the process includes the following steps:

[0034] S10: In response to detecting an editing operation of the user on the initial video, updating a time parameter of the preview video based on the editing operation.

[0035] In this embodiment, before step S10, the following may be included: initializing the display interface, for example, loading an initial video and displaying editing tools (such as a scissors icon, etc.) for selection and editing operations, and loading a timeline corresponding to the initial video.

[0036] In one embodiment, the display interface for editing a video may include a preview area, an editing area, etc., and may also include a play control button, etc. Here, the initial video may be used for the user to edit and obtain the desired video material, such as obtaining one or more video clips, etc. The timeline may be used to display and edit the location and duration of the video clips, for example, the timeline may display basic information (such as duration, thumbnails, etc.) of the initial video and / or the video clips. The preview area is used to play the corresponding preview video obtained along with the user's editing operation, and the preview video may reflect the result of the editing operation. The editing area may be used for the user to edit the timeline or the initial video, and the timeline, the initial video, and the editing tools may be located in the editing area.

[0037] In one embodiment, the editing operation may include at least one of the following: a cropping operation, a splicing operation, a video beautification operation, a sequence adjustment operation, a duration adjustment operation, etc. The editing operation on the initial video may be performed by the user directly on the initial video or on the timeline. For example, the editing operation of the user on the initial video may be determined by detecting the operation on the timeline. The operation on the timeline may be an operation such as the user selecting or dragging a cursor or a slider on the timeline.

[0038] In one embodiment, the cropping operation may refer to an operation of obtaining one or more video segments in the timeline and / or the original video. Each video segment may have a starting time point and an ending time point, and the starting time point and the ending time point may refer to the corresponding time points of the video segment in the timeline and / or the original video.

[0039] For example, through the cropping operation, a video segment 1 with a start and end time point of 00:08 to 00:16 and a duration of 8 seconds, a video segment 2 with a start and end time point of 00:35 to 00:45 and a duration of 10 seconds, and a video segment 3 with a start and end time point of 01:02 to 01:15 and a duration of 13 seconds are obtained in the initial video. Here, the cropping operation can be detected by detecting a selection operation of one or more time points on the timeline.

[0040] In one embodiment, the splicing operation may refer to an operation of splicing one or more video clips in the timeline and / or the initial video, for example, the splicing may be performed in a certain order. Exemplarily, the splicing operation splices the video clips 1, 2, and 3 together in the order in which they are arranged on the timeline, or in an order specified by a user. Here, the splicing operation may be detected by detecting a selection and / or dragging operation on multiple video clips in the timeline and / or the initial video.

[0041] In one embodiment, the video beautification operation may refer to an operation of beautifying at least one frame or at least one video segment in the timeline and / or the original video, such as adding a filter to the video segment or adjusting the speed.

[0042] In one embodiment, the sequence adjustment operation may refer to an operation of adjusting the play order of one or more video clips in the timeline and / or the initial video, for example, adjusting the play order of multiple video clips from 1-2-3 to 1-3-2. Here, the sequence adjustment operation may be detected by detecting the selection and dragging operation of the slider on the timeline.

[0043] In one embodiment, the duration adjustment operation may refer to an operation of adjusting the duration of one or more video segments in the timeline and / or the initial video or the total duration of the preview video, for example, adjusting the duration of video segment 1 from 8s to 5s, or adjusting the duration of the video after splicing video segments 1, 2 and 3 to 28s, etc. Here, the duration adjustment operation may be detected by detecting the selection operation of one or more video segments, and the adjustment operation of the start time point and / or the end time point. Alternatively, it may also be detected by detecting the expected duration input by the user.

[0044] In one embodiment, the preview video is a video played in the preview area according to the editing operation, for example, it may include one or more video clips. The time parameters of the preview video may include at least one of the parameters such as the start time point, the end time point, and the video duration of the preview video. Here, the start time point refers to the time position corresponding to the start point of the video in the initial video, and the end time point refers to the time position corresponding to the end point of the video in the initial video.

[0045] S20: Play the preview video based on the updated time parameter.

[0046] In this embodiment, playing the preview video based on the updated time parameter may include starting to play the preview video from the start time point of the updated preview video. For example, after detecting an editing operation of the user, updating the start time point of the preview video based on the editing operation, the preview video is started to play based on the new start time point.

[0047] In one embodiment, playing the preview video can be implemented through a video tag of HyperText Markup Language (HTML) 5, and HTML5 can complete the playing of the preview video by controlling video elements such as a canvas element.

[0048] In one embodiment, playing the preview video based on the updated time parameter may include updating the currentTime attribute of the video element based on the updated time parameter, and playing the preview video based on the new currentTime attribute.

[0049] In this way, by responding to the user's video editing operation, the relevant time parameters of the preview video are updated in real time, so that the preview video can be quickly located and displayed according to the new time parameters, allowing the user to view the effect of the current editing operation in real time. Based on this, the user does not need to export the video and return to edit and other repeated operations, which can greatly improve the user's operating efficiency and optimize the user experience when multiple edits are required.

[0050] In some embodiments, the above-mentioned video processing method and device can be integrated into a generative artificial intelligence (AIGC) platform, so that successfully produced videos can be directly used for advertising. In this way, not only the production efficiency is improved, but also high-quality advertising videos can be brought to the market more quickly.

[0051] In some embodiments, playing the preview video based on the updated time parameters includes: loading the preview video in a preview area, the preview area and the editing area of ​​the initial video are in the same display interface; playing the preview video in the preview area based on the updated time parameters.

[0052] Here, the preview area can be above or below the editing area, or on the left or right side of the editing area, or can be located in the upper or lower layer of the editing area in the form of stacked layers to save interface space and improve the preview viewing effect.

[0053] In this way, the preview effect can be displayed in real time on the same interface following the user's editing operations, without the need to exit and re-enter or click multiple times, thus improving the user's operating experience.

[0054] In some embodiments, since different editing operations are aimed at different adjustment purposes, the requirements for the preview video are also different. Therefore, different update methods need to be set for different editing operations to improve the accuracy of the preview video's response to the editing operation. Therefore, when the editing operation is a cropping operation or a splicing operation, updating the time parameters of the preview video based on the editing operation in step S10 may include: determining one or more video clips corresponding to the cropping operation or the splicing operation, and determining the playback position of each video clip in the preview video; based on the start time point, the end time point and the corresponding playback position of the one or more video clips in the initial video, updating the time parameters of the preview video.

[0055] Here, the one or more video segments corresponding to the cropping operation may refer to one or more video segments obtained by cropping the timeline and / or the initial video. According to the cropping operation, at least one of the starting time point, the ending time point, and the segment duration of each video segment may be determined, and the time sequence between the multiple video segments may also be determined. The starting time point of the video segment refers to the time position corresponding to the starting point of the video segment in the initial video, and the ending time point of the video segment refers to the time position corresponding to the ending point of the video segment in the initial video.

[0056] In one embodiment, when the cropping operation corresponds to a video clip, the video clip is the preview video. Based on the starting time point, ending time point and corresponding playback position of the one or more video clips in the initial video, the time parameters of the preview video are updated. The starting time point and ending time point of the video clip can be used as the updated time parameters of the preview video.

[0057] In one embodiment, one or more video segments corresponding to the cropping operation or splicing operation are determined; when the cropping operation corresponds to a video segment, it is determined whether the next editing operation is detected. If not detected, the starting time point and the ending time point of the video segment are used as the time parameters for updating the preview video.

[0058] In one embodiment, the playback position of each video segment in the preview video may indicate the playback order of the video segment in the preview video. The playback position may be determined based on the time sequence of the video segments in the initial video, or the playback position may be determined based on the starting time points of multiple video segments, for example, the closer the corresponding starting time point of a video segment in the timeline and / or the initial video is, the closer the playback position is.

[0059] In one embodiment, the playback position of each video clip in the preview video may also be determined according to a cropping operation or a splicing operation, for example, according to a selection operation, a drag operation or input information of a user.

[0060] In one embodiment, when the cropping operation corresponds to multiple video clips, updating the time parameters of the preview video based on the start time point, end time point and corresponding playback position of the one or more video clips in the initial video may include: arranging the multiple video clips according to the playback position, using the start time point of the frontmost video clip as the start time point of the preview video, and using the end time point of the backmost video clip as the end time point of the preview video.

[0061] In one embodiment, when the cropping operation corresponds to multiple video clips, updating the time parameters of the preview video based on the start time point, end time point and corresponding playback position of the one or more video clips in the initial video may include: determining whether the next editing operation is detected, and if not detected, arranging the multiple video clips according to the playback position, with the start time point of the frontmost video clip as the start time point of the preview video, and the end time point of the backmost video clip as the end time point of the preview video.

[0062] In one embodiment, the preview video may include the one or more video clips. When the editing operation is a cropping operation, playing the preview video based on the updated time parameter may include: playing one or more video clips corresponding to the cropping operation in sequence based on the updated time parameter. Here, playing in sequence may be playing in sequence according to the play position of the one or more video clips.

[0063] In one embodiment, the splicing operation may correspond to a video clip, and the starting time point and the ending time point of the video clip are used as the updated time parameters of the preview video. For example, it may include: based on the starting time point, the ending time point and the corresponding playback position of the one or more video clips in the initial video, updating the time parameters of the preview video, and it may include: determining whether the next editing operation is detected, and if not detected, using the starting time point and the ending time point of the video clip as the updated time parameters of the preview video.

[0064] In one embodiment, the splicing operation may correspond to multiple video clips, and the play positions of the multiple video clips may be determined according to the start time points of the multiple video clips, for example, the earlier the start time point of the video clip in the timeline and / or the initial video, the earlier the play position, etc. Alternatively, the play positions of the multiple video clips may also be obtained according to the splicing operation, for example, the user specifies the play positions or play order corresponding to the multiple video clips in the splicing operation, for example, specifying that the video clip with the later start time point is placed at the front in the time order, etc.

[0065] Exemplarily, the playback positions corresponding to the plurality of video clips may be determined according to the dragging operation or the selection order in the splicing operation. For example, the earlier the video clips are selected, the earlier their playback positions in the preview video.

[0066] In this way, for one or more video clips corresponding to the cropping and splicing operations, the video effects that need to be previewed can be quickly determined based on the start and end time points and playback positions of the video clips, thereby accurately responding to editing operations and providing real-time preview videos.

[0067] In some embodiments, the editing operation is a splicing operation, and when there are multiple video clips, step S20 may include: setting timers for the multiple video clips respectively based on the starting time point and the ending time point corresponding to the video clips; playing the multiple video clips in sequence starting from the playback position and starting the corresponding timers in sequence; the preview video includes the multiple video clips; stopping the playback of the current video clip after one of the timers expires, starting the playback of the next video clip and starting the corresponding timer.

[0068] In this embodiment, the timer can be implemented by a function that implements timed calls in JavaScript, such as setInterval and / or setTimeout functions.

[0069] In one embodiment, before updating the time parameter of the preview video based on the editing operation, the method may further include: defining an array to store information of all video clips; here, the information is at least one of the play position, start time point and end time point corresponding to the video clip. The play position of the video clip may correspond to the time sequence of the video clip in the initial video.

[0070] In one embodiment, based on the start time point and the end time point, timers are set for the multiple video segments respectively, which may refer to setting the duration between the start time point and the end time point of the video segment as the timing duration of the timer corresponding to the video segment.

[0071] In one embodiment, the first video clip is played starting from the playback position and the timer of the first video clip is started at the same time, the first video clip is stopped when the timer of the first video clip expires, the second video clip is played starting and the timer of the second video clip is started at the same time... and so on.

[0072] In this way, for the multiple spliced ​​video clips, the playback of the preview video can be accurately controlled in combination with the timer. Without exporting the generated video product, the connection smoothness between the multiple video clips in the preview can be improved, and the real-time preview effect can be optimized.

[0073] In some embodiments, when the editing operation is a sequential adjustment operation, step S20 may include: locating the start time point and the end time point of the target video segment after the sequential adjustment based on the timeline; based on the start time point and the end time point of the target video segment, updating the start time point, the end time point of the preview video, and the playback positions of multiple video segments in the preview video.

[0074] In this embodiment, the sequence adjustment operation can be determined by detecting a selection operation and a drag operation on a slider on the timeline, etc. For example, the user changes the order of multiple video clips by dragging the slider on the timeline.

[0075] In one embodiment, the sequence adjustment operation may also be determined by sequence information input by the user. For example, for video segments 1, 2, and 3, the user inputs the desired sequence information "1-3-2", and then it may be determined that the sequence adjustment operation is detected.

[0076] In one embodiment, based on the sequence adjustment operation, the playback positions of multiple video clips are determined according to the adjusted sequence, the starting time point of the video clip with the frontmost playback position after the adjustment is updated to the starting time point of the preview video, and the ending time point of the video clip with the backmost playback position after the adjustment is updated to the ending time point of the preview video.

[0077] In this way, a preview effect can be quickly provided for adjusting the order of video clips, allowing users to flexibly and quickly adjust the order of video materials and improve editing efficiency.

[0078] In some embodiments, when the editing operation is a duration adjustment operation, step S20 may include:

[0079] Determining an adjusted duration based on the duration adjustment operation;

[0080] The starting time point and the ending time point of at least one video segment in the preview video are updated based on the adjusted duration.

[0081] In this embodiment, the duration adjustment operation can be detected by detecting the selection operation of one or more video segments and the adjustment operation of the start time point and / or the end time point. For example, the user determines the desired adjusted duration by selecting the desired start time point and the end time point in sequence.

[0082] In one embodiment, the duration adjustment operation can also be detected by detecting the expected duration input by the user. For example, if the user inputs the expected duration as 30 seconds, the duration of the preview video is adjusted to 30 seconds.

[0083] In one embodiment, updating the start time point and the end time point of at least one video segment in the preview video based on the adjusted duration may include: determining whether the start time point and the end time point are specified in the duration adjustment operation; if the start time point and the end time point are specified, updating the start time point and the end time point to the start time point and the end time point of the preview video; if the start time point and the end time point are not specified, adjusting the start time point and the end time point of at least one video segment in the preview video based on the adjusted duration.

[0084] In one embodiment, if the starting time point and the ending time point are not specified, the starting time point of the video segment with the earliest playback position in the preview video is adjusted based on the adjusted duration, and / or the ending time point of the video segment with the latest playback position in the preview video is adjusted.

[0085] In one embodiment, updating the start time point and the end time point of at least one video segment in the preview video based on the adjusted duration may include: updating the start time point and the end time point of each video segment in the preview video based on the adjusted duration. For example, the duration of each video segment is reduced by a portion so that the duration of the preview video is equal to the adjusted duration.

[0086] In one embodiment, updating the start time point and the end time point of each video segment in the preview video may include: determining to delete at least one image frame by analyzing a predetermined number of image frames in each video segment in the preview video; and updating the start time point and the end time point of each video segment based on the deleted video segment.

[0087] In this way, users can flexibly set the required video length according to the platform or scene requirements, and flexibly provide accurate preview effects based on the adjustment of the start and end time points of the video clip.

[0088] In this embodiment, a video processing method is provided. Figure 3 is a flow chart of a video processing method according to an embodiment of the present application. Figure 3 As shown, the process includes the following steps:

[0089] S11: in response to detecting an editing operation of the user on the initial video, updating a time parameter of the preview video based on the editing operation;

[0090] S21: Play the preview video based on the updated time parameter;

[0091] S31: If the next editing operation is not detected, the preview video is played in a loop based on the updated time parameters.

[0092] In this embodiment, the specific implementation and related embodiments of steps S11 and S21 can refer to the specific implementation and related embodiments of the aforementioned steps S10 and S20, which will not be repeated here.

[0093] In one embodiment, if the next editing operation is not detected, looping the preview video based on the updated time parameter may include: if the next editing operation is not detected within a predetermined time period, looping the preview video based on the updated time parameter.

[0094] Here, the predetermined duration may be a fixed value, such as 0.5s, 1s or 2s, etc. Alternatively, the predetermined duration may also be determined based on the duration of the current editing operation and / or the preview video, for example, it may be determined according to the type, frequency, number of edits, etc. of the current editing operation. Exemplarily, when the current editing operation is a sequence adjustment operation, the predetermined duration may be shortened; when the current editing operation is a cropping or splicing operation, the predetermined duration may be increased, thereby flexibly adjusting the predetermined duration for different editing operations to better meet the user's operational requirements.

[0095] In one embodiment, the higher the frequency of the current editing operation, the shorter the predetermined time can be; the more times the current editing operation has been edited, the shorter the predetermined time can be, thereby shortening the detection time and improving flexibility when the user needs to operate frequently.

[0096] In one embodiment, playing the preview video in a loop based on the updated time parameter may refer to playing the preview video in a loop based on the updated time parameter in the preview area.

[0097] In one embodiment, after playing the preview video in a loop based on the updated time parameters, the method may further include: in response to detecting the next editing operation, updating the time parameters again based on the next editing operation; stopping the current loop playback, and playing the preview video based on the again updated time parameters.

[0098] In this way, if there is no further editing after the editing operation, the preview video can be played in a loop for the user to refer to multiple times without repeatedly clicking the preview, further optimizing the real-time preview effect.

[0099] As a possible implementation, a video processing method is provided, and the steps may include:

[0100] 1. System architecture design

[0101] Front-end interface design:

[0102] The user interface includes a video preview window, a timeline, editing tools, and playback control buttons.

[0103] The Timeline is used to display and edit the position and duration of video clips.

[0104] 2. Front-end Function Implementation

[0105] 1. Initialization interface:

[0106] The video clip is loaded and displayed on the timeline.

[0107] A clipping tool (such as a scissors icon) is provided for selecting and trimming video clips.

[0108] 2. Real-time preview function:

[0109] As the user drags or resizes the video clip, the contents of the preview window are updated in real time.

[0110] Use HTML5 video tags to implement preview functions, combined with JavaScript for precise control.

[0111] 3. Timer function:

[0112] Use JavaScript's setInterval and setTimeout functions to implement the timer function, which is used to control the timed playback of video clips.

[0113] 3. Specific implementation steps

[0114] 1. Load video material:

[0115] When the front-end page is loaded, the video materials uploaded by the user are loaded, and the basic information of these video materials (such as duration, thumbnails, etc.) are displayed on the timeline.

[0116] 2. Use of editing tools:

[0117] The user selects the start time and end time of the video clips through the interface, and the front end stores the location information of these clips.

[0118] For example, a user drags a slider on the timeline to select a clip, and the front end records the start time and end time of the clip.

[0119] 3. Real-time preview of video clips:

[0120] Use JavaScript to control video elements and implement real-time preview function.

[0121] When the user adjusts the video clip, the front end dynamically adjusts the playback time of the video element according to the user's operation and displays the editing effect in real time.

[0122] Here, the specific steps include:

[0123] The user adjusts the slider on the timeline, and the front end captures the user's actions.

[0124] The front end calculates the new playback time and updates the currentTime attribute of the video element.

[0125] The video element plays according to the new play time, and users can preview the editing effect in real time.

[0126] 4. Video clip stitching:

[0127] The user can select multiple video clips for stitching, and the front end records the order and location information of these clips based on the user's selection.

[0128] During playback, the front end plays each video clip in sequence according to the recorded order and position information to achieve a seamless splicing effect.

[0129] 5. Play video clips at a fixed time:

[0130] The user can adjust the playback order of the video clips on the interface, and the front end uses a timer to control the playback order of the video clips according to the user's settings.

[0131] Here, the specific steps of step 4 and step 5 may include:

[0132] Define an array to store the information of all video clips (such as source file path, start time and end time).

[0133] Use the setTimeout function to set a timer according to the length of the video clip. When the timer is triggered, pause the current video and play the next video clip.

[0134] The front end plays the video clips in sequence according to the recorded information to achieve seamless video splicing.

[0135] Through the above steps, a method for cutting and splicing advertising video materials for instant preview is realized, which greatly improves the efficiency and flexibility of advertising production and provides users with an efficient and convenient solution.

[0136] As a possible implementation, a video processing method is provided, and the steps may include:

[0137] 1. Implementation of real-time preview function

[0138] Technical implementation: Use front-end technology (such as JavaScript) to achieve real-time preview, and dynamically display the effects of video cropping and splicing through HTML5 video tags and Canvas elements.

[0139] Advantages: Users can see the effects immediately when cropping and stitching videos, which improves the intuitiveness and accuracy of the operation.

[0140] 2. Implementation of video duration editing function

[0141] Technical implementation: Use JavaScript timers (setTimeout, setInterval) to control the playback duration of video clips, and provide drag and input functions through the user interface to accurately adjust the video editing points.

[0142] Advantages: Users can quickly adjust the length of videos according to different platforms and needs to create more adaptable advertising content.

[0143] 3. Realization of seamless splicing of multiple videos

[0144] Technical implementation: Video buffering and preloading technology are used to ensure seamless connection of multiple video clips, and JavaScript is used to control the playback order and connection points of the videos.

[0145] Advantages: Automatically process transitions between video clips, reduce manual adjustments, and improve the continuity and professionalism of ads.

[0146] 4. Implementation of playing multiple videos in any order

[0147] Technical implementation: Provide a user interface that allows users to drag and drop video clips to adjust the playback order, use JavaScript to dynamically control the video playback logic, and implement flexible playback order settings.

[0148] Advantages: Users can freely adjust the order of video clips to achieve personalized and creative advertising effects.

[0149] 5. Implementation of integrated advertising video production process

[0150] Technical implementation: Integrates video cropping, splicing and real-time preview functions into one, and realizes an efficient advertising video production process through a unified user interface and background logic.

[0151] Advantages: Reduces dependence on multiple tools and software, and improves the smoothness and efficiency of the production process.

[0152] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0153] In the present embodiment, a video processing device is also provided to implement the above-mentioned embodiments and preferred implementation modes, which have been described and will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0154] Figure 4 is a structural block diagram of a video processing device according to an embodiment of the present application, such as Figure 4 As shown, the device includes: an update module 100 and a playback module 200, wherein the update module 100 is used to update the time parameters of the preview video based on the editing operation in response to detecting the user's editing operation on the initial video; and the playback module 200 is used to play the preview video based on the updated time parameters.

[0155] Furthermore, the playback module 200 is specifically used to: load the preview video in a preview area, the preview area and the editing area of ​​the initial video are in the same display interface; and play the preview video in the preview area based on the updated time parameter.

[0156] Furthermore, when the editing operation is a cropping operation or a splicing operation, the updating module 100 is specifically used to: determine one or more video segments corresponding to the cropping operation or the splicing operation, and determine the playback position of each video segment in the preview video; based on the starting time point, the ending time point and the corresponding playback position of the one or more video segments in the initial video, update the time parameters of the preview video.

[0157] Furthermore, when the editing operation is a splicing operation and there are multiple video clips, the playback module 200 is specifically used to: set timers for the multiple video clips based on the starting time point and the ending time point corresponding to the video clips; start playing the multiple video clips in sequence according to the playback position and start the corresponding timers in sequence; the preview video includes the multiple video clips; stop playing the current video clip after one of the timers expires, start playing the next video clip and start the corresponding timer.

[0158] Furthermore, when the editing operation is a sequential adjustment operation, the update module 100 is specifically used to: locate the start time point and the end time point of the target video segment after the sequential adjustment based on the timeline; based on the start time point and the end time point of the target video segment, update the start time point and the end time point of the preview video, as well as the playback positions of multiple video segments in the preview video.

[0159] Further, when the editing operation is a duration adjustment operation, the updating module 100 is specifically used to: determine the adjusted duration based on the duration adjustment operation; and update the start time point and the end time point of at least one video segment in the preview video based on the adjusted duration.

[0160] Furthermore, the playing module 200 is also used for: after playing the preview video based on the updated time parameter, if the next editing operation is not detected, loopingly playing the preview video based on the updated time parameter.

[0161] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0162] The embodiment of the present application also provides an electronic device, Figure 5 is a structural diagram of an electronic device according to an embodiment of the present application, such as Figure 5 As shown, it includes a processor 41, a communication interface 42, a memory 43 and a communication bus 44, wherein the processor 41, the communication interface 42 and the memory 43 communicate with each other through the communication bus 44, and the memory 43 is used to store computer programs; the processor 41 is used to execute the program stored in the memory 43 to implement the following steps: in response to detecting an editing operation of the user on the initial video, updating the time parameters of the preview video based on the editing operation; playing the preview video based on the updated time parameters.

[0163] Further, playing the preview video based on the updated time parameters includes: loading the preview video in a preview area, the preview area and the editing area of ​​the initial video are in the same display interface; playing the preview video in the preview area based on the updated time parameters.

[0164] Furthermore, when the editing operation is a cropping operation or a splicing operation, updating the time parameters of the preview video based on the editing operation includes: determining one or more video clips corresponding to the cropping operation or the splicing operation, and determining the playback position of each video clip in the preview video; and updating the time parameters of the preview video based on the start time point, the end time point and the corresponding playback position of the one or more video clips in the initial video.

[0165] Furthermore, when the editing operation is a splicing operation and there are multiple video clips, playing the preview video based on the updated time parameters includes: setting timers for the multiple video clips respectively based on the starting time point and the ending time point corresponding to the video clips; playing the multiple video clips in sequence starting from the playback position and starting the corresponding timers in sequence; the preview video includes the multiple video clips; and stopping playing the current video clip after one of the timers expires, starting playing the next video clip and starting the corresponding timer.

[0166] Furthermore, when the editing operation is a sequential adjustment operation, the updating of the time parameters of the preview video based on the editing operation includes: locating the start time point and the end time point of the target video segment after the sequential adjustment based on the timeline; based on the start time point and the end time point of the target video segment, updating the start time point and the end time point of the preview video, and the playback positions of multiple video segments in the preview video.

[0167] Further, when the editing operation is a duration adjustment operation, updating the time parameters of the preview video based on the editing operation includes: determining the adjusted duration based on the duration adjustment operation; and updating the starting time point and the ending time point of at least one video segment in the preview video based on the adjusted duration.

[0168] Furthermore, after playing the preview video based on the updated time parameter, the method further includes: if the next editing operation is not detected, loopingly playing the preview video based on the updated time parameter.

[0169] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0170] The communication interface is used for communication between the above terminal and other devices.

[0171] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0172] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0173] In another embodiment provided in the present application, a computer-readable storage medium is provided. The computer-readable storage medium stores instructions. When the computer-readable storage medium is executed on a computer, the computer executes the video processing method described in any one of the above embodiments.

[0174] In another embodiment provided in the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the video processing method described in any one of the above embodiments.

[0175] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.

[0176] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.

[0177] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.

Claims

1. A video processing method, characterized in that: include: In response to detecting an editing operation of the user on the initial video, updating a time parameter of the preview video based on the editing operation; The preview video is played based on the updated time parameter.

2. The video processing method according to claim 1, characterized in that: The playing of the preview video based on the updated time parameter includes: Loading the preview video in a preview area, wherein the preview area and the editing area of ​​the initial video are in the same display interface; The preview video is played in the preview area based on the updated time parameter.

3. The video processing method according to claim 1, characterized in that: When the editing operation is a cropping operation or a splicing operation, the updating of the time parameter of the preview video based on the editing operation includes: Determining one or more video segments corresponding to the cropping operation or the splicing operation, and determining a playback position of each video segment in the preview video; Based on the start time point, the end time point and the corresponding playback position of the one or more video clips in the initial video, the time parameter of the preview video is updated.

4. The video processing method according to claim 3, characterized in that: The editing operation is a splicing operation, and when there are multiple video clips, playing the preview video based on the updated time parameter includes: Based on the starting time point and the ending time point corresponding to the video clips, respectively set timers for the multiple video clips; Starting to play the multiple video clips in sequence according to the playback position and starting corresponding timers in sequence; the preview video includes the multiple video clips; When one of the timers ends, the current video segment is stopped from being played, and the next video segment is started to be played and the corresponding timer is started.

5. The video processing method according to claim 1, characterized in that: When the editing operation is a sequence adjustment operation, updating the time parameter of the preview video based on the editing operation includes: Locate the start time point and the end time point of the target video segment after the sequence is adjusted based on the time axis; Based on the starting time point and the ending time point of the target video segment, the starting time point and the ending time point of the preview video, and the playing positions of the multiple video segments in the preview video are updated.

6. The video processing method according to claim 1, characterized in that: When the editing operation is a duration adjustment operation, updating the time parameter of the preview video based on the editing operation includes: Determining an adjusted duration based on the duration adjustment operation; The starting time point and the ending time point of at least one video segment in the preview video are updated based on the adjusted duration.

7. The video processing method according to claim 1, characterized in that: After playing the preview video based on the updated time parameter, the method further includes: If the next editing operation is not detected, the preview video is played in a loop based on the updated time parameter.

8. A video processing device, characterized in that: include: An updating module, configured to update a time parameter of the preview video based on the editing operation performed by the user on the initial video in response to detecting the editing operation performed by the user; A playing module is used to play the preview video based on the updated time parameter.

9. An electronic device, characterized in that: The electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the video processing method according to any one of claims 1 to 7 when executed by the processor.

10. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the video processing method according to any one of claims 1 to 7 are implemented.