A method for adding transition special effects and electronic equipment

By automatically adding transition effects and freeze frames on electronic devices, the problem of low efficiency of user manual editing of videos is solved, the efficiency and quality of video editing is improved, and the stability of video duration is ensured.

CN115484423BActive Publication Date: 2024-11-19HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210056663.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2021-11-29
Filing Date
2022-01-18
Publication Date
2024-11-19
Estimated Expiration
2042-01-18

AI Technical Summary

Technical Problem

In the prior art, the human-computer interaction efficiency is low when users manually edit videos, and the video length is shortened after adding transition effects to the video, affecting the video quality and user experience.

Method used

Provide a method of adding transition effects, by displaying multiple interfaces on an electronic device, automatically processing video data in response to user operations, adding transition effects, such as superimposing, blurring or melting transitions, and inserting a freeze frame if necessary, Ensure that the video duration remains unchanged and improve editing efficiency.

Benefits of technology

It improves the efficiency and quality of video editing, reduces the steps of manual adjustment by users, and ensures the stability and viewability of video duration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115484423B_ABST
    Figure CN115484423B_ABST
Patent Text Reader

Abstract

The present application provides a method for adding transition effects and an electronic device, which relate to the field of terminal technology. The problem of low human-machine efficiency in adding transition effects is solved. The specific scheme is: displaying a first interface; receiving a first operation of a user on a first thumbnail; in response to the first operation, displaying a second interface; the second interface is a video editing interface for the first video data; after receiving a second operation of a user on a one-key blockbuster control, displaying a third interface; the third interface is used to display the second video data; the second video data includes a video frame of the first video data and a first transition effect; when the first transition effect is any one of a dissolve transition, a blur transition or a melt transition, the second video data also includes a first freeze frame and a second freeze frame; the first freeze frame overlaps with the second video frame, the second freeze frame overlaps with the first video frame, and the first transition effect is superimposed on the first video frame and the second video frame.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims priority to a Chinese patent application filed with the State Intellectual Property Office on June 16, 2021, with application number 202110676709.3 and application name “A user video creation method and electronic device based on storyline mode”, the entire contents of which are incorporated by reference in this application.

[0002] This application also claims the priority of the Chinese patent application submitted to the State Intellectual Property Office on November 29, 2021, with application number 202111434131.7 and application name "A method for adding transition special effects and electronic equipment", and the new content of "202111434131.7" compared to "202110676709.3" is incorporated into this application by reference. Technical Field

[0003] The present application relates to the field of terminal technology, and in particular to a method for adding transition special effects and an electronic device. Background Art

[0004] With the development of electronic technology, electronic devices such as mobile phones and tablet computers are generally equipped with multiple cameras, such as front cameras, rear cameras, wide-angle cameras, etc. Multiple cameras make it convenient for users to shoot video works using electronic devices.

[0005] After the user finishes shooting the video with the electronic device, the user can also edit the video by adding special effects, configuring music, etc. to obtain a more enjoyable video work. Currently, in the process of users manually editing the video, there is still a problem of low human-computer interaction efficiency. Summary of the invention

[0006] The embodiments of the present application provide a method for adding transition special effects and an electronic device for improving the human-computer interaction efficiency of video editing.

[0007] In order to achieve the above purpose, this application adopts the following technical solutions:

[0008] In a first aspect, an embodiment of the present application provides a method for adding a transition special effect, the method being applied to an electronic device, the method comprising: the electronic device displays a first interface; wherein the first interface comprises a first thumbnail of first video data; the electronic device receives a first operation of a user on the first thumbnail; the electronic device displays a second interface in response to the first operation; the second interface is a video editing interface of the first video data; the second interface comprises a one-key blockbuster control; after receiving a second operation of the user on the one-key blockbuster control, the electronic device displays a third interface; wherein the third interface is used to display second video data; the second video data comprises a video frame of the first video data and a first transition special effect; when the first transition special effect is any one of a dissolve transition, a blur transition or a melt transition, the second video data further comprises a first freeze frame and a second freeze frame; the first freeze frame is the same as the first video frame, the second freeze frame is the same as the second video frame, and the first video frame and the second video frame are two adjacent frames in the first video data; the first freeze frame overlaps with the second video frame, the second freeze frame overlaps with the first video frame, and the first transition special effect is superimposed on the first video frame and the second video frame.

[0009] That is, for the saved video data, such as the first video data, the electronic device can automatically edit and process the first video data in response to the user's operation of the one-key blockbuster control to obtain the second video data. The process of processing the first video data involves adding a transition effect, such as adding a first transition effect at a first time point of the first video data.

[0010] When the first transition special effect is a dissolve transition, a blur transition or a melt transition, the electronic device inserts freeze frames before and after the first time point to make the created second video data have the same length as the first video data, thereby improving the problem of shortening the video length after adding a dissolve transition, a blur transition or a melt transition, reducing the possibility of manual adjustment by the user, and improving the human-computer interaction efficiency in creating video data.

[0011] In some possible embodiments, before the electronic device displays the first interface, the method further includes: the electronic device displays a fourth interface; the fourth interface is a viewfinder preview interface provided by a camera application; the fourth interface includes a first control indicating the start of video shooting; the electronic device receives a third operation of the user on the first control; the electronic device displays a fifth interface in response to the third operation, and starts recording the first video data; wherein the fifth interface is a video recording interface; the fifth interface includes a second control indicating pause shooting; when recording to a first time point of the first video data, the electronic device displays a sixth interface in response to the user's operation on the second control; wherein , the sixth interface is an interface for pausing shooting; the sixth interface includes a third control indicating to continue shooting; the electronic device receives a fourth operation of the user on the third control; the electronic device responds to the fourth operation, displays the fifth interface again, and determines the first video frame and the second video frame located before and after the first time point in the first video data; wherein the fifth interface includes a fourth control indicating to stop shooting; the electronic device receives a fifth operation of the user on the fourth control; the electronic device displays the first interface, including: the electronic device responds to the fifth operation, displays the first interface; the first interface is also the framing preview interface provided by the camera application.

[0012] In the above embodiment, the first video data may be a video shot by the electronic device in a normal mode. During the process of shooting the video, the electronic device receives an operation indicating to pause shooting at a first time point, and can pause recording the first video data. During the pause period, the user can adjust the framing screen. In this way, during the process of editing and processing the first video data, the electronic device can add a first transition effect at the first time point of the first video data, connect the video clips collected before and after the pause, and improve the watchability of the created second video data. The automated processing process also improves the efficiency of human-computer interaction.

[0013] In some possible embodiments, the fifth interface is a video recording interface under the first lens mode, and the fifth interface includes a fifth control indicating switching lens modes; before the electronic device receives the fifth operation, the method further includes: when recording to the second time point of the first video data, the electronic device freezes the third video frame in response to the user's sixth operation on the fifth control to obtain multiple first replacement frames; wherein the third video frame is the last video frame captured before receiving the sixth operation; the sixth operation is an operation indicating switching to the second lens mode; after the electronic device displays the seventh interface, the freeze on the third video frame is canceled; wherein the seventh interface is a video recording interface under the second lens mode; after the electronic device receives the fifth operation, the method further includes: the electronic device superimposes a second transition special effect on the first replacement frame.

[0014] In the above embodiment, the first video data may be a video shot by the electronic device in a normal mode. During the process of shooting the video, the electronic device receives an operation indicating switching the lens mode at a second time point, and can directly switch the lens mode, so that the electronic device can use different framing modes to collect video frames. In addition, the effect of lens mode switching on the quality of the video frame can be improved by freezing the frame, thereby improving the viewability of the second video data and improving the human-computer interaction efficiency of video editing.

[0015] In some possible embodiments, the second video data also includes: a second replacement frame, first music and a third transition effect; the third transition effect corresponds to the first music; the third transition effect is superimposed on the second replacement frame, and the second replacement frame is used to replace the first replacement frame in the first video data.

[0016] In the above embodiment, in the process of editing and processing the first video data, the second transition special effect added in the first video data can also be replaced by a third transition special effect, and the third transition special effect matches the first music. In this way, the music and the transition special effect in the obtained second video data are adapted to each other, thereby improving the watchability of the second video data and improving the human-computer interaction efficiency of editing the video.

[0017] In some possible embodiments, before the electronic device displays the third interface, the method also includes: the electronic device deletes the first replacement frame; wherein the first replacement frame is located between the third video frame and the fourth video frame; the fourth video frame is the first video frame collected after the electronic device displays the seventh interface; the electronic device determines multiple frames of the second replacement frame; wherein the second replacement frame includes frames identical to the third video frame and frames identical to the fourth video frame; the number of the second replacement frames is not less than the number of the first replacement frames; the electronic device superimposes the third field special effect on the second replacement frame to obtain the second video data.

[0018] In some possible embodiments, before the electronic device displays the first interface, the method also includes: the electronic device displays a main interface; the main interface includes an icon of a gallery application; the electronic device receives a seventh operation of the user on the icon of the gallery application; the electronic device displays the first interface, including: the electronic device displays the first interface in response to the seventh operation, the first interface being an application interface provided by the gallery application.

[0019] In some possible embodiments, before the electronic device displays the third interface, the method also includes: the electronic device determines a first effect template from a plurality of preconfigured effect templates in response to the second operation; the first effect template includes first music; the electronic device determines the first transition special effect corresponding to the first music; when the first transition special effect is any one of a dissolve transition, a blur transition or a melt transition, the electronic device overlaps the first freeze frame on the second video frame; and overlaps the second freeze frame under the first video frame; the electronic device superimposes the first transition special effect on the first video frame and the second video frame.

[0020] In some possible embodiments, the first effect template corresponds to a first style; determining the first effect template from a plurality of preconfigured effect templates includes: the electronic device using a preset artificial intelligence model to determine that the first video data matches the first style; the electronic device determines the first effect template from the effect templates belonging to the first style; or, the electronic device randomly determines the first effect template from a plurality of preset effect templates.

[0021] In the above embodiment, the electronic device can produce diverse second video data by randomly determining the first effect template, thereby avoiding the production of stereotyped video works and improving the human-computer interaction efficiency of video production.

[0022] In some possible embodiments, the electronic device determines the first transition special effect corresponding to the first music, including: the electronic device determines the first transition special effect having an associated identifier with the first music from a plurality of preset transition special effects; or, the electronic device determines the first transition special effect from a plurality of preset transition special effects based on a matching weight; wherein each of the preset transition special effects corresponds to a matching weight, and the matching weight is a quantized ratio parameter of the degree of fit between the first music and the preset transition special effect.

[0023] In the above embodiment, while ensuring that the transition special effects in the second video data are adapted to the music, the randomness of the transition special effects that appear is improved, thereby improving the watchability of the produced video work.

