Slow motion video recording method and device

By allowing users to accurately set the start and end frames of slow motion video segments during the recording process, the problem of inaccurate position of slow motion video segments in the prior art is solved, and accurate capture of exciting moments in slow motion and personalized needs are achieved.

CN114520886BActive Publication Date: 2025-04-04HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011296546.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-18
Publication Date
2025-04-04
Estimated Expiration
2040-11-18

AI Technical Summary

Technical Problem

In the existing slow motion recording scheme, the starting position and end position of the slow motion video segment automatically judged by electronic devices are inaccurate, making it difficult to meet users' personalized needs for exciting moments in slow motion.

Method used

By displaying the image frames to be selected during the recording process, the user is allowed to accurately set the start and end frames of the slow motion video segment, and generate the slow motion video segment in the target video so that it corresponds to the desired position of the user.

Benefits of technology

The generated slow motion video segment can accurately correspond to the exciting moments of slow motion and meet the personalized needs of users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114520886B_ABST
    Figure CN114520886B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a slow-motion recording method and device, which relates to the field of electronic technology. The user can accurately set the starting position and ending position of the slow-motion video segment during the recording process, so that the generated slow-motion video segment can accurately correspond to the slow-motion wonderful moments, and can also meet the user's personalized needs for the slow-motion wonderful moments. The scheme includes: the electronic device turns on the recording function; after detecting the user's recording operation, if a slow motion trigger is detected, the image frame to be selected is displayed on the frame selection interface, and the image frame to be selected includes multiple frames of images; the starting frame and the ending frame set by the user based on the image frame to be selected are obtained; the target video is generated, and the target video includes a slow-motion video segment, the slow-motion video segment corresponds to the starting frame and the ending frame, and the recording frame rate of the slow-motion video segment is higher than the encoding frame rate of the slow-motion video segment. The embodiment of the present application is used to record slow-motion video.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of electronic technology, and in particular to a slow-motion video recording method and device. Background Art

[0002] With the development of electronic technology, the recording function of electronic devices such as mobile phones is becoming more and more powerful. For example, slow motion recording can capture the slow motion details of an object in high-speed motion and record fleeting wonderful moments. In the existing slow motion recording scheme, the electronic device determines the start / end time of the motion process and generates a slow motion video segment based on the start / end time. The slow motion video segment can facilitate users to watch slow motion wonderful moments at a slow speed.

[0003] Among them, the start / end time of the slow motion determined by the electronic device may be inaccurate, and the starting and ending positions of the generated slow-motion video segments are usually deviated from the user's expectations, making it difficult to meet the user's personalized needs for slow-motion wonderful moments. Summary of the invention

[0004] The embodiments of the present application provide a slow-motion recording method and device, which enable the user to accurately set the starting position and ending position of the slow-motion video segment during the recording process, so that the generated slow-motion video segment can accurately correspond to the slow-motion highlights, and can also meet the user's personalized needs for the slow-motion highlights.

[0005] In order to achieve the above purpose, the embodiment of the present application adopts the following technical solution:

[0006] On the one hand, an embodiment of the present application provides a recording method, which is applied to an electronic device, and the method includes: the electronic device turns on the recording function. After the electronic device detects the user's recording operation, if a slow motion trigger is detected, the selected image frame is displayed on the frame selection interface, and the selected image frame includes multiple frames of images. The electronic device obtains the start frame and the end frame set by the user based on the selected image frame. The electronic device generates a target video, and the target video includes a slow-motion video segment, the slow-motion video segment corresponds to the start frame and the end frame, and the recording frame rate of the slow-motion video segment is higher than the encoding frame rate of the slow-motion video segment.

[0007] In this solution, the user can accurately select the start frame and the end frame based on the candidate image frames displayed by the electronic device during the video recording process, so that the electronic device generates a slow-motion video segment in the target video according to the start frame and the end frame, so that the generated slow-motion video segment can accurately correspond to the slow-motion wonderful moment, and can also meet the user's personalized needs for the slow-motion wonderful moment. The recording frame rate of the slow-motion video segment is higher than the encoding frame rate of the slow-motion video segment, so that the user can watch the slow-motion wonderful process slowly, carefully, and for a long time through the slow-motion video segment.

[0008] In a possible implementation, the method further includes: after the electronic device detects the user's recording operation, the electronic device captures image frames at a first frame rate and caches a first image frame set, wherein the first image frame set includes the image frames within the T0 duration that were recently captured. After the electronic device detects a slow motion trigger, the electronic device captures image frames with a duration of T1 at the first frame rate and caches a second image frame set, wherein the second image frame set includes image frames with a duration of T1 that were captured at the first frame rate. The image frames to be selected come from the first image frame set and the second image frame set.

[0009] That is to say, the electronic device can cache image frames captured at the first frame rate within the time period T0 before the slow motion is triggered, and image frames captured at the first frame rate within the time period T1 after the slow motion is triggered, and display the image frames to be selected based on the cached image frames of the first frame rate, so that the user can select the starting frame and the ending frame based on the image frames to be selected.

[0010] In another possible implementation manner, the image frame to be selected is obtained by sampling image frames in the first image frame set and the second image frame set.

[0011] In this way, the number of image frames to be selected is small, which makes it convenient for the user to select the start frame and the end frame.

[0012] In another possible implementation, the number of image frames to be selected is positively correlated with the slow motion speed of the slow motion video segment; or, the frame sampling interval for obtaining the image frames to be selected from the image frames in the first image frame set and the second image frame set is positively correlated with the slow motion speed of the slow motion video segment.

[0013] That is to say, the larger the slow motion speed, the more frames to be selected; the smaller the slow motion speed, the fewer frames to be selected. The larger the slow motion speed, the larger the frame extraction interval for extracting frames to obtain the selected image frames; the smaller the slow motion speed, the smaller the frame extraction interval for extracting frames to obtain the selected image frames.

[0014] In another possible implementation, the slow-motion video segment uses the encoding frame rate to obtain the target image frame between the start frame and the end frame. The target image frame is an image frame between the start frame and the end frame in the first image frame set and the second image frame set, and the video frame rate is equal to the first frame rate. Alternatively, the target image frame is an image frame of the first frame rate between the start frame and the end frame in the first image frame set and the second image frame set, and the image frame of the video frame rate is obtained after interpolation.

[0015] That is to say, the target image frame is obtained according to the start frame and the end frame, and the target image frame is an image frame with a high frame rate. The slow-motion video segment adopts a low encoding frame rate, and obtains the target image frame with a high frame rate by video encoding, so that the user can watch the wonderful slow-motion process slowly, carefully and for a long time through the slow-motion video segment.

[0016] In another possible implementation, the method also includes: after the electronic device detects the user's recording operation, the recorded image is displayed at a second frame rate on the shooting interface, and the recorded image is obtained by extracting image frames according to the first frame rate, and the second frame rate is less than the first frame rate.

[0017] In this solution, during the video recording process, the electronic device captures image frames at a high frame rate and displays the recorded images at a low frame rate, which can reduce the load of image processing and image display and save power consumption of the electronic device.

[0018] In another possible implementation, the video recording frame rate corresponds to the slow-motion speed of the slow-motion video segment.

[0019] That is to say, the electronic device can determine the video frame rate according to the slow motion speed.

[0020] In another possible implementation, the first frame rate is related to a slow-motion speed of the slow-motion video segment.

[0021] That is to say, during the video recording process, the frame rate of the electronic device used to collect image frames can be determined according to the slow motion speed.

[0022] In another possible implementation, the method further includes: if the electronic device detects a slow motion trigger, prompting the user to set a start frame and an end frame on a frame selection interface.

[0023] In this way, the user can select the start frame and the end frame according to the intuitive prompts of the electronic device.

[0024] In another possible implementation, the electronic device determines the start frame and the end frame set by the user based on the image frame to be selected, including: if the electronic device detects that the user performs a first preset operation on a first image frame on the image frame to be selected, determining the first image frame as the start frame. If the electronic device detects that the user performs a second preset operation on a second image frame on the image frame to be selected, determining the second image frame as the end frame.

[0025] In this solution, the electronic device can determine the start frame and end frame set by the user based on the user's preset operation.

[0026] In another possible implementation, an image frame located at a preset position among the image frames to be selected is displayed in large image format on the frame selection interface. The preset position is a middle position of the image frame to be selected or a boundary position of the frame selection interface.

[0027] In this way, the user can clearly view the content information of the image frame through the large picture.

[0028] In another possible implementation, the method further includes: if the electronic device detects a slow motion trigger, displaying a first control and a second control on a frame selection interface. The first control and the second control can slide on the image frame to be selected, the first control is used to set the start frame, and the second control is used to set the end frame. The image frame where the first control or the second control is located is displayed in a large image on the frame selection interface. When the user drags the first control on the image frame to be selected, the image frame where the first control is located is displayed in a large image on the interface. When the user drags the second control on the image frame to be selected, the image frame where the second control is located is displayed in a large image on the interface. The electronic device determines the start frame and the end frame set by the user based on the image frame to be selected, including: the electronic device determines that the image frame where the first control is located in the image frame to be selected is the start frame. The electronic device determines that the image frame where the second control is located in the image frame to be selected is the end frame.

[0029] In this solution, the user can set the start frame and the end frame through the first control and the second control respectively, and the electronic device can display the image frame of the location of the first control or the second control currently targeted by the user in the form of a large image.

[0030] In another possible implementation, the image frame to be selected is obtained by extracting frames from the image frames of the first image frame set and the second image frame set at a first interval. The electronic device determines the start frame and the end frame set by the user based on the image frame to be selected, including: the electronic device determines the reference start frame set by the user based on the image frame to be selected. The electronic device displays a third image frame set on the frame selection interface, the third image frame set includes a reference start frame, and the third image frame set is obtained by extracting frames from the image frames of the first image frame set and the second image frame set at a second interval, and the second interval is smaller than the first interval. The electronic device determines the start frame set by the user based on the third image frame set, and determines the reference end frame set by the user based on the image frame to be selected. The electronic device displays a fourth image frame set on the interface, the fourth image frame set includes a reference end frame, and the fourth image frame set is obtained by extracting frames from the image frames of the first image frame set and the second image frame set at a second interval. The electronic device determines the end frame set by the user based on the fourth image frame set.

