Video processing method and device and electronic equipment

By recording video segments in segments and managing video segments dynamically in preset storage space, the problem of memory overflow when electronic devices record videos is solved, and memory resources are saved and effective utilization is achieved.

CN119544901APending Publication Date: 2025-02-28BEIJING ZITIAO NETWORK TECH CO LTD

Patent Information

Application Number
CN202311118724.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-31
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

In the prior art, when electronic devices record videos, the cached videos occupy a large amount of memory, which can easily lead to memory overflow and waste of memory resources.

Method used

The method of recording video segments in segments is adopted, in response to the touch operation of the shooting control, the first video segment is recorded, and at least one second video segment is acquired in the preset storage space, and a video is generated based on the first video segment and the second video segment. The preset storage space dynamically deletes the recorded video segments and saves memory resources.

Benefits of technology

It effectively avoids memory overflow problems caused by excessive memory occupancy of video cache, saves memory resources of electronic devices, and improves memory utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119544901A_ABST
    Figure CN119544901A_ABST
Patent Text Reader

Abstract

The invention provides a video processing method and device and electronic equipment, and the method comprises the steps: recording a first video segment in response to a touch operation on a shooting control in a shooting page; at least one second video segment is obtained in a preset storage space, the second video segment is a video segment recorded before the touch operation, and the preset storage space is used for storing one or more latest recorded video segments before the touch operation; and generating a video according to the first video segment and the at least one second video segment. The memory of the electronic equipment is saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of video processing technology, and more particularly to a video processing method, device, and electronic device. Background Art

[0002] A live photo is a dynamic image. When a user long presses the image, the electronic device can play the picture before and after the image is taken.

[0003] At present, when a user opens the shooting page of an electronic device, the electronic device can start recording a video and save the recorded video in a cache. When the user presses the shooting control, the electronic device can stop the video recording after a period of time and intercept a video in the cached video, thereby obtaining a dynamic image. However, in the above method, the video cached by the electronic device occupies a large amount of memory, which is prone to memory overflow, resulting in a waste of memory resources. Summary of the invention

[0004] The present disclosure provides a video processing method, device and electronic device, which are used to solve one or more problems in the prior art.

[0005] In a first aspect, the present disclosure provides a video processing method, the method comprising:

[0006] In response to a touch operation on a capture control in a capture page, recording a first video segment;

[0007] Acquire at least one second video segment in a preset storage space, where the second video segment is a video segment recorded before the touch operation, and before the touch operation, the preset storage space is used to store one or more newly recorded video segments;

[0008] A video is generated based on the first video segment and the at least one second video segment.

[0009] In a second aspect, the present disclosure provides a video processing device, the video processing device comprising a recording module, an acquisition module and a generation module, wherein:

[0010] The recording module is used to record a first video segment in response to a touch operation on a shooting control in a shooting page;

[0011] The acquisition module is used to acquire at least one second video segment in a preset storage space, where the second video segment is a video segment recorded before the touch operation, and before the touch operation, the preset storage space is used to store one or more recently recorded video segments;

[0012] The generating module is used to generate a video according to the first video segment and the at least one second video segment.

[0013] In a third aspect, an embodiment of the present disclosure provides an electronic device including: a processor and a memory;

[0014] The memory stores computer-executable instructions;

[0015] The processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the video processing method as described in the first aspect and various possible aspects of the first aspect.

[0016] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the video processing method as described in the first aspect and various possible aspects of the first aspect are implemented.

[0017] The present disclosure provides a video processing method, device and electronic device, in response to a touch operation on a shooting control in a shooting page, the electronic device can record a first video segment, and obtain at least one second video segment in a preset storage control, wherein the second video segment is a video segment recorded before the touch operation, wherein before the touch operation, the preset storage space is used to store one or more recently recorded video segments, and the electronic device can generate a video based on the first video segment and at least one second video segment. In the above method, since the electronic device adopts a segmented recording mode of video segments, and the preset storage space can retain the latest recorded video segment, the preset storage space can dynamically delete the earlier recorded video segments, thereby saving the memory resources of the electronic device and avoiding memory overflow. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0019] Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present disclosure;

[0020] Figure 2 A schematic diagram of a video processing method provided by an embodiment of the present disclosure;

[0021] Figure 3 A schematic diagram of a process for obtaining a first video segment provided by an embodiment of the present disclosure;

[0022] Figure 4 A schematic diagram of obtaining a third video segment provided by an embodiment of the present disclosure;

[0023] Figure 5 A schematic diagram of a process for determining a second video segment provided by an embodiment of the present disclosure;

[0024] Figure 6 A schematic diagram of generating a video provided by an embodiment of the present disclosure;

[0025] Figure 7 A schematic diagram of another method of generating a video provided by an embodiment of the present disclosure;

[0026] Figure 8 A schematic diagram of a method for storing multiple video segments provided in an embodiment of the present disclosure;

[0027] Fig. 9 A schematic diagram of an electronic device storing multiple video segments provided by an embodiment of the present disclosure;

[0028] Fig.10 A schematic diagram of the structure of a video processing device provided by an embodiment of the present disclosure;

[0029] Fig.11 A schematic diagram of the structure of another video processing device provided by an embodiment of the present disclosure;

[0030] Fig.12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0031] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0032] To facilitate understanding, the concepts involved in the embodiments of the present disclosure are explained below.