[0024] In a second aspect, an embodiment of the present application provides a method for adding transition special effects, which is applied to an electronic device, and the method includes: the electronic device displays an eighth interface; wherein the eighth interface includes a first identifier indicating a first effect template; the first effect template includes first music and a first transition special effect corresponding to the first music; the electronic device displays a ninth interface in response to a user's operation on the first identifier; the ninth interface is a framing preview interface corresponding to the first effect template; the ninth interface includes a sixth control indicating the start of shooting; the electronic device displays a tenth interface in response to a user's operation on the sixth control, and starts recording third video data; wherein the tenth interface is a video recording interface corresponding to the first effect template; the tenth interface includes a second control indicating pause shooting; when recording to a first time point of the third video data, the electronic device displays an eleventh interface in response to the user's operation on the second control; wherein the eleventh interface is pause shooting the eleventh interface includes a third control indicating to continue shooting; the electronic device displays the tenth interface again in response to the user's operation on the third control, and determines the fifth video frame and the sixth video frame located before and after the first time point in the third video data; after the third video data is recorded, the twelfth interface is displayed; the twelfth interface is used to display the fourth video data; the fourth video data includes the video frame of the third video data, the first music and the first transition special effect; when the first transition special effect is any one of a dissolve transition, a blur transition or a melt transition, the fourth video data also includes a third freeze frame and a fourth freeze frame; the third freeze frame is the same as the fifth video frame, the fourth freeze frame is the same as the sixth video frame, the third freeze frame overlaps with the sixth video frame, the fourth freeze frame overlaps with the fifth video frame, and the first transition special effect is superimposed on the fifth video frame and the sixth video frame.

[0025] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising one or more processors and a memory; the memory is coupled to the processor, the memory is used to store computer program code, the computer program code includes computer instructions, and when the one or more processors execute the computer instructions, the one or more processors are used to:

[0026] A first interface is displayed; wherein the first interface includes a first thumbnail of first video data; a first operation of a user on the first thumbnail is received; in response to the first operation, a second interface is displayed; the second interface is a video editing interface of the first video data; the second interface includes a one-key blockbuster control; after receiving a second operation of the user on the one-key blockbuster control, a third interface is displayed; wherein the third interface is used to display second video data; the second video data includes a video frame of the first video data and a first transition special effect; when the first transition special effect is any one of a dissolve transition, a blur transition or a melt transition, the second video data also includes a first freeze frame and a second freeze frame; the first freeze frame is the same as the first video frame, the second freeze frame is the same as the second video frame, and the first video frame and the second video frame are two adjacent frames in the first video data; the first freeze frame overlaps with the second video frame, the second freeze frame overlaps with the first video frame, and the first transition special effect is superimposed on the first video frame and the second video frame.

[0027] In some possible embodiments, the one or more processors are further used to: display a fourth interface; the fourth interface is a viewfinder preview interface provided by a camera application; the fourth interface includes a first control indicating the start of video shooting; a third operation of the user on the first control is received; in response to the third operation, a fifth interface is displayed, and the first video data is started to be recorded; wherein the fifth interface is a video recording interface; the fifth interface includes a second control indicating pause shooting; when recording to a first time point of the first video data, in response to the user's operation on the second control, a sixth interface is displayed; wherein the sixth interface is an interface for pausing shooting; the sixth interface includes a third control indicating continued shooting; a fourth operation of the user on the third control is received; in response to the fourth operation, the fifth interface is displayed again, and the first video frame and the second video frame located before and after the first time point are determined in the first video data; wherein the fifth interface includes a fourth control indicating stop shooting; a fifth operation of the user on the fourth control is received; in response to the fifth operation, the first interface is displayed; and the first interface is also a viewfinder preview interface provided by the camera application.

[0028] In some possible embodiments, the fifth interface is a video recording interface in the first lens mode, and the fifth interface includes a fifth control indicating switching lens modes; and the one or more processors are further configured to:

[0029] When recording to the second time point of the first video data, in response to the user's sixth operation on the fifth control, the third video frame is frozen to obtain multiple first replacement frames; wherein the third video frame is the last video frame captured before receiving the sixth operation; the sixth operation is an operation indicating switching to the second lens mode; after displaying the seventh interface, the freeze on the third video frame is canceled; wherein the seventh interface is the video recording interface under the second lens mode; and a second transition special effect is superimposed on the first replacement frame.

[0030] In some possible embodiments, the second video data also includes: a second replacement frame, first music and a third transition effect; the third transition effect corresponds to the first music; the third transition effect is superimposed on the second replacement frame, and the second replacement frame is used to replace the first replacement frame in the first video data.

[0031] In some possible embodiments, the one or more processors are also used to: delete the first replacement frame; wherein the first replacement frame is located between the third video frame and the fourth video frame; the fourth video frame is the first video frame captured after the electronic device displays the seventh interface; determine multiple frames of the second replacement frame; wherein the second replacement frame includes frames identical to the third video frame and frames identical to the fourth video frame; the number of the second replacement frames is not less than the number of the first replacement frames; and superimpose the third transition special effect on the second replacement frame to obtain the second video data.

[0032] In some possible embodiments, the one or more processors are further configured to:

[0033] Displaying a main interface; the main interface includes an icon of a gallery application; receiving a seventh operation performed by a user on the icon of the gallery application; and displaying the first interface in response to the seventh operation, the first interface being an application interface provided by the gallery application.

[0034] In some possible embodiments, the one or more processors are further configured to:

[0035] In response to the second operation, a first effect template is determined from multiple preconfigured effect templates; the first effect template includes first music; the first transition special effect corresponding to the first music is determined; when the first transition special effect is any one of a dissolve transition, a blur transition or a melt transition, the first freeze frame is overlapped on the second video frame; and the second freeze frame is overlapped under the first video frame; the first transition special effect is superimposed on the first video frame and the second video frame.

[0036] In some possible embodiments, the first effect template corresponds to a first style; and the one or more processors are further configured to:

[0037] Use a preset artificial intelligence model to determine whether the first video data matches the first style; determine the first effect template from the effect templates belonging to the first style; or randomly determine the first effect template from multiple preset effect templates.

[0038] In some possible embodiments, the one or more processors are further configured to: determine the first transition effect having an association identifier with the first music from a plurality of preset transition effects;

[0039] Alternatively, based on the matching weight, the first transition special effect is determined from a plurality of preset transition special effects;

[0040] Each of the preset transition effects corresponds to a matching weight, and the matching weight is a quantized ratio parameter of the degree of adaptability between the first music and the preset transition effect.

[0041] In a fourth aspect, an electronic device provided by an embodiment of the present application includes one or more processors and a memory; the memory is coupled to the processor, the memory is used to store computer program code, the computer program code includes computer instructions, and when one or more processors execute the computer instructions, the one or more processors are used to: display an eighth interface; wherein the eighth interface includes a first identifier indicating a first effect template; the first effect template includes a first music and a first transition special effect corresponding to the first music; in response to a user's operation on the first identifier, a ninth interface is displayed; the ninth interface is a framing preview interface corresponding to the first effect template; the ninth interface includes a sixth control indicating the start of shooting; in response to a user's operation on the sixth control, a tenth interface is displayed, and recording of a third video data is started; wherein the tenth interface is a video recording interface corresponding to the first effect template; the tenth interface includes a second control indicating the pause of shooting; when recording to the first time point of the third video data, in response to the user's operation on the second The control is operated to display an eleventh interface; wherein the eleventh interface is an interface for pausing shooting; the eleventh interface includes a third control for instructing to continue shooting; in response to the user's operation on the third control, the tenth interface is displayed again, and in the third video data, the fifth video frame and the sixth video frame located before and after the first time point are determined; after the third video data is recorded, the twelfth interface is displayed; the twelfth interface is used to display the fourth video data; the fourth video data includes the video frame of the third video data, the first music and the first transition special effect; when the first transition special effect is any one of a dissolve transition, a blur transition or a melt transition, the fourth video data also includes a third freeze frame and a fourth freeze frame; the third freeze frame is the same as the fifth video frame, the fourth freeze frame is the same as the sixth video frame, the third freeze frame overlaps with the sixth video frame, the fourth freeze frame overlaps with the fifth video frame, and the first transition special effect is superimposed on the fifth video frame and the sixth video frame.

[0042] In a fifth aspect, an embodiment of the present application provides a computer storage medium, comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method described in the first aspect, the second aspect and possible embodiments thereof.

[0043] In a sixth aspect, the present application provides a computer program product. When the computer program product runs on the above-mentioned electronic device, it enables the electronic device to execute the methods described in the above-mentioned first aspect, second aspect and possible embodiments thereof.

[0044] It can be understood that the electronic devices, computer storage media and computer program products provided in the above-mentioned aspects are all applied to 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. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0046] Figure 2 One of the example diagrams of the display interface provided in the embodiment of the present application;

[0047] Figure 3 The second example diagram of the display interface provided in the embodiment of the present application;

[0048] Figure 4 An example diagram conceptually shows the effect of switching the lens mode from the front-to-back mode to the picture-in-picture mode on the video data 1;

[0049] Figure 5 An example diagram conceptually showing processing of video data 1 after the lens mode is switched from the front-to-back mode to the picture-in-picture mode;

[0050] Figure 6 The third example diagram of the display interface provided in the embodiment of the present application;

[0051] Fig. 7A One of the example diagrams conceptually illustrates processing video data 1 in a scenario where the lens mode is switched from the front-to-back mode to the rear-to-back mode;

[0052] Figure 7B The second example diagram conceptually shows the processing of video data 1 in a scenario where the lens mode is switched from the front-to-back mode to the back-to-back mode;

[0053] Figure 7C The fourth example diagram of the display interface provided in the embodiment of the present application;

[0054] Fig.7D An example diagram conceptually shows the effect of a pause event on video data 1;

[0055] Figure 8 The fifth example of the display interface provided in the embodiment of the present application;

[0056] Fig. 9 Figure 6 of the example of the display interface provided in the embodiment of the present application;

[0057] Fig.10 Figure 7 of the example display interface provided in the embodiment of the present application;

[0058] Fig.11 A flowchart of the steps of processing video data 1 using an effect template provided in an embodiment of the present application;

[0059] Fig.12 An example diagram conceptually showing how to replace the original transition effect in the video data 1;

[0060] Fig.13 An example diagram conceptually showing adding an overlay transition to video data 1;

[0061] Fig.14 An eighth example of a display interface provided in an embodiment of the present application;

[0062] Fig.15 Figure 9 is an example of a display interface provided in an embodiment of the present application;

[0063] Fig.16 Figure 10 is an example of a display interface provided in an embodiment of the present application;

[0064] Fig.17 A schematic diagram of the composition of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0065] 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.

[0066] The implementation of this embodiment will be described in detail below with reference to the accompanying drawings.

[0067] The embodiment of the present application provides a method for adding transition effects, which can be applied to electronic devices with multiple cameras. Using the method provided by the embodiment of the present application, the electronic device can respond to user operations and automatically process video data, such as adding transition effects, configuring video music, etc. After adding transition effects, the video duration is not affected, rework is avoided, and the human-computer interaction efficiency of creating videos is improved.

[0068] Exemplarily, the electronic device in the embodiments of the present application may be a mobile phone, a tablet computer, a smart watch, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, as well as a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, and other devices including multiple cameras. The embodiments of the present application do not impose any special restrictions on the specific form of the electronic device.

[0069] The following will describe in detail the implementation of the embodiment of the present application in conjunction with the accompanying drawings. Figure 1 , is a schematic diagram of the structure of an electronic device 100 provided in an embodiment of the present application. Figure 1 As 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, etc.