[0031] In this scheme, the electronic device can first display the image frames to be selected at large intervals so that the user can coarsely select the reference start frame and the reference end frame; then, the electronic device can display the image frames near the reference start frame and the reference end frame at small intervals so that the user can accurately select the start frame and the end frame.

[0032] In another possible implementation, the image frames to be selected include a fifth image frame set and a sixth image frame set, the fifth image frame set includes a recommended start frame and adjacent multiple image frames, and the sixth image frame set includes a recommended end frame and adjacent multiple image frames. The electronic device determines the start frame and the end frame set by the user based on the image frames to be selected, including: the electronic device determines the start frame set by the user based on the fifth image frame set and the recommended start frame. The electronic device determines the end frame set by the user based on the sixth image frame set and the recommended end frame.

[0033] In this solution, the electronic device can first automatically determine a relatively accurate recommended start frame and a recommended end frame, and display them to the user; so that the user can accurately select a start frame near the recommended start frame, and accurately select an end frame near the recommended end frame.

[0034] In another possible implementation, the image frame to be selected includes a recommended start frame interval and a recommended end frame interval. The electronic device determines the start frame and the end frame set by the user based on the image frame to be selected, including: the electronic device determines the start frame set by the user based on the recommended start frame interval; the electronic device determines the end frame set by the user based on the recommended end frame interval.

[0035] In this solution, the electronic device can first automatically determine a relatively accurate recommended start frame interval and a recommended end frame interval, and display them to the user; so that the user can accurately select the start frame and the end frame based on the recommended start frame interval and the recommended end frame interval.

[0036] In another possible implementation, the method further includes: after the electronic device detects the user's recording operation, the seventh image frame set is cached, and the seventh image frame set includes image frames of the second frame rate obtained by extracting image frames of the first frame rate before the T0 duration. The target video also includes a first video segment, and the first video segment is obtained by encoding image frames in the seventh image frame set and the eighth image frame set using the encoding frame rate. Among them, the eighth image frame set is an image frame of the second frame rate obtained by extracting image frames of the first frame rate before the start frame in the first image frame set and the second image frame set.

[0037] The first video segment is a normal speed video segment. Thus, when playing the target video, the normal speed first video segment can be played first, and then the slow motion video segment can be played, giving the user a visual impact of switching between fast and slow.

[0038] In another possible implementation, the target video further includes a second video segment, and the second video segment is obtained by encoding the image frames in the ninth image frame set using the encoding frame rate. The ninth image frame set is the image frames of the first frame rate after the end frame in the first image frame set and the second image frame set, and the image frames of the second frame rate are obtained by extracting the frames.

[0039] The first video segment is a normal speed video segment. In this way, when playing the target video, the slow motion video segment can be played first, and then the second video segment at normal speed can be played, giving the user a visual impact of slow-fast switching.

[0040] In another possible implementation, the method further includes: after the video recording function is turned on, the electronic device captures images at a third frame rate, and displays the preview image at the third frame rate on the preview interface, where the third frame rate is lower than the first frame rate.

[0041] That is, in the preview state, the electronic device can capture image frames at a low frame rate and display the preview image.

[0042] On the other hand, an embodiment of the present application provides a shooting device, which is included in an electronic device. The device has the function of realizing the behavior of the electronic device in any of the above aspects and possible designs, so that the electronic device executes the recording method performed by the electronic device in any of the possible designs of the above aspects. The function can be implemented by hardware, or by hardware executing the corresponding software implementation. The hardware or software includes at least one module or unit corresponding to the above function. For example, the device may include an opening unit, a detection unit, a display unit, an acquisition unit, and a generation unit.

[0043] On the other hand, an embodiment of the present application provides an electronic device, comprising: a camera for capturing images; a display screen for displaying an interface; one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions, which, when executed by the electronic device, enable the electronic device to execute a recording method executed by the electronic device in any possible design of the above aspects.

[0044] In another aspect, an embodiment of the present application provides an electronic device, including: one or more processors; and a memory, wherein a code is stored in the memory. When the code is executed by the electronic device, the electronic device executes the video recording method executed by the electronic device in any possible design of the above aspects.

[0045] On the other hand, an embodiment of the present application provides a computer-readable storage medium, including computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes a recording method in any possible design of the above aspects.

[0046] On the other hand, an embodiment of the present application provides a computer program product. When the computer program product is run on a computer, it enables the computer to execute the video recording method executed by the electronic device in any possible design of the above aspects.

[0047] In another aspect, an embodiment of the present application provides a chip system, which is applied to an electronic device. The chip system includes one or more interface circuits and one or more processors; the interface circuit and the processor are interconnected through a line; the interface circuit is used to receive a signal from the memory of the electronic device and send a signal to the processor, the signal including a computer instruction stored in the memory; when the processor executes the computer instruction, the electronic device executes the recording method in any possible design of the above aspects.

[0048] The beneficial effects corresponding to the above-mentioned other aspects can be found in the description of the beneficial effects of the method, which will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0050] Figure 2 A schematic diagram of a slow motion video recording method provided in an embodiment of the present application;

[0051] Figure 3A A set of interface schematic diagrams provided for embodiments of the present application;

[0052] Figure 3B Another set of interface schematic diagrams provided for embodiments of the present application;

[0053] Figure 4 A schematic diagram of an interface provided in an embodiment of the present application;

[0054] Figure 5 A schematic diagram of an image processing process provided in an embodiment of the present application;

[0055] Figure 6 Another interface schematic diagram provided for an embodiment of the present application;

[0056] Figure 7 A schematic diagram of another image processing process provided in an embodiment of the present application;

[0057] Figure 8 A schematic diagram of a cache solution provided in an embodiment of the present application;

[0058] Fig. 9 A schematic diagram of a process for generating a target video provided in an embodiment of the present application;

[0059] Fig.10 Another set of interface schematic diagrams provided for embodiments of the present application;

[0060] Fig.11A Another set of interface schematic diagrams provided for embodiments of the present application;

[0061] Fig. 11B Another set of interface schematic diagrams provided for embodiments of the present application;

[0062] Fig.12 Another set of interface schematic diagrams provided for embodiments of the present application;

[0063] Fig.13 Another set of interface schematic diagrams provided for embodiments of the present application;

[0064] Fig.14 Another set of interface schematic diagrams provided for embodiments of the present application;

[0065] Fig.15 Another interface schematic diagram provided for an embodiment of the present application;

[0066] Fig.16 Another set of interface schematic diagrams provided for embodiments of the present application;

[0067] Fig.17 Another interface schematic diagram provided for an embodiment of the present application;

[0068] Fig.18 A schematic diagram of the structure of a target video provided in an embodiment of the present application;

[0069] Fig.19A A timing diagram of a slow motion video recording method provided in an embodiment of the present application;

[0070] Fig.19B A schematic diagram of the effect of a video frame of a target video playback provided in an embodiment of the present application;

[0071] Fig. 20 A schematic diagram of the structure of another electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0072] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0073] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.

[0074] In the embodiments of the present application, the words "exemplarily" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a specific way.

[0075] Slow motion video can capture the high-speed motion process of an object, capture the motion details that are difficult to see with the naked eye, and record the fleeting wonderful moments. It can also be called high-speed video. For example, slow motion video can record the motion state of a bullet when it flies out of the barrel, the motion process of a football shot, the moment when a water drop splashes when it falls, etc. In the existing slow motion video scheme, the electronic device can automatically determine the start / end time of the motion process through algorithms such as human motion detection algorithms or optical flow motion detection algorithms, and automatically generate a slow motion video segment based on the start / end time. However, the start / end time of the motion process automatically determined by the electronic device is often inaccurate. For example, the user wants to capture the moment when the bullet is ejected from the barrel, but the change range of the picture when the bullet is ejected from the barrel is not large. It is difficult for the electronic device to accurately capture the start time of the bullet ejecting from the barrel through the optical flow motion detection algorithm. The starting position and end position of the slow motion video segment automatically generated by the electronic device based on the start / end time are also usually deviated from the user's expectations, and it is difficult to meet the user's personalized needs for slow motion wonderful moments.

[0076] The embodiment of the present application provides a slow motion video recording method, which can be applied to electronic devices, and can allow users to accurately set the start position and end position of a slow motion video segment during the video recording process, so that the generated slow motion video segment can accurately correspond to the captured slow motion wonderful moment, and can also meet the user's personalized needs for slow motion wonderful moments. Among them, the slow motion video segment has a high recording frame rate, and a low encoding frame rate and playback frame rate, which can facilitate users to slowly and carefully watch and review the slow motion wonderful moments of an object.

[0077] For example, the electronic device may be a mobile terminal such as a mobile phone, a tablet computer, a wearable device (such as a smart watch), a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), or may be a professional camera or other device. The embodiments of the present application do not impose any restrictions on the specific type of the electronic device.

[0078] For example, Figure 1 A schematic diagram of the structure of the electronic device 100 is shown. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0079] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0080] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0081] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0082] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0083] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0084] In an embodiment of the present application, the display screen 194 can be used to display interface contents such as a preview interface and a shooting interface in a slow motion video recording scene. The display screen 194 is also used to display high frame rate image frames cached during the slow motion video recording process on the shooting interface, so that the user can select the starting position and the ending position of the slow motion video segment.

[0085] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0086] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.

[0087] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0088] In an embodiment of the present application, the camera 193 may include one or more of the following cameras: a telephoto camera, a wide-angle camera, an ultra-wide-angle camera, a zoom camera, or a depth camera. Among them, the telephoto camera has a small shooting range and is suitable for shooting distant objects; the wide-angle camera has a larger shooting range; the ultra-wide-angle camera has a larger shooting range than the wide-angle camera and is suitable for shooting panoramic and other large-screen scenes. The depth camera can be used to measure the object distance of the object to be photographed, that is, to measure the depth information of the object to be photographed, for example, it may include a three-dimensional (3D) depth camera, a time of flight (TOF) depth camera, or a binocular depth camera. The camera 193 may include a front camera and / or a rear camera.