[0033] Electronic device: is a device with wireless transceiver function. Electronic devices can be deployed on land, including indoors or outdoors, handheld, wearable or vehicle-mounted. The electronic device can be a mobile phone, a tablet computer, a computer with wireless transceiver function, a virtual reality (VR) electronic device, an augmented reality (AR) electronic device, a wireless terminal in industrial control, a vehicle-mounted electronic device, a wireless terminal in self-driving, a wireless electronic device in remote medical care, a wireless electronic device in smart grid, a wireless electronic device in transportation safety, a wireless electronic device in smart city, a wireless electronic device in smart home, a wearable electronic device, etc. The electronic device involved in the embodiments of the present disclosure can also be called a terminal, a user equipment (UE), an access electronic device, a vehicle-mounted terminal, an industrial control terminal, a UE unit, a UE station, a mobile station, a mobile station, a remote station, a remote electronic device, a mobile device, a UE electronic device, a wireless communication device, a UE agent or a UE device, etc. The electronic device can also be fixed or mobile.

[0034] In the related art, a live photo is a dynamic image, which can save a video before and after the image is taken, and the user can browse the above video when long pressing the image. At present, after the user opens the shooting page of the electronic device, the electronic device can start recording the video and save the recorded video in the cache. When the user presses the shooting control, the electronic device can stop the video recording after a period of time, thereby obtaining a long video. The electronic device can capture a section of the long video based on the moment when the user presses the shooting control, and obtain the live photo in combination with the captured image. However, in the above method, the memory occupied by the electronic device for caching long videos is relatively large. When the user opens the shooting page for a long time, the problem of memory overflow is prone to occur. Moreover, most of the recorded videos are irrelevant to the production of live photos, thereby resulting in a waste of memory resources.

[0035] In order to solve the technical problems in the related art, the embodiment of the present disclosure provides a video processing method, in response to the touch operation of the shooting control in the shooting page, a first video segment is recorded, and a third video segment is determined in multiple video segments of a preset storage space, wherein before the touch operation, the preset storage space is used to store the latest recorded one or more video segments, the third video segment is the last video segment recorded before the touch operation, the electronic device can obtain the duration of the third video segment, and according to the duration of the third video segment, obtain at least one second video segment in the preset storage space, and the electronic device can generate a video according to the first video segment and at least one second video segment. In this way, since the electronic device adopts a segmented recording method of video segments, and before the touch operation, the preset storage space can only store the latest recorded video segment and delete the earlier recorded video segment, therefore, the memory overflow caused by opening the shooting page for a long time can be avoided, thereby saving the memory resources of the electronic device.

[0036] Next, combine Figure 1 , the application scenarios of the embodiments of the present disclosure are described.

[0037] Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present disclosure. Figure 1 , including: an electronic device. Among them, the display page of the electronic device is a shooting page, and the shooting page may include a shooting control. When the electronic device displays the shooting page, the electronic device can start recording multiple videos. After the electronic device records video segment 1 and video segment 2, the user clicks the shooting control in the shooting page, the electronic device can continue to record video segment 3, and the electronic device can generate a dynamic image including video segment 2 and video segment 3. In the above method, if the user of the electronic device does not click the shooting control, the video segment 1 can be deleted after the electronic device records video segment 3, which can effectively save memory resources and avoid memory overflow. In addition, through segmented video recording, the flexibility of generating dynamic images can be improved.

[0038] The technical solution of the present invention and how the technical solution of the present invention solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.

[0039] Figure 2 A flowchart of a video processing method provided by an embodiment of the present disclosure. Figure 2 , the method may include:

[0040] S201: Record a first video segment in response to a touch operation on a shooting control in a shooting page.

[0041] The execution subject of the embodiment of the present disclosure may be an electronic device, or a video processing device arranged in the electronic device. The video processing device may be implemented based on software, or may be implemented based on a combination of software and hardware, which is not limited in the embodiment of the present disclosure.

[0042] Among them, the electronic device may include a shooting application. When the user clicks on the shooting application, the electronic device can display a shooting page. The shooting page may include shooting controls for shooting. In response to the user's touch operation on the shooting control (it can also be a voice control operation, etc., which is not limited to the embodiments of the present disclosure), the electronic device can capture images.

[0043] The first video segment may be a video segment recorded by the electronic device after the user clicks the shooting control. For example, when the electronic device displays the shooting page, the electronic device may store the video captured by the camera in a cache, and the first video segment may be a video segment captured by the camera after the user clicks the shooting control. For example, if the user clicks the shooting control at time A, the first video segment may be a video segment captured by the camera of the electronic device after time A, and if the user clicks the shooting control at time B, the first video segment may be a video segment captured by the camera of the electronic device after time B.

[0044] Optionally, the duration of the first video segment may be the first duration. For example, if the first duration is 1 second, and the user clicks the shooting control at time A, the electronic device may store 1 second of video captured by the camera after time A to obtain the first video segment; if the first duration is 2 seconds, and the user clicks the shooting control at time B, the electronic device may store 2 seconds of video captured by the camera after time B to obtain the first video segment.

[0045] Next, combine Figure 3 , the process of obtaining the first video segment is described.