[0070] Among them, the above-mentioned sensor module 180 may include sensors such as pressure sensor, gyroscope sensor, air pressure sensor, magnetic sensor, acceleration sensor, distance sensor, proximity light sensor, fingerprint sensor, temperature sensor, touch sensor, ambient light sensor and bone conduction sensor.

[0071] It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 100. In other embodiments, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate 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.

[0072] 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.

[0073] 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.

[0074] 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.

[0075] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0076] It is understandable that the interface connection relationship between the modules shown in this embodiment is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0077] 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.

[0078] 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.

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

[0080] The ISP is used to process the data fed back by the 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 the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. The ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP can be set in the camera 293.

[0081] 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 light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion 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 N cameras 193, where N is a positive integer greater than 1.

[0082] Exemplarily, the N cameras 193 may include: one or more front cameras and one or more rear cameras. For example, the electronic device 100 is a mobile phone. The mobile phone includes at least one front camera. The front camera is configured on the front side of the mobile phone, such as, Figure 2 The front camera 201 shown in (a) in FIG. In addition, the mobile phone includes at least one rear camera. The rear camera is arranged on the back side of the mobile phone. In this way, the front camera and the rear camera face different directions.

[0083] In some embodiments, the electronic device may enable at least one of the N cameras 193 to shoot and generate corresponding photos or videos. For example, a front camera of the electronic device 100 is used alone to shoot. For another example, a rear camera of the electronic device 100 is used alone to shoot. For another example, two front cameras are enabled at the same time to shoot. For another example, two rear cameras are enabled at the same time to shoot. For another example, a front camera and a rear camera are enabled at the same time to shoot, etc.

[0084] It is understandable that enabling a single camera 193 for shooting can be referred to as enabling a single-camera mode, such as a front-camera mode (also referred to as a single front mode) and a rear-camera mode (also referred to as a single rear mode). Enabling multiple cameras 193 for shooting at the same time can be collectively referred to as enabling a multi-camera mode, such as a front-front mode, a front-back mode, a rear-back mode, and a picture-in-picture mode.

[0085] Take the example of enabling a front camera and a rear camera at the same time. After enabling a front camera and a rear camera at the same time to take pictures, the electronic device can render and merge the image frames captured by the front camera and the rear camera. Among them, the above-mentioned rendering and merging can be splicing the image frames captured by different cameras. For example, after taking a vertical screen photo using the front-to-back mode, the image frames captured by different cameras can be spliced ​​up and down. For another example, after taking a horizontal screen photo using the back-to-back mode, the image frames captured by different cameras can be spliced ​​left and right. For another example, after taking a photo using the picture-in-picture mode, the image frames captured by one camera can be inlaid in the image frames captured by another camera. Then, encoding is performed to generate photos.

[0086] In addition, after a front camera and a rear camera are enabled to shoot video at the same time, the front camera collects one video stream and caches it. The rear camera collects one video stream and caches it. Then, the electronic device 100 renders and merges the two cached video streams frame by frame, that is, renders and merges the video frames with the same or matching acquisition time points in the two video streams. After that, encoding is performed to generate a video file.

[0087] 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.

[0088] 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.

[0089] 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.

[0090] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110. The speaker 170A, also called a "speaker", is used to convert audio electrical signals into sound signals. In this way, the electronic device 100 can play audio data, such as video music, etc.

[0091] The pressure sensor is used to sense pressure signals and can convert pressure signals into electrical signals. In some embodiments, the pressure sensor can be arranged on the display screen 194. The gyroscope sensor can be used to determine the movement posture of the electronic device 100. When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device 100, and is applied to applications such as horizontal and vertical screen switching. Touch sensor, also known as "touch panel". The touch sensor can be arranged on the display screen 194, and the touch sensor and the display screen 194 form a touch screen, also known as a "touch screen". The touch sensor 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.

[0092] In order to make the description of the following embodiments clear and concise, a brief introduction to the relevant concepts or technologies is first given:

[0093] After the user uses an electronic device to shoot a video, the video can be edited by operating the electronic device, such as configuring video music, adding animation effects, adding transition effects, etc. In this way, the video after secondary creation will be more vivid and rich, and also in line with the user's creative intention. Among them, adding transition effects can not only make the transition of video content more natural, but also make the content presented in the video richer.

[0094] However, in the related art, on the one hand, if a user manually changes the original transition effect in a video, the operation process is very complicated. If the user does not change the original transition effect, the original transition effect may not match the video music style selected by the user. On the other hand, after adding some types of transition effects (such as dissolve transition) to the video, the video length will be shortened, which affects the video quality and the user experience.

[0095] To solve this problem, an embodiment of the present application provides a method for adding transition effects. The method of the embodiment of the present application is described below by taking the electronic device 100 as a mobile phone as an example.

[0096] In some embodiments, the above method can be used to process video data shot without selecting an effect template. It is understandable that in the scenario where no effect template is selected for shooting, the mobile phone can directly store the original video shot after finishing shooting.

[0097] In other embodiments, the above method can also be used to process video data shot when an effect template is selected. It is understandable that in the scenario where an effect template is selected for shooting, after the mobile phone finishes shooting the video, it can edit the video according to the effect template to obtain a video work with a style similar to the effect template and then save it.

[0098] It is understandable that when creating a video work with music, filters, and special effects, using the above effect templates helps to simplify the complexity of creation. Exemplarily, the effect template includes configuration items such as filters, stickers, and multiple optional transition effects. At the same time, the effect template also corresponds to video music.

[0099] The following description is given by taking the case where no effect template is selected, video data 1 is shot by a mobile phone, and the above method is used to process video data 1 as an example:

[0100] like Figure 2 As shown in (a) of FIG. 1 , the mobile phone includes a main interface. The main interface is also called a desktop 202. The main interface may be a user interface displayed after the mobile phone is unlocked. The main interface may include icons of installed applications (Application, APP), such as an icon 203 of a camera APP.

[0101] In some embodiments, the mobile phone can receive the user's operation on the main interface and start the APP indicated by the operation. Figure 2 As shown in (a) of FIG. 1 , the mobile phone can receive an operation of the user on icon 203, such as a click operation, and in response to the operation, start the camera APP. After the camera APP is started, the application interface provided by the camera APP can be displayed. For example, the viewfinder interface for realizing the shooting function is displayed, that is, Figure 2 Interface 204 shown in (b) in FIG.

[0102] In some embodiments, the user can switch different function modes of the camera APP in the interface 204, such as portrait function mode, photo function mode, video function mode and multi-lens video function mode. That is, the mobile phone can receive the user's operation 1 in the interface 204, and the operation 1 is used to instruct the camera APP to switch different function modes.

[0103] Exemplarily, the interface 204 includes controls corresponding to multiple function modes of the camera APP, such as portrait controls, photo controls, video controls, multi-lens video controls, etc. Among them, the photo control is in a selected state, which is used to prompt the user that the current framing interface is used to implement the shooting function.

[0104] While displaying interface 204, the mobile phone can receive the user's operation on any of the portrait controls, video controls, and multi-lens video controls, and determine the switched functional mode based on the operation. In addition, the mobile phone can also display the framing interface for implementing the functional mode.

[0105] For example, when the mobile phone receives an operation on the portrait control by the user, such as a click operation, the viewfinder interface for implementing the portrait shooting function can be displayed. When the mobile phone receives an operation on the video control by the user, such as a click operation, the viewfinder interface for implementing the video recording function can be displayed. Figure 2 As shown in (b) of FIG. 1 , when the mobile phone receives an operation of the user on the multi-lens recording control, such as a click operation, a framing interface for realizing the multi-lens recording function may be displayed, that is, Figure 2 The interface 205 shown in (c) is also called the fourth interface.

[0106] Among them, both the video recording function and the multi-lens video recording function can record video data, and the difference between the two is that the lens modes enabled at the start of recording are different. In the video recording function, the mobile phone can respond to the user's operation and enable single-lens modes such as single front mode or single rear mode to shoot video. In the multi-lens video recording function, the mobile phone can respond to the user's operation and enable multi-lens modes such as front-to-back mode, rear-to-rear mode or picture-in-picture to shoot video. The method provided in the embodiment of the present application is not only applicable to video data shot under the video recording function, but also to video data shot under the multi-lens video recording function, and the implementation principle is the same. In the subsequent embodiments, the method provided in the embodiment of the present application is mainly introduced by taking the multi-lens video recording function as an example.

[0107] In the multi-camera recording function, Figure 2 As shown in (c) in the figure, the framing interface (i.e., interface 205) displayed by the mobile phone includes multiple framing frames, such as framing frame 206 and framing frame 207. The arrangement position relationship between framing frame 206 and framing frame 207 is related to the posture of the mobile phone. For example, in a scenario where the gyroscope sensor of the mobile phone recognizes that the mobile phone is in a portrait state, the framing frame 206 and framing frame 207 are arranged up and down. In a scenario where the gyroscope sensor of the mobile phone recognizes that the mobile phone is in a landscape state, the framing frame 206 and framing frame 207 are arranged left and right.

[0108] In addition, viewfinder 206 and viewfinder 207 correspond to cameras respectively. For example, viewfinder 206 corresponds to camera 1 (such as rear camera a), so that viewfinder 206 can be used to display the video stream uploaded by camera 1. Viewfinder 207 corresponds to camera 2 (such as front camera), so that viewfinder 207 can be used to display the video stream uploaded by camera 2. It can be understood that the camera corresponding to each viewfinder (such as viewfinder 206 and viewfinder 207) can be adjusted according to the user's operation. After the camera corresponding to each viewfinder changes, it means that the lens mode used by the mobile phone also changes accordingly. Several scenarios of lens mode switching will be introduced in subsequent embodiments, which will not be repeated here.

[0109] In addition, in interface 205, the mobile phone can receive operation 2 of the user, which is used to trigger the mobile phone to directly start video shooting without selecting any effect template. Exemplarily, interface 205 includes a control 208 for indicating the start of shooting, such as a first control. When the mobile phone receives a third operation of the user on control 208, such as a click operation, a recording interface can be displayed, such as a fifth interface, for example, Figure 2 The interface 209 shown in (d) in FIG. The interface 209 also includes a viewfinder 206 and a viewfinder 207. In this way, the interface 209 of the mobile phone can display the video streams collected by the front camera and the rear camera a in real time. At the same time, the mobile phone can also render and merge the video streams collected by the front camera and the rear camera a, and then encode them to generate video data and save them. During the shooting process, the video frames of the video data will gradually increase.

[0110] In addition, during the video shooting process, the mobile phone may receive the user's operation 3 in the interface 209, and the operation 3 may be an operation for instructing to switch the lens mode. In response to the operation 3, the mobile phone may enable different cameras or different camera combinations to collect video streams, so that the user can create videos with diverse scenes and rich content.