[0089] In an embodiment of the present application, the camera 193 can be used to capture images in a slow-motion video recording scene.

[0090] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0091] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0092] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0093] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), a double data rate synchronous dynamic random-access memory (DDR SDRAM), etc.

[0094] In an embodiment of the present application, the internal memory 121 can be used to cache high frame rate image frames within a preset duration during the slow motion recording process. The processor 110 generates a slow motion video segment according to the start position and end position accurately set by the user during the slow motion recording process by running the instructions stored in the internal memory 121, thereby meeting the user's personalized needs for slow motion wonderful moments.

[0095] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0096] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.

[0097] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0098] In an embodiment of the present application, the camera 193 can be used to capture images in a slow-motion recording scenario; the internal memory 121 can be used to cache high-frame rate image frames within a preset time length during the slow-motion recording process; the display screen 194 can be used to display a preview interface or a shooting interface in a slow-motion recording scenario, and is also used to display the high-frame rate image frames cached during the slow-motion recording process on the shooting interface, so that the user can select the starting position and the ending position of the slow-motion video segment from the high-frame rate image frames; the processor 110 runs the instructions stored in the internal memory 121, so that the user can accurately set the starting position and the ending position of the slow-motion video segment during the recording process, thereby meeting the user's personalized needs for slow-motion wonderful moments.

[0099] The following will be based on electronic equipment Figure 1 Taking the mobile phone with the structure shown as an example, the slow motion video recording method provided in the embodiment of the present application is explained.

[0100] In a slow-motion recording method provided in an embodiment of the present application, a mobile phone can first turn on the recording function. Then, after the mobile phone detects the user's recording operation, if a slow motion trigger is detected, a to-be-selected image frame is displayed on the frame selection interface, and the to-be-selected image frame includes multiple frames of images. Then, the mobile phone can obtain the start frame and the end frame set by the user based on the to-be-selected image frame. Then, the mobile phone can generate a target video, which includes a slow-motion video segment, which corresponds to the start frame and the end frame, and the recording frame rate of the slow-motion video segment is higher than the encoding frame rate of the slow-motion video segment.

[0101] The present application also provides another slow motion video recording method. Figure 2 , the method comprising:

[0102] 201. The mobile phone starts the video recording function.

[0103] In an embodiment of the present application, when a user wants to perform slow motion video recording, the user can activate the video recording function of the mobile phone.

[0104] In some embodiments, the mobile phone may have multiple recording functions, and when the user wants to perform slow motion recording, the mobile phone may activate the slow motion recording function.

[0105] For example, the mobile phone can start the camera application, or start other applications with photo or video recording functions (such as AR applications such as TikTok or Hetu cyberverse), and then start the slow motion video recording function of these applications.

[0106] For example, the mobile phone detects that the user clicks Figure 3A After the camera application icon 301 shown in (a) is operated, the photo taking function is started and the following is displayed: Figure 3A The preview interface shown in (b) in the figure. The phone detects that the user clicks Figure 3A After the operation of the control 302 shown in (b) in FIG. Figure 3A As shown in (c) in the figure, start the slow motion recording function.

[0107] For example, the mobile phone detects that the user clicks Figure 3A After the operation of the control 303 shown in (b) in FIG. Figure 3A The interface shown in (d) in FIG. 3 is as follows; after the mobile phone detects that the user clicks the control 304, Figure 3A As shown in (c) in the figure, start the slow motion recording function.

[0108] For further example, see Figure 3B , the phone detects that the user clicks Figure 3B After the operation of the control 305 shown in (a) in Figure 3B The normal video mode is entered as shown in (b) in FIG. The preview interface of the normal video mode includes a slow motion speed control 306. When the user selects a slow motion speed greater than 1X, the mobile phone starts the slow motion video function. For example, Figure 3B As shown in (c), after the mobile phone detects that the user has selected a slow motion speed of 32X through the slow motion speed control 306, the slow motion recording function is activated. The slow motion speed kX indicates that the recording frame rate of the slow motion video segment is k times the preset reference recording frame rate, and k is a positive integer. For example, the reference recording frame rate can be a recording frame rate commonly used in the normal recording mode, such as 30fps or 25fps. The recording frame rate of the slow motion video segment is the encoding frame rate of the slow motion video segment.

[0109] As another example, when the mobile phone is displaying the desktop or other non-camera application interface, after detecting the user's voice command to enter the slow-motion recording mode, the slow-motion recording function is activated.

[0110] It should be noted that the mobile phone can also start the slow-motion recording function in response to other user touch operations, voice commands or quick gestures, and the embodiment of the present application does not limit the specific operation of triggering the mobile phone to start the slow-motion recording function.

[0111] In some embodiments, after the slow motion video recording function is activated, the mobile phone uses the slow motion video recording method provided in the following embodiments to record the target video, wherein the target video includes a slow motion video segment, and the slow motion video segment is used to record the slow motion wonderful moments.

[0112] In other embodiments, the slow motion recording method provided in the following embodiments is used to record the target video only when the slow motion recording function is activated and the slow motion speed set by the user is greater than or equal to the preset speed 1. For example, the preset speed 1 is 8X, and when the mobile phone determines that the slow motion speed set by the user is greater than or equal to 8X, the slow motion recording method provided in the following embodiments is used to record the target video.

[0113] In other embodiments, after the mobile phone starts the slow motion video recording function, it can enter the slow motion video recording mode, so as to record the target video in the slow motion video recording mode using the slow motion video recording method provided in the following embodiments.

[0114] In some other embodiments, after the slow motion recording function is activated, the mobile phone may include multiple slow motion recording sub-modes. The mobile phone uses the slow motion recording method provided in the following embodiments to record the target video only in a specific sub-mode. Figure 4 The preview interface of the mobile phone includes a normal slow motion control 401 and a super slow motion control 402. After the mobile phone detects that the user clicks the super slow motion control 402, it enters the super slow motion sub-mode and uses the slow motion recording method provided in the following embodiment to record the target video.

[0115] 202. The mobile phone collects image frames at a frame rate f1 and displays the preview image on the preview interface.

[0116] After the mobile phone starts the slow motion recording function, it can capture image frames at a frame rate of f1 in the preview state, obtain a preview image based on the image frame, and display the preview image on the preview interface at a frame rate of f1. The preview image can be generated by the image frame captured by the camera after ISP processing. For example, the ISP processing operation may include converting the RAW image of the image frame into an RGB image, automatic white balance (AWB), bad pixel cluster correction, noise reduction pre-filtering, color aberration correction, or chroma noise reduction and other processing operations.

[0117] The frame rate f1 is relatively low, for example, it may be a transmission and recording frame rate commonly used in a normal recording mode, such as 30fps or 25fps, etc. In a possible implementation, the frame rate f1 is equal to the reference recording frame rate.

[0118] In some embodiments, see Figure 5 The process shown in step 202 may include: the camera captures image frames at a frame rate f1 (for example, 30fps) (i.e., outputs frames at a frame rate f1), and the captured image frames are processed frame by frame by the ISP to generate a preview image and send it to the preview interface for display.

[0119] In some embodiments, after the above step 201, the method may further include step 203:

[0120] 203. Get slow motion speed on your mobile phone.

[0121] Among them, the slow motion speed represents the multiple of the recording frame rate of the slow motion video segment (hereinafter referred to as the recording frame rate corresponding to the slow motion speed) relative to the preset reference recording frame rate, for example, it can be 32X, 64X or 256X, etc., which respectively represent 32 times, 64 times or 256 times the preset reference recording frame rate. The recording frame rate corresponding to the slow motion speed is used to encode the target image frames between the start position and the end position of the slow motion set by the user after the recording starts, so as to generate a slow motion video segment in the target video. The image frames in the slow motion video segment have a higher recording frame rate, as well as a lower encoding frame rate and playback frame rate, which can facilitate users to watch the slow motion wonderful moments slowly, carefully and for a long time. In other words, the slow motion video segment is used to record slow motion wonderful moments.

[0122] In some embodiments, the slow motion speed is a default speed, or a speed used in the last slow motion video recording process.

[0123] In other embodiments, the slow motion speed is automatically determined by the mobile phone according to the shooting scene. For example, in a shooting scene where an object moves at a high speed (such as shooting scenes such as rocket launch or bullet launch), the slow motion speed can be larger (such as 256X or 128X, etc.), so that the recording frame rate of the slow motion video segment is larger, and more image frames are used to generate the slow motion video segment, so that the user can watch the slow motion wonderful moments slowly, carefully, and for a long time through more video frames. Correspondingly, in a shooting scene where the object moves at a lower speed (such as shooting scenes such as water drops falling or jumping), the slow motion speed can be smaller (such as 64X or 32X, etc.).

[0124] In some other embodiments, the slow motion speed is a speed set by the user. Figure 6 After the mobile phone starts the slow motion video recording function, a plurality of slow motion speed controls 601 are displayed on the preview interface. The mobile phone determines the slow motion speed set by the user according to the slow motion speed control selected by the user.

[0125] For example, Figure 3A As shown in (b)-(c) in FIG. 1 , the slow motion speed may be the speed set by the user when starting the slow motion recording function.

[0126] As another example, the mobile phone can obtain the slow motion speed set by the user according to the user's voice command.

[0127] It is understandable that there may be multiple ways to set the slow motion speed, and the embodiments of the present application do not specifically limit this method.

[0128] It can also be understood that the mobile phone can also modify the slow motion speed in response to the user's operation.

[0129] It should be noted that in some embodiments of the present application, step 203 is an optional step.

[0130] 204. After detecting the user's video recording operation, the mobile phone collects image frames at a frame rate f2 and caches the images.