[0046] Figure 3 A schematic diagram of a process for obtaining a first video segment provided by an embodiment of the present disclosure. Figure 3 , including: an electronic device. Wherein, the display page of the electronic device is a shooting page, and the shooting page may include a shooting control. When the electronic device displays the shooting page, the shooting page does not include a shooting object. When the user clicks the shooting control, the shooting page includes a static shooting object, and the electronic device can continue to collect n images to obtain a first video segment. Wherein, the first video segment includes image 1, image 2, ..., image n, wherein each image includes a static shooting object, that is, the first video segment can be a video segment collected by the camera of the electronic device after the user clicks the shooting control.

[0047] S202: Acquire at least one second video segment in a preset storage space.

[0048] The second video segment is a video segment recorded before the touch operation. For example, when the electronic device displays the shooting page, the electronic device can store the video captured by the camera in the cache, and the second video segment can be the video segment captured by the camera before the user clicks the shooting control. For example, if the user clicks the shooting control at time A, the second video segment can be the video segment captured by the camera of the electronic device before time A, and if the user clicks the shooting control at time B, the second video segment can be the video segment captured by the camera of the electronic device before time B.

[0049] Among them, before the touch operation, the preset storage space is used to store one or more recently recorded video segments. For example, the preset storage space may include the two most recently recorded video segments by the terminal device before the touch operation. For example, before the touch operation, the terminal device records video segment 1, video segment 2, and video segment 3 in chronological order. If the preset storage space is used to store the two most recently recorded video segments, before the terminal device records video segment 3, the preset storage space may include video segment 1 and video segment 2. When the terminal device starts recording video segment 3, the terminal device may delete video segment 1 (the earliest recorded video segment) in the preset storage space. When the recording of video segment 3 is finished, the preset storage space may include video segment 2 and video segment 3.

[0050] Optionally, the duration of the multiple video segments stored in the preset storage space may be of any duration, which is not limited in this embodiment of the present disclosure.

[0051] Among them, the electronic device can obtain at least one second video segment in the preset storage space based on the following feasible implementation method: determine a third video segment among multiple video segments in the preset storage space, and obtain the length of the third video segment, and obtain at least one second video segment in the preset storage space according to the length of the third video segment.

[0052] The third video segment may be the last video segment recorded before the touch operation. For example, the electronic device records video segments 1, 2, and 3 before the touch operation. When the electronic device finishes recording video segment 3, if the user touches the shooting control, the electronic device may determine that the third video segment is video segment 3.

[0053] Next, combine Figure 4 , the process of obtaining the third video segment is explained.