[0111] Exemplarily, the interface 209 may include a control for indicating switching lens modes, also referred to as a fifth control, such as: Figure 3 The control 301 shown in (a) of FIG. 301 is used to indicate the currently enabled lens mode. After the mobile phone receives the user's operation on the control 301, Figure 3As shown in (b) of FIG. 2 , a lens mode selection window, such as window 302, may be displayed in interface 209. In the window 302, a plurality of lens modes for selection are listed, such as front-to-back mode, rear-to-rear mode, picture-in-picture mode, single-rear mode, single-rear mode, etc. In window 302, the front-to-back mode is in a selected state. In this scenario, the mobile phone may receive a user's selection operation of the rear-to-rear mode, the picture-in-picture mode, the single-rear mode, or the single-rear mode, and switch the lens mode used in response to the selection operation.

[0112] Among them, the operation of switching the lens mode by operating the fifth control may be referred to as the sixth operation. The time when the sixth operation is received, corresponding to the moment in the video data 1, may be referred to as the second time point. The mode before the lens mode switching may be referred to as the first lens mode, and the mode after the lens mode switching may be referred to as the second lens mode. The video recording interface before the lens mode switching may be referred to as the fifth interface, and the recording interface after the lens mode switching may be referred to as the seventh interface.

[0113] For example, when the mobile phone receives a user's selection operation for the picture-in-picture mode, the mobile phone can switch the lens mode to the picture-in-picture mode. Figure 3 In (c), the mobile phone can switch the display interface 303. The interface 303 also includes a viewfinder 206 and a viewfinder 207. Among them, the viewfinder 206 continues to be used to display the video stream uploaded by the rear camera a, and the viewfinder 207 also continues to be used to display the video stream uploaded by the front camera.

[0114] In addition, during the switching process, the view frame 207 is reduced. However, the view frame 206 is increased. In addition, the view frame 207 is superimposed on the view frame 206. In this process, the camera parameters of the front camera and the rear camera a are also adjusted. After adjusting the camera parameters, the video streams captured by the front camera and the rear camera a may not be uploaded in time. This will cause pauses in the captured video data 1. That is, if Figure 3 As shown in (c) of FIG. 303 , the viewfinder 206 and the viewfinder 207 of the interface 303 will be briefly black. Of course, after the camera parameters are adjusted, Figure 3 As shown in (d) in FIG. 3 , the viewfinder 207 of the interface 303 displays the video stream uploaded by the front camera in real time, and the viewfinder 206 displays the video stream uploaded by the rear camera a in real time.

[0115] refer to Figure 4 , Figure 4The effect on video data 1 after the lens mode is switched (from front-to-back mode to picture-in-picture mode) during video shooting by a mobile phone is conceptually demonstrated. On the relative time axis of video data 1, between time 00:00 and 00:05, both the front camera and the rear camera a can upload video streams normally. At the same time, the mobile phone can also encode the video streams uploaded by the front camera and the rear camera a normally to generate continuous multiple video frames, also known as video clip 1. The relative time axis is a time axis created based on video data 1. The time 00:00 of the relative time axis corresponds to the acquisition time of the first video frame (also known as the first frame) of video data 1.

[0116] After time 00:05 (i.e., the second time point), the mobile phone detects an operation indicating switching to the picture-in-picture mode. This operation can temporarily affect the video streams of the front camera and the rear camera a, so there is a problem of missing video frames between time 00:05 and time 00:06. After time 00:06, the front camera and the rear camera a return to normal, and can collect and encode continuous video frames, that is, obtain video clip 2.

[0117] In the embodiments of the present application, Figure 5 As shown, the mobile phone can insert multiple frames of replacement frame 1, also called first replacement frame, between time 00:05 and time 00:06 to obtain a coherent flow of video data 1.

[0118] In some examples, after the mobile phone determines that the user instructs to switch to the picture-in-picture mode, the mobile phone can freeze the video frame 401 (the last frame in the video clip 1) to obtain the replacement frame 1. The video frame 401 can be called the third video frame. In this scenario, the screen content displayed by the replacement frame 1 is the same as that of the video frame 401. After re-receiving the video streams sent back by each camera, the mobile phone cancels the frame freeze for the video frame 401.

[0119] In other examples, after determining that the user instructs to switch to the picture-in-picture mode, the mobile phone can insert a preview-configured image frame, such as a black image frame or a white image frame, after the video frame 401, until the video streams returned by each camera are received again, and then stop inserting the replacement frame 1. It can be understood that the inserted image frames can also be collectively referred to as replacement frames 1.

[0120] In other examples, after determining that the user instructs to switch to the picture-in-picture mode, the mobile phone can mark the video frame 401. In this way, after completing the shooting of the video data 1, the mobile phone automatically inserts multiple frames of replacement frame 1 after the video frame 401. The replacement frame 1 can be the same image frame as the video frame 401, or it can be a pre-configured white image frame or black image frame.

[0121] For another example, when the interface 209 includes a window 302, Figure 6 As shown in (a) of FIG. 1 , the mobile phone can receive the user's selection operation for the rear-rear mode. In this way, the mobile phone can switch the lens mode used to the rear-rear mode in response to the selection operation. That is, Figure 6 In (b), the mobile phone can switch the display interface 601. The interface 601 also includes a viewfinder 206 and a viewfinder 207. Among them, the viewfinder 206 is used to display the video stream uploaded by the rear camera a, and the viewfinder 207 is used to display the video stream uploaded by the rear camera b.

[0122] In addition, after selecting the back-to-back mode in window 302, while the interface 209 is displayed, that is, while the mobile phone is shooting video in the front-to-back mode, the mobile phone receives a user operation on the control 602, such as a click operation, and the lens mode can also be switched to the back-to-back mode.

[0123] In the process of switching to the rear-rear mode, the relative position and size between the view frame 206 and the view frame 207 remain unchanged, the mobile phone enables the rear camera b, turns off the front camera, and matches the rear camera b with the view frame 207. In this way, the view frame 206 of the mobile phone continues to display the video stream uploaded by the rear camera a, while the view frame 207 displays the video stream uploaded by the rear camera b.

[0124] During this process, the video stream sent back by the rear camera a is not affected. Figure 6 As shown in (b) in FIG. 1 , the image display of the viewfinder 206 is not affected during the lens switching. However, due to the hardware response delay, there is a time gap between the front camera turning off and the rear camera b uploading the video stream normally. During this time gap, the image display of the viewfinder 207 is affected, such as Figure 6 As shown in (b) in FIG. 2 , a black screen appears briefly in the viewfinder 207. Of course, after the rear camera b can upload the video stream normally, as shown in FIG. Figure 6 As shown in (c) in FIG. 6 , the viewfinder 207 of the interface 601 can display the video stream uploaded by the rear camera b in real time, and the viewfinder 206 can display the video stream uploaded by the rear camera a in real time.

[0125] refer to Fig. 7A , Fig. 7A The following conceptually shows an example diagram of generating video data 1 when the lens mode is switched (from front-to-back mode to rear-to-rear mode) during video shooting with a mobile phone.

[0126] like Fig. 7AAs shown in (a) in FIG. 1 , on the relative time axis of video data 1, there are multiple video frames with abnormal images between time 00:05 and time 00:06. These video frames with abnormal images are caused by the switching of lens modes.

[0127] In some embodiments, the mobile phone can mark the video frame when instructing to start the rear camera b. After determining that the rear camera b has returned the video stream normally, the marking is stopped. Fig. 7A As shown in (b) in FIG, the mobile phone can remove the video frame corresponding to the marked position, so that video clip 1 and video clip 2 can be obtained. Then, in order to ensure the continuity of the video data, as shown in FIG. Fig. 7A As shown in (c) in FIG. 8 , the mobile phone may also add a replacement frame 1 between the video segment 1 and the video segment 2 , thereby obtaining video data 1 .

[0128] In other embodiments, after the mobile phone determines that a new camera (ie, rear camera b) needs to be enabled, the last video frame that has been captured may be frozen, for example, Figure 7B The video frame 701 in the video frame is frame-frozen to obtain the replacement frame 1. After determining that the rear camera b has normally returned the video stream, the frame-frozen for the video frame 701 is canceled, and the video streams uploaded by the rear cameras a and b are normally encoded to generate the video data 1.

[0129] It can be seen that the adding of the replacement frame 1 mentioned in the above embodiment can be done after the video shooting is completed, or can be done during the video shooting process.

[0130] In addition, switching the lens mode will not interrupt the normal shooting of the video. For example, after the mobile phone is switched to the rear mode, the mobile phone can display the interface 601 and shoot the video. In this way, the number of video frames corresponding to the video data 1 will continue to increase.

[0131] In the above examples, the mobile phone switches the lens mode from the front-to-back mode to the picture-in-picture mode, and from the front-to-back mode to the back-to-back mode. In actual applications, similar problems also exist when switching between other lens modes, which can also be solved by inserting the replacement frame 1 described in the above examples, and will not be repeated here.

[0132] In addition, it is understandable that when a replacement frame 1 is added to the video data 1, a still picture may appear during playback. In the embodiment of the present application, the mobile phone can add a replacement frame to the video data 1 and also superimpose a transition effect on multiple replacement frames 1, such as transition effect 1 or second transition effect.

[0133] In some examples, the transition effect 1 can be any type of transition effect pre-specified in the mobile phone, such as left transition, right transition, rotation transition, superposition transition, blur transition, melting transition, black transition, white transition, zoom in transition, zoom out transition, up transition and down transition. In addition, it is required that among the above transition effects, the left transition and the right transition are only applicable to the scene of shooting the video in the vertical screen, while the up transition and the down transition are only applicable to the scene of shooting the video in the horizontal screen. In other examples, the up transition effect 1 can be a transition randomly determined by the mobile phone from the above multiple types of transition effects.

[0134] In this way, transition effect 1 can better connect the video clips before and after the replacement frame 1, that is, there can be a better transition between video clip 1 and video clip 2, which improves the user's viewing experience and also improves the video shooting quality.

[0135] In addition, in the area where transition effect 1 is added, the mobile phone can also mark the alternative frame 1 where the transition effect is actually superimposed, such as marking mark 1, so that the mobile phone can later identify the location where the transition is added.

[0136] In some other embodiments, during the video shooting process, the mobile phone may also receive an operation for instructing to pause shooting. The mobile phone may respond to the instruction to pause shooting and stop shooting the video. Figure 7C As shown in (a), during the period when the mobile phone displays the interface 209, that is, the mobile phone is in the process of shooting a video, the user can receive an operation of the pause control (such as control 701), that is, the second control, such as a click operation. The mobile phone can also pause encoding and storing video frames in response to the operation.

[0137] At this time, during the pause period, if Figure 7C As shown in (b) of FIG. 1 , the mobile phone can also display an interface 702, such as the sixth interface. The shooting duration in the interface 702 is paused. In addition, the interface 702 also includes a viewfinder 206 and a viewfinder 207, which can continue to display the video stream uploaded by the corresponding camera to facilitate the user to preview the framing effect.

[0138] In other embodiments, the mobile phone may also receive an operation from the user indicating to resume shooting, and in response to the operation, display the interface 209 again. Figure 7C As shown in (b) of FIG. 7 , the mobile phone receives a fourth operation of the user on the control 703 (ie, the third control) on the interface 702, such as Figure 7C As shown in (c) in the figure, the interface 209 can be displayed again and the video can be continuously shot.