[0131] When the user wants to start recording a video, the recording operation can be triggered to cause the mobile phone to enter the recording process. Figure 3A After the operation of the shooting control 300 on the preview interface shown in (c) of FIG. 1 is performed, it is determined that the user's recording operation is detected, thereby entering the recording process. In another exemplary embodiment, after the mobile phone detects the user's voice instruction to start recording, it is determined that the user's recording operation is detected, thereby entering the recording process.

[0132] It is understandable that there may be other methods such as gestures for triggering the mobile phone to enter the recording process, and the embodiment of the present application does not specifically limit this method.

[0133] See also Figure 7 After the mobile phone detects the user's video recording operation, the camera can capture image frames at a frame rate of f2. The frame rate f2 can be relatively large. In some embodiments, the frame rate f2 is greater than the frame rate f1, that is, the image capture frame rate of the mobile phone in the preview state is relatively low, and the image capture frame rate in the video recording process is relatively high. For example, the frame rate f1 can be 30fps, and the frame rate f2 can be 1920fps, 960fps, or 240fps, etc.

[0134] In some embodiments, f2 may be a default frame rate, a frame rate set by a user, or a maximum frame rate supported by the ISP (ie, a maximum frame rate at which the ISP can perform real-time image processing).

[0135] In other embodiments, when the slow motion speed is obtained in step 203, the frame rate f2 may be related to the slow motion speed. When the slow motion speed is less than the preset speed 2, the frame rate f2 is the video frame rate corresponding to the slow motion speed. When the slow motion speed is greater than or equal to the preset speed 2, the frame rate f2 is the frame rate corresponding to the preset speed 2.

[0136] In some technical solutions, the frame rate corresponding to the preset speed 2 is the maximum frame rate supported by the ISP. For example, the maximum frame rate supported by the ISP is 1920fps, and the reference video frame rate is 30fps, then the preset speed 2 is 1920fps / 30fps=64X. That is to say, when the slow motion speed is less than or equal to 64X, f2 is the video frame rate corresponding to the slow motion speed, that is, the slow motion speed*reference video frame rate. Exemplarily, when the slow motion speed is 8X, the frame rate f2 is 8*30fps=240fps; when the slow motion speed is 32X, the frame rate f2 is 32*30fps=960fps. When the slow motion speed is greater than or equal to 64X, the frame rate f2 is the maximum frame rate 1920fps supported by the ISP.

[0137] like Figure 7 As shown, after the mobile phone detects the user's video recording operation, it can cache the image frames collected according to the frame rate f2. Since the frame rate f2 is high, the ISP may not be able to process each frame in real time. Therefore, the mobile phone can cache the image frames with a frame rate of f2 first, so that the image frames involved can be processed by the ISP in subsequent use.

[0138] For example, after the mobile phone detects the user's recording operation, it can first cache the image frames captured at a high frame rate f2 in real time until the cache duration is equal to T0. After the cache duration is greater than T0, the mobile phone caches the image frames captured at a high frame rate f2 within a duration of T0 between the current moment t0 and the previous moment t1 in real time, so that after detecting a slow motion trigger, a slow motion video segment is generated based on the cached image frames captured at a frame rate f2 within the most recent duration of T0. Among them, the image frames captured at a frame rate f2 within the most recent duration of T0 cached by the mobile phone can be called the first image frame set. As for the image frames cached before the duration of T0 during the recording process, since they are not used to generate slow motion video segments later, the mobile phone can cache the image frames with a frame rate of f3 obtained after frame extraction.

[0139] Among them, T0 duration is relatively short, for example, it can be 0.5s, 1s or 1.5s, etc.; f3 is relatively small, for example, it can be 25fps or 30fps, etc., and f3 can be equal to or different from f1. In this way, after starting to record, the mobile phone only needs to cache the image frames with high frame rate f2 within the shorter T0 duration during the recording process, and the image frames with low frame rate f3 obtained by extracting frames before the T0 duration during the recording process, without caching the image frames with high frame rate f2 collected during the entire recording process. Therefore, the amount of data cached in real time by the mobile phone during the recording process can be reduced, and the requirements for the mobile phone's cache capacity during the recording process can be reduced.

[0140] In a possible implementation, after the mobile phone detects the user's video recording operation, it can initialize the following Figure 8 The three DDR cache queues shown are: cache queue 1, cache queue 2 and cache queue 3. The length of cache queue 2 is f2*T0. After starting recording, the camera captures image frames at a frame rate of f2 (for example, 1920fps). The image frames newly captured by the camera are placed at the head of cache queue 2. If cache queue 2 is full, that is, f2*T0 frames of images have been cached in cache queue 2, the mobile phone extracts the image frames at the end of cache queue 2 into normal-speed image frames with a frame rate of f3 and moves them to the head of cache queue 1.

[0141] 205. After the mobile phone detects the user's video recording operation, it extracts the image frames collected at the frame rate f2 to generate a recorded image, and displays the recorded image on the shooting interface.

[0142] After the mobile phone detects the user's video recording operation, Figure 7 As shown, the image frames collected at the frame rate f2 are extracted to obtain image frames with a frame rate f3, and the image frames with the frame rate f3 are processed by ISP to generate recorded images, which are displayed on the shooting interface. Figure 7 ,The image frames processed by ISP can also be sent to the slow motion ,detection module to detect whether the slow motion is triggered.

[0143] In some embodiments, based on Figure 8 In the caching scheme shown, the image frames with a frame rate of f2 cached in cache queue 2 can be extracted into image frames with a frame rate of f3, and then sent to the ISP for processing to generate recorded images for display.

[0144] In this way, after starting to record, although the mobile phone uses a high frame rate f2 to collect image frames, it only performs ISP processing and display on the image frames with a low frame rate f3 obtained after frame extraction. This can reduce the amount of image processing calculations and reduce the requirements for the real-time computing capabilities of the mobile phone during the recording process.

[0145] 206. After the mobile phone detects the slow motion trigger, it collects image frames of duration T1 at a frame rate f2 and caches them.

[0146] After the mobile phone detects a slow motion trigger, it can determine that the subject is currently in motion, and thus can generate a slow motion video segment based on the image frames in the motion process.

[0147] Among them, the slow motion trigger can be automatically triggered by the mobile phone or actively triggered by the user.

[0148] For example, the automatic triggering algorithm used by the mobile phone may include a human motion detection algorithm or an optical flow motion detection algorithm.

[0149] The human motion detection algorithm can detect the motion of the human body being filmed. If the mobile phone detects the motion of the human body being filmed, the continuous process of the motion can be processed in slow motion to generate a slow motion video segment.

[0150] For example, the corresponding relationship between the motion action and the detection condition can be seen in Table 1. After the detection condition is met, the mobile phone determines that the motion action of the human body is detected, and thus can determine that the slow motion is triggered.

[0151] Table 1

[0152]

[0153]

[0154] The optical flow motion detection algorithm can detect whether the object is moving by detecting the intensity of the picture changes between adjacent image frames. If the mobile phone detects that the object is moving, the motion process is processed in slow motion to generate a slow motion video segment, so it can be determined that the slow motion is triggered.

[0155] It is understandable that there are many ways for a user to actively trigger slow motion, and the embodiments of the present application do not specifically limit the triggering method. For example, a slow motion trigger control is displayed on the shooting interface, and the mobile phone detects that the user clicks the control and determines that the slow motion is triggered. For another example, the mobile phone detects a user voice command that triggers the slow motion and determines that the slow motion is triggered.

[0156] According to the description in the above step 204, after the mobile phone detects the video recording operation, it caches the image frames collected at the frame rate f2 within the duration T0 between the current moment t0 and the previous moment t1 in real time during the video recording process, as well as the image frames with a frame rate of f3 after the image frames collected at the frame rate f2 before the moment t1 are extracted. Therefore, when the mobile phone detects the slow motion trigger, it has cached the image frames collected at the frame rate f2 within the duration T0 between the current moment t0 and the previous moment t1, as well as the image frames with a frame rate of f3 after the image frames collected at the frame rate f2 before the moment t1 are extracted. In other words, the mobile phone caches the image frames collected at the frame rate f2 within the duration T0 before the slow motion trigger is detected. Since the process of the mobile phone detecting the slow motion trigger takes a certain amount of time, when the mobile phone detects the slow motion trigger, the slow motion may have lasted for a period of time. Therefore, the mobile phone caches the image frames collected at the frame rate f2 within the duration T0 before the slow motion trigger is detected, so as to record the slow motion process as completely as possible.

[0157] Moreover, after the phone detects the slow motion trigger, the slow motion process may not be completed. Fig. 9 As shown, the mobile phone can continue to collect and cache subsequent image frames of duration T1 at a frame rate of f2 to record the entire slow motion process as completely as possible. Among them, the cached image frames with a frame rate of f2 within the duration T1 after the slow motion trigger is detected can be called a second image frame set.

[0158] In an embodiment of the present application, image frames with a frame rate of f2 within the T0 duration cached by the mobile phone before the slow motion trigger is detected, and image frames with a frame rate of f2 within the T1 duration cached after the slow motion trigger is detected, are used to generate a slow motion video segment.

[0159] In some embodiments, based on Figure 8 In the caching scheme shown, after the mobile phone detects a slow motion trigger, the length of cache queue 2 can be extended to f2*(T0+T1); after the mobile phone detects a slow motion trigger, the image frame newly collected by the camera at a frame rate of f2 is placed at the head of cache queue 2, and image frames are stopped after cache queue 2 is full.

[0160] In some embodiments, the time lengths of T0 and T1 are preset by the mobile phone.

[0161] In some other embodiments, the time lengths of T0 and T1 may be set by the user. For example, the user may set the values ​​of T0 and T1 according to the shooting scene.