[0054] Figure 4 A schematic diagram of obtaining a third video segment provided by an embodiment of the present disclosure. Figure 4 , including: electronic equipment ( Figure 4(not shown) recorded video segments 1, 2, and 3. If the user clicks the shooting control after the recording of video segment 2 is finished, the electronic device can determine video segment 2 as the third video segment, and the electronic device can determine video segment 3 as the first video segment.

[0055] Optionally, the duration of the plurality of video segments except the third video segment in the preset storage space may be the second duration, and the duration of the third video segment may be less than or equal to the second duration. For example, the electronic device may store video segment 1 and video segment 2 in the preset storage space, so the duration of video segment 1 and video segment 2 may both be the second duration. Figure 4 In the embodiment shown, video segment 2 is the third video segment, the duration of video segment 1 may be the second duration, the duration of video segment 3 (the first video segment) may be the first duration, and the duration of video segment 2 may be the second duration or may be less than the second duration. Figure 4 In the illustrated embodiment, the second duration of the video segment recorded by the electronic device is 1.5 seconds. When the electronic device finishes recording video segment 1, if the electronic device continues to record for 0.5 seconds and the user clicks the shooting control, the electronic device can determine that the duration of video segment 2 is 0.5 seconds.

[0056] It should be noted that in the embodiment of the present disclosure, the first duration and the second duration can be any duration, and the embodiment of the present disclosure is not limited to this. In addition, the first duration can be equal to the second duration, or the first duration can be different from the second duration, and the embodiment of the present disclosure is not limited to this.

[0057] Optionally, the electronic device may determine the duration of the third video segment based on any feasible implementation method, which is not limited in the embodiments of the present disclosure.

[0058] The electronic device obtains at least one second video segment in the preset storage space according to the duration of the third video segment, and there are two situations as follows:

[0059] Case 1: the duration of the third video segment is equal to the first threshold.

[0060] If the duration of the third video segment is equal to the first threshold, the electronic device may determine the third video segment as the second video segment. The first threshold may be the duration of the recorded video segment in the preset storage space. For example, the first threshold may be the second duration in the embodiment of the present disclosure. If the electronic device determines that the duration of each video segment in the preset storage space is 1.5 seconds, the first threshold may be 1.5 seconds. When the duration of the third video segment is equal to 1.5 seconds, it means that when the user clicks the shooting control, the previous video segment has been recorded for 1.5 seconds. Therefore, the electronic device may determine the video segment as the second video segment.

[0061] For example, Figure 4 In the embodiment shown, the second duration can be 1.5 seconds. When the user clicks the shooting control, the electronic device can determine that the third video segment is video segment 2. If video segment 2 has been recorded for 1.5 seconds, the electronic device can determine that video segment 2 is the second video segment.

[0062] In this way, the electronic device can accurately and quickly determine the second video segment based on the duration of the third video segment, without having to cut or splice multiple video segments in a preset storage space, thereby improving the efficiency of determining the second video segment.

[0063] Case 2: the duration of the third video segment is less than the first threshold.

[0064] If the duration of the third video segment is less than the first threshold, the third video segment and the video segment recorded before the third video segment are determined as the second video segment. For example, the first threshold may be the second duration in the embodiment of the present disclosure, wherein the first threshold may be 1.5 seconds. If the duration of the third video segment is less than 1.5 seconds, it means that when the user clicks the shooting control, the previous video segment has not been recorded to 1.5 seconds. Therefore, the duration of the third video segment is insufficient, and the electronic device may determine the third video segment and the previous video segment of the third video segment as the second video segment.

[0065] Next, combine Figure 5 , in this case, the process of determining the second video segment is explained.

[0066] Figure 5 A schematic diagram of a process for determining a second video segment provided by an embodiment of the present disclosure. Figure 5 , including: electronic equipment ( Figure 5 (not shown) video segment 1 and video segment 2 stored in a preset storage space. Among them, the duration of video segment 1 is 1.5 seconds, and the duration of video segment 2 is 0.7 seconds. When video segment 2 is recorded to 0.7 seconds, the user clicks the shooting control, and the electronic device can determine video segment 2 as the third video segment. Since the duration of video segment 2 is less than 1.5 seconds, the electronic device can determine video segment 1 and video segment 2 as the second video segment. In this way, when the duration of video segment 2 is insufficient, the electronic device can crop and splice video segment 1 and video segment 2, and then obtain the video segment before shooting in the live photo, thereby improving the accuracy and flexibility of obtaining live photos and saving system memory.

[0067] S203: Generate a video according to the first video segment and at least one second video segment.

[0068] The video may be a video in a live image, for example, a video before the user presses the capture control and a video after the user presses the capture control.

[0069] The electronic device generates a video according to the first video segment and at least one second video segment, and there are two situations as follows:

[0070] Case 1: The number of the second video segments is 1.

[0071] If the number of the second video segments is 1, the first video segment and the second video segment are spliced ​​to obtain a video. For example, if the number of the second video segments is 1, it means that a video segment before the touch operation has been recorded (that is, the recording duration reaches the second duration), so the electronic device can splice the first video segment and the second video segment to obtain a video in the live image.

[0072] Next, combine Figure 6 , the process of generating a video in this case is explained.

[0073] Figure 6 A schematic diagram of generating a video provided by an embodiment of the present disclosure. Figure 6 , including: electronic equipment ( Figure 6 (not shown) video segment 1, video segment 2 and video segment 3 stored in a preset storage space. Among them, the duration of video segment 1 is 1.5 seconds, the duration of video segment 2 is 1.5 seconds, and the duration of video segment 3 is 2 seconds.

[0074] See also Figure 6 When the recording of video segment 2 ends, the user clicks the shooting control, and the electronic device can continue to record 2 seconds of video segment 3. Since the duration of video segment 2 is the same as the duration of video segment 1, the electronic device can determine video segment 2 as the second video segment, and the electronic device can determine video segment 3 as the first video segment.

[0075] See also Figure 6 , since the number of the second video segments is 1, the electronic device can splice video segments 2 and 3 in the order of recording time to obtain a video of the live image, wherein the video of the live image can include video segments 2 and 3, and the duration of the video in the live image is 3.5 seconds. In this case, the electronic device can quickly obtain the video of the live image, thereby improving the efficiency of generating the live image.

[0076] Case 2: The number of second video segments is greater than one.

[0077] If the number of second video segments is greater than 1, a fourth video segment is intercepted from the plurality of second video segments, and the fourth video segment is spliced ​​with the first video segment to obtain a video. The duration of the fourth video segment may be the second duration, or may be any duration, which is not limited in the embodiment of the present disclosure.

[0078] For example, if the number of second video segments is greater than 1, it means that the video segment recorded by the electronic device before the touch operation is insufficient in length. Therefore, the electronic device can capture a fourth video segment of the second length from multiple second video segments, and splice the fourth video segment with the first video segment to obtain a video of the live image.

[0079] Next, combine Figure 7 , in this case, the process of generating a video is explained.

[0080] Figure 7 A schematic diagram of another method of generating a video provided by an embodiment of the present disclosure. Figure 7 , including: electronic equipment ( Figure 7 (not shown) video segment 1, video segment 2 and video segment 3 stored in a preset storage space. Among them, the duration of video segment 1 is 1.5 seconds, the duration of video segment 2 is 1 second, and the duration of video segment 3 is 2 seconds.

[0081] See also Figure 7 When video segment 2 is recorded to 1 second, the user clicks the shooting control, and the electronic device stops recording video segment 2 and records 2-second video segment 3. Since the duration of video segment 2 is shorter than the duration of video segment 1, the electronic device can determine video segment 1 and video segment 2 as the second video segment, and the electronic device can determine video segment 3 as the first video segment.

[0082] See also Figure 7 Since the number of the second video segments is 2, the electronic device can capture a 1.5-second video segment 4 from video segments 1 and 2, wherein the electronic device can splice the last 0.5-second video segment of video segment 1 with video segment 2 to obtain video segment 4.

[0083] See also Figure 7 , the electronic device can splice video segment 4 and video segment 3 in time sequence to obtain a video of the live image, which can include video segment 4 and video segment 3, and the duration of the video of the live image can be 3.5 seconds. In this case, the electronic device can accurately intercept a sufficiently long video segment from the multiple second video segments, and then accurately determine the video in the live image, thereby improving the accuracy of the video.

[0084] It should be noted that in the embodiment of the present disclosure, the length of the generated video can be any length and the embodiment of the present disclosure is not limited to this. The length of the video can determine the length of the first video segment and the length of the fourth video segment. For example, each video segment in the preset storage space is 0.5 seconds. If the user needs 2 seconds of video before pressing the shooting control, the electronic device can obtain at least 4 video segments before pressing the shooting control. If the user needs 4 seconds of video after pressing the shooting control, the electronic device can continue to record 4 seconds of video after the user presses the shooting control.

[0085] Optionally, after the electronic device generates a video based on the first video segment and at least one second video segment, the video processing method further includes: acquiring a captured image associated with the touch operation, and determining a live image based on the captured image and the video. For example, after the electronic device acquires the video, the electronic device may use the captured image as the cover of the video to obtain the live image.

[0086] It should be noted that the electronic device may also use any image in the video as the cover of the live image, which is not limited in the embodiments of the present disclosure.

[0087] The disclosed embodiment provides a video processing method, in response to a touch operation on a shooting control in a shooting page, a first video segment is recorded, and a third video segment is determined from a plurality of video segments in a preset storage space, the electronic device can obtain the duration of the third video segment, if the duration of the third video segment is equal to a first threshold, the third video segment is determined as a second video segment, if the duration of the third video segment is less than the first threshold, the third video segment and the video segment recorded before the third video segment are determined as a second video segment, the electronic device can generate a video based on the first video segment and at least one second video segment. In this way, since the electronic device adopts a segmented recording mode of video segments, and before the touch operation, the preset storage space can only store one or more recently recorded video segments, therefore, the memory overflow caused by a long opening time of the shooting page can be avoided, and after the electronic device records a video segment, the video segment can be encoded without storing the original picture data in the preset storage space, thereby saving the memory resources of the electronic device.

[0088] exist Figure 2 Based on the embodiment shown in the figure, before the electronic device obtains at least one second video in the preset storage space, the above video processing method further includes a method for storing multiple video segments in the preset storage space. Figure 8 , a method for storing multiple video segments in a preset storage space is described.

[0089] Figure 8 A schematic diagram of a method for storing multiple video segments provided by an embodiment of the present disclosure. Figure 8 The method flow includes:

[0090] S801. Obtain the remaining memory of the electronic device.

[0091] It should be noted that the electronic device can obtain the remaining memory of the electronic device based on any feasible implementation method (such as by obtaining device storage information, etc.), and the embodiments of the present disclosure are not limited to this.

[0092] S802: Determine the duration of the video segment stored in the preset storage space according to the remaining memory of the electronic device.

[0093] Optionally, the electronic device may determine the duration of the video segment stored in the preset storage space based on a preset corresponding relationship. The preset corresponding relationship may include at least one memory and the duration corresponding to each memory. For example, the preset corresponding relationship may be as shown in Table 1:

[0094] Table 1

[0095] Memory Duration Memory 1 Duration 1 Memory 2 Duration 2 Memory 3 Duration 3 …… ……

[0096] It should be noted that Table 1 is only an example of the preset corresponding relationship, and is not a limitation on the preset corresponding relationship.

[0097] For example, if the remaining memory of the electronic device is memory 1, the electronic device can determine that the duration of the video segment stored in the preset storage space is duration 1; if the remaining memory of the electronic device is memory 2, the electronic device can determine that the duration of the video segment stored in the preset storage space is duration 2; if the remaining memory of the electronic device is memory 3, the electronic device can determine that the duration of the video segment stored in the preset storage space is duration 3.

[0098] Optionally, the remaining memory of the electronic device is proportional to the duration of the video segment stored in the preset storage space. For example, the larger the remaining memory of the electronic device, the longer the duration of the video segment stored in the preset storage space by the electronic device. In this way, the memory of the electronic device can be effectively utilized, which not only improves the flexibility of video segment storage, but also improves the utilization rate of the memory.

[0099] S803: Record a video segment according to the duration of the video segment stored in the preset storage space.

[0100] For example, if the duration of the video segment stored in the preset storage space is 0.5 seconds, the electronic device can record a 0.5 second video segment; if the duration of the video segment stored in the preset storage space is 1.5 seconds, the electronic device can record a 1.5 second video segment.

[0101] S804: Store the video segment in a preset storage space.

[0102] Optionally, the electronic device may store multiple video segments in a preset storage space based on the following feasible implementation method: obtaining the number of video segments stored in the preset storage space, and if the number of stored video segments is greater than or equal to a second threshold, deleting the earliest recorded video segment in the preset storage space.

[0103] It should be noted that the second threshold may be the number of the latest video segments stored in the preset storage space, or may be an arbitrarily set value, which is not limited in the embodiments of the present disclosure.

[0104] Among them, the electronic device can record and store multiple video segments before the user presses the shooting control. When there are many video segments stored in the preset storage space, the electronic device can delete the earliest recorded video segment, thereby saving the preset storage space. For example, the electronic device has recorded two 1.5-second video segments before the user presses the shooting control. When the electronic device starts recording the third video segment, the electronic device can delete the first 1.5-second video segment in the preset storage space, thereby saving memory controls.

[0105] Next, combine Fig. 9 , a process of storing multiple video segments in an electronic device is described.

[0106] Fig. 9 A schematic diagram of an electronic device storing multiple video segments provided by an embodiment of the present disclosure. Fig. 9 , including: a preset storage space. The preset storage space may include video segment 1 and video segment 2. The video segment 1 and video segment 2 are both the video segments of the electronic device ( Fig. 9 The video segments recorded by the present invention are as follows (not shown), the duration of video segment 1 is 1.5 seconds, the duration of video segment 2 is 1.5 seconds, and video segment 1 is the video segment to be deleted.

[0107] See also Fig. 9 When the electronic device starts recording the next video segment of video segment 2, the electronic device can delete video segment 1, and the preset storage space can include video segment 1. When the electronic device starts recording the video segment to be recorded, the electronic device can store the recorded content in the preset storage space. In this way, the electronic device can store at most 2 video segments in the preset storage space based on the segmented pre-buffering mechanism, thereby saving the memory of the electronic device.

[0108] The disclosed embodiment provides a method for storing multiple video segments, which includes obtaining the remaining memory of an electronic device, determining the duration of the video segments stored in a preset storage space according to the remaining memory of the electronic device, recording multiple video segments according to the duration of the video segments stored in the preset storage space, and storing the multiple video segments in the preset storage space. In this way, when the number of video segments stored in the preset storage space is greater than or equal to a second threshold, the electronic device can delete the earliest recorded video segment in the preset storage space, thereby saving the memory of the electronic device and avoiding the problem of memory overflow.

[0109] Fig.10 A schematic diagram of the structure of a video processing device provided by an embodiment of the present disclosure. Fig.10 The video processing device 100 includes a recording module 101, an acquisition module 102 and a generation module 103, wherein:

[0110] The recording module 101 is used to record a first video segment in response to a touch operation on a shooting control in a shooting page;

[0111] The acquisition module 102 is used to acquire at least one second video segment in a preset storage space, where the second video segment is a video segment recorded before the touch operation, and before the touch operation, the preset storage space is used to store one or more recently recorded video segments;

[0112] The generating module 103 is configured to generate a video according to the first video segment and the at least one second video segment.

[0113] According to one or more embodiments of the present disclosure, the acquisition module 102 is specifically used for:

[0114] Determine a third video segment from the multiple video segments in the preset storage space, where the third video segment is the last video segment recorded before the touch operation;

[0115] Obtaining the duration of the third video segment;

[0116] At least one second video segment is acquired in the preset storage space according to the duration of the third video segment.

[0117] According to one or more embodiments of the present disclosure, the acquisition module 102 is specifically used for:

[0118] If the duration of the third video segment is equal to the first threshold, determining the third video segment as the second video segment;

[0119] If the duration of the third video segment is less than the first threshold, the third video segment and a video segment recorded before the third video segment are determined as the second video segment.

[0120] According to one or more embodiments of the present disclosure, the duration of the first video segment is a first duration, the duration of the multiple video segments in the preset storage space except the third video segment is a second duration, and the duration of the third video segment is less than or equal to the second duration.

[0121] According to one or more embodiments of the present disclosure, the generating module 103 is specifically used for:

[0122] If the number of the second video segments is 1, concatenating the first video segment and the second video segment to obtain the video;

[0123] If the number of the second video segments is greater than 1, a fourth video segment is intercepted from the plurality of second video segments, and the fourth video segment is spliced ​​with the first video segment to obtain the video.

[0124] According to one or more embodiments of the present disclosure, the generating module 103 is further configured to:

[0125] Acquiring a captured image associated with the touch operation;

[0126] A live image is determined according to the captured image and the video.

[0127] The video processing device provided in the embodiment of the present disclosure may be used to execute the technical solution of the above method embodiment, and its implementation principle and technical effect are similar, which will not be described in detail in this embodiment.

[0128] Fig.11 A schematic diagram of the structure of another video processing device provided by an embodiment of the present disclosure. Fig.10 Based on the examples shown, see Fig.11 The video processing device 100 further includes a storage module 104, wherein the storage module 104 is used for:

[0129] Get the remaining memory of the electronic device;

[0130] Determining the duration of the video segment stored in the preset storage space according to the remaining memory of the electronic device;

[0131] According to the duration of the video segment stored in the preset storage space, the video segment is recorded and stored in the preset storage space.

[0132] According to one or more embodiments of the present disclosure, the storage module 104 is specifically used for:

[0133] Obtaining the number of video segments stored in the preset storage space;

[0134] If the number of the stored video segments is greater than or equal to a second threshold, the earliest recorded video segment is deleted from the preset storage space.

[0135] The video processing device provided in the embodiment of the present disclosure may be used to execute the technical solution of the above method embodiment, and its implementation principle and technical effect are similar, which will not be described in detail in this embodiment.

[0136] Fig.12 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Fig.12 , which shows a schematic diagram of the structure of an electronic device 1200 suitable for implementing the embodiment of the present disclosure. The electronic device may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.12 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0137] like Fig.12 As shown, the electronic device 1200 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1201, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1202 or a program loaded from a storage device 1208 to a random access memory (RAM) 1203. Various programs and data required for the operation of the electronic device 1200 are also stored in the RAM 1203. The processing device 1201, the ROM 1202, and the RAM 1203 are connected to each other via a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.

[0138] Typically, the following devices may be connected to the I / O interface 1205: input devices 1206 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 1207 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1208 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1209. The communication device 1209 may allow the electronic device 1200 to communicate with other devices wirelessly or by wire to exchange data. Although Fig.12 The electronic device 1200 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0139] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 1209, or installed from the storage device 1208, or installed from the ROM 1202. When the computer program is executed by the processing device 1201, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0140] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0141] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0142] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.