[0139] Like the switch lens mode, pausing shooting will also have a certain impact on the captured video. However, unlike the switch lens mode, pausing shooting will not affect the continuity of the obtained video data 1, and there is no need to insert a replacement frame. In addition, the time point at which the instruction to suspend shooting is received is the first time point.

[0140] For reference Fig.7D , Fig.7D The following is a conceptual diagram showing an example of generating video data 1 when a pause event occurs during the process of shooting a video with a mobile phone.

[0141] like Fig.7D As shown, during the period from 00:00 to 00:05, the mobile phone shoots the video normally, that is, the video frames can be encoded and stored normally. During this period, the mobile phone can obtain video clip 1. Then, at time 00:05 (that is, the first time point), after the mobile phone receives the user's instruction to pause shooting, the mobile phone pauses shooting. During the pause of shooting, the mobile phone pauses encoding and storing video frames. At the same time, the cumulative shooting time is also paused. Until the mobile phone receives the user's instruction to resume shooting, the mobile phone continues shooting, that is, resumes encoding and storing video frames, thereby obtaining video clip 2. In this way, video clip 1 and video clip 2 can constitute video data 1. Of course, the picture difference between the last frame of video clip 1 and the first frame of video clip 1 will be very large. In this scenario, the mobile phone does not need to insert a replacement frame between video clip 1 and video clip 2, but can mark the first frame of video clip 1 and the last frame of video clip 2, such as marking mark 2.

[0142] In addition, in some embodiments, the mobile phone may also receive an operation 4 in which the user instructs to stop filming. Then, the mobile phone may respond to the operation 4 to stop filming the video.

[0143] For example, during the display interface 209, that is, during the mobile phone is shooting video data, such as Figure 8 As shown in (a) of FIG. 2 , the interface 209 further includes a control for indicating to pause shooting, also called a fourth control, such as control 801. The mobile phone can receive a fifth operation of the user on the control 801, such as a click operation. In response to the click operation on the control 801, the video shooting is stopped, and the shot video data 1, also called the first video data, is saved.

[0144] In addition, if Figure 8 As shown in (b) in FIG. 1 , after the mobile phone stops shooting the video, the interface 205 can be displayed again.

[0145] As another example, the mobile phone can exit the camera APP operation according to the user's instruction, such as sliding up on the interface 601, stop shooting, and save the shot video data 1. In addition, the mobile phone can also display the main interface again.

[0146] After the video data 1 is saved, the mobile phone can display the shot video data 1 according to the user's operation 5, so as to facilitate the user to edit the video data 1.

[0147] For example, when the shooting is stopped and the mobile phone displays the interface 205, the interface 205 includes a thumbnail of the video data 1, that is, a first thumbnail, such as icon 802. The interface 205 can also be an example of a first interface. In this example, the first interface can be an interface provided by a camera application. While the mobile phone displays the interface 205, it can receive a first operation of the user on the icon 802, and in response to the operation, display a video editing interface, also called a second interface, such as Figure 8 The interface 803 shown in (c) is used to display the video data 1.

[0148] For example, when shooting stops and the phone displays interface 205, the phone can exit the camera APP according to the user's instructions, such as swiping up, and display the main interface of the phone again, that is, the desktop 202. The desktop 202 also includes an icon of the gallery APP. Fig. 9 As shown in (a) of FIG. 2 , during the display of the desktop 202, the mobile phone can receive a seventh operation on the icon 901 of the gallery APP, such as a click operation, and in response to the operation, display the application interface provided by the gallery APP, such as Fig. 9 Of course, when the shooting is stopped and the mobile phone displays the main interface, the mobile phone can directly receive the click operation on the icon 901 of the gallery APP, and in response to the operation, display the application interface provided by the gallery APP, such as Fig. 9 Interface 902 shown in (b).

[0149] In some embodiments, interface 902 displays thumbnails of various picture resources and video resources, and interface 902 may be an example of a first interface. In this example, the first interface may be an application interface provided by a gallery APP. These picture resources or video resources may be taken and stored by a mobile phone, for example, a thumbnail 903 of video data 1, or may be thumbnails of images, videos, etc. downloaded from the Internet, or may be thumbnails of images, videos, etc. synchronized to the cloud.

[0150] In some embodiments, the mobile phone may receive a user's selection operation on a thumbnail of any video in interface 902, and in response to the user's selection operation on a thumbnail of any video, the mobile phone may display a corresponding video editing interface. For example, in response to a user's click operation on thumbnail 903 in interface 902, the mobile phone may display Fig. 9 Interface 803 shown in (c) is a video editing interface corresponding to video data 1.

[0151] In other embodiments, the mobile phone can automatically perform secondary creation on the video data 1 according to the user's operation in the above video editing interface, such as configuring video music, adding transition effects, etc. For example, Fig.10 As shown, the interface 803 also includes a control for instructing to edit the video data 1, such as a one-key blockbuster control 1001. When the mobile phone receives a second operation of the user on the one-key blockbuster control 1001, such as a click operation, the mobile phone can automatically edit the video data 1.

[0152] In some embodiments, Fig.11 As shown, the mobile phone can automatically edit video data 1, which may include the following steps:

[0153] S101 , the mobile phone determines an effect template matching the video data 1 .

[0154] In some embodiments, the mobile phone can be pre-configured with effect templates of various styles, each of which corresponds to a video music. In addition, the effect template also corresponds to filters, special effects, transitions, and stickers.

[0155] In some embodiments, the mobile phone can use an artificial intelligence model to analyze the screen content of video data 1 and determine an effect template that matches video data 1, also called effect template 1, or a first effect template. The first effect template corresponds to a first style, such as a soothing style.

[0156] For example, the artificial intelligence model of the mobile phone can search for similar videos based on the screen content of video data 1. And obtain the video music used by the similar videos. In this way, the corresponding effect template 1 is determined based on the obtained video music. For another example, the artificial intelligence model of the mobile phone searches for similar videos based on the screen content of video data 1. According to the style names of similar videos, multiple effect templates belonging to the same style are determined. Then, from the multiple determined effect templates, effect template 1 is randomly determined. In other embodiments, the mobile phone can also randomly determine an effect template as effect template 1.

[0157] S102, the mobile phone processes the video data 1 according to the effect template 1.

[0158] For example, the mobile phone can adjust the volume of the original soundtrack of video data 1 to zero, and then add the video music (i.e., the first music) of shooting template 1 to video data 1, so that the video music fits the video picture of video data 1. In other embodiments, the volume of the original soundtrack can also be adjusted to other decibel values ​​according to the user's operation.

[0159] As another example, the mobile phone can add filters, special effects, transitions, and stickers corresponding to the effect template 1 to the video data 1.

[0160] In the process of adding the transition special effect, the mobile phone can replace the original transition special effect in the video data 1 (eg, the transition special effect 1 superimposed on the replacement frame 1).

[0161] It can be understood that the adaptability between the effect template and various transition effects is different. Generally, the transition effect with a higher adaptability is relatively more suitable for the style of the effect template and the corresponding video music. The transition effect with a lower adaptability is relatively less suitable for the style of the effect template and the corresponding video music. In this embodiment, by replacing the transition effect 1, the problem of conflict between the original transition effect 1 and the processed video style after the video data is processed using the effect template is improved.

[0162] In some embodiments, Fig.12 As shown, the mobile phone can first identify whether there is a transition effect 1 in the video data 1. For example, it can be detected whether there is a video frame with a mark 1 in the video data 1. When the mark is identified, the video frame with the mark 1 (that is, the replacement frame 1 superimposed with the transition effect 1) is deleted, so that the video data 1 is divided into a video segment 1 and a video segment 2. Then, the mobile phone generates multiple replacement frames 2 and multiple replacement frames 3, and the above replacement frames 2 and replacement frames 3 can be collectively referred to as second replacement frames. Among them, the replacement frame 2 can be the same as the last frame of the video segment 1 (that is, the third video frame), and the replacement frame 3 is the same as the first frame of the video data 2 (that is, the fourth video frame). In addition, the number of replacement frames 2 and replacement frames 3 is not less than the number of deleted video frames to ensure that the length of the final video data 1 is not affected. Then, the mobile phone determines the transition effect 2 (that is, the third transition effect) based on the adaptability between the effect template 1 and various transition effects, and superimposes the transition effect 2 between the replacement frame 2 and the replacement frame 3 to achieve the connection between the video segment 1 and the video segment 2.

[0163] In some embodiments, the degree of fit between the effect template and the transition effect can be quantified as a matching weight. In this way, when determining the transition effect 2, the mobile phone can combine the matching weights between the effect template 1 and each transition effect, and randomly select the transition effect 2 that matches the effect template 1 from multiple types of transition effects. Understandably, the transition effect with a higher matching weight is relatively easier to be selected as the transition effect 2 that matches the effect template 1. The transition effect with a lower matching weight is relatively more difficult to be selected as the transition effect 2 that matches the effect template 1.

[0164] In some examples, the matching weights of effect templates and transition effects can be preconfigured. For example, as shown in Table 1 below:

[0165] Table 1

[0166]

[0167]

[0168] Table 1 above lists the corresponding relationship between different effect templates and the matching weights of video music, style, and different transition effects. The percentage value corresponding to each transition effect in the table is the matching weight between the transition effect and the effect template.

[0169] Take the Hello Summer effect template recorded in Table 1 as an example. The matching weight between the effect template and the dissolve transition is 50%, that is, the dissolve transition has a 50% probability of being selected as a matching transition effect. In addition, the matching weight between the effect template and the blur transition is 0%, that is, the blur transition will not be selected as a matching transition effect. The matching weight between the effect template and the melt transition is 0%, that is, the melt transition will not be selected as a matching transition effect. The matching weight between the effect template and the upward transition is 50%, that is, in the scenario of horizontal screen video data 1 that the mobile phone needs to process, the upward transition has a 50% probability of being selected as a matching transition effect. The matching weight between the effect template and the downward transition is 50%. Of course, in the scenario of horizontal screen video data 1 that the mobile phone needs to process, the downward transition has a 50% probability of being selected as a matching transition effect. The matching weight between the effect template and the left shift transition is 50%, that is, in the scenario of vertical screen video data 1 that the mobile phone needs to process, the left shift transition has a 50% probability of being selected as the matching transition effect. The matching weight between the effect template and the right shift transition is 50%. Of course, in the scenario of vertical screen video data 1 that the mobile phone needs to process, the right shift transition has a 50% probability of being selected as the matching transition effect. The matching weight between the effect template and the black field transition is 90%, that is, the black field transition has a 90% probability of being selected as the matching transition effect. The matching weight between the effect template and the white field transition is 90%, that is, the white field transition has a 90% probability of being selected as the matching transition effect. The matching weight between the effect template and the enlarged transition is 90%, that is, the enlarged transition has a 90% probability of being selected as the matching transition effect. The matching weight between the effect template and the zoom-out transition is 90%, that is, the zoom-out transition has a 90% probability of being selected as the matching transition effect. The matching weight between the effect template and the rotation transition is 30%, that is, the rotation transition has a 30% probability of being selected as the matching transition effect.

[0170] That is, the mobile phone can use the matching weights corresponding to each transition effect to randomly select transition effect 2 to replace transition effect 1. This selection method is not only highly flexible, but also can ensure that there is a high probability of a high correlation between the selected transition effect 2 and the effect template.