[0162] In some other embodiments, the time lengths of T0 and T1 are automatically determined by the mobile phone according to the shooting scene. For example, if the duration of the motion process in the shooting scene is long (such as a shooting scene of falling water drops), T0 and T1 can be longer so that the mobile phone can cache more image frames with a frame rate of f2. In this way, more image frames can be included between the start frame and the end frame selected by the user, so that there are more video frames in the slow-motion video segment generated according to the image frames between the start frame and the end frame, so that the user can watch the slow-motion wonderful moments slowly and carefully through more video frames in the slow-motion video segment. Correspondingly, if the duration of the motion process in the shooting scene is short (such as a shooting scene of a bullet firing), T0 and T1 can be shorter.

[0163] 207. The mobile phone displays the image frames to be selected according to the cached image frames, and obtains the start frame and the end frame set by the user.

[0164] After the mobile phone detects the slow motion trigger, the image frames to be selected can be displayed on the frame selection interface according to the image frames in the first image frame set and the second image frame set, so as to Fig. 9 The start frame and the end frame selected by the user based on the image frame to be selected are obtained. The image frame with a frame rate of f2 between the start frame and the end frame can be a target image frame or used to generate a target image frame, and the target image frame is used to generate a slow-motion video segment in the target video obtained by the final shooting. The slow-motion video segment is used to record the slow-motion wonderful moments that the user wants.

[0165] There are many ways for a mobile phone to display image frames to be selected on the frame selection interface, and the embodiment of the present application does not specifically limit the display method.

[0166] For example, in some embodiments, the image frames to be selected are image frames in the first image frame set and the second image frame set, so that the user can select a start frame and an end frame therefrom.

[0167] In some other embodiments, the number of image frames with a frame rate of f2 in the first image frame set and the second image frame set is relatively large, and the difference between adjacent image frames is relatively small, which makes it inconvenient for the user to select the start frame and the end frame. Therefore, the mobile phone can extract the image frames in the first image frame set and the second image frame set to obtain the image frames to be selected. Then, the mobile phone displays the image frames to be selected on the frame selection interface, so that the user can quickly select the start frame and the end frame based on the image frames with a small number and large differences.

[0168] In some embodiments, the number of image frames to be selected is different for different slow motion speeds. For example, the larger the slow motion speed, the higher the motion speed of the motion process that the user wants to shoot, and the greater the difference between adjacent image frames. Therefore, the number of image frames to be selected can be larger, so that the user can accurately select the starting frame and the ending frame corresponding to the high-speed motion process based on a larger number of image frames to be selected. Correspondingly, the smaller the slow motion speed, the smaller the number of image frames to be selected. In other words, the number of image frames to be selected is positively correlated with the slow motion speed. For example, if the slow motion speed is 32X, the image frames to be selected can be 30 frames; if the slow motion speed is 64X, the image frames to be selected can be 60 frames.

[0169] In other embodiments, if the slow motion speed is different, the frame extraction intervals used by the mobile phone to extract frames from the cached first image frame set and the second image frame set to obtain the image frames to be selected are also different. For example, the larger the slow motion speed, the more image frames are usually included in the first image frame set and the second image frame set, and the frame extraction interval can be correspondingly larger, so as to facilitate the user to quickly select the starting frame and the ending frame based on the smaller number of image frames with larger differences obtained based on the larger frame extraction interval. Correspondingly, the smaller the slow motion speed, the smaller the frame extraction interval can also be. For example, if the slow motion speed is 32X, the frame extraction interval can be 16 frames; if the slow motion speed is 64X, the frame extraction interval can be 32 frames. In other words, the frame extraction interval used to obtain the image frames to be selected is positively correlated with the slow motion speed.

[0170] In other embodiments, the user can set the number of image frames to be selected or the frame extraction interval. For example, the mobile phone can display a plurality of frame number controls / frame extraction interval controls of image frames to be selected on the frame selection interface so that the user can select the number / frame extraction interval of image frames to be selected. In some technical solutions, the larger the slow motion speed, the more image frames the frame number controls displayed by the mobile phone correspond to. Exemplarily, if the slow motion speed is 32X, the frame number controls displayed by the mobile phone on the frame selection interface include: 15 frame controls, 30 frame controls and 45 frame controls. If the slow motion speed is 64X, the frame number controls displayed by the mobile phone on the frame selection interface include: 30 frame controls, 60 frame controls and 90 frame controls. In other technical solutions, the larger the slow motion speed, the larger the frame extraction interval corresponding to the frame extraction interval control displayed by the mobile phone on the frame selection interface.

[0171] In other embodiments, since the display area of ​​the mobile phone interface is limited and the number of image frames that can be displayed is limited, the mobile phone can first extract frames from the image frames of the first image frame set and the second image frame set at a larger frame extraction interval to obtain the image frames to be selected and display them on the frame selection interface, so that the user can first coarsely select the reference start frame and the reference end frame. Then, the mobile phone can also extract frames from the image frames of the first image frame set and the second image frame set at a smaller frame extraction interval to obtain the reference start frame and the nearby image frames to be selected (which can be called the third image frame set), and the reference end frame and the nearby image frames to be selected (which can be called the fourth image frame set). The mobile phone displays the third image frame set and the fourth image frame set on the frame selection interface, so that the user can select the start frame and the end frame in a fine-grained and precise manner.

[0172] In other embodiments, to facilitate the user to select the start frame and the end frame, the mobile phone can display the recommended start frame and the recommended end frame automatically determined by the algorithm on the frame selection interface, or mark the recommended start frame and the recommended end frame in the image frame to be selected. The start frame and the end frame that the user wants to select are usually between the recommended start frame and the recommended end frame. In this way, the mobile phone can facilitate the user to accurately select the start frame near the recommended start frame and the end frame near the recommended end frame by prompting the user with the recommended start frame and the recommended end frame on the frame selection interface.

[0173] In other embodiments, to facilitate the user to select the start frame and the end frame, the mobile phone can display the recommended start frame interval and the recommended end frame interval automatically determined by the algorithm on the frame selection interface, or mark the recommended start frame interval and the recommended end frame interval in the image frame to be selected. The start frame and the end frame that the user wants to select are usually within or near the recommended start frame interval and the recommended end frame interval. In this way, the mobile phone can facilitate the user to accurately select the start frame in or near the recommended start frame interval, and accurately select the end frame in or near the recommended end frame interval by prompting the user with the recommended start frame interval and the recommended end frame interval on the frame selection interface.

[0174] In some embodiments, due to the limited display area of ​​the frame selection interface, the image frames to be selected may be displayed in the form of thumbnails, so that the thumbnails of multiple image frames can be displayed on the interface at the same time, which is convenient for the user to select. The thumbnails of the image frames to be selected may be displayed at any position on the frame selection interface, such as arranged horizontally at the bottom of the frame selection interface, or arranged vertically on the right side of the frame selection interface. Among them, the interface may only be able to display the thumbnails of some image frames to be selected at the same time, and the thumbnails of all image frames to be selected cannot be displayed at the same time. The mobile phone can slide and display the thumbnails of other image frames to be selected on the frame selection interface in response to the user's sliding operation.

[0175] Furthermore, there may be multiple ways for the user to select the start frame and the end frame based on the image frames to be selected, and the embodiments of the present application do not specifically limit this method.

[0176] In addition, for recorded images, in some embodiments, after the mobile phone detects a slow motion trigger, it performs frame extraction and other processing on the subsequently acquired image frames with a frame rate of f2, generates recorded images with a frame rate of f3, and displays the recorded images in real time at the frame rate of f3 on the background of the frame selection interface, and displays thumbnails of the image frames to be selected on the foreground of the frame selection interface.

[0177] In other embodiments, after the mobile phone detects a slow motion trigger, the currently displayed recorded image is continuously displayed on the background of the frame selection interface, and the recorded image displayed in the background is no longer refreshed, and a thumbnail of the image frame to be selected is displayed on the foreground of the frame selection interface.

[0178] In other embodiments, after the mobile phone detects a slow motion trigger, the recorded image is no longer displayed on the frame selection interface, but only thumbnails of the image frames to be selected are displayed on the frame selection interface.

[0179] In some embodiments, after the mobile phone detects a slow motion trigger, a shooting control is displayed on the frame selection interface, and the state of the shooting control is consistent with that of the shooting control on the preview interface.

[0180] In some embodiments, after the mobile phone detects a slow motion trigger, the shooting controls are not displayed on the frame selection interface.

[0181] In other embodiments, the mobile phone continues to display the shooting controls on the frame selection interface while the recorded image is displayed on the frame selection interface. After the mobile phone stops capturing images, the shooting controls are no longer displayed on the frame selection interface; or the mobile phone displays the shooting controls on the frame selection interface, and the shooting controls are in the same state as the shooting controls on the preview interface.

[0182] The following is an example of a specific method in which a user sets a start frame and an end frame based on a to-be-selected image frame, with reference to the accompanying drawings.

[0183] For example, after the mobile phone detects the user's video recording operation, it displays the following Fig.10 The shooting interface and recorded image shown in (a) of FIG. Fig.10 As shown in (b) in FIG. 1 , the mobile phone can prompt the user on the shooting interface that a slow motion trigger is detected. Then, Fig.10 As shown in (c)-(e) in FIG. 1 , the mobile phone continues to refresh and display the recorded image on the shooting interface until the mobile phone stops collecting image frames and stops refreshing and displaying the recorded image. Fig.10As shown in (f) of FIG. 1 , the mobile phone can display thumbnails 1000 of the image frames to be selected on the frame selection interface and prompt the user to set the start frame and the end frame. The thumbnails 1000 of the image frames to be selected can be slid and switched to display thumbnails of other image frames to be selected in response to the user's sliding operation. For example, in response to the user's sliding operation based on Fig.10 The operation of sliding the thumbnail of the selected image frame shown in (f) to the right, such as Fig.10 As shown in (g) in FIG. 1 , the thumbnail of the image frame to be selected also slides to the right, thereby displaying the thumbnails of other image frames to be selected. Fig.10 As shown in (f) of FIG. 1 , the frame selection interface further includes a first control 1001 for indicating a start frame and a second control 1002 for indicating an end frame. The first control 1001 and the second control 1002 can slide on the thumbnails of the image frames to be selected in response to the user's dragging operation. Fig.10 After the operation of the first control 1001 shown in (f) in FIG. Fig.10 As shown in (g) in the figure, the user is prompted on the frame selection interface that the start frame is being selected. Fig.10 In (g), the mobile phone can also prompt the user on the frame selection interface whether the start frame selection is complete. After the mobile phone detects that the user clicks the "OK" control, it determines that the start frame selection is complete. Then, Fig.10 As shown in (h) in the figure, the mobile phone can prompt the user to select the end frame on the frame selection interface. The method of selecting the end frame is similar to that of the start frame and is not repeated here. In some embodiments, after the mobile phone detects the user's recording operation, the slow motion speed can also be displayed on the interface of the recording process, for example, Fig.10 "256X" shown in (a)-(h) in FIG.