[0143] The embodiments of the present disclosure provide a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the video processing methods that may be involved in the above embodiments are implemented.

[0144] The embodiments of the present disclosure provide a computer program product, including a computer program. When the computer program is executed by a processor, the video processing method that may be involved in the above embodiments is implemented.

[0145] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0146] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0147] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".

[0148] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0149] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0150] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0151] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0152] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0153] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can independently choose whether to provide personal information to software or hardware such as an electronic device, application, server or storage medium that performs the operation of the technical solution of the present disclosure based on the prompt message. As an optional but non-limiting implementation method, in response to receiving an active request from a user, the method of sending a prompt message to the user can be, for example, a pop-up window, and the prompt message can be presented in text in the pop-up window. In addition, the pop-up window can also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0154] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0155] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of the relevant laws and regulations. The data may include information, parameters and messages, such as flow switching indication information.

[0156] In a first aspect, according to one or more embodiments of the present disclosure, a video processing method is provided, the method comprising:

[0157] In response to a touch operation on a capture control in a capture page, recording a first video segment;

[0158] Acquire at least one second video segment in a preset storage space, where the second video segment is a video segment recorded before the touch operation, and before the touch operation, the preset storage space is used to store one or more newly recorded video segments;

[0159] A video is generated based on the first video segment and the at least one second video segment.