[0171] In some other embodiments, the video music in the effect template may also have an association mark with at least one transition special effect. The transition special effect with the association mark may be used preferentially.

[0172] In some embodiments, during the process of adding transition effects, the mobile phone may add transition effects to the video data 1. In some embodiments, the location point where the transition effect is added (that is, the video frame where the transition effect needs to be added) may be a location where the video picture in the video data 1 changes significantly, such as a location where the shooting is paused during shooting.

[0173] As shown in the above embodiment, when the mobile phone receives an operation indicating to pause shooting during video shooting, the last video frame (first video frame) captured at this time may be marked with mark 2. After the mobile phone receives an operation indicating to resume shooting (such as the fourth operation), the first video frame (second video frame) captured will also be marked with mark 2.

[0174] Thus, as an implementation method, the mobile phone can determine whether there is a position in the video data 1 where a transition needs to be added by identifying the marker 2. For example, the mobile phone can identify whether the video data 1 includes a video frame with the marker 2. After identifying the video frame with the marker 2, the mobile phone can add a transition effect between each group of adjacent video frames with the marker 2.

[0175] As another implementation method, the mobile phone can also use the artificial intelligence model to identify adjacent video frames whose picture content similarity is lower than a preset value from the video data 1, and add transition effects between the adjacent video frames.

[0176] The added transition effect can also be called transition effect 3 or the first transition effect. The transition effect 3 can also be a transition effect randomly determined by the mobile phone according to the matching weight between various transition effects and effect template 1, from left shift transition, right shift transition, rotation transition, dissolve transition, blur transition, melt transition, black transition, white transition, zoom in transition, zoom out transition, up transition and down transition, etc., as transition effect 3.

[0177] The following takes the adjacent video frames 1 and 2 with the mark 2 as an example to introduce the process of adding different types of transition effects 3.

[0178] When the matched transition effect 3 is any one of left shift transition, right shift transition, rotation transition, black field transition, white field transition, zoom in transition, zoom out transition, up shift transition or down shift transition, the mobile phone can directly superimpose transition effect 3 on video frame 1 and video frame 2 without additional processing. The specific implementation can refer to the relevant technology, which will not be repeated here.

[0179] When the matched transition special effect 3 is any one of the dissolve transition, blur transition or melt transition, the mobile phone needs to add video frames to video data 1 before superimposing transition special effect 3 on video frame 1 and video frame 2 to avoid shortening the duration of video data 1 after superimposing the special effect.

[0180] That is, in some embodiments, after the mobile phone determines that the transition effect 3 to be added between video frame 1 (first video frame) and video frame 2 (second video frame) is any one of dissolve transition, blur transition or melt transition, the mobile phone can add substitute frame 4 (first freeze frame) and substitute frame 5 (second freeze frame) between video frame 1 and video frame 2. Among them, substitute frame 4 is a freeze frame of video frame 1, that is, the picture content of substitute frame 4 is the same as that of video frame 1. Substitute frame 5 is a freeze frame of video frame 2, that is, the picture content of substitute frame 5 is the same as that of video frame 2.

[0181] like Fig.13 As shown, when the transition effect 3 is a dissolve effect, the mobile phone can overlap the substitute frame 5 with the video frame 1, wherein the video frame 1 is placed on top. At the same time, the mobile phone can also overlap the substitute frame 4 with the video frame 2, wherein the substitute frame 4 is placed on top. After the overlap is completed, a transparency change effect is added to the video frame 1 and the substitute frame 4. For example, the transparency of the video frame 1 is controlled from 0% to 50%, and the transparency of the substitute frame 4 is controlled from 50% to 100%.

[0182] In addition, when transition effect 3 is a blur effect or a melting transition effect, in addition to overlapping alternative frame 4 with video frame 2, alternative frame 5 with video frame 1, and controlling the transparency changes of video frame 1 and alternative frame 4, the mobile phone can also superimpose blur effects or melting effects on the overlapping alternative frame 4, video frame 2, video frame 1, and alternative frame 5.

[0183] In addition, in the aforementioned embodiment, when the transition effect 1 in the video data 1 is replaced by the transition effect 2, after the replacement is completed, the mobile phone can obtain the length of the video data 1. If the length is the same as the length of the original video data 1, no additional processing is performed. If the length is shorter than the length of the original adaptation data 1, the length of the video data 1 can be ensured to be unchanged by inserting the replacement frame 2 before the transition effect 2 and / or inserting the replacement frame 3 after the transition effect 2.

[0184] In other embodiments, after the video data 1 is processed using the effect template, the mobile phone can also change the effect template used when processing the video data 1, or change the video music used separately according to the user's operation.

[0185] For example, Fig.14 As shown in (a), after the mobile phone processes the video data 1 using the effect template, the mobile phone can display a preview interface, such as the third interface, such as interface 1401. The interface 1401 displays video data 2, also called second video data. The above video data 2 is a video obtained by processing the effect template 1 on the basis of the video data 1. Obviously, the video data 2 includes the video frames in the video data 1, and of course, also includes the transition special effect 3 and the cache special effect 2.

[0186] The mobile phone can receive the user's operation 6 on the interface 1401, such as clicking the style control 1402 on the interface 1401. And respond to the operation 6, such as Fig.14 As shown in (b) in the figure, interface 1403 is displayed. Among them, interface 1403 is a guide interface for guiding the user to select an effect template. The above interface 1403 includes multiple template windows indicating different effect templates. For example, window 1404, window 1405, window 1406 and window 1407. Among them, the above window 1404 is used to indicate an effect template named hello summer, window 1405 is used to indicate an effect template named sunny, window 1406 is used to indicate an effect template named HAPPY, and window 1407 is used to indicate an effect template named Little Beauty. Among these effect templates, the template window of the hello summer effect template is in a selected state, indicating that effect template 1 is a hello summer effect template. In this way, the mobile phone can determine the effect template 2 selected by the user based on the user's operation on other template windows. For example, after the mobile phone receives the user's click operation on window 1405, the preview window 1408 in interface 1403 can display a sample of the sunny effect template. In this way, if the mobile phone receives the user's operation on the control 1409 in the interface 1403, it can determine that the sunny effect template is the selected effect template 2. Afterwards, the mobile phone can use the effect template 2 to process the original video data 1 to obtain the video data 1 that conforms to the style of the effect template 2, and Fig.14 As shown in (c) , the interface 1401 is displayed again, and the interface 1401 at this time includes the video data 1 processed based on the effect template 2.

[0187] In addition, during the display of interface 1403, the mobile phone receives the user's operation on control 1409 without receiving the user's instruction to select other effect templates. The mobile phone can determine that the user instructs to reprocess the original video data 1 using effect template 1. During the reprocessing process, the matching weights between each transition effect and effect template 1 can still be used to randomly determine transition effect 2 and transition effect 3, and use them to reprocess the original video data 1.

[0188] It is understandable that the re-randomized transition effects 2 and 3 may be different from the transition effects determined for the first time using the effect template 1. In this way, the visual effect of the video data 1 obtained after the second processing will also be different, improving the diversity of one-click filming.

[0189] As another example, the mobile phone may receive an operation 7 of the user on the interface 1401, such as clicking the music control 1410 on the interface 1401. In response to the operation 7, the mobile phone may replace different video music. The replaced video music may be music of the same style as the effect template 2, or may be a random piece of music, which is not limited.

[0190] In addition, the interface 1401 also includes a control 1411 indicating confirmation. Fig.14 As shown in (c) of FIG. 1 , after receiving the user's operation on the control 1411, such as a click operation, the mobile phone saves the processed video data 1, such as the video data 1 processed based on the effect template is also called video data 2. In addition, the mobile phone can also display the video editing interface corresponding to the video data 2, such as Fig.14 The interface 1412 shown in (d) in FIG. 14 can display the video data 2. The mobile phone can play the video data 2 according to the user's operation in the interface 1412.

[0191] In a possible embodiment, the interface 1401 may also include a control indicating an undo effect template, such as: Fig.14 The control 1413 shown in (a) in FIG. 8 . The mobile phone can receive a user click operation on the control 1413, delete the video data 1 processed based on the effect template, and display the interface 803 again. When the mobile phone displays the interface 803 again, the interface 803 still includes the one-key blockbuster control 1001. If the mobile phone receives the user's operation on the one-key blockbuster 1001 again, it can determine a matching effect template again, and use the newly determined effect template to process the video data 1 again. The processing process can refer to the aforementioned embodiment and will not be repeated here. In addition, for the same video data 1, the mobile phone can make the effect templates determined by the one-key blockbuster two adjacent times different, thereby improving the diversity of secondary creation video data.

[0192] In another scenario, if an effect template is selected before shooting video data 1, the process of shooting video data 1 by the mobile phone is different from the aforementioned embodiment, and the timing of triggering the mobile phone to process video data 1 using the effect template is also different from the aforementioned embodiment. However, the actual implementation method of adding transition effects to video data 1 using the effect template is the same. The following briefly introduces the process of shooting video data 1 by the mobile phone and processing video data 1 using effect template a when effect template a is selected:

[0193] like Fig.15 As shown in (a), during the period when the mobile phone displays interface 205, that is, during the period when the framing interface for realizing multi-lens recording is displayed. In interface 205, a micro-movie control 1501 is also included, and the micro-movie control 1501 is used to start the micro-movie function. When the micro-movie function is enabled, users can conveniently create video works with soundtracks, filters, and special effects through their mobile phones. In addition, in other framing interfaces for recording videos (such as framing interfaces for realizing single-lens recording functions), micro-movie controls with the same functions may also be included.

[0194] In some embodiments, when the mobile phone displays the interface 205, an operation of the user on the micro-movie control 1501 is received, such as a click operation, the following may be displayed: Fig.15 The interface 1502 shown in (b) is the eighth interface. The interface 1502 is a guide interface for guiding the user to select an effect template. The interface 1502 includes a plurality of template windows indicating different effect templates. For example, window 1503, window 1504, window 1505, and window 1506. The window 1503 is used to indicate an effect template named hello summer, the window 1504 is used to indicate an effect template named sunny, the window 1505 is used to indicate an effect template named HAPPY, and the window 1506 is used to indicate an effect template named little beautiful.

[0195] Of course, in addition to the different corresponding video music, different effect templates may also have different filters, stickers, atmosphere effects, and transition effects. Obviously, with the cooperation of different video music, filters, stickers, atmosphere effects, and transition effects, the styles of the videos produced are also different. In other words, users can create video works of different styles by selecting different effect templates. Among them, the effect template selected by the user can be called the first effect template, and the template window corresponding to the first effect template is also called the first identifier.

[0196] In some embodiments, the user can select effect templates of different video styles while the mobile phone displays interface 1502. That is, the mobile phone can receive the user's operation on the first mark of the template window in interface 1502, such as a click operation, and determine the effect template selected by the user, that is, the first effect template. For example, the mobile phone receives the user's click operation on window 1504, and can determine that the user has selected the effect template named sunny.