[0184] In some other embodiments, the user can select the start frame and the end frame based on the first control 1001 and the second control 1002 respectively, and the mobile phone can prompt the user on the frame selection interface "Have you completed the selection of the start frame and the end frame?" After the mobile phone detects that the user clicks the "OK" control operation, it obtains the start frame corresponding to the location of the first control 1001 and the end frame corresponding to the location of the second control 1002.

[0185] For another example, after the mobile phone detects the slow motion trigger, if it detects that the user performs preset operation 1 on image frame 1 in the thumbnail of the image frame to be selected, image frame 1 is determined to be the starting frame. If it detects that the user performs preset operation 2 on image frame 2 in the thumbnail of the image frame to be selected, image frame 2 is determined to be the ending frame. For example, the preset operation 1 and the preset operation 2 can be operations such as clicking, double-clicking, or pressure pressing. The specific forms of the preset operation 1 and the preset operation 2 are not limited in the embodiments of the present application. In some embodiments, see Fig.11AIn (a), after the phone detects the slow motion trigger, it prompts the user to select the start frame and end frame on the frame selection interface. Fig.11A In (b)-(c), after the mobile phone detects the user's operation of clicking on image frame 1 and image frame 2 in the thumbnail of the image frame to be selected, it determines that the image frame with an earlier time sequence among image frame 1 and image frame 2 is the starting frame, and the image frame with a later time sequence is the ending frame.

[0186] For example, after the mobile phone detects a slow motion trigger, Fig. 11B As shown in (a) of FIG. 1 , a thumbnail 1100 of the image frame to be selected can be displayed on the frame selection interface. The thumbnail image of the image frame to be selected also includes a selection control 1101 for selecting a start frame and an end frame. The selection control 1101 can select one of the image frames. Fig. 11B In (b), the selection control 1101 can slide on the thumbnails of the image frames to be selected in response to the user's dragging operation, thereby selecting different image frames. In addition, the interface also includes a large image 1102 of the image frame selected by the selection control 1101. When the selection control 1101 slides on the thumbnail of the image frame to be selected, the large image 1102 can scroll and display the image frame and adjacent image frames at the location of the control 1101 in the thumbnail of the image frame to be selected in the form of animation. In this way, the image frame corresponding to the selection control 1101 in real time can be displayed in the form of a large image on the frame selection interface, which is convenient for the user to see the specific content of the image frame selected by the selection control 1101, thereby facilitating the user to accurately select the starting frame and the ending frame. See Fig. 11B In (a), the mobile phone can first prompt the user to select the starting frame. Fig.10 As shown in (b) of FIG. 1 , after the mobile phone detects that the user clicks the selection control 1101 to select the image frame, a selection mark (such as the √ or text mark "starting frame" shown in the figure) is displayed on the image frame, and the image frame is determined as the starting frame. Then, see Fig. 11B In (c), the mobile phone can prompt the user to select the end frame. Fig. 11B As shown in (d) in the figure, the method of selecting the end frame is similar to that of the start frame and will not be repeated here.

[0187] In some other embodiments, after detecting a slow motion trigger, the mobile phone can display an image frame at a preset position in the image frame to be selected in the form of a large image on the frame selection interface. For example, the preset position is the middle position of the image frame to be selected or the interface boundary position.

[0188] For example, the above selection control can be replaced by Fig.12The draggable dot 1201 or other form of control shown in (a)-(e) of FIG. 1 is not limited to the specific form of the selection control in the embodiment of the present application. In addition, the mobile phone can display a large image of the image frame selected by the selection control on the frame selection interface, or it can not display the large image. The process of the user selecting the start frame and the end frame is similar to Fig. 11B The methods shown in (a)-(d) are similar and will not be described in detail. Fig.12 In the example given, after the mobile phone detects a slow motion trigger, it no longer refreshes and displays new recorded images on the background of the frame selection interface, but continues to display the recorded images stored in the memory until the slow motion is triggered on the background, and displays thumbnails of the image frames to be selected on the foreground of the frame selection interface.

[0189] For example, after the mobile phone detects a slow motion trigger, Fig.13 As shown in (a) in FIG. 1 , thumbnails of the image frames to be selected can be displayed, and the user is prompted to select the interval corresponding to the start frame and the end frame. Fig.13 As shown in (b) of FIG. 2 , after the mobile phone detects the user's selection operation based on the thumbnail of the image frame to be selected, it determines that the first frame image in the selected image frame interval is the start frame, and the last frame image in the selected image frame interval is the end frame. In some embodiments, if the mobile phone does not obtain the slow motion speed in step 203, then Fig.13 As shown in (a) in FIG. 1 , the mobile phone can also prompt the user to select a slow motion speed. The mobile phone can display multiple speed controls on the frame selection interface for the user to select.

[0190] For example, after the mobile phone detects a slow motion trigger, Fig.14 As shown in (a) of FIG. 1 , thumbnails of the image frames to be selected obtained at a larger frame extraction interval can be displayed on the frame selection interface so that the user can select the reference start frame in a coarse-grained manner. After the mobile phone detects the user's operation of selecting the reference start frame, as shown in FIG. Fig.14 As shown in (b) of FIG. 1 , thumbnails of the image frames to be selected (i.e., the third image frame set) near the reference start frame obtained with a smaller frame extraction interval are displayed on the frame selection interface, so that the user can accurately select the start frame in a fine-grained manner. Fig.14 As shown in (c)-(d) in FIG. 1 , the mobile phone can also select a reference end frame and an end frame, which will not be described in detail. Fig.14 In the example given, after detecting a slow motion trigger, the mobile phone continues to refresh the latest recorded image on the background of the frame selection interface, and at the same time displays thumbnails of the image frames to be selected on the foreground of the frame selection interface.

[0191] For example, after the mobile phone detects a slow motion trigger, thumbnails of the image frames to be selected are displayed on the frame selection interface, and a recommended start frame and a recommended end frame are marked, so that the user can quickly and accurately select the start frame and the end frame near the recommended start frame and the recommended end frame, respectively. Fig.15 As shown, the image frames to be selected include a fifth image frame set and a sixth image frame set, and the fifth image frame set includes Fig.15 The recommended starting frame and adjacent multiple frames of images shown in the first row of thumbnails in FIG. 1 , the sixth image frame set includes the following: Fig.15 The user can set the start frame based on the fifth image frame set and the recommended start frame, and set the end frame based on the sixth image frame set and the recommended end frame.

[0192] For example, after the mobile phone detects a slow motion trigger, Fig.16 As shown in (a)-(b) in the figure, thumbnails of the image frames to be selected are displayed on the frame selection interface, including a recommended start frame interval and a recommended end frame interval, so that the user can quickly and accurately select the start frame and the end frame within or near the recommended start frame interval and the recommended end frame interval, respectively.

[0193] in, Figure 10-16 The following is an example of the horizontal arrangement of thumbnails of image frames to be displayed on the frame selection interface. For example, a schematic diagram of the vertical arrangement of thumbnails of image frames to be displayed can be seen in Fig.17 .

[0194] 208. The mobile phone generates a target video, where the target video includes a slow-motion video segment corresponding to a start frame and an end frame.

[0195] like Fig. 9 As shown, after the mobile phone obtains the start frame and the end frame, a target video can be generated. The target video includes a slow-motion video segment, and the slow-motion video segment is obtained according to the target image frame between the start frame and the end frame.

[0196] It should be noted that, although in step 207, the user selects the start frame and the end frame of the target image frame based on the thumbnail of the image frame to be selected, the target image frame is an image frame with a frame rate of f2 between the start frame and the end frame, or the target image frame is an image frame obtained by interpolating the image frame with a frame rate of f2 between the start frame and the end frame. The frame rate of the target image frame is f4, and f4 may be greater than or equal to f2.

[0197] After the mobile phone performs ISP processing and image post-processing on the target image frame with a frame rate of f4, it encodes and generates a slow-motion video segment according to the encoding frame rate. The image post-processing operation can be performed in a processor such as a CPU, GPU, or NPU. For example, the image post-processing operation may include image smoothing, image sharpening, image enhancement, histogram equalization, image super-resolution, noise reduction, or frame interpolation.

[0198] Among them, the frame rate f4 of the target image frame can be called the recording frame rate of the slow-motion video segment. The encoding frame rate of the slow-motion video segment can be much smaller than the recording frame rate. For example, the recording frame rate can be 7680fps, and the encoding frame rate can be 30fps or 25fps. In some embodiments, the encoding frame rate is equal to f3. For example, if f2 is 1920fps, f4 is 7680fps, and the encoding frame rate is 30fps, the mobile phone can interpolate the image frames with a frame rate of 1920fps between the start frame and the end frame to obtain the target image frame with a frame rate of 7680fps; the mobile phone uses 30fps to perform video encoding on the target image frame with a frame rate of 7680fps, thereby generating a slow-motion video segment. Among them, the recording frame rate f4 of the slow-motion video segment is 7680fps.

[0199] In some embodiments, f4 is a default preset frame rate, or an encoding frame rate used when encoding the target image frame last time to generate a slow-motion video segment.