[0160] According to one or more embodiments of the present disclosure, acquiring at least one second video segment in a preset storage space includes:

[0161] Determine a third video segment from the multiple video segments in the preset storage space, where the third video segment is the last video segment recorded before the touch operation;

[0162] Obtaining the duration of the third video segment;

[0163] At least one second video segment is acquired in the preset storage space according to the duration of the third video segment.

[0164] According to one or more embodiments of the present disclosure, acquiring at least one second video segment in the preset storage space according to the duration of the third video segment includes:

[0165] If the duration of the third video segment is equal to the first threshold, determining the third video segment as the second video segment;

[0166] If the duration of the third video segment is less than the first threshold, the third video segment and a video segment recorded before the third video segment are determined as the second video segment.

[0167] According to one or more embodiments of the present disclosure, the duration of the first video segment is a first duration, the duration of the multiple video segments in the preset storage space except the third video segment is a second duration, and the duration of the third video segment is less than or equal to the second duration.

[0168] According to one or more embodiments of the present disclosure, generating a video according to the first video segment and the at least one second video segment includes:

[0169] If the number of the second video segments is 1, concatenating the first video segment and the second video segment to obtain the video;

[0170] If the number of the second video segments is greater than 1, a fourth video segment is intercepted from the plurality of second video segments, and the fourth video segment is spliced ​​with the first video segment to obtain the video.