[0197] In addition, in some other embodiments, a default template may be pre-set in the mobile phone. For example, the Hello Summer effect template may be pre-selected and configured as the default template. In this way, when the mobile phone switches from interface 205 to display interface 1502, the Hello Summer effect template is in a selected state. Afterwards, if the mobile phone does not receive a selection operation for other effect templates, the mobile phone determines that the user has selected the Hello Summer effect template. If the mobile phone receives a selection operation for other effect templates (such as the Little Beautiful Effect Template), the mobile phone determines that the user has selected the Little Beautiful Effect Template.

[0198] In some embodiments, each effect template corresponds to a sample. The sample is a video pre-made based on the effect template. When the effect template is selected by the user, the corresponding sample can be displayed in the preview window 1507. Thus, the user can preview the style effect of the effect template, and it is also convenient for the user to select. For example, when the "Hello Summer" effect template is selected, the preview window 1507 plays the sample of "Hello Summer".

[0199] In addition, while the mobile phone displays interface 1502, the user can change the selected effect template by selecting a different template window.

[0200] Of course, during the period when the mobile phone displays the interface 1502, the mobile phone can also receive the user's operation on the control 1508. After receiving the operation of the control 1508, the mobile phone can determine the effect template in the selected state as the actual selected effect template. For the convenience of description, the actual selected effect template can also be called effect template a.

[0201] After determining the effect template a, the mobile phone can also switch to display Fig.15 The interface 1509 shown in (c) is also called the ninth interface. The interface 1509 is the template framing interface corresponding to the effect template a.

[0202] Interface 1509 also includes view frames. When the mobile phone switches from interface 1502 to interface 1509, the number of view frames corresponding to interface 1509 is related to effect template a. At the same time, the video stream displayed by the view frame is also related to effect template a.

[0203] In some embodiments, the effect template may also correspond to a default lens mode, which may include a single front mode, a single rear mode, an upper front and lower rear mode, an upper rear and lower front mode, an upper rear (near) and lower rear (far) mode, an upper rear (far) and lower rear (near), a picture-in-picture mode, etc.

[0204] Exemplarily, when the single front mode is enabled, the interface 1509 includes a viewfinder, which is used to preview the video stream captured by the front camera.

[0205] Also illustratively, when the single rear mode is enabled, the interface 1509 includes a viewfinder, which is used to preview the video stream captured by the rear camera.

[0206] It should be noted that when there are multiple front cameras and rear cameras, there is a main camera among the multiple front cameras, such as front camera a, and there is also a main camera among the multiple rear cameras, such as rear camera a. In the single front mode, the viewfinder is used to display the video stream captured by the front camera a. In the single rear mode, the viewfinder is used to display the video stream captured by the rear camera a.

[0207] As another example, when the top-front-bottom-back mode is enabled, the interface 1509 includes two viewfinders, such as viewfinder 1 and viewfinder 2. The above viewfinder 1 and viewfinder 2 are arranged up and down in the interface 1509. The viewfinder 1 arranged on the top is used to display the video stream captured by the front camera, and the viewfinder 2 arranged on the bottom is used to display the video stream captured by the rear camera. For example, viewfinder 1 is used to display the video stream captured by the front camera a, and viewfinder 2 is used to display the video stream captured by the rear camera a. For another example, viewfinder 1 is used to display the video stream captured by other front cameras, and viewfinder 2 is used to display the video stream captured by other rear cameras. The same is true when the top-back-bottom-front mode is enabled, the difference is that viewfinder 1 is used to display the video stream captured by the rear camera, and viewfinder 2 is used to display the video stream captured by the front camera.

[0208] For example, when the mobile phone includes multiple rear cameras, when the upper rear (near) and lower rear (far) modes are enabled, the interface 1509 includes two viewfinders, such as viewfinder 1 and viewfinder 2. The viewfinder 1 and viewfinder 2 are arranged up and down in the interface 1509. The viewfinder 1 and viewfinder 2 are respectively used to display the video streams captured by the two rear cameras.

[0209] It is understandable that the types of multiple rear cameras installed in a mobile phone may be different. For example, the rear camera of the mobile phone may be one or a combination of a main camera, a telephoto camera, a wide-angle camera, an ultra-wide-angle camera, a macro camera, etc. In some examples, different rear cameras may have different focal lengths, so that different rear cameras can shoot at different distances.

[0210] In the above example, the viewfinder 1 arranged on the top can be used to display the rear camera with a relatively long focal length, and the viewfinder 2 arranged on the bottom can be used to display the rear camera with a relatively short focal length. For example, when the viewfinders 1 and 2 are used to display the video streams captured by the rear camera b (telephoto camera) and the rear camera c (wide-angle camera) respectively, the telephoto camera has a longer focal length than the wide-angle camera, so the viewfinder 1 is used to display the video stream captured by the rear camera b, and the viewfinder 2 is used to display the video stream captured by the rear camera c.

[0211] Of course, viewfinders 1 and 2 can also display other types of combinations of rear cameras, for example, the main camera and the telephoto camera, the main camera and the wide-angle camera, the main camera and the ultra-wide-angle camera, the main camera and the macro camera, the telephoto camera and the ultra-wide-angle camera, the telephoto camera and the macro camera, or the wide-angle camera and the macro camera, etc.

[0212] For example, when the mobile phone includes multiple rear cameras, when the upper rear (far) and lower rear (near) modes are enabled, the interface 1509 includes two viewfinders, such as viewfinder 1 and viewfinder 2. The viewfinder 1 and viewfinder 2 are arranged up and down in the interface 1509. The viewfinder 1 arranged up can be used to display a rear camera with a relatively short focal length, and the viewfinder 2 arranged down can be used to display a rear camera with a relatively long focal length.

[0213] As another example, when the picture-in-picture mode is enabled, the interface 1509 includes two viewfinders, such as viewfinder 1 and viewfinder 2. The size of viewfinder 2 is smaller than that of viewfinder 1, and viewfinder 2 can be embedded in viewfinder 1. Viewfinder 1 is used to display the video stream captured by the rear camera, and viewfinder 2 is used to display the video stream captured by the front camera. Of course, viewfinder 1 is used to display the video stream captured by the front camera, and viewfinder 2 is used to display the video stream captured by the rear camera. In other examples, viewfinder 1 can also be used to display the video stream captured by the front camera, and viewfinder 2 can be used to display the video stream captured by the rear camera. It can also be that viewfinder 1 is used to display a rear camera with a relatively long focal length, and viewfinder 2 is used to display a rear camera with a relatively close focal length. That is, the cameras corresponding to viewfinder 1 and viewfinder 2 in the picture-in-picture mode can be determined by the user. In some examples, when the picture-in-picture mode is enabled by default, viewfinder 1 is used to display the video stream captured by the rear camera, and viewfinder 2 is used to display the video stream captured by the front camera.

[0214] In the above example, the lens mode described is the mode applicable when the mobile phone is in portrait mode. When the mobile phone is in landscape mode, the lens mode may also include left front right rear mode, left rear right front mode, left rear (near) right rear (far) mode, left rear (far) right rear (near), etc.

[0215] Among them, the left front right rear mode, the left rear right front mode, the left rear (near) right rear (far) mode, and the left rear (far) right rear (near) are similar to the top front bottom rear mode, the top rear bottom front mode, the top rear (near) bottom rear (far) mode, and the top rear (far) bottom rear (near) in the above example, and all correspond to two viewfinders, such as viewfinder 3 and viewfinder 4, which are arranged left and right in interface 1509. The viewfinder 3 corresponds to the viewfinder 1, and the viewfinder 4 corresponds to the viewfinder 2. For example, the left front right rear mode is similar to the top front bottom rear mode, and the viewfinder 3 is used to display the video stream of the front camera, and the viewfinder 4 is used to display the video stream of the rear camera.

[0216] As an example, the lens mode corresponding to the "Hello Summer" effect template is up, back, down, front, such as Fig.15 As shown in (c) in FIG. 1 , when the “Hello Summer” effect template is determined to be effect template a, the interface 1509 displayed by the mobile phone includes a viewfinder 206 and a viewfinder 207. The viewfinder 206 is arranged on the upper side of the viewfinder 207. In addition, the viewfinder 206 is used to display the video stream captured by the rear camera a, and the viewfinder 207 is used to display the video stream captured by the front camera a.

[0217] In some embodiments, the interface 1509 also includes a lens switching control, such as control 1510. The lens switching control is used to assist the user in selecting other lens modes to replace the default lens mode of the effect template a.

[0218] In addition, during the display of interface 1509, the mobile phone can also play the video music corresponding to effect template a. For example, the video music corresponding to the "Hello Summer" effect template is the song "Hello Summer". When the mobile phone determines that the "Hello Summer" effect template is effect template a, during the display of interface 1509, the mobile phone can play the song "Hello Summer". Fig.15 As shown in (c), the duration of the song "Hello Summer" is 15 seconds. After playing the song "Hello Summer" for 15 seconds, the mobile phone can play the song "Hello Summer" in a loop.

[0219] In some embodiments, interface 1509 also includes a song switching control, such as control 1511. The song switching control is used to assist the user in selecting replacement music to replace the video music corresponding to effect template a. After the mobile phone responds to the user's instructions and replaces the video music corresponding to effect template a, the mobile phone plays the replacement music. In some examples, the replacement music corresponding to different effect templates may be different. The replacement music and the video music corresponding to the effect template may be songs with similar styles, the same beats, or similar melodies. In other examples, the replacement music corresponding to different effect templates may be the same, such as music that has been saved in the mobile phone, or music that can be searched by the mobile phone.

[0220] During the display of interface 1509 , the mobile phone has not actually started shooting video data 1. However, along with the video music, the user can preview the framing effect of this shooting through interface 1509 .

[0221] In some embodiments, the interface 1509 also includes a one-touch shooting control, also called a sixth control, such as control 1512. After the mobile phone receives the user's operation on the control 1512, such as a click operation, Fig.15 As shown in (d) in FIG. 1 , the mobile phone displays a recording interface, also known as the tenth interface, such as interface 1513, and begins to formally shoot video data 1, also known as the third video data. In addition, the duration of the shot video data 1 does not exceed the set duration of the effect template a. For example, the set duration can be equal to the duration of the video music corresponding to the effect template a, and for another example, the set duration can also be slightly shorter than the duration of the video music.

[0222] In addition, the tenth interface also includes a second control for indicating the pause of shooting. Exemplarily, when recording the first time point of the third video data, the electronic device receives the user's operation on the second control, and displays the eleventh interface in response to the operation. Among them, the eleventh interface is an interface for pausing shooting; the eleventh interface includes a third control for indicating to continue shooting. In response to the user's operation on the third control, the electronic device displays the tenth interface again, and determines the fifth video frame and the sixth video frame located before and after the first time point in the third video data. Among them, the fifth video frame is the last frame captured before receiving the pause instruction, and the sixth video frame is the first frame captured after receiving the resume shooting instruction.

[0223] For example, the duration of "Hello Summer" is 15 seconds, and the setting duration of the Hello Summer effect template is also 15 seconds. When shooting video data 1, if the shooting duration reaches 15 seconds, the mobile phone can automatically stop shooting, obtain video data 1, and trigger the mobile phone to process the video data 1 using effect template a.