[0200] In other embodiments, if the mobile phone obtains the slow motion speed in step 203, the video frame rate f4 corresponds to the obtained slow motion speed. When the video frame rate corresponding to the slow motion speed is the same as f2, f4 is the same as f2. When the video frame rate corresponding to the slow motion speed is greater than f2, f4 is greater than f2, and f4 is the video frame rate corresponding to the slow motion speed. For example, if f2 is 960fps, the slow motion speed is 32X, and the reference video frame rate is 30fps, then the video frame rate corresponding to the slow motion speed is also 32*30fps=960fps, which is the same as f2, so f4 is also 960fps. If f2 is 960ps, the slow motion speed is 256X, and the reference video frame rate is 30fps, then the video frame rate corresponding to the slow motion speed is 256*30fps=7680fps, which is greater than f2, so f4 is 7680fps.

[0201] If the mobile phone does not obtain the slow motion speed in step 203, it can obtain the slow motion speed in step 208, thereby obtaining the recording frame rate corresponding to the slow motion speed, which is f4; or, the mobile phone can obtain the encoding frame rate f4 of the target image frame in step 208.

[0202] For example, in Figure 8 In the illustrated cache scheme, the target image frame 80 with a frame rate of f2 between the start frame and the end frame in the cache queue 2 can be used for interpolation to generate a target image frame with a frame rate of f4, thereby encoding to generate a slow-motion video segment.

[0203] In a possible implementation, the above f1 is 30fps or 25fps, f2 is 1920fps, the slow motion speed is 256X, f3 is equal to f1, and f4 is 7680fps.

[0204] In some embodiments, see Fig.18 , the target video may also include a video segment 1 located before the slow-motion video segment, and / or a video segment 2 located after the slow-motion video segment. In the first image frame set and the second image frame set, the mobile phone extracts the image frames with a frame rate of f2 before the start frame (referred to as the eighth image frame set), obtains image frames with a frame rate of f3, and generates video segment 1 after ISP processing, image post-processing and encoding. In the first image frame set and the second image frame set, the mobile phone extracts the image frames with a frame rate of f2 after the end frame (referred to as the ninth image frame), obtains image frames with a frame rate of f3, and generates video segment 2 (also referred to as the second video segment) after ISP processing, image post-processing and encoding.

[0205] For example, in Figure 8 In the caching scheme shown, the mobile phone can extract the image frames in cache queue 2 that are collected before the start frame selected by the user into image frames with a frame rate of f3, and move them to the head of cache queue 1 to obtain image frame set 801. Image frame set 801 in cache queue 1 can be used to encode and generate normal-speed video segment 1. The mobile phone can extract the image frames in cache queue 2 that are collected after the end frame selected by the user into image frames with a frame rate of f3, and move them to the head of cache queue 3 to obtain image frame set 802. Image frame set 802 in cache queue 3 can be used to encode and generate normal-speed video segment 2.

[0206] It can be understood that if the starting frame is the first image frame in the cached image frames with a frame rate of f2, the mobile phone no longer generates video segment 1, or video segment 1 is empty; if the ending frame is the last image frame in the cached image frames with a frame rate of f2, the mobile phone no longer generates video segment 2, or video segment 2 is empty.

[0207] In some embodiments, see Fig.18 , the target video may also include video segment 0 located before video segment 1. The mobile phone performs ISP processing and image post-processing on the cached image frames with a frame rate of f3 before the duration T0 (called the seventh image frame set), and then encodes them at a frame rate of f3 to generate video segment 0. For example, Figure 8 In the illustrated cache solution, the image frame set 800 with a frame rate of f3 cached in the cache queue 1 can be used for encoding to generate the normal-speed video segment 0. The video segment 0 and the video segment 1 can be referred to as the first video segment.

[0208] That is, the order of the video segments in the target video may be: video segment 0, video segment 1, slow motion video segment, and video segment 2, ie, the first video segment, the slow motion video segment, and the second video segment.

[0209] In the scheme described in the above embodiment, since the starting frame and the ending frame of the target image frame used to generate the slow-motion video segment are accurately selected by the user during the recording process, that is, the user accurately selects the starting position and the ending position of the slow-motion video segment in the target video, it can avoid false detection when the mobile phone automatically detects the start / end time of the slow motion, so that the generated slow-motion video segment can accurately correspond to the captured slow-motion wonderful moments, and can also meet the user's personalized needs for slow-motion wonderful moments.

[0210] Subsequently, after the mobile phone detects the user's playback operation, it plays the generated target video, including video segment 0, video segment 1, slow-motion video segment and video segment 2 in the target video. Among them, the playback frame rate of the target video is less than f4. Among them, the playback frame rate is usually equal to the encoding frame rate, or is slightly different from the encoding frame rate. When the encoding frame rate is much lower than the recording frame rate of the slow-motion video segment, the playback frame rate is also much lower than the recording frame rate of the slow-motion video segment. In this way, when the slow-motion video segment recorded at the recording frame rate f4 in the target video is played at the playback frame rate, the captured motion process corresponding to the slow-motion video segment can be stretched and played in slow speed, so that users can watch the wonderful slow-motion moments carefully and clearly over a long period of time.

[0211] The recording frame rate and encoding frame rate of video segments 0, 1 and 2 are all f3, and the playback frame rate is equal to the encoding frame rate or is not much different from the encoding frame rate, that is, the playback frame rate is equal to or is not much different from the recording frame rate, so they can be called normal speed video segments.

[0212] In addition to the slow-motion video segment, the target video may also include a normal-speed video segment before the slow-motion video segment, such as video segment 0 or video segment 1, and may also include a normal-speed video after the slow-motion video segment, such as video segment 2. In this way, the generated target video can give the user a visual contrast impact from the normal-speed video segment to the slow-motion video segment played at a slow speed, and then to the normal-speed video segment, which provides a good user experience.

[0213] For example, the timing diagram of a slow motion video recording method described in the above embodiment can be found in Fig.19A The effect diagram of the video frame of the target video played by the mobile phone can be seen in Fig.19B .

[0214] In some other embodiments, after the above step 206, the method may further include: the mobile phone collects and caches image frames of duration T2 at a frame rate f3. The target video generated by the mobile phone also includes ISP processing and image post-processing on the cached image frames of duration T2 with a frame rate f3, and encoding according to the encoding frame rate to obtain video segment 3.

[0215] In the solution described in the above embodiment, the mobile phone automatically stops collecting image frames. In some other embodiments, after the mobile phone detects a slow motion trigger, the method may further include: the mobile phone collects image frames at a frame rate f2 and caches them until the mobile phone detects a user's stop recording operation, and then stops collecting image frames.

[0216] For slow-motion recording, on the one hand, in order to obtain a better slow-motion effect, the encoding frame rate of the slow-motion video is getting higher and higher, and the corresponding acquisition frame rate f2 during the recording process is also getting higher and higher. On the other hand, when shooting a high-speed motion process, the duration of the motion process is short. In order to better see the motion details in a short period of time, the encoding frame rate of the slow-motion video is high, and the corresponding acquisition frame rate f2 during the recording process is also high. In the slow-motion recording method provided in the embodiment of the present application, the mobile phone does not cache the high-frame rate image frames acquired with f2 during the entire recording process, but only caches the high-frame rate image frames within the T0 duration and the T1 duration, and performs ISP processing and display after extracting the high-frame rate image frames, thereby reducing the requirements for the mobile phone image cache transmission and computing power.

[0217] In addition, the mobile phone only performs high frame rate encoding on the high frame rate image frames between the start frame and the end frame selected by the user, and performs low frame rate encoding on other low frame rate image frames during the recording process, which can reduce the image processing tasks and lower the requirements on the computing power of the mobile phone.

[0218] Moreover, in the slow-motion recording method provided in the embodiment of the present application, the user can select the start frame and the end frame during the recording process to generate a slow-motion video segment in the target video, without the need to perform secondary editing after the video is generated to obtain the slow-motion video segment. The solution of first generating the video and then editing to obtain the slow-motion video segment requires the ISP to process the captured image frames in real time during the recording process, and then generate the video after encoding. However, the processing capacity of the ISP is limited, and it is difficult to achieve real-time processing of image frames with a higher acquisition frame rate.

[0219] In the above embodiment, the mobile phone caches the image frames with a frame rate of f2 for a duration of T0 after starting recording, and does not cache images in the preview state. In some other embodiments, the mobile phone caches the image frames with a frame rate of f2 for a duration of T0 in the preview state.

[0220] For example, in a possible implementation, after the mobile phone starts the slow-motion recording function, it captures image frames at a frame rate of f2 in the preview state, and extracts the frames into image frames with a frame rate of f3 before sending them for display. In addition, the mobile phone first caches the image frames captured at a high frame rate of f2 in real time until the cache duration is equal to T0. After the cache duration is greater than T0, the mobile phone caches the image frames captured at a high frame rate of f2 in real time between the current moment t0 and the previous moment t1 for a duration of T0, and extracts the image frames with a frame rate of f2 before the duration of T0, and caches the image frames with a frame rate of f3 after obtaining them. After the mobile phone detects the user's recording operation, it continues to cache the image frames in the previous caching state. That is, after the mobile phone detects the user's recording operation, it continues the caching progress in the preview state, and continues to cache the image frames captured at a frame rate of f2 within a duration of T0 between the current moment t0 and the previous moment t1, and the image frames with a frame rate of f3 after extracting the image frames captured with a frame rate of f2 before the moment t1. Then, the mobile phone can execute steps 205-208 in the above embodiment.

[0221] In some cases, the mobile phone may detect the slow motion trigger very soon after detecting the user's video recording operation, for example, the time difference between the time when the slow motion trigger is detected and the time when the video recording operation is detected is less than T0. In this case, if the mobile phone starts to cache image frames only after detecting the user's video recording operation, the cached image frames with a high frame rate f2 may not include the complete slow motion process that occurred before the slow motion trigger.