[0171] According to one or more embodiments of the present disclosure, after generating a video according to the first video segment and the at least one second video segment, the method further includes:

[0172] Acquiring a captured image associated with the touch operation;

[0173] A live image is determined according to the captured image and the video.

[0174] According to one or more embodiments of the present disclosure, before acquiring at least one second video segment in the preset storage space, the method further includes:

[0175] Get the remaining memory of the electronic device;

[0176] Determining the duration of the video segment stored in the preset storage space according to the remaining memory of the electronic device;

[0177] According to the duration of the video segment stored in the preset storage space, the video segment is recorded and stored in the preset storage space.

[0178] According to one or more embodiments of the present disclosure, storing the video segment in the preset storage space includes:

[0179] Obtaining the number of video segments stored in the preset storage space;

[0180] If the number of the stored video segments is greater than or equal to a second threshold, the earliest recorded video segment is deleted from the preset storage space.

[0181] In a second aspect, one or more embodiments of the present disclosure provide a video processing device, the video processing device comprising a recording module, an acquisition module and a generation module, wherein:

[0182] The recording module is used to record a first video segment in response to a touch operation on a shooting control in a shooting page;

[0183] The acquisition module is used to acquire at least one second video segment in a preset storage space, where the second video segment is a video segment recorded before the touch operation, and before the touch operation, the preset storage space is used to store one or more recently recorded video segments;

[0184] The generating module is used to generate a video according to the first video segment and the at least one second video segment.

[0185] According to one or more embodiments of the present disclosure, the acquisition module is specifically used to:

[0186] Determine a third video segment from the multiple video segments in the preset storage space, where the third video segment is the last video segment recorded before the touch operation;

[0187] Obtaining the duration of the third video segment;

[0188] At least one second video segment is acquired in the preset storage space according to the duration of the third video segment.

[0189] According to one or more embodiments of the present disclosure, the acquisition module is specifically used to:

[0190] If the duration of the third video segment is equal to the first threshold, determining the third video segment as the second video segment;

[0191] If the duration of the third video segment is less than the first threshold, the third video segment and a video segment recorded before the third video segment are determined as the second video segment.

[0192] According to one or more embodiments of the present disclosure, the duration of the first video segment is a first duration, the duration of the multiple video segments in the preset storage space except the third video segment is a second duration, and the duration of the third video segment is less than or equal to the second duration.