[0224] As another example, during the recording process, the mobile phone displays a recording interface, such as: Fig.15 Interface 1513 shown in (d) in FIG. Interface 1513 includes a control for indicating the termination of shooting, such as control 1514. If the duration of shooting video data 1 does not reach 15 seconds, the mobile phone can receive a user operation on control 1514, such as a long press operation. After receiving the operation on control 1514, the mobile phone stops shooting, thereby obtaining video data 1, and triggers the mobile phone to process the video data 1 using effect template a.

[0225] For example, Fig.16As shown, after the shooting time of video data 1 reaches the set time, the mobile phone can process video data 1 according to effect template a and display a preview interface for playing the video work, also known as the twelfth interface, such as interface 1601.

[0226] In some embodiments, after the third video data is recorded, a twelfth interface is displayed; the twelfth interface is used to display the fourth video data; the fourth video data includes the video frame of the third video data, the first music, and the first transition effect. In addition, the fourth video data also includes a third freeze frame and a fourth freeze frame. The third freeze frame is the same as the fifth video frame, and the fourth freeze frame is the same as the sixth video frame.

[0227] In some embodiments, the process of processing the video data 1 using the effect template a can refer to the aforementioned embodiments and will not be described in detail here.

[0228] It can be seen that whether the effect template is selected before shooting or after shooting, the mobile phone can automatically process the video data so that the processed video work can be close to the effect template used. In addition, in the process of using the effect template to process the video, the mobile phone can not only automatically replace the original transition effects in the video, but also flexibly add transition effects. While adding transition effects, it does not affect the length of the video, improves the quality and watchability of the processed video, reduces the efficiency of human-computer interaction in editing the video, and also improves the user experience.

[0229] The present application also provides an electronic device, which may include: a memory and one or more processors. The memory and the processor are coupled. The memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device can execute the various steps executed by the mobile phone in the above embodiment. Of course, the electronic device includes but is not limited to the above memory and one or more processors. For example, the structure of the electronic device can refer to Figure 1 The structure of the mobile phone shown.

[0230] The present application also provides a chip system, which can be applied to the electronic device in the above embodiment. Fig.17As shown, the chip system includes at least one processor 2201 and at least one interface circuit 2202. The processor 2201 may be a processor in the above-mentioned electronic device. The processor 2201 and the interface circuit 2202 may be interconnected via a line. The processor 2201 may receive and execute computer instructions from the memory of the above-mentioned electronic device via the interface circuit 2202. When the computer instructions are executed by the processor 2201, the electronic device may execute the various steps executed by the mobile phone in the above-mentioned embodiment. Of course, the chip system may also include other discrete devices, which are not specifically limited in the embodiments of the present application.

[0231] In some embodiments, through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0232] Each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units.

[0233] 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 computer-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, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a 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: various media that can store program codes, such as flash memory, mobile hard disk, read-only memory, random access memory, disk or optical disk.

[0234] The above is only a specific implementation of the embodiment of the present application, but the protection scope of the embodiment of the present application is not limited thereto, and any changes or replacements within the technical scope disclosed in the embodiment of the present application should be included in the protection scope of the embodiment of the present application. Therefore, the protection scope of the embodiment of the present application should be based on the protection scope of the claims.

Claims

1. A method for adding transition special effects, characterized in that: The method is applied to an electronic device, and the method comprises: In response to a user operation, recording first video data; When recording the first video data to a first time point, in response to a user's instruction to pause shooting, pausing recording of the first video data; After pausing the recording of the first video data, in response to a user operation, continuing to record the first video data, and marking a first video frame and a second video frame in the first video data; the first video frame is located at the last video frame before the first time point, and the second video frame is located at the first video frame after the first time point; The electronic device displays a first interface; wherein the first interface includes a first thumbnail of the first video data; The electronic device receives a first operation of a user on the first thumbnail; In response to the first operation, the electronic device displays a second interface; the second interface is a video editing interface of the first video data; the second interface includes a one-key blockbuster control; After receiving a second operation of the user on the one-key blockbuster control, the electronic device generates second video data, and the electronic device displays a third interface; wherein the third interface is used to display the second video data; the second video data includes a video frame of the first video data and a first transition special effect; The generating of the second video data comprises: when the first transition special effect is any one of a dissolve transition, a blur transition or a melt transition, adding a first freeze frame and a second freeze frame to the first video data; the first freeze frame is the same as the first video frame, the second freeze frame is the same as the second video frame, and the first video frame and the second video frame are two adjacent frames in the first video data; the first freeze frame overlaps with the second video frame, and the second freeze frame overlaps with the first video frame; and superimposing the special effects corresponding to the dissolve transition, the blur transition or the melt transition on the first video frame and the second video frame.

2. The method according to claim 1, characterized in that: The step of recording the first video data in response to the user's operation includes: The electronic device displays a fourth interface; the fourth interface is a viewfinder preview interface provided by a camera application; the fourth interface includes a first control indicating starting to shoot a video; The electronic device receives a third operation of the user on the first control; The electronic device displays a fifth interface in response to the third operation, and starts recording the first video data; wherein the fifth interface is a video recording interface; the fifth interface includes a second control indicating to pause shooting; The step of pausing the recording of the first video data in response to the user's operation of pausing the shooting comprises: when recording the first time point of the first video data, the electronic device displays a sixth interface in response to the user's operation on the second control; wherein the sixth interface is an interface for pausing the shooting; and the sixth interface includes a third control for instructing to continue shooting; The step of continuing to record the first video data in response to the user's operation includes: the electronic device receiving a fourth operation of the user on the third control; The electronic device displays the fifth interface again in response to the fourth operation; wherein the fifth interface includes a fourth control indicating to stop shooting; Before displaying the first interface, the method further includes: receiving, by the electronic device, a fifth operation of the user on the fourth control; The electronic device displays a first interface, comprising: the electronic device displays the first interface in response to the fifth operation; the first interface is also a viewfinder preview interface provided by the camera application.

3. The method according to claim 2, characterized in that The fifth interface is a video recording interface in the first lens mode, and the fifth interface includes a fifth control indicating switching lens modes; Before the electronic device receives the fifth operation, the method further includes: When recording to a second time point of the first video data, the electronic device freezes the third video frame in response to a sixth operation of the user on the fifth control to obtain a plurality of first replacement frames; wherein the third video frame is the last video frame captured before receiving the sixth operation; and the sixth operation is an operation indicating switching to the second lens mode; After the electronic device displays a seventh interface, canceling the freeze of the third video frame; wherein the seventh interface is a video recording interface in the second lens mode; After the electronic device receives the fifth operation, the method further includes: the electronic device superimposing a second transition special effect on the first replacement frame.

4. The method according to claim 3, characterized in that The second video data also includes: a second replacement frame, a first music and a third transition effect; the third transition effect corresponds to the first music; the third transition effect is superimposed on the second replacement frame, and the second replacement frame is used to replace the first replacement frame in the first video data.

5. The method according to claim 4, characterized in that Before the electronic device displays the third interface, the method further includes: The electronic device deletes the first replacement frame; wherein the first replacement frame is located between the third video frame and the fourth video frame; the fourth video frame is the first video frame collected after the electronic device displays the seventh interface; The electronic device determines a plurality of frames of the second replacement frames; wherein the second replacement frames include frames identical to the third video frame and frames identical to the fourth video frame; and the number of the second replacement frames is not less than the number of the first replacement frames; The electronic device superimposes the third transition special effect on the second replacement frame to obtain the second video data.

6. The method according to claim 1, characterized in that Before the electronic device displays the first interface, the method further includes: the electronic device displays a main interface; the main interface includes an icon of a gallery application; the electronic device receives a seventh operation of the user on the icon of the gallery application; The electronic device displays a first interface, comprising: the electronic device displays the first interface in response to the seventh operation, where the first interface is an application interface provided by the gallery application.

7. The method according to any one of claims 1 to 6, characterized in that: Before the electronic device displays the third interface, the method further includes: In response to the second operation, the electronic device determines a first effect template from a plurality of preconfigured effect templates; the first effect template includes a first music; The electronic device determines the first transition special effect corresponding to the first music; When the first transition special effect is any one of a dissolve transition, a blur transition or a melt transition, the electronic device overlaps the first freeze frame on the second video frame; and overlaps the second freeze frame under the first video frame; The electronic device superimposes the first transition special effect on the first video frame and the second video frame.

8. The method according to claim 7, characterized in that The first effect template corresponds to the first style; The step of determining a first effect template from a plurality of preconfigured effect templates includes: The electronic device determines, using a preset artificial intelligence model, that the first video data matches the first style; the electronic device determines the first effect template from effect templates belonging to the first style; Alternatively, the electronic device randomly determines the first effect template from a plurality of preset effect templates.

9. The method according to claim 7, characterized in that: The electronic device determines the first transition special effect corresponding to the first music, including: The electronic device determines the first transition effect having an association identifier with the first music from a plurality of preset transition effects; Alternatively, the electronic device determines the first transition special effect from a plurality of preset transition special effects based on a matching weight; Each of the preset transition effects corresponds to a matching weight, and the matching weight is a quantized ratio parameter of the degree of adaptability between the first music and the preset transition effect.

10. A method for adding transition special effects, characterized in that: The method is applied to an electronic device, and the method comprises: The electronic device displays an eighth interface; wherein the eighth interface includes a first identifier indicating a first effect template; the first effect template includes a first music and a first transition effect corresponding to the first music; The electronic device displays a ninth interface in response to the user's operation on the first identifier; the ninth interface is a framing preview interface corresponding to the first effect template; the ninth interface includes a sixth control indicating starting shooting; The electronic device displays a tenth interface in response to the user's operation on the sixth control, and starts recording the third video data; wherein the tenth interface is a video recording interface corresponding to the first effect template; and the tenth interface includes a second control indicating to pause shooting; When recording to the first time point of the third video data, the electronic device displays an eleventh interface in response to the user's operation on the second control; wherein the eleventh interface is an interface for pausing shooting; and the eleventh interface includes a third control for instructing to continue shooting; The electronic device displays the tenth interface again in response to the user's operation on the third control, and marks a fifth video frame and a sixth video frame located before and after the first time point in the third video data; After the third video data is recorded, a twelfth interface is displayed, and fourth video data is generated; the twelfth interface is used to display the fourth video data; the fourth video data includes the video frame of the third video data, the first music and the first transition special effect; The generating of the fourth video data comprises: when the first transition special effect is any one of a dissolve transition, a blur transition or a melt transition, adding a third freeze frame and a fourth freeze frame to the fourth video data; the third freeze frame is the same as the fifth video frame, the fourth freeze frame is the same as the sixth video frame, the third freeze frame overlaps with the sixth video frame, and the fourth freeze frame overlaps with the fifth video frame; and superimposing the special effects corresponding to the dissolve transition, the blur transition or the melt transition on the fifth video frame and the sixth video frame.

11. An electronic device, characterized in that: The electronic device includes one or more processors and a memory; the memory is coupled to the processor, the memory is used to store computer program code, the computer program code includes computer instructions, and when the one or more processors execute the computer instructions, the one or more processors are used to execute the method as described in any one of claims 1-10.

12. A computer storage medium, characterized in that: The method comprises computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 10.