[0222] If the mobile phone caches the image frames with a high frame rate of f2 in the preview state, and continues to cache the image frames in the cache state in the preview state after detecting the user's recording operation, the cached image frames with a high frame rate of f2 can include the complete slow motion process before the slow motion is triggered as much as possible. In this way, when the mobile phone detects the slow motion trigger immediately after detecting the recording operation, it can also generate a complete slow motion video segment based on the cached image frames.

[0223] The above is explained using the example of a mobile phone as an electronic device. When the electronic device is a tablet computer or other device such as a camera, the slow-motion recording method provided in the above embodiment can still be used. During the recording process, the user can accurately set the starting position and the ending position of the slow-motion video segment, so that the generated slow-motion video segment can accurately correspond to the captured slow-motion wonderful moments, and can also meet the user's personalized needs for slow-motion wonderful moments, which will not be elaborated here.

[0224] It is understandable that in order to implement the above functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of the present application.

[0225] In this embodiment, the electronic device can be divided into functional modules according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0226] The embodiment of the present application also provides an electronic device, including one or more processors and one or more memories. The one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program codes, and the computer program codes include computer instructions. When the one or more processors execute the computer instructions, the electronic device executes the above-mentioned related method steps to implement the slow-motion video recording method in the above-mentioned embodiment.

[0227] The present application also provides an electronic device, such as Fig. 20 As shown, it includes: a display screen 2001, one or more processors 2002, multiple cameras 2003, a memory 2004, and one or more computer programs 2005, and the above-mentioned devices can be connected through one or more communication buses 2006. The one or more computer programs 2005 are stored in the above-mentioned memory 2004 and are configured to be executed by the one or more processors 2002. The one or more computer programs 2005 include instructions, and the above-mentioned instructions can be used to execute the various steps in the above-mentioned embodiments. Among them, all relevant contents of the various steps involved in the above-mentioned method embodiments can be referred to the functional description of the corresponding physical devices, and will not be repeated here.

[0228] Exemplarily, the processor 2002 may be Figure 1 The processor 110 shown in the figure, the memory 2004 can be specifically Figure 1 The internal memory 121 shown, the camera 2003 can be specifically Figure 1 The camera 193 shown in the figure, the display screen 2001 can be specifically Figure 1Display screen 194 is shown.

[0229] An embodiment of the present application further provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the slow-motion recording method in the above-mentioned embodiment.

[0230] The embodiments of the present application also provide a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement the slow-motion video recording method executed by the electronic device in the above-mentioned embodiment.

[0231] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory so that the chip executes the slow-motion recording method performed by the electronic device in the above-mentioned method embodiments.

[0232] Among them, the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here.

[0233] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0234] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0235] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0236] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0237] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0238] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A video recording method, applied to electronic equipment, characterized in that: include: Turn on the video recording function; After detecting the user's video recording operation, if a slow motion trigger is detected, displaying image frames to be selected on the frame selection interface according to the image frames in the first image frame set and the second image frame set, wherein the image frames to be selected include multiple frames of images; Acquire the start frame and the end frame set by the user based on the image frame to be selected; Generate a target video, the target video includes a slow-motion video segment, the slow-motion video segment corresponds to the start frame and the end frame, the recording frame rate of the slow-motion video segment is higher than the encoding frame rate of the slow-motion video segment; the slow-motion video segment uses the encoding frame rate to encode the target image frame between the start frame and the end frame; the target image frame is the image frame between the start frame and the end frame in the first image frame set and the second image frame set; the first image frame set includes image frames within a duration of T0 captured at a first frame rate after detecting the user's recording operation; the second image frame set includes image frames with a duration of T1 captured at the first frame rate after detecting a slow-motion trigger; the recording frame rate is equal to the first frame rate.

2. The method according to claim 1, characterized in that The method further comprises: After detecting the video recording operation of the user, capturing image frames at the first frame rate, and caching the first image frame set, where the first image frame set includes the image frames captured most recently within a duration of T0; After detecting a slow motion trigger, capturing image frames of duration T1 at the first frame rate, and caching the second image frame set; The image frames to be selected are from the first image frame set and the second image frame set.

3. The method according to claim 1 or 2, characterized in that: The image frames to be selected are obtained by extracting image frames from the first image frame set and the second image frame set.

4. The method according to claim 3, characterized in that The number of the image frames to be selected is positively correlated with the slow motion speed of the slow motion video segment; Alternatively, a frame extraction interval for extracting the to-be-selected image frames from the image frames in the first image frame set and the second image frame set is positively correlated with the slow-motion speed of the slow-motion video segment.

5. The method according to claim 2 or 4, characterized in that: The method further comprises: After detecting the user's video recording operation, the recorded image is displayed at a second frame rate on the shooting interface, and the recorded image is obtained by extracting the image frames according to the first frame rate, and the second frame rate is lower than the first frame rate.

6. The method according to any one of claims 1, 2 and 4, characterized in that: The video recording frame rate corresponds to the slow motion speed of the slow motion video segment.

7. The method according to claim 2 or 4, characterized in that: The first frame rate is related to the slow motion speed of the slow motion video segment.

8. The method according to any one of claims 1, 2 and 4, characterized in that: The method further comprises: If a slow motion trigger is detected, the user is prompted to set the start frame and the end frame on the frame selection interface.

9. The method according to any one of claims 1, 2 and 4, characterized in that: The obtaining the start frame and the end frame set by the user based on the image frame to be selected includes: If a first preset operation of the user on a first image frame among the image frames to be selected is detected, determining the first image frame as the starting frame; If a second preset operation of the user on a second image frame on the to-be-selected image frame is detected, the second image frame is determined to be the end frame.

10. The method according to claim 9, characterized in that The frame selection interface displays an image frame located at a preset position among the image frames to be selected in a large image format, and the preset position is a middle position of the image frame to be selected or a boundary position of the frame selection interface.

11. The method according to any one of claims 1, 2 and 4, characterized in that: The method further comprises: If a slow motion trigger is detected, a first control and a second control are displayed on the frame selection interface, the first control and the second control can be slid on the image frame to be selected, the first control is used to set the start frame, and the second control is used to set the end frame; the image frame where the first control or the second control is located is displayed in the form of a large image on the frame selection interface; When the user drags the first control on the image frame to be selected, the image frame where the first control is located is displayed in a large image on the interface; When the user drags the second control on the image frame to be selected, the image frame where the second control is located is displayed in a large image on the interface; The obtaining the start frame and the end frame set by the user based on the image frame to be selected includes: Determine, among the image frames to be selected, the image frame where the first control is located as the starting frame; Determine, in the candidate image frames, that the image frame where the second control is located is the end frame.

12. The method according to claim 4, characterized in that The image frames to be selected are obtained by extracting frames from the image frames of the first image frame set and the second image frame set at a first interval; The obtaining the start frame and the end frame set by the user based on the image frame to be selected includes: Determine a reference start frame set by the user based on the image frame to be selected; Displaying a third image frame set on the frame selection interface, the third image frame set including the reference start frame, and the third image frame set is obtained by extracting frames from the image frames of the first image frame set and the second image frame set at a second interval, and the second interval is smaller than the first interval; Determining the starting frame set by the user based on the third image frame set; Determine a reference end frame set by the user based on the image frame to be selected; Displaying a fourth image frame set on the interface, the fourth image frame set including the reference end frame, and the fourth image frame set is obtained by extracting frames from image frames of the first image frame set and the second image frame set using the second interval; The end frame set by the user based on the fourth image frame set is determined.

13. The method according to any one of claims 1, 2 and 4, characterized in that: The image frames to be selected include a fifth image frame set and a sixth image frame set, the fifth image frame set includes a recommended start frame and adjacent multiple image frames, and the sixth image frame set includes a recommended end frame and adjacent multiple image frames; The obtaining the start frame and the end frame set by the user based on the image frame to be selected includes: Determining the start frame set by the user based on the fifth image frame set and the recommended start frame; The end frame set by the user based on the sixth image frame set and the recommended end frame is determined.

14. The method according to any one of claims 1, 2 and 4, characterized in that: The image frames to be selected include a recommended start frame interval and a recommended end frame interval; The obtaining the start frame and the end frame set by the user based on the image frame to be selected includes: Determining the start frame set by the user based on the recommended start frame interval; The end frame set by the user based on the recommended end frame interval is determined.

15. The method according to any one of claims 1, 2, 4, 10 and 12, characterized in that: The method further comprises: After detecting the video recording operation of the user, cache a seventh image frame set, wherein the seventh image frame set includes image frames of a second frame rate obtained by extracting image frames of the first frame rate before the time duration T0; The target video further includes a first video segment, which is obtained by encoding image frames in the seventh image frame set and the eighth image frame set using the encoding frame rate; The eighth image frame set is an image frame with the first frame rate before the start frame in the first image frame set and the second image frame set, and is obtained by extracting the image frames with the second frame rate.

16. The method according to any one of claims 1, 2, 4, 10 and 12, characterized in that: The target video further includes a second video segment, and the second video segment is obtained by encoding the image frames in the ninth image frame set using the encoding frame rate; The ninth image frame set is an image frame with a first frame rate obtained by extracting the image frames with a second frame rate after the end frame in the first image frame set and the second image frame set.

17. The method according to any one of claims 1, 2, 4, 10 and 12, characterized in that: The method further comprises: After the video recording function is turned on, images are captured at a third frame rate, and preview images are displayed at the third frame rate on the preview interface, where the third frame rate is lower than the first frame rate.

18. An electronic device, characterized in that: include: A camera, used to collect images; A display screen, used for displaying an interface; one or more processors and one or more memories; The one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program codes, wherein the computer program codes include computer instructions. When the one or more processors execute the computer instructions, the electronic device executes the recording method as described in any one of claims 1-17.

19. A computer storage medium, characterized in that: It comprises computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the video recording method as described in any one of claims 1 to 17.

20. A computer program product, characterized in that When the computer program product runs on a computer, the computer is enabled to execute the recording method according to any one of claims 1 to 17.

Citation Information

Patent Citations

  • Method for providing video content and electronic device for supporting the same

    CN107666581A

  • Video recording method and electronic device

    CN110086905A