[0193] According to one or more embodiments of the present disclosure, the generating module is specifically used for:

[0194] If the number of the second video segments is 1, concatenating the first video segment and the second video segment to obtain the video;

[0195] If the number of the second video segments is greater than 1, a fourth video segment is intercepted from the plurality of second video segments, and the fourth video segment is spliced ​​with the first video segment to obtain the video.

[0196] According to one or more embodiments of the present disclosure, the generating module is further used for:

[0197] Acquiring a captured image associated with the touch operation;

[0198] A live image is determined according to the captured image and the video.

[0199] According to one or more embodiments of the present disclosure, the video processing device further includes a storage module, wherein the storage module is used to:

[0200] Get the remaining memory of the electronic device;

[0201] Determining the duration of the video segment stored in the preset storage space according to the remaining memory of the electronic device;

[0202] According to the duration of the video segment stored in the preset storage space, the video segment is recorded and stored in the preset storage space.

[0203] According to one or more embodiments of the present disclosure, the storage module is specifically used for:

[0204] Obtaining the number of video segments stored in the preset storage space;

[0205] If the number of the stored video segments is greater than or equal to a second threshold, the earliest recorded video segment is deleted from the preset storage space.

[0206] The video processing device provided in the embodiment of the present disclosure may be used to execute the technical solution of the above method embodiment, and its implementation principle and technical effect are similar, which will not be described in detail in this embodiment.

[0207] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: a processor and a memory;

[0208] The memory stores computer-executable instructions;

[0209] The processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the video processing method as described in the first aspect and various possible aspects of the first aspect.

[0210] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the video processing method as described in the first aspect and various possible aspects of the first aspect are implemented.

[0211] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the video processing method as described in the first aspect and various possible aspects of the first aspect.

[0212] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0213] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0214] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A video processing method, characterized in that: include: In response to a touch operation on a capture control in a capture page, recording a first video segment; Acquire at least one second video segment in a preset storage space, where the second video segment is a video segment recorded before the touch operation, and before the touch operation, the preset storage space is used to store one or more newly recorded video segments; A video is generated based on the first video segment and the at least one second video segment.

2. The method according to claim 1, characterized in that The acquiring at least one second video segment in the preset storage space includes: Determine a third video segment from the multiple video segments in the preset storage space, where the third video segment is the last video segment recorded before the touch operation; Obtaining the duration of the third video segment; At least one second video segment is acquired in the preset storage space according to the duration of the third video segment.

3. The method according to claim 2, characterized in that The acquiring at least one second video segment in the preset storage space according to the duration of the third video segment includes: If the duration of the third video segment is equal to the first threshold, determining the third video segment as the second video segment; If the duration of the third video segment is less than the first threshold, the third video segment and a video segment recorded before the third video segment are determined as the second video segment.

4. The method according to claim 3, characterized in that The duration of the first video segment is a first duration, the duration of the multiple video segments in the preset storage space except the third video segment is a second duration, and the duration of the third video segment is less than or equal to the second duration.

5. The method according to any one of claims 1 to 4, characterized in that: Generating a video according to the first video segment and the at least one second video segment includes: If the number of the second video segments is 1, concatenating the first video segment and the second video segment to obtain the video; If the number of the second video segments is greater than 1, a fourth video segment is intercepted from the plurality of second video segments, and the fourth video segment is spliced ​​with the first video segment to obtain the video.

6. The method according to any one of claims 1 to 4, characterized in that: After generating the video according to the first video segment and the at least one second video segment, the method further includes: Acquiring a captured image associated with the touch operation; A live image is determined according to the captured image and the video.

7. The method according to any one of claims 1 to 4, characterized in that: Before acquiring at least one second video segment in the preset storage space, the method further includes: Get the remaining memory of the electronic device; Determining the duration of the video segment stored in the preset storage space according to the remaining memory of the electronic device; According to the duration of the video segment stored in the preset storage space, a video segment is recorded and stored in the preset storage space.

8. The method according to claim 7, characterized in that The storing of the video segments in the preset storage space includes: Obtaining the number of video segments stored in the preset storage space; If the number of the stored video segments is greater than or equal to a second threshold, the earliest recorded video segment is deleted from the preset storage space.

9. A video processing device, characterized in that: It includes recording module, acquisition module and generation module, among which: The recording module is used to record a first video segment in response to a touch operation on a shooting control in a shooting page; The acquisition module is used to acquire at least one second video segment in a preset storage space, where the second video segment is a video segment recorded before the touch operation, and before the touch operation, the preset storage space is used to store one or more recently recorded video segments; The generating module is used to generate a video according to the first video segment and the at least one second video segment.

10. An electronic device, characterized in that: include: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor executes the video processing method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the processor executes the computer-executable instructions, the video processing method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Information display method and device

    CN104850487A

  • Multi-video clip merging method and multi-video clip merging device

    CN104980665A

  • Video generation method and device, and mobile terminal

    CN106210541A

  • Terminal and method for obtaining video

    CN106303290A

Cited By

  • Monitoring video pre-recording method, electronic equipment and storage medium

    CN120128667A

  • Dynamic image generation method and device, computer equipment and program product

    CN120751209A

  • Video processing method and apparatus, and electronic device

    EP4773587A1

  • Video processing method and apparatus, and electronic device

    WO2025045187A1