Image processing method, device, electronic device and storage medium in video editing
By adjusting the play time point of the image display bit on the time axis in the video editing interface, and obtaining and displaying frame images at the target play time point, the problem of slow image acquisition and display speed on low-end devices is solved, and the efficiency of video editing is improved.
Patent Information
- Application Number
- CN202110949471.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-18
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2041-08-18
AI Technical Summary
During the video editing process, low-end mobile devices have slow image acquisition and display speed due to performance limitations, resulting in lag and black screen, hindering user operations.
By adjusting the play time point of the image display bit on the time axis in the video editing interface, the frame images at the target play time point are obtained and displayed, reducing the number of images and improving the acquisition and display efficiency.
By reducing the number of playback time points of image display bits, the speed and efficiency of image acquisition and display are improved, and the problem of lag on low-end devices is solved.
Smart Images

Figure CN115942036B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to video processing technology, and in particular to an image processing method, device, electronic device and computer-readable storage medium in video editing. Background Art
[0002] When editing videos, the required display images for each frame in the timeline are captured for different timeline display resolutions. For example, for a 10-second video with a frame rate of 30 frames per second, 300 frames need to be captured when the display resolution is 1 frame. For a 100-second video, 3,000 frames are required. However, due to the varying performance of mobile devices, when displaying at higher resolution on low-end devices, the corresponding image acquisition and display speed will be slower, resulting in image display freezes or even a black screen, seriously hindering users' video editing operations. Summary of the Invention
[0003] The embodiments of the present application provide an image processing method, device, electronic device and computer-readable storage medium in video editing, which can improve the image acquisition speed and image display efficiency during the video editing process.
[0004] The technical solution of the embodiment of the present application is implemented as follows:
[0005] The present invention provides an image processing method for video editing, including:
[0006] In response to an image acquisition instruction for a frame image in a video to be edited, acquiring a playback time point corresponding to each image display position on a time axis in a video editing interface;
[0007] There are multiple image display positions for displaying frame images at corresponding playback time points in the video to be edited, so as to form a frame image sequence;
[0008] Adjusting the playback time points corresponding to the plurality of image display positions to obtain a target playback time point corresponding to each image display position; wherein the time interval between adjacent target playback time points is greater than the time interval between adjacent playback time points;
[0009] Acquire frame images corresponding to each target playback time point in the video to be edited;
[0010] The acquired frame image is filled into the corresponding image display position on the time axis for display.
[0011] The present invention provides an image processing method for video editing, including:
[0012] In the video editing interface, the timeline corresponding to the video to be edited is presented;
[0013] Displaying a plurality of frame images of the video to be edited in the timeline, wherein the plurality of frame images constitute a frame image sequence;
[0014] In response to an image update instruction for the frame image displayed in the timeline, updating the frame image displayed in the timeline;
[0015] Among them, the target playback time point corresponding to the frame image in the time axis after update is obtained by adjusting the playback time point corresponding to each frame image in the frame image sequence, and the time interval between adjacent target playback time points is greater than the time interval between adjacent playback time points.
[0016] An embodiment of the present application provides an image processing device for video editing, including:
[0017] An acquisition module, configured to respond to an image acquisition instruction for a frame image in a video to be edited, and acquire a playback time point corresponding to each image display position on a time axis in a video editing interface;
[0018] There are multiple image display positions for displaying frame images at corresponding playback time points in the video to be edited, so as to form a frame image sequence;
[0019] an adjustment module, configured to adjust the playback time points corresponding to the plurality of image display positions to obtain a target playback time point corresponding to each image display position; wherein the time interval between adjacent target playback time points is greater than the time interval between adjacent playback time points;
[0020] A determination module, configured to obtain frame images corresponding to each target playback time point in the video to be edited;
[0021] The filling module is used to fill the acquired frame image into the corresponding image display position on the time axis for display.
[0022] In the above scheme, the image processing device also includes a trigger module, which is used to present a video import function item for importing the video to be edited in the video editing interface; in response to the trigger operation for the video import function item, present a video selection page; based on the video selection page, in response to the selection operation for the video to be edited, trigger the image acquisition instruction; wherein, the image acquisition instruction is used to indicate that starting from the first frame image in the video to be edited, a target number of frame images are acquired, and the target number is the same as the number of image display positions.
[0023] In the above scheme, the acquisition module is also used to obtain the default display accuracy corresponding to the frame image sequence display on the time axis, and the display accuracy is used to indicate the video playback duration corresponding to each image display position; based on the default display accuracy, the playback time point corresponding to each image display position on the time axis is determined.
[0024] In the above solution, the acquisition module is further configured to capture, based on each target playback time point, a frame image corresponding to each target playback time point in the video to be edited.
[0025] In the above scheme, the trigger module is also used to present the timeline in the video editing interface, and to display the frame image sequence of the video to be edited with a first display accuracy through multiple image display positions in the timeline; wherein, the first display accuracy is used to indicate that the video playback duration corresponding to each image display position is the target duration; and in response to the accuracy adjustment operation for adjusting the size of the first display accuracy, the image acquisition instruction is triggered.
[0026] In the above solution, the acquisition module is further configured to receive a scaling operation on a frame image in the frame image sequence, and use the scaling operation as the precision adjustment operation.
[0027] In the above scheme, the acquisition module is also used to present a precision input box and a corresponding determination function item in the video editing interface; receive a second display precision entered in the precision input box; based on the second display precision, receive a trigger operation for the determination function item, and use the trigger operation as the precision adjustment operation.
[0028] In the above solution, the acquisition module is further used to present a precision adjustment control for adjusting the first display precision in the video editing interface; and receive the precision adjustment operation based on the precision adjustment control.
[0029] In the above scheme, the image processing device also includes: a sliding processing module, which is used to receive a sliding operation on the frame image displayed on the time axis; along with the execution of the sliding operation, the frame image in the frame image sequence is slid out along the sliding direction of the sliding operation, and based on the third display accuracy, the first playback time point corresponding to the target image display position that needs to be filled with the frame image is determined; wherein the third display accuracy is the display accuracy obtained after adjusting the first display accuracy; the first playback time point corresponding to the target image display position is adjusted to obtain the second playback time point corresponding to each target image display position; the frame image corresponding to each second playback time point in the video to be edited is obtained, and the obtained frame image is filled into the corresponding target image display position for display.
[0030] In the above scheme, the adjustment module is also used to obtain the normalized accuracy corresponding to the playback time point, and the normalized accuracy is used to indicate the time interval between adjacent target time points; based on the normalized accuracy, the playback time points corresponding to multiple image display positions are normalized to obtain the target playback time point corresponding to each image display position.
[0031] In the above scheme, the image processing device also includes: a setting module, which is used to present a setting interface corresponding to the normalization accuracy and present a normalization accuracy setting control in the setting interface; based on the normalization accuracy setting control, the set normalization accuracy is received.
[0032] In the above scheme, the determination module is also used to search for frame images corresponding to each of the target playback time points in the image cache pool used to cache frame images; when a frame image corresponding to the target playback time point exists in the image cache pool, the corresponding frame image is obtained from the image cache pool; when a frame image corresponding to the target playback time point does not exist in the image cache pool, the frame image corresponding to the target playback time point in the video to be edited is intercepted, and the frame image is cached to the image cache pool.
[0033] In the above scheme, the filling module is also used to obtain the mapping relationship between the playback time point and the target playback time point; based on the mapping relationship, the image display position corresponding to each target playback time point on the time axis is determined respectively; based on the target playback time point, the acquired frame image is filled into the corresponding image display position for display.
[0034] An embodiment of the present application provides an electronic device, including:
[0035] a memory for storing computer-executable instructions;
[0036] The processor is used to implement the image processing method in video editing provided by the embodiment of the present application when executing the computer-executable instructions stored in the memory.
[0037] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions for causing a processor to execute the instructions to implement the image processing method in video editing provided by the embodiment of the present application.
[0038] The embodiments of the present application have the following beneficial effects:
[0039] During the video editing process, the target playback time points are obtained by adjusting the playback time points corresponding to each image display position on the time axis in the video editing interface, thereby obtaining frame images corresponding to each target playback time point in the video to be edited for display. Since the time interval between adjacent target playback time points is smaller than the time interval between adjacent playback time points, the number of playback time points corresponding to each image display position on the time axis is reduced through adjustment processing, thereby reducing the number of images that need to be obtained. Compared with directly obtaining the images of the playback time points corresponding to each image display position, the speed of obtaining images and the efficiency of image display are improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 1 is a schematic structural diagram of an image processing system 100 for video editing provided in an embodiment of the present application;
[0041] Figure 2 4 is a schematic diagram of the structure of the terminal 400 provided in an embodiment of the present application;
[0042] Figure 3 1 is a flow chart of an image processing method in video editing provided by an embodiment of the present application;
[0043] Figure 4 Schematic diagram of the interface of the image processing method in video editing provided by the embodiment of the present application;
[0044] Figure 5 This is a schematic diagram of an optional precision adjustment method for the image processing method in video editing provided by an embodiment of the present application;
[0045] Figure 6 This is a schematic diagram of an optional precision adjustment method for the image processing method in video editing provided by an embodiment of the present application;
[0046] Figure 7 This is a schematic diagram of an optional precision adjustment method for the image processing method in video editing provided by an embodiment of the present application;
[0047] Figure 8 This is a schematic diagram of an optional precision adjustment method for the image processing method in video editing provided by an embodiment of the present application;
[0048] Figure 9 This is an optional normalization accuracy adjustment diagram of the image processing method in video editing provided by an embodiment of the present application;
[0049] Figure 10 This is an optional schematic diagram of the normalization processing of the playback time point of the image processing method in video editing provided by an embodiment of the present application;
[0050] Figure 11This is an optional schematic diagram of the normalization processing of the playback time point of the image processing method in video editing provided by an embodiment of the present application;
[0051] Figure 12 This is an optional example diagram of the image processing method in video editing provided by an embodiment of the present application;
[0052] Figure 13 This is an optional schematic diagram of the image processing method in video editing provided by an embodiment of the present application;
[0053] Figure 14 1 is a flow chart of an image processing method in video editing provided by an embodiment of the present application;
[0054] Figure 15 1 is a flow chart of an image processing method in video editing provided by an embodiment of the present application;
[0055] Figure 16 It is a schematic diagram of the interface of image processing in video editing provided by related technologies;
[0056] Figure 17 1 is a flow chart of an image processing method in video editing provided by an embodiment of the present application;
[0057] Figure 18 Schematic diagram of the interface of the image processing method in video editing provided by the embodiment of the present application;
[0058] Figure 19 Schematic diagram of the interface of the image processing method in video editing provided by the embodiment of the present application;
[0059] Figure 20 This is a schematic diagram of precision adjustment of an image processing method in video editing provided by an embodiment of the present application;
[0060] Figure 21 This is an optional image acquisition diagram in the video editing provided by the embodiment of the present application;
[0061] Figure 22 This is an optional image acquisition diagram in the video editing provided by the embodiment of the present application. DETAILED DESCRIPTION
[0062] In order to make the purpose, technical solutions and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limiting this application. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0063] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0064] In the following description, the terms "first, second, and third" are used merely to distinguish similar objects and do not represent a specific ordering of the objects. It is understood that the specific order or sequence of "first, second, and third" can be interchanged where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In the following description, the term "plurality" refers to at least two.
[0065] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.
[0066] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.
[0067] 1) Timeline: A user interface (UI) control in the mobile video editing interface. The timeline displays multiple video frames in a chronological order. These frames exist in the timeline as a video frame sequence. Users can manipulate the timeline to change the position of each video frame in the video frame sequence, and then locate a specific frame in the video for quick preview and editing.
[0068] 2) Timeline display accuracy (screenshot accuracy): The video playback duration corresponding to each frame image (video screenshot) displayed in the timeline, that is, the unit duration range represented by a frame image (video screenshot) in the timeline.
[0069] 3) In response, it is used to indicate the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more operations executed can be real-time or have a set delay. Unless otherwise specified, there is no restriction on the order in which the multiple operations executed are executed.
[0070] Based on the above explanations of the nouns and terms involved in the embodiments of the present application, the image processing system for video editing provided by the embodiments of the present application is described below. Figure 1 , Figure 11 is a schematic diagram of the structure of an image processing system 100 for video editing provided in an embodiment of the present application. To support an exemplary application, a terminal 400 is connected to a server 200 via a network 300, and the terminal 400 is connected to a database 500. The network 300 can be a wide area network or a local area network, or a combination of the two, using wireless or wired links to achieve data transmission.
[0071] The terminal 400 is configured to send a request for obtaining the video to be edited to the server 200 in response to an import instruction for the video to be edited;
[0072] The server 200 is configured to search for a video to be edited corresponding to the acquisition request and send the video to the terminal 400;
[0073] The terminal 400 is further configured to obtain, in response to an image acquisition instruction for a frame image in a video to be edited, a playback time point corresponding to each image display position on a time axis in a video editing interface;
[0074] There are multiple image display positions for displaying frame images at corresponding playback time points in the video to be edited, so as to form a frame image sequence;
[0075] Adjusting the playback time points corresponding to the plurality of image display positions to obtain a target playback time point corresponding to each image display position; wherein the time interval between adjacent target playback time points is greater than the time interval between adjacent playback time points;
[0076] Obtain the frame images corresponding to each target playback time point in the video to be edited;
[0077] The acquired frame image is filled into the corresponding image display position on the time axis for display.
[0078] In some embodiments, the server 200 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms, wherein the cloud service can be a video editing service for the terminal 400 to call. The terminal 400 can be a smart phone, tablet computer, laptop computer, desktop computer, set-top box, and mobile device (e.g., mobile phone, portable music player, personal digital assistant, dedicated messaging device, portable gaming device, smart speaker and smart watch), etc., but is not limited to this. The terminal device and the server can be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiment of the present application. It should be noted that the video to be edited can be deployed locally on the terminal 400 in advance, or the video to be edited can be obtained from the database 500, or for example, it can be a distributed file system or blockchain of the server 200, etc. The storage location of the video to be edited is not limited in the embodiment of the present application.
[0079] Next, the electronic device for implementing the image processing method in the video editing of the embodiment of the present application is described. In practical applications, the electronic device can be Figure 1 The server or terminal shown is taken as an example of the electronic device provided in the embodiment of the present application being a terminal, see Figure 2 , Figure 2 is a schematic diagram of the structure of the terminal 400 provided in an embodiment of the present application, Figure 2 The terminal 400 shown includes: at least one processor 410, a memory 450, at least one network interface 420, and a user interface 430. The various components in the terminal 400 are coupled together via a bus system 440. It is understood that the bus system 440 is used to achieve connection and communication between these components. In addition to including a data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, the bus system 440 is not shown in FIG. Figure 2 Various buses are labeled as bus system 440 .
[0080] The processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0081] The user interface 430 includes one or more output devices 431 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
[0082] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard drives, optical drives, etc. The memory 450 may optionally include one or more storage devices that are physically remote from the processor 410.
[0083] The memory 450 includes volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 450 described in the embodiments of the present application is intended to include any suitable type of memory.
[0084] In some embodiments, the memory 450 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplified below.
[0085] Operating system 451, including system programs for processing various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, and driver layer, which are used to implement various basic services and process hardware-based tasks;
[0086] A network communication module 452 for reaching other computing devices via one or more (wired or wireless) network interfaces 420 , exemplary network interfaces 420 including Bluetooth, WiFi, and USB;
[0087] a presentation module 453 for enabling presentation of information via one or more output devices 431 (e.g., a display screen, a speaker, etc.) associated with the user interface 430 (e.g., a user interface for operating peripheral devices and displaying content and information);
[0088] The input processing module 454 is configured to detect one or more user inputs or interactions from one of the one or more input devices 432 and to translate the detected inputs or interactions.
[0089] In some embodiments, the apparatus provided in the embodiments of the present application may be implemented in software. Figure 2 The image processing device 455 for video editing stored in memory 450 is shown. This device can be software in the form of a program or plug-in, and includes the following software modules: an acquisition module 4551, an adjustment module 4552, a determination module 4553, and a filling module 4554. These modules are logical and can be arbitrarily combined or further separated according to the functions they implement. The functions of each module will be described below.
[0090] In other embodiments, the device provided in the embodiments of the present application can be implemented in hardware. As an example, the image processing device in video editing provided in the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the image processing method in video editing provided in the embodiments of the present application. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs) or other electronic components.
[0091] Based on the above description of the image processing system and electronic device in video editing provided by the embodiment of the present application, the image processing method in video editing provided by the embodiment of the present application is described below. In actual implementation, the image processing method in video editing provided by the embodiment of the present application can be implemented by a terminal alone, or by a terminal and a server in collaboration, so that Figure 1 The terminal 400 in the embodiment of the present invention independently performs the image processing method in the video editing provided by the embodiment of the present invention as an example for description. Figure 3 , Figure 3 This is a flow chart of the image processing method in video editing provided by the embodiment of the present application, which will be combined with Figure 3 The steps shown are explained.
[0092] Step 101 : In response to an image acquisition instruction for a frame image in a video to be edited, the terminal acquires a playback time point corresponding to each image display position on a time axis in a video editing interface.
[0093] It should be noted that the number of image display positions here is multiple, which are used to display frame images at corresponding playback time points in the video to be edited to form a frame image sequence.
[0094] The image acquisition instruction is used to acquire images for display at each image display position in the timeline. In actual implementation, before responding to the image acquisition instruction for the frame image in the video to be edited, it is necessary to receive a triggered image acquisition instruction. It should be noted that the triggered image acquisition instruction can be triggered by the import operation of the video to be edited, or by the editing operation of the displayed video image. The triggering process of the two image acquisition instructions is described in detail below.
[0095] In some embodiments, when the image acquisition instruction is triggered by the import operation of the video to be edited, specifically, the terminal can present a video import function item for importing the video to be edited in the video editing interface; in response to the triggering operation for the video import function item, present a video selection page; based on the video selection page, in response to the selection operation for the video to be edited, present the video frame to be edited in the video editing interface, and trigger the image acquisition instruction; wherein, the image acquisition instruction is used to indicate that starting from the first frame image in the video to be edited, a target number of frame images are acquired, where the target number is the same as the number of image display positions.
[0096] In actual implementation, the video to be edited can be pre-stored locally in the terminal, or obtained by the terminal from the outside world (such as the Internet), or collected by the terminal in real time, for example, collected in real time by the terminal's camera. The terminal can present an import function option for the video to be edited on the video editing interface. When it is detected that the import function option is triggered, a video selection page is presented for the user to select the video to be edited. After the user selects the video to be edited, the video frame to be edited is presented in the video editing interface, thereby triggering the image acquisition instruction. It should be noted that the embodiment of the present application does not limit the form of the triggering operation, for example, it can be a click operation or a long press operation.
[0097] Here, after selecting the video to be edited, it also includes: presenting a confirmation prompt corresponding to the selected video to be edited; the above-mentioned process of importing the video to be edited can be achieved in this way: in response to the confirmation operation of the confirmation prompt, importing the selected video to be edited.
[0098] The user can quickly and accurately select the video to be edited through the confirmation prompt. Upon receiving a confirmation action in response to the prompt, the electronic device imports the selected video to be edited. Upon receiving a rejection action in response to the confirmation prompt, the electronic device stops importing the selected video to be edited and returns to the video selection page, allowing the user to reselect the video to be edited. This method of determining the video to be edited through human-computer interaction can reduce the waste of computing resources.
[0099] In actual implementation, when the image acquisition instruction is triggered by the import operation of the video to be edited, after the image acquisition instruction for the frame image in the video to be edited is triggered, in response to the image acquisition instruction, the default display accuracy (i.e., the default display accuracy) corresponding to the frame image sequence display on the timeline is acquired, wherein the display accuracy is used to indicate the video playback duration corresponding to each image display position, that is, each image display position can correspond to a video clip in the video to be edited, and the display accuracy can be used to locate the position, playback start time point, and playback end time point of the video clip corresponding to each image display position in the video to be edited. Of course, the display accuracy can also be used to locate the position and playback time point of the frame image in each image display position in the video to be edited; according to the default display accuracy, the playback time point corresponding to each image display position on the timeline is determined.
[0100] Here, the default display accuracy may be the default duration of video playback corresponding to each image display position on the timeline set when a video to be edited is first imported during the development process of the video editing software.
[0101] In other embodiments, when the image acquisition instruction is triggered by an editing operation on the displayed video image, specifically, a timeline is presented in the video editing interface, and a frame image sequence of the video to be edited is displayed using a first display accuracy through multiple image display positions in the timeline; wherein the first display accuracy is used to indicate that the video playback duration corresponding to each image display position is the target duration, and the target duration of the video playback corresponding to each image display position here refers to the unit duration represented by the frame image displayed by an image display position on the timeline. For example, when the first display accuracy indicates that an image display position When the unit duration represented by the displayed frame image is 0.2 seconds, it indicates that the duration of the video segment in the video to be edited corresponding to the image display position is 0.2 seconds. Then, the position, playback start time point, and playback end time point of the corresponding video segment in the video to be edited can be located by the order of the current image display position. For example, if the order of the current image display position is the second image display position, the playback start time point of the corresponding video segment is 0.2 seconds and the playback end time point is 0.4 seconds, and the playback time point of the frame image in the current image display position in the video to be edited is 0.2 seconds; continue here to see Figure 4 , Figure 4 This is a schematic diagram of an interface of an image processing method in video editing provided by an embodiment of the present application. For example, the frame rate of the current video is 30 seconds / frame. Figure 4 The display accuracy of the time axis is one frame image per second, and a frame image displayed by an image display position represents a time range of 1 second; in response to the accuracy adjustment operation for adjusting the size of the first display accuracy, the image acquisition instruction is triggered.
[0102] In actual implementation, the terminal presents a timeline in the video editing interface, and uses the first display accuracy to display the frame image sequence of the video to be edited through multiple image display positions in the timeline. Figure 4 , the timeline presented in the video editing interface is Figure 4 The timeline control in the dotted area displays frames of the video to be edited that are close to the current frame, helping users quickly locate a frame and then edit it, such as adding filters or special effects.
[0103] In actual implementation, during the video editing process, the terminal adjusts the size of the first display precision in response to the received precision adjustment operation.
[0104] As an example, the terminal presents a video editing interface, and in response to a precision adjustment operation received on the video editing interface, adjusts the size of the first display precision.
[0105] In actual applications, the precision adjustment operation is used to adjust the display precision of the timeline, which can be implemented in different ways, as exemplified below.
[0106] In some embodiments, the terminal presents a timeline in a video editing interface, and displays a frame image sequence of the video to be edited using a first display accuracy through multiple image display positions in the timeline. After receiving a zoom operation on a frame image in the frame image sequence, the terminal uses the zoom operation as a precision adjustment operation.
[0107] Here, the zoom operation can be based on the user's two fingers zooming outward on the timeline to improve the display accuracy, see Figure 5 , Figure 5 This is an optional precision adjustment diagram of the image processing method in video editing provided by the embodiment of the present application. Specifically, the display precision of the frame image sequence of the video to be edited is improved by stretching the frame image sequence of the time axis by the user with two fingers. Correspondingly, the zoom operation can also be to reduce the first display precision by zooming the time axis inward with two fingers on the time axis, see Figure 6 , Figure 6 It is an optional precision adjustment diagram of the image processing method in video editing provided in an embodiment of the present application. Specifically, the user pinches two fingers to shrink the frame image sequence of the timeline, thereby reducing the display accuracy of the frame image sequence of the video to be edited.
[0108] In some embodiments, the terminal presents a timeline in a video editing interface, and after displaying a frame image sequence of a video to be edited using a first display accuracy through multiple image display positions in the timeline, presents an accuracy input box and a corresponding determination function item in the video editing interface; receives a second display accuracy entered in the accuracy input box; based on the second display accuracy, receives a trigger operation for the determination function item, and uses the trigger operation as a precision adjustment operation.
[0109] Here, the precision input box and the corresponding confirmation function item can be presented by long pressing or double-clicking the timeline, and then after receiving the user's click operation on the confirmation function item, the second display precision entered by the user in the precision input box is determined to adjust the first display precision to the second display precision.
[0110] In some embodiments, the terminal presents a timeline in a video editing interface, and after displaying a frame image sequence of the video to be edited using a first display accuracy through multiple image display positions in the timeline, presents a precision adjustment control for adjusting the first display accuracy in the video editing interface; based on the precision adjustment control, a precision adjustment operation is received.
[0111] Here, you can press and hold or double-click the timeline to display the precision adjustment control below the timeline. Figure 7 , Figure 7 This is an optional precision adjustment diagram of the image processing method in video editing provided in an embodiment of the present application. Specifically, the user clicks the "+" in the dotted box to improve the display accuracy of the frame image sequence of the video to be edited, or clicks the "-" in the dotted box to reduce the display accuracy of the frame image sequence of the video to be edited.
[0112] In some embodiments, the terminal presents a timeline in a video editing interface, and after displaying a frame image sequence of the video to be edited using a first display accuracy through multiple image display positions in the timeline, presents a precision adjustment roller for adjusting the first display accuracy in the video editing interface; based on the precision adjustment roller, a precision adjustment operation is received.
[0113] Here, by long pressing or double-clicking the timeline, the precision adjustment roller and the corresponding confirmation function items are displayed. The user adjusts the display precision by scrolling the precision adjustment roller up and down or left and right. For example, if the user scrolls up and down to adjust the display precision, see Figure 8 , Figure 8 It is an optional precision adjustment diagram of the image processing method in video editing provided by an embodiment of the present application. Specifically, the user adjusts the display precision by scrolling up and down through the roller in the dotted box displayed on the right, and then after receiving the user's click operation for the determined function item, determines the second display precision determined by the user based on the precision adjustment roller to adjust the first display precision to the second display precision.
[0114] It should be noted that in addition to the above-mentioned methods of implementing the receiving accuracy adjustment operation, there may be other methods of implementing accuracy adjustment, and this application does not limit this.
[0115] In actual implementation, when the image acquisition instruction is triggered by an editing operation on the displayed video image, after triggering the image acquisition instruction for the frame image in the video to be edited, in response to the image acquisition instruction, the current display accuracy corresponding to the frame image sequence display on the time axis is obtained; based on the current display accuracy, the playback time point corresponding to each image display position on the current time axis is determined.
[0116] In some embodiments, in addition to the two methods of triggering the image acquisition instruction mentioned above, the image acquisition instruction can also be triggered based on a sliding operation on the frame image sequence on the timeline in the video editing interface. Here, after the frame image sequence of the video to be edited is presented on the timeline, a quick preview of the frame images in the video to be edited is achieved by sliding the frame image sequence, so that the user can quickly locate the frame image that needs to be edited based on the image displayed on the timeline, and then edit the frame image, such as adding filters or special effects.
[0117] In actual implementation, for the case where the image acquisition instruction is triggered by a sliding operation on the frame image sequence on the timeline in the video editing interface, specifically, the current display accuracy corresponding to the frame image sequence display on the timeline is also obtained; based on the current display accuracy, the playback time point corresponding to each image display position on the current timeline is determined.
[0118] It should be noted that for the current display accuracy, when the frame image sequence on the timeline has not undergone accuracy adjustment operation, the current display accuracy is the default display accuracy; when the frame image sequence on the timeline has undergone accuracy adjustment operation, the current display accuracy is the display accuracy after adjusting the first display accuracy.
[0119] Step 102 : adjusting the playback time points corresponding to the plurality of image display positions to obtain a target playback time point corresponding to each image display position.
[0120] In some embodiments, the adjustment of the playback time points corresponding to the multiple image display positions can be performed by normalizing the playback time points corresponding to the multiple image display positions, that is, mapping the multiple playback time points to a time range with a certain time point accuracy, that is, standardizing the multiple playback time points. In actual implementation, before step 102, it is necessary to first obtain the normalized accuracy corresponding to the playback time points, where the normalized accuracy is used to indicate the time interval between adjacent target time points; based on the normalized accuracy, the playback time point corresponding to each image display position on the time axis is determined.
[0121] Here, the normalization accuracy can be set by the developer during the development process of the video editing software, or it can be set by the user independently during the video editing process. Specifically, the user clicks the setting option in the video editing software to present the setting interface corresponding to the normalization accuracy, and presents the normalization accuracy setting control in the setting interface; based on the normalization accuracy setting control, the set normalization accuracy is received.
[0122] The following describes how to set the normalization accuracy based on the normalization accuracy setting control.
[0123] In some embodiments, after the user clicks on the setting option in the video editing software, an interface including a normalization accuracy adjustment control is presented. Here, the normalization accuracy adjustment control includes a button for increasing the normalization accuracy and a button for decreasing the normalization accuracy. The user increases the normalization accuracy by clicking on the increase button for normalization accuracy, or decreases the normalization accuracy by clicking on the decrease button for normalization accuracy.
[0124] In some embodiments, after the user clicks the settings option in the video editing software, an interface including a normalized precision adjustment roller is presented, see Figure 9 , Figure 9 This is an optional normalization accuracy adjustment diagram of the image processing method in video editing provided by an embodiment of the present application. Specifically, the user sets the normalization accuracy by scrolling up and down through the roller in the dotted box displayed on the right.
[0125] In some embodiments, after the user clicks the setting option in the video editing software, an interface including a normalization accuracy input box and corresponding confirmation function items is presented, and the user sets the corresponding normalization accuracy through the normalization accuracy input box.
[0126] It should be noted that in addition to the above-mentioned methods of implementing normalization accuracy by the user, there may be other methods of setting normalization accuracy, and this application does not limit this.
[0127] In actual implementation, after determining the normalization accuracy, the playback time points corresponding to multiple image display positions on the time axis are adjusted, i.e., normalized, based on the normalization accuracy to obtain the target playback time points corresponding to each image display position. Here, the time interval between adjacent target playback time points is greater than the time interval between adjacent playback time points.
[0128] As an example, a two-second video is edited here. Here, the playback time points corresponding to multiple image display positions are [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0]. Assuming that the current normalization accuracy is 0.2 seconds, the above playback time points are normalized and referenced. Figure 10 , Figure 10 This is an optional schematic diagram of the normalization processing of the playback time points of the image processing method in the video editing provided by the embodiment of the present application, thereby obtaining the target playback time points [0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0] corresponding to each image display position; or if the current normalization accuracy is 0.5 seconds, then after normalizing the above playback time points, refer to Figure 11 , Figure 11 This is an optional schematic diagram of the normalization processing of the playback time points of the image processing method in video editing provided in an embodiment of the present application, thereby obtaining the target playback time points [0.0, 0.5, 1.0, 1.5, 2.0] corresponding to each image display position.
[0129] In actual implementation, after obtaining the target playback time points corresponding to each image display position, the terminal intercepts the frame images corresponding to each target playback time point in the video to be edited based on each target playback time point. In this way, by normalizing the playback time points, the number of frame image acquisition requests corresponding to each target playback time point is reduced, thereby simplifying the process of the terminal taking screenshots of the video to be edited to obtain the corresponding frame images, thereby improving the display speed. In this way, although the display accuracy on the time axis will be reduced, under normal circumstances, the content of adjacent frame images of the video changes less. The playback time points of multiple video screenshots in the time axis are normalized by normalization accuracy, that is, the multiple playback time points are mapped to a time range with a certain time point accuracy, and adjacent frame images with less content change are replaced by one frame image, thereby reducing the number of images that need to be acquired and achieving a balance between display speed and display accuracy.
[0130] Step 103: Acquire frame images corresponding to each target playback time point in the video to be edited.
[0131] It's worth noting that, due to the different triggering processes for the image acquisition instructions for the frames in the video to be edited, the process for acquiring the playback time points corresponding to each image display position on the timeline of the video editing interface also differs. Therefore, based on the differences in the triggering processes for the image acquisition instructions, the process for acquiring the frame images corresponding to each target playback time point in the video to be edited also differs. The following describes two specific processes for acquiring the frame images corresponding to each target playback time point in the video to be edited.
[0132] In some embodiments, when the image acquisition instruction is triggered by the import operation of the video to be edited, the process of obtaining the frame image corresponding to each target playback time point in the video to be edited is specifically that the terminal takes a screenshot of the original video based on the default display accuracy, thereby obtaining the frame image corresponding to each target playback time point.
[0133] In other embodiments, when the image acquisition instruction is triggered by an editing operation on the displayed video image, the process of acquiring the frame image corresponding to each target playback time point in the video to be edited is specifically as follows: searching for the frame image corresponding to each target playback time point in the image cache pool used to cache frame images; when the frame image corresponding to the target playback time point exists in the image cache pool, acquiring the corresponding frame image from the image cache pool; when the frame image corresponding to the target playback time point does not exist in the image cache pool, intercepting the frame image corresponding to the target playback time point in the video to be edited.
[0134] Following the above example, here is the reference Figure 12 , Figure 12 This is an optional example diagram of the image processing method in video editing provided by an embodiment of the present application. Assuming that the normalized accuracy is 0.2 seconds, the frame image corresponding to the target playback time point [0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0] is searched in the image cache pool. As an example, there is no frame image corresponding to 1.2 seconds in the image cache pool here, so the frame image corresponding to the target playback time point [0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.4, 1.6, 1.8, 2.0] is obtained from the image cache pool. When the terminal receives a message that the frame image search corresponding to 1.2 seconds fails, the screenshot of the video to be edited is taken through the screenshot device to generate a frame image corresponding to 1.2 seconds.
[0135] It should be noted that, after acquiring the frame image at the corresponding target playback time point, the terminal will cache the frame image in the image cache pool so as to facilitate direct acquisition next time.
[0136] Continue to refer to Figure 12After acquiring a 1.2-second frame image, the 1.2-second frame image is placed in the image cache pool. This caches the frame images that have already been displayed on the timeline. When a new image acquisition request comes in, the corresponding frame image is first searched from the cache, thereby improving the image display speed.
[0137] Step 104: Fill the acquired frame image into the corresponding image display position on the time axis for display.
[0138] In actual implementation, after obtaining the frame images corresponding to each target playback time point in the video to be edited, the mapping relationship between the playback time point and the target playback time point is obtained; based on the mapping relationship, the image display positions corresponding to each target playback time point on the time axis are determined respectively; based on the target playback time point, the obtained frame images are filled into the corresponding image display positions for display.
[0139] Here, the mapping relationship between the playback time point and the target playback time point is determined by the normalized accuracy. Continuing with the above example, assuming that the normalized accuracy is 0.2 seconds, here is the reference Figure 10 , then the playback time points 0.0 and 0.1 correspond to the target playback time point 0.0, the playback time points 0.2 and 0.3 correspond to the target playback time point 0.2, the playback time points 0.4 and 0.5 correspond to the target playback time point 0.4, the playback time points 0.6 and 0.7 correspond to the target playback time point 0.6, the playback time points 0.8 and 0.9 correspond to the target playback time point 0.8, the playback time points 1.0 and 1.1 correspond to the target playback time point 1.0, the playback time points 1.2 and 1.3 correspond to the target playback time point 1.2, the playback time points 1.4 and 1.5 correspond to the target playback time point 1.4, the playback time points 1.6 and 1.7 correspond to the target playback time point 1.6, the playback time points 1.8 and 1.9 correspond to the target playback time point 1.8, and the playback time point 2.0 corresponds to the target playback time point 2.0. Or assuming that the normalized accuracy is 0.5 seconds, here we refer to Figure 11 , then the playback time point [0.0, 0.1, 0.2, 0.3, 0.4] corresponds to the target playback time point 0.0, the playback time point [0.5, 0.6, 0.7, 0.8, 0.9] corresponds to the target playback time point 0.5, the playback time point [1.0, 1.1, 1.2, 1.3, 1.4] corresponds to the target playback time point 1.0, the playback time point [1.5, 1.6, 1.7, 1.8, 1.9] corresponds to the target playback time point 1.5, and the playback time point 2.0 corresponds to the target playback time point 2.0.
[0140] In actual implementation, after obtaining the mapping relationship between the playback time point and the target playback time point, the process of determining the image display position corresponding to each target playback time point on the time axis based on the mapping relationship is specifically as follows: based on the image display position corresponding to the playback time point on the time axis, the frame image of the target playback time point corresponding to the playback time point is filled into the image display position corresponding to the playback time point on the time axis.
[0141] Continuing with the above example, assuming the normalized accuracy is 0.5 seconds, here is the reference Figure 11 , fill the frame image corresponding to 0.0 second in the video to be edited into the image display position corresponding to the playback time point [0.0, 0.1, 0.2, 0.3, 0.4] on the time axis, fill the frame image corresponding to 0.5 second in the video to be edited into the image display position corresponding to the playback time point [0.5, 0.6, 0.7, 0.8, 0.9] on the time axis, fill the frame image corresponding to 1.0 second in the video to be edited into the image display position corresponding to the playback time point [1.0, 1.1, 1.2, 1.3, 1.4] on the time axis, fill the frame image corresponding to 1.5 second in the video to be edited into the image display position corresponding to the playback time point [1.5, 1.6, 1.7, 1.8, 1.9] on the time axis, and fill the frame image corresponding to 2.0 second in the video to be edited into the image display position corresponding to the playback time point 2.0 second on the time axis.
[0142] In some embodiments, after step 104, it also includes: receiving a sliding operation on the frame image displayed on the timeline; along with the execution of the sliding operation, sliding out the frame image in the frame image sequence along the sliding direction of the sliding operation, and determining the first playback time point corresponding to the target image display position that needs to be filled with the frame image based on the third display accuracy; the third display accuracy here is the display accuracy obtained after adjusting the first display accuracy; then adjusting the first playback time point corresponding to the target image display position to obtain the second playback time point corresponding to each target image display position; obtaining the frame image corresponding to each second playback time point in the video to be edited, and filling the obtained frame image into the corresponding target image display position for display.
[0143] It should be noted that due to the limited video editing interface, the timeline displayed in the video editing interface only corresponds to a portion of the entire timeline of the video to be edited. Based on this, after editing the frame images corresponding to the portion of the timeline displayed in the video editing interface, the frame images in the remaining frame image sequence are presented by sliding the timeline. Figure 13 , Figure 13It is an optional schematic diagram of the image processing method in video editing provided by an embodiment of the present application. Specifically, after the user has edited the frame image in the frame image sequence displayed on the timeline, he slides the timeline to the left, and then obtains the frame image of the corresponding time point obtained by taking a screenshot of the video to be edited based on the second display accuracy, so as to fill the obtained multiple frame images into the corresponding image display position on the timeline, thereby presenting the frame image in the frame image sequence on the right side of the timeline, and then receives the user's accuracy adjustment operation for the frame image sequence displayed on the timeline. The accuracy adjustment operation here can refer to the accuracy adjustment operation in step 101, so as to obtain the display accuracy after adjusting the second display accuracy. Then, based on the adjusted display accuracy, the terminal determines the playback time point corresponding to the target image display position where the frame image needs to be filled, that is, the first playback time point.
[0144] Then, the first playback time point corresponding to the target image display position is adjusted to obtain the second playback time point corresponding to each target image display position; the frame image corresponding to each second playback time point in the video to be edited is obtained, and the obtained frame image is filled into the corresponding target image display position for display. Here, the process of adjusting the first playback time point to obtain the frame image corresponding to each second playback time point for display can be referred to the process of steps 102-104, and will not be described in detail.
[0145] In actual implementation, a timeline of a frame sequence consisting of multiple frame images for the video to be edited is presented in the video editing interface to receive the user's image update instructions for the frame images displayed in the timeline, so as to adjust the playback time points corresponding to each frame image in the frame image sequence, and obtain the target playback time points corresponding to the frame images in the timeline after adjustment, thereby updating the frame images displayed in the timeline based on the target playback time points.
[0146] By applying the above-mentioned embodiments of the present application, during the video editing process, the target playback time points are obtained by adjusting the playback time points corresponding to each image display position on the time axis in the video editing interface, thereby obtaining frame images corresponding to each target playback time point in the video to be edited for display. Since the time interval between adjacent target playback time points is smaller than the time interval between adjacent playback time points, the number of playback time points corresponding to each image display position on the time axis is reduced through adjustment processing, thereby reducing the number of images that need to be obtained. Compared with directly obtaining the images of the playback time points corresponding to each image display position, the speed of image acquisition and the efficiency of image display are improved.
[0147] Below, by Figure 1 The terminal 400 in the embodiment of the present application implements the image processing method in the video editing provided by the embodiment of the present application as an example. Figure 14 , Figure 14This is a flow chart of the image processing method in video editing provided by the embodiment of the present application, which will be combined with Figure 14 The steps shown are explained.
[0148] Step 201 : In response to a triggering operation on a video editing client, the terminal presents a video editing interface including a video importing function item for importing a video to be edited.
[0149] In actual implementation, a video editing client is presented on the terminal, or the terminal presents a client with video editing function. Here, taking the video editing client as an example, when the client receives the user's trigger operation, that is, the user runs the video editing client, the terminal presents a video editing interface including a video import function item for importing the video to be edited.
[0150] Step 202: In response to a click operation on a video import function item, a video selection page including multiple videos is presented.
[0151] In actual implementation, after the user clicks the video import item in the video editing interface, the terminal presents a video selection page including multiple videos. The videos on the video selection page can be pre-stored locally in the terminal, or obtained by the terminal from the outside world (such as the Internet), or collected in real time by the terminal, for example, through the terminal's camera.
[0152] Step 203 : In response to the selection operation on the video to be edited in the video selection page, a confirmation prompt corresponding to the selected video to be edited is presented.
[0153] In actual implementation, after the user selects the video to be edited, the terminal will present a confirmation prompt corresponding to the selected video to be edited, so that the user can confirm the video to be edited, thereby importing the selected video to be edited and triggering the image acquisition instruction.
[0154] Step 204: Obtain the default display accuracy corresponding to the frame image sequence display on the time axis in the video editing interface.
[0155] Step 205: Determine the playback time point corresponding to each image display position on the time axis according to the default display accuracy.
[0156] It should be noted that, in the case where the image acquisition instruction is triggered by the import operation of the video to be edited, according to the default display accuracy, the playback time point corresponding to each image display position on the time axis is determined to be the target playback time point.
[0157] Step 206 : Screenshot the video to be edited based on the default display accuracy to obtain frame images corresponding to each target playback time point.
[0158] Step 207: Fill the received frame image into the corresponding image display position on the time axis for display.
[0159] Here, after the received frame images are filled into the corresponding image display positions on the time axis for display, the time axis in the video editing interface will present the frame image sequence of the video to be edited, so that the user can edit the displayed video images based on the frame image sequence. Figure 1 The terminal 400 in the embodiment of the present application implements the image processing method in the video editing provided by the embodiment of the present application as an example. Figure 15 , Figure 15 This is a flow chart of the image processing method in video editing provided by the embodiment of the present application, which will be combined with Figure 15 The steps shown are explained.
[0160] In step 301 , the terminal presents a timeline in a video editing interface, and displays a frame image sequence of a video to be edited with a first display accuracy through a plurality of image display positions in the timeline.
[0161] In actual implementation, the first display precision is the default display precision. The user adjusts the size of the first display precision through the precision adjustment operation in the video editing interface, triggering an image acquisition instruction for a frame image in the video to be edited.
[0162] In actual implementation, the precision adjustment operation can be a user's zoom operation on a frame image in a frame image sequence on a video editing interface, or a user's input of display precision data based on a precision input box presented by the terminal, or an operation in which the user adjusts the display precision through a precision adjustment control or a precision adjustment roller presented by the terminal.
[0163] Step 302 : In response to the precision adjustment operation of adjusting the first display precision to the second display precision, a playback time point and a normalized precision corresponding to the image display position corresponding to the second display precision are obtained.
[0164] In actual implementation, the normalization accuracy can be set by the developer during the development of the video editing software, or can be set by the user independently during the video editing process.
[0165] Step 303 : Based on the normalization accuracy, the play time points corresponding to the plurality of image display positions displayed according to the second display accuracy are normalized to obtain a target play time point corresponding to each image display position.
[0166] Step 304 : Searching for a frame image corresponding to each target playback time point in the image buffer pool used for buffering frame images.
[0167] Step 3041 : When a frame image corresponding to the target playback time point exists in the image buffer pool, the frame image corresponding to the target playback time point is obtained from the image buffer pool.
[0168] Step 3042: When there is no frame image corresponding to the target playback time point in the image buffer pool, a frame image corresponding to the target playback time point in the video to be edited is intercepted.
[0169] In actual implementation, after intercepting the frame image at the corresponding target playback time point, the terminal will cache the frame image in the image cache pool so that it can be directly obtained next time.
[0170] Step 305: Obtain a mapping relationship between the playback time point and the target playback time point.
[0171] Step 306 : Based on the mapping relationship, determine the image display position corresponding to each target playback time point on the time axis.
[0172] Step 307: Based on the target playback time point, the acquired frame image is filled into the corresponding image display position for display.
[0173] In actual implementation, after the frame images are filled into corresponding image display positions for display, the user performs a sliding operation on the frame image sequence displayed on the time axis.
[0174] Step 308: In response to a sliding operation on the frame image sequence displayed on the time axis, the terminal presents the frame image in the frame image sequence that slides out along the sliding direction of the sliding operation, and determines the first playback time point corresponding to the target image display position that needs to be filled with the frame image based on the third display accuracy.
[0175] It should be noted that the third display accuracy here is the display accuracy obtained by adjusting the first display accuracy.
[0176] In actual implementation, the terminal takes a screenshot of the video to be edited and obtains frame images of corresponding time points based on the third display accuracy, so as to fill the obtained multiple frame images into the corresponding image display positions on the timeline, and then receives the user's accuracy adjustment operation for the frame image sequence displayed on the timeline, thereby obtaining the adjusted display accuracy. The accuracy adjustment operation here can refer to step 301. Then, based on the adjusted display accuracy, the terminal determines the playback time point corresponding to the target image display position that needs to be filled with the frame image, that is, the first playback time point.
[0177] Step 309 : normalize the first playback time points corresponding to the target image display positions to obtain the second playback time points corresponding to the target image display positions.
[0178] Step 310: Acquire frame images corresponding to each second playback time point from the image buffer pool.
[0179] In actual implementation, when there is a frame image corresponding to the target playback time point in the image cache pool, the frame image corresponding to the target playback time point is obtained from the image cache pool; when there is no frame image corresponding to the target playback time point in the image cache pool, the frame image corresponding to the target playback time point in the video to be edited is intercepted. Here, after intercepting the frame image of the corresponding target playback time point, the terminal will cache the frame image to the image cache pool so that it can be directly obtained next time.
[0180] Step 311: Fill the acquired frame image into the corresponding target image display position for display.
[0181] In actual implementation, after step 311, the process of steps 308 to 311 can be continued, which is not described in detail in the embodiment of the present application.
[0182] By applying the above-mentioned embodiments of the present application, during the video editing process, the target playback time points are obtained by adjusting the playback time points corresponding to each image display position on the time axis in the video editing interface, thereby obtaining frame images corresponding to each target playback time point in the video to be edited for display. Since the time interval between adjacent target playback time points is smaller than the time interval between adjacent playback time points, the number of playback time points corresponding to each image display position on the time axis is reduced through adjustment processing, thereby reducing the number of images that need to be obtained. Compared with directly obtaining the images of the playback time points corresponding to each image display position, the speed of image acquisition and the efficiency of image display are improved.
[0183] The following describes an exemplary application of the embodiment of the present invention in a practical application scenario. Figure 16 , Figure 16 It is a schematic diagram of the interface for image processing in video editing provided by related technologies. Figure 16 In the existing video editing technology solutions, for different timeline screenshot precisions (i.e. timeline display precisions), all the screenshots (i.e. display images) required for each frame in the timeline control are captured. For example, for a 10-second video with a frame rate of 30 frames per second, when the screenshot precision is 1 frame, 300 screenshots are required, and when the video is 100 seconds, 3,000 screenshots are required. Due to the different performance of mobile devices, when the timeline control is displayed with higher screenshot precision on a low-end model, and the user's video is long, the screenshot will be displayed very slowly, and it is difficult for the user to locate the current frame. Figure 15 As shown, it seriously hinders the user's video editing operations.
[0184] In response to the above problems, the embodiment of the present application uses normalization technology and caching technology to solve the problem of slow screenshot generation on low-end and mid-range mobile devices when the video duration is long and the screenshot is taken with high screenshot accuracy. Figure 17 , Figure 17 This is a flow chart of the image processing method in video editing provided by the embodiment of the present application, see Figure 17 , the image processing method in video editing of the embodiment of the present application includes:
[0185] Step 401: The user opens a video editing interface and imports a corresponding video to be edited.
[0186] In actual implementation, after opening the video editing interface, the user clicks the video import item presented on the video editing interface. At this time, the video editing interface will present a video selection page containing multiple videos. The multiple videos here can be pre-stored locally on the terminal, obtained from the external environment (such as the Internet), or collected in real time by the terminal, for example, through the terminal's camera. The user selects the video to be edited on the presented video selection page and imports the corresponding video for subsequent editing.
[0187] Step 402: In the video editing interface, the terminal presents the timeline corresponding to the video to be edited according to the current screenshot accuracy.
[0188] In actual implementation, after the user imports the corresponding video, the terminal determines the current screenshot accuracy (i.e., the default display accuracy), takes a screenshot of the video to be edited, and obtains multiple corresponding frame images, thereby forming a frame image sequence of the multiple frame images and displaying them on the timeline.
[0189] As an example, see Figure 4 The screenshot accuracy here is 0.33 seconds per frame. After the user imports the corresponding video to be edited, it will be displayed as follows Figure 4 The video editing interface shown includes the corresponding timeline.
[0190] In step 403 , the user performs a precision adjustment operation based on the time axis corresponding to the video to be edited to generate the original screenshot request time point A.
[0191] In actual implementation, the user adjusts the precision based on the time axis of the video editing interface, that is, adjusts the current screenshot precision to generate the original screenshot request time point A (that is, the playback time point corresponding to each image display position on the time axis). Figure 18 and Figure 19 , Figure 18 and Figure 19This is a schematic diagram of the interface of the image processing method in video editing provided by the embodiment of the present application. The user can adjust the screenshot accuracy of the time axis by pinching and zooming in and out on the time axis. That is, the user can select the screenshot accuracy he wants by pinching and zooming in and out. Figure 18 As shown, the user can adjust the precision based on the time axis of the video editing interface by pinching the time axis outward to stretch and enlarge the screenshot precision to generate the original screenshot request time point A; or as shown in FIG. Figure 19 As shown, the user can adjust the precision based on the timeline of the video editing interface by pinching two fingers to zoom inward on the timeline to stretch and reduce the screenshot precision, thereby generating the original screenshot request time point A.
[0192] Continuing with the above example, here we take the example of enlarging the screenshot accuracy. The user zooms outward on the time axis to increase the screenshot accuracy. For example, the screenshot accuracy of 0.33s is adjusted to 0.1s. Figure 20 , Figure 20 This is a schematic diagram of the precision adjustment of an image processing method in video editing provided by an embodiment of the present application. Figure 20 As shown, the screenshot accuracy of 0.33s is adjusted to the screenshot accuracy of 0.1s, that is, the playback time points [0.00, 0.33, 0.66, 0.99, 1.32, 1.65, 0.98, 2.00] displayed on the timeline are adjusted to [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0], which is the screenshot request time point A.
[0193] Step 404 : normalize the original screenshot request time point A according to the current normalization accuracy to generate the screenshot request time point B.
[0194] In actual implementation, after determining the original screenshot request time point A, the terminal first obtains the set normalization accuracy, and normalizes the screenshot request time point A according to the screenshot request normalization processing module to generate a new screenshot request time point B.
[0195] Following the above example, continue to refer to Figure 20, where the original screenshot request time point A is [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0], and the normalization accuracy is 0.2 seconds for example. The original screenshot request time point A is normalized to generate a new screenshot request time point B [0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0].
[0196] Step 405: Read the screenshot cache from the screenshot cache pool according to the screenshot request time point B.
[0197] In actual implementation, the terminal first sends a cache search request corresponding to the screenshot request time point B to the screenshot cache pool based on the screenshot request time point B. If there is a screenshot at a certain time point in the screenshot cache pool (i.e., the image cache pool), the screenshot at the corresponding time point is read from the screenshot cache pool; if there is no screenshot at a certain time point in the cache pool, the terminal then requests a screenshot from the screenshotter, so that the screenshotter takes a screenshot from the original video to obtain the image at the corresponding time point.
[0198] Continuing with the above example, if there is a screenshot at a certain point in time in the screenshot cache pool, here is the reference Figure 21 , Figure 21 This is an optional image acquisition diagram in the video editing provided by the embodiment of the present application. The screenshot request normalization processing module in the terminal sends a cache search request to the screenshot cache pool, and searches the cached screenshot corresponding to the screenshot request time point B in the screenshot cache pool. Assuming that there are images with time points of [0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0] in the cache pool at this time, but no image with time point 0.0s exists, then the terminal can obtain the corresponding cached screenshot. For the image of 0.0s that does not exist in the cache pool, refer to Figure 22 , Figure 22 This is an optional image acquisition diagram in the video editing provided by the embodiment of the present application. When there is no screenshot at 0.0s in the cache pool, the 0.0s screenshot cache search fails, and the screenshot request normalization processing module sends a screenshot request corresponding to the time point of 0.0s to the screenshot device, so that the screenshot device takes a screenshot of the original video and generates an image with the time point of 0.0s. In this way, by optimizing the timeline screenshot, the screenshot generation speed is improved. According to the different settings of the screenshot normalization accuracy, the screenshot generation speed can be increased, greatly improving the user experience.
[0199] Step 406: Fill the acquired screenshot into the timeline.
[0200] In actual implementation, when the terminal obtains the screenshot corresponding to the screenshot request time point B, the obtained screenshot is filled into the corresponding position on the timeline for display according to the mapping relationship between the original screenshot request time point A and the screenshot request time point B. It should be noted that in the case where the screenshot of a certain time point does not exist in the cache pool and the cache search fails, after the terminal receives the video to be edited and captures the frame image corresponding to the target playback time point and fills the image into the timeline, the terminal will also put the obtained screenshot into the screenshot cache pool for direct retrieval next time.
[0201] See here for more information Figure 21 and Figure 22 After obtaining the corresponding screenshot, the terminal fills the obtained screenshot into the corresponding position of the time axis for display based on the mapping relationship between the original screenshot request time point A and the screenshot request time point B.
[0202] It should be noted that, due to the limitations of the video editing interface, the timeline displayed in the video editing interface only corresponds to a portion of the entire timeline of the video to be edited. Based on this, after step 306, the user can slide the timeline to display the frame images in the remaining frame image sequence. Figure 18 and Figure 19 ,like Figure 18 As shown, the user can preview the video with more precision by dragging the zoomed-in timeline with two fingers, or as shown in Figure 19 As shown, the user can drag the zoomed-out timeline left and right with two fingers, and quickly preview the video with more blurred precision by dragging left and right.
[0203] By applying the above-mentioned embodiments of the present application, during the video editing process, the target playback time points are obtained by adjusting the playback time points corresponding to each image display position on the time axis in the video editing interface, thereby obtaining frame images corresponding to each target playback time point in the video to be edited for display. Since the time interval between adjacent target playback time points is smaller than the time interval between adjacent playback time points, the number of playback time points corresponding to each image display position on the time axis is reduced through adjustment processing, thereby reducing the number of images that need to be obtained. Compared with directly obtaining the images of the playback time points corresponding to each image display position, the speed of image acquisition and the efficiency of image display are improved.
[0204] The following continues to describe the exemplary structure of the image processing device 455 in the video editing provided by the embodiment of the present application implemented as a software module. In some embodiments, such as Figure 2 As shown, the software modules stored in the image processing device 455 in the video editing of the memory 450 may include:
[0205] The acquisition module 4551 is used to respond to the image acquisition instruction for the frame image in the video to be edited, and obtain the playback time point corresponding to each image display position on the time axis in the video editing interface; wherein the number of the image display positions is multiple, and is used to display the frame image of the corresponding playback time point in the video to be edited to form a frame image sequence.
[0206] The adjustment module 4552 is used to adjust the playback time points corresponding to the multiple image display positions to obtain the target playback time point corresponding to each image display position; wherein the time interval between adjacent target playback time points is greater than the time interval between adjacent playback time points.
[0207] The determination module 4553 is configured to obtain frame images corresponding to each target playback time point in the video to be edited.
[0208] The filling module 4554 is used to fill the acquired frame image into the corresponding image display position on the time axis for display.
[0209] In some embodiments, the image processing device 455 also includes: a trigger module, which is used to present a video import function item for importing the video to be edited in the video editing interface; present a video selection page in response to a trigger operation for the video import function item; based on the video selection page, in response to a selection operation for the video to be edited, trigger the image acquisition instruction; wherein, the image acquisition instruction is used to indicate that a target number of frame images are acquired starting from the first frame image in the video to be edited, and the target number is the same as the number of image display positions.
[0210] In some embodiments, the acquisition module 4551 is also used to obtain the default display accuracy corresponding to the frame image sequence display on the time axis, and the display accuracy is used to indicate the video playback duration corresponding to each image display position; based on the default display accuracy, the playback time point corresponding to each image display position on the time axis is determined.
[0211] In some embodiments, the acquisition module 4551 is further configured to capture, based on each target playback time point, a frame image corresponding to each target playback time point in the video to be edited.
[0212] In some embodiments, the trigger module is also used to present the timeline in the video editing interface, and to display the frame image sequence of the video to be edited using a first display accuracy through multiple image display positions in the timeline; wherein, the first display accuracy is used to indicate that the video playback duration corresponding to each image display position is the target duration; and in response to the accuracy adjustment operation for adjusting the size of the first display accuracy, the image acquisition instruction is triggered.
[0213] In some embodiments, the acquisition module 4551 is further configured to receive a scaling operation on a frame image in the frame image sequence, and use the scaling operation as the precision adjustment operation.
[0214] In some embodiments, the acquisition module 4551 is also used to present a precision input box and a corresponding determination function item in the video editing interface; receive a second display precision entered in the precision input box; based on the second display precision, receive a trigger operation for the determination function item, and use the trigger operation as the precision adjustment operation.
[0215] In some embodiments, the acquisition module 4551 is further used to present a precision adjustment control for adjusting the first display precision in the video editing interface; and receive the precision adjustment operation based on the precision adjustment control.
[0216] In some embodiments, the image processing device 455 also includes: a sliding processing module, which is used to receive a sliding operation on the frame image displayed on the timeline; along with the execution of the sliding operation, the frame image in the frame image sequence is slid out along the sliding direction of the sliding operation, and based on the third display accuracy, the first playback time point corresponding to the target image display position that needs to be filled with the frame image is determined; wherein the third display accuracy is the display accuracy obtained after adjusting the first display accuracy; the first playback time point corresponding to the target image display position is adjusted to obtain the second playback time point corresponding to each target image display position; the frame image corresponding to each second playback time point in the video to be edited is obtained, and the obtained frame image is filled into the corresponding target image display position for display.
[0217] In some embodiments, the adjustment module 4552 is also used to obtain the normalized accuracy corresponding to the playback time point, and the normalized accuracy is used to indicate the time interval between adjacent target time points; based on the normalized accuracy, the playback time points corresponding to multiple image display positions are normalized to obtain the target playback time point corresponding to each image display position.
[0218] In some embodiments, the image processing device 455 also includes: a setting module, which is used to present a setting interface corresponding to the normalization accuracy and present a normalization accuracy setting control in the setting interface; based on the normalization accuracy setting control, the set normalization accuracy is received.
[0219] In some embodiments, the determination module 4553 is also used to search for frame images corresponding to each of the target playback time points in the image cache pool used to cache frame images; when there is a frame image corresponding to the target playback time point in the image cache pool, the corresponding frame image is obtained from the image cache pool; when there is no frame image corresponding to the target playback time point in the image cache pool, the frame image corresponding to the target playback time point in the video to be edited is intercepted, and the frame image is cached to the image cache pool.
[0220] In some embodiments, the filling module 4554 is also used to obtain the mapping relationship between the playback time point and the target playback time point; based on the mapping relationship, the image display position corresponding to each target playback time point on the time axis is determined respectively; based on the target playback time point, the acquired frame image is filled into the corresponding image display position for display.
[0221] The present invention provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the image processing method for video editing described in the present invention.
[0222] The embodiment of the present application provides a computer-readable storage medium storing executable instructions, wherein the executable instructions are stored. When the executable instructions are executed by a processor, the processor will execute the method provided by the embodiment of the present application, for example, Figure 3 、 Figure 14 、 Figure 15 as well as Figure 17 It is worth noting that computers include various computing devices including terminal devices and servers.
[0223] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface storage, optical disk, or CD-ROM; or various devices including one or any combination of the above memories.
[0224] In some embodiments, executable instructions may be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0225] As an example, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinating files (e.g., files storing one or more modules, subroutines, or code portions).
[0226] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.
[0227] In summary, the following technical effects can be achieved through the embodiments of the present application:
[0228] 1) Use normalization technology to normalize the time points of screenshot requests when taking screenshots of the edited video, reducing the number of screenshot requests from the screenshot control and improving the screenshot speed;
[0229] 2) Use caching technology to cache the screenshots generated on the timeline control. When there is a new screenshot request, first search the screenshot from the cache to improve the screenshot speed.
[0230] The above description is merely an embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent replacements, and improvements made within the spirit and scope of the present application are included in the scope of protection of the present application.
Claims
1. An image processing method in video editing, characterized in that: The method comprises: In response to an image acquisition instruction for a frame image in a video to be edited, acquiring a playback time point corresponding to each image display position on a time axis in a video editing interface; There are multiple image display positions for displaying frame images at corresponding playback time points in the video to be edited, so as to form a frame image sequence; Adjusting the playback time points corresponding to the plurality of image display positions to obtain a target playback time point corresponding to each image display position; wherein the time interval between adjacent target playback time points is greater than the time interval between adjacent playback time points; Acquire frame images corresponding to each target playback time point in the video to be edited; The acquired frame image is filled into the corresponding image display position on the time axis for display.
2. The method according to claim 1, characterized in that The method further comprises: In the video editing interface, a video import function item for importing the video to be edited is presented; In response to a triggering operation on the video import function item, presenting a video selection page; Based on the video selection page, in response to a selection operation on the video to be edited, triggering the image acquisition instruction; The image acquisition instruction is used to instruct to acquire a target number of frame images starting from the first frame image in the video to be edited, and the target number is the same as the number of image display positions.
3. The method according to claim 2, characterized in that The step of obtaining the playback time point corresponding to each image display position on the time axis of the video editing interface includes: Obtaining a default display accuracy corresponding to displaying a frame image sequence on the time axis, wherein the display accuracy is used to indicate a video playback duration corresponding to each image display position; The playback time point corresponding to each image display position on the time axis is determined according to the default display accuracy.
4. The method according to claim 3, characterized in that The obtaining of the frame images corresponding to the target playback time points in the video to be edited includes: Based on each of the target playback time points, frame images corresponding to each of the target playback time points in the video to be edited are captured.
5. The method according to claim 1, wherein The method further comprises: Presenting the timeline in the video editing interface, and displaying a frame image sequence of the video to be edited using a first display accuracy through a plurality of image display positions in the timeline; The first display accuracy is used to indicate that the video playback duration corresponding to each image display position is the target duration; The image acquisition instruction is triggered in response to a precision adjustment operation for adjusting the size of the first display precision.
6. The method according to claim 5, characterized in that The method further comprises: A scaling operation for a frame image in the frame image sequence is received, and the scaling operation is used as the precision adjustment operation.
7. The method according to claim 5, characterized in that The method further comprises: In the video editing interface, a precision input box and a corresponding confirmation function item are presented; receiving a second display precision input in the precision input box; Based on the second display accuracy, a trigger operation for the determined function item is received, and the trigger operation is used as the accuracy adjustment operation.
8. The method according to claim 5, characterized in that The method further comprises: Presenting a precision adjustment control for adjusting the first display precision in the video editing interface; Based on the precision adjustment control, the precision adjustment operation is received.
9. The method according to claim 5, characterized in that After filling the acquired frame image into the corresponding image display position on the time axis for display, the method further includes: receiving a sliding operation on the frame image displayed on the timeline; As the sliding operation is performed, a frame image in the frame image sequence is slid out along the sliding direction of the sliding operation, and a first playback time point corresponding to a target image display position requiring frame image filling is determined based on a third display accuracy; wherein the third display accuracy is a display accuracy obtained by adjusting the first display accuracy; Adjusting the first playback time point corresponding to the target image display position to obtain the second playback time point corresponding to each target image display position; Frame images corresponding to each second playback time point in the video to be edited are obtained, and the obtained frame images are filled into corresponding target image display positions for display.
10. The method according to claim 5, characterized in that The obtaining of the frame images corresponding to the target playback time points in the video to be edited includes: Searching for the frame images corresponding to the target playback time points in an image buffer pool for buffering frame images; When a frame image corresponding to the target playback time point exists in the image cache pool, obtaining the corresponding frame image from the image cache pool; When the frame image corresponding to the target playback time point does not exist in the image cache pool, the frame image corresponding to the target playback time point in the video to be edited is intercepted and cached in the image cache pool.
11. The method according to claim 1, wherein The step of adjusting the playback time points corresponding to the plurality of image display positions to obtain a target playback time point corresponding to each image display position includes: Obtaining a normalized precision corresponding to the playback time point, where the normalized precision is used to indicate a time interval between adjacent target playback time points; Based on the normalization accuracy, the playback time points corresponding to the plurality of image display positions are normalized to obtain the target playback time point corresponding to each image display position.
12. The method according to claim 11, characterized in that The method further comprises: Presenting a setting interface corresponding to the normalized accuracy, and presenting a normalized accuracy setting control in the setting interface; Based on the normalization precision setting control, the set normalization precision is received.
13. The method according to claim 1, wherein Filling the acquired frame image into the corresponding image display position on the time axis for display includes: Obtaining a mapping relationship between the playback time point and the target playback time point; Based on the mapping relationship, respectively determining the image display position corresponding to each target playback time point on the time axis; Based on the target playback time point, the acquired frame image is filled into the corresponding image display position for display.
14. An image processing method in video editing, characterized in that: The method comprises: In the video editing interface, the timeline corresponding to the video to be edited is presented; Displaying a plurality of frame images of the video to be edited in the timeline, wherein the plurality of frame images constitute a frame image sequence; In response to an image update instruction for the frame image displayed in the timeline, updating the frame image displayed in the timeline; Among them, the target playback time point corresponding to the frame image in the time axis after update is obtained by adjusting the playback time point corresponding to each frame image in the frame image sequence, and the time interval between adjacent target playback time points is greater than the time interval between adjacent playback time points.
15. An image processing device in video editing, characterized in that: The device comprises: An acquisition module, configured to respond to an image acquisition instruction for a frame image in a video to be edited, and acquire a playback time point corresponding to each image display position on a time axis in a video editing interface; There are multiple image display positions for displaying frame images at corresponding playback time points in the video to be edited, so as to form a frame image sequence; an adjustment module, configured to adjust the playback time points corresponding to the plurality of image display positions to obtain a target playback time point corresponding to each image display position; wherein the time interval between adjacent target playback time points is greater than the time interval between adjacent playback time points; A determination module, configured to obtain frame images corresponding to each target playback time point in the video to be edited; The filling module is used to fill the acquired frame image into the corresponding image display position on the time axis for display.
16. An electronic device, characterized in that: include: a memory for storing executable instructions; The processor is configured to implement the image processing method in video editing according to any one of claims 1 to 14 when executing the executable instructions stored in the memory.
17. A computer-readable storage medium, characterized in that Executable instructions are stored, which are used to cause a processor to execute and implement the image processing method in video editing according to any one of claims 1 to 14.
18. A computer program product comprising computer executable instructions or a computer program, characterized in that When the computer executable instructions or computer program are executed by a processor, the image processing method in video editing according to any one of claims 1 to 14 is implemented.
Citation Information
Patent Citations
Video editing method based on artificial intelligence
CN112218005A