Video anti-shake processing method and device and electronic equipment

By acquiring and using the anti-shake parameters of the video frame after collecting videos in electronic devices, the anti-shake processing of the video frames is solved, and the problem of poor anti-shake effect caused by memory limitations in the prior art is solved, thereby achieving higher quality video shooting.

CN119729212APending Publication Date: 2025-03-28VIVO MOBILE COMM CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411841489.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

Due to the camera's memory limitations, existing electronic devices cannot cache enough video frames to calculate effective anti-shake paths, resulting in poor anti-shake effect, which in turn affects the quality of video shooting.

Method used

After collecting videos, the anti-shake parameters corresponding to the video frames are obtained, and the video frames are anti-shake based on these parameters. The anti-shake path is planned using a large number of video frames to improve the anti-shake effect.

Benefits of technology

By performing anti-shake processing after the acquisition is completed, electronic devices can select a larger number of video frames, which are not limited by the camera memory, significantly improving the anti-shake effect, thereby improving the quality of video shooting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119729212A_ABST
    Figure CN119729212A_ABST
Patent Text Reader

Abstract

The invention discloses a video anti-shake processing method and device and electronic equipment, and belongs to the technical field of communication. In the process of collecting the first video, N first anti-shake parameters are obtained, the N first anti-shake parameters are anti-shake parameters corresponding to N video frames included in the first video, and the N video frames are in one-to-one correspondence with the N first anti-shake parameters; n is an integer greater than 1; and under the condition that the first video is acquired, performing anti-shake processing on the N video frames based on the N first anti-shake parameters to obtain processed N video frames.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of communication technology, and specifically relates to a video anti-shake processing method, device and electronic equipment. Background Art

[0002] At present, most electronic devices have video stabilization function to provide more stable video shooting effect. The commonly used video stabilization technology is to cache the video frames and the stabilization parameters corresponding to each video frame in the camera's running memory during the process of recording video through the camera, and then use the software algorithm to calculate the camera's stabilization path. The more video frames are cached, the better the stabilization path planning is, and the better the stabilization effect will be.

[0003] However, due to the limitation of the camera's running memory, currently only a small number of video frames (for example, about 30 frames) can be cached in the camera's running memory, and more video frames cannot be cached to calculate the anti-shake path. Therefore, only a small number of video frames can be used to continuously plan the anti-shake path, resulting in poor anti-shake effect of the electronic device, which in turn leads to poor video shooting quality. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a video stabilization processing method, device and electronic equipment, which can improve the shooting quality of the video.

[0005] In a first aspect, an embodiment of the present application provides a video stabilization processing method, the method comprising: in a process of capturing a first video, obtaining N first stabilization parameters, the N first stabilization parameters being stabilization parameters corresponding to N video frames included in the first video, the N video frames corresponding one-to-one to the N first stabilization parameters; N being an integer greater than 1; when the first video is captured, performing stabilization processing on the N video frames based on the N first stabilization parameters to obtain N processed video frames.

[0006] In a second aspect, an embodiment of the present application provides a video anti-shake processing device, which includes: an acquisition module and a processing module. The acquisition module is used to acquire N first anti-shake parameters during the process of acquiring a first video, where the N first anti-shake parameters are anti-shake parameters corresponding to N video frames included in the first video, and the N video frames correspond one-to-one to the N first anti-shake parameters; N is an integer greater than 1. The processing module is used to perform anti-shake processing on the N video frames based on the N first anti-shake parameters acquired by the acquisition module after the first video is acquired, so as to obtain N processed video frames.

[0007] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.

[0008] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0009] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.

[0010] In a sixth aspect, an embodiment of the present application provides a computer program / program product, wherein the computer program / program product is stored in a storage medium, and the program / program product is executed by at least one processor to implement the method described in the first aspect.

[0011] In an embodiment of the present application, in the process of acquiring the first video, N first anti-shake parameters are obtained, the N first anti-shake parameters are anti-shake parameters corresponding to the N video frames included in the first video, and the N video frames correspond one to one to the N first anti-shake parameters; N is an integer greater than 1; when the first video is acquired, the N video frames are anti-shake processed based on the N first anti-shake parameters to obtain the processed N video frames. In this solution, since the electronic device performs anti-shake processing on the first video after acquiring the first video, it is not limited by the camera memory, and the electronic device can select a larger number of video frames and continuously plan the anti-shake path of the electronic device to perform anti-shake processing on the first video. Thereby, the anti-shake effect of the electronic device can be improved, thereby improving the shooting quality of the electronic device. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 It is a flowchart of a video anti-shake processing method provided by an embodiment of the present application;

[0013] Figure 2 This is one of the example schematic diagrams of a video anti-shake processing provided by an embodiment of the present application;

[0014] Figure 3 This is a second example schematic diagram of a video anti-shake processing provided by an embodiment of the present application;

[0015] Figure 4 This is a third example schematic diagram of a video anti-shake processing provided by an embodiment of the present application;

[0016] Figure 5 is a structural schematic diagram of a video anti-shake processing device provided in an embodiment of the present application;

[0017] Figure 6This is one of the hardware structure diagrams of an electronic device provided in an embodiment of the present application;

[0018] Figure 7 This is the second schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0019] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0020] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0021] The terms "at least one (item)", "at least one of" and the like in the specification and claims of the present application refer to any one, any two or a combination of more than two of the objects included therein. For example, at least one (item) of a, b, and c can be represented by: "a", "b", "c", "a and b", "a and c", "b and c" and "a, b and c", where a, b, and c can be single or multiple. Similarly, "at least two (items)" refers to two or more, and its meaning is similar to that of "at least one (item)".

[0022] The video stabilization processing method provided by the embodiment of the present application is described in detail below through specific embodiments and application scenarios in conjunction with the accompanying drawings.

[0023] The video stabilization processing method in the embodiment of the present application can be applied to the scene of capturing video.

[0024] Video stabilization refers to the use of some technical means to reduce or eliminate the effects of camera shake during video recording, so that the video picture is more stable and clear. Video stabilization technology can be implemented through hardware or software, including the use of optical image stabilization, electronic image stabilization, mechanical image stabilization, etc. These technologies can reduce camera shake when shooting sports, walking or other situations, thereby improving video quality. Many smartphones and cameras are equipped with video stabilization functions to provide more stable video shooting effects. Electronic Image Stabilization (EIS) is a common video stabilization technology that is widely used in cameras and other digital video devices of electronic devices. EIS uses software algorithms to offset camera shake, thereby reducing shake and blur in the video. In electronic device cameras, EIS uses gyroscopes and accelerometers to detect camera movement, and then uses software algorithms to adjust the position of the video frame to offset camera shake. This allows for a more stable picture when shooting video.

[0025] The commonly used video stabilization technology is to cache video frames and the stabilization parameters corresponding to each video frame in the camera's running memory while recording video, and then use software algorithms to calculate the camera's stabilization path. The more video frames cached, the better the stabilization path planning and the better the stabilization effect will be.

[0026] However, due to the limitations of the camera system's power consumption, memory, and access, only a small number of video frames (for example, about 30 frames) can be cached in the camera's running memory, and more video frames cannot be cached to calculate the anti-shake path. Therefore, only a small number of video frames can be used to plan the anti-shake path each time, resulting in poor anti-shake effect of the electronic device, which in turn leads to poor video shooting quality.

[0027] In the video anti-shake processing method, device and electronic device provided in the embodiments of the present application, in the process of collecting the first video, N first anti-shake parameters are obtained, the N first anti-shake parameters are the anti-shake parameters corresponding to the N video frames included in the first video, and the N video frames correspond one to one to the N first anti-shake parameters; N is an integer greater than 1; when the first video is collected, the N video frames are anti-shake processed based on the N first anti-shake parameters to obtain the processed N video frames. In this solution, since the electronic device performs anti-shake processing on the first video after collecting the first video, it is not limited by the camera memory. The electronic device can select a larger number of video frames and continuously plan the anti-shake path of the electronic device to perform anti-shake processing on the first video. Thereby, the anti-shake effect of the electronic device can be improved, and then the shooting quality of the electronic device is improved.

[0028] The video stabilization processing method provided in the embodiment of the present application may be executed by a video stabilization processing device, which may be an electronic device, or a functional module or entity in an electronic device. The technical solution provided in the embodiment of the present application is described below using an electronic device as an example.

[0029] The present application provides a video anti-shake processing method. Figure 1 FIG. 1 is a flow chart of a video anti-shake processing method provided by an embodiment of the present application, which can be applied to electronic devices. Figure 1 As shown, the video stabilization processing method provided in the embodiment of the present application may include the following steps 201 and 202.

[0030] Step 201: During the process of capturing a first video, the electronic device obtains N first anti-shake parameters.

[0031] In some embodiments of the present application, the electronic device may receive a first input from a user and start recording a first video.

[0032] Exemplarily, the first input may be an input to a recording control, or may be a voice input, which is not limited in the present application.

[0033] In an embodiment of the present application, the above-mentioned N first anti-shake parameters are anti-shake parameters corresponding to the N video frames included in the first video.

[0034] In an embodiment of the present application, the above-mentioned N video frames correspond one-to-one to N first anti-shake parameters; N is an integer greater than 1.

[0035] It can be understood that the electronic device can obtain the first anti-shake parameter corresponding to each video frame during the process of recording the first video.

[0036] In some embodiments of the present application, the first anti-shake parameter may include at least one of the following: a gyroscope parameter, an accelerometer parameter, an optical image stabilization (OIS) parameter, a timestamp of a video frame, an exposure time of a video frame, and a rolling shutter parameter. The present application does not limit this.

[0037] It should be noted that, for the first anti-shake parameter, reference may be made to the anti-shake parameter of each video frame used when performing anti-shake processing on a video in the related art, which will not be described in detail here.

[0038] In some embodiments of the present application, the electronic device may store the acquired first anti-shake parameter of each video frame in a disk of the electronic device.

[0039] In some embodiments of the present application, after the electronic device completes capturing the first video, it may store the captured first video in a disk of the electronic device.

[0040] In some embodiments of the present application, the electronic device may store the acquired N first anti-shake parameters in association with the first video in a disk of the electronic device.

[0041] Step 202: When the first video is captured, the electronic device performs anti-shake processing on N video frames based on N first anti-shake parameters to obtain N processed video frames.

[0042] In some embodiments of the present application, the electronic device may decode the first video to obtain N video frames included in the first video, and perform anti-shake processing on the N video frames based on N first anti-shake parameters.

[0043] In some embodiments of the present application, the EIS module in the electronic device may perform anti-shake processing on N video frames based on N first anti-shake parameters to obtain N processed video frames.

[0044] In some embodiments of the present application, after obtaining the processed N video frames, the electronic device may encode the processed N video frames to obtain a second video.

[0045] Specifically, after the EIS module in the electronic device obtains the processed N video frames, the processed N video frames can be transferred to the codec module in the electronic device, and the codec module can encode the processed N video frames to obtain the second video.

[0046] In the video anti-shake processing method provided in the embodiment of the present application, since the electronic device performs anti-shake processing on the first video after acquiring the first video, it is not limited by the camera memory, and the electronic device can select a larger number of video frames and continuously plan the anti-shake path of the electronic device to perform anti-shake processing on the first video. This can improve the anti-shake effect of the electronic device, thereby improving the shooting quality of the electronic device.

[0047] In some embodiments of the present application, in the above step 202, "the electronic device performs anti-shake processing on N video frames based on N first anti-shake parameters" can be specifically implemented through the following steps 202a to 202c.

[0048] Step 202a: The electronic device decodes the first video to obtain N video frames.

[0049] In some embodiments of the present application, the codec module in the electronic device can decode the first video stored in the disk to obtain N video frames.

[0050] Step 202b: The electronic device plans a first anti-shake path based on a first anti-shake parameter corresponding to a first video frame among the N video frames through a path calculation module in the electronic device.

[0051] In an embodiment of the present application, the first video frame includes the i-th video frame to the i+M-th video frame among the N video frames.

[0052] In the embodiments of the present application, i is a positive integer, and M is an integer greater than 1.

[0053] In an embodiment of the present application, the first anti-shake path includes adjusted position information corresponding to the first video frame.

[0054] In some embodiments of the present application, the electronic device may first calculate an initial jitter path based on a first anti-shake parameter corresponding to a first video frame among N video frames through a path calculation module in the electronic device, and then smooth the jitter in the jitter path whose jitter amplitude is greater than or equal to a first threshold to obtain a first anti-shake path.

[0055] It should be noted that for the detailed steps of the electronic device planning the first anti-shake path based on the first anti-shake parameter corresponding to the first video frame, please refer to the description of planning the anti-shake path based on the anti-shake parameter corresponding to the video frame in the related technology, which will not be repeated here.

[0056] In some embodiments of the present application, since the first video is anti-shake processed after the first video is captured, the anti-shake process is not limited by the camera's running memory, so the value of M is not limited (for example, M is 100). The electronic device can plan an anti-shake path each time based on the first anti-shake parameters corresponding to more video frames to perform anti-shake processing on the first video.

[0057] Step 202c: The electronic device performs anti-shake processing on the first video frame based on the first anti-shake path through a synthesis processing module in the electronic device.

[0058] In some embodiments of the present application, after obtaining the first anti-shake path, the electronic device can perform anti-shake processing on each video frame based on the adjusted position information corresponding to each video frame in the first video frame included in the first anti-shake path through a synthesis processing module.

[0059] In some embodiments of the present application, when the position information of any video frame after adjustment is the same as the position information before adjustment, the electronic device does not perform anti-shake processing on the any video frame.

[0060] In some embodiments of the present application, the path calculation module and the synthesis processing module are modules in the EIS module in the electronic device. Therefore, it can also be understood that after decoding the first video and obtaining N video frames, the EIS module in the electronic device plans to obtain the first anti-shake path based on the M+1 first anti-shake parameters corresponding to the i-th video frame to the i+M-th video frame, and then the EIS module can perform anti-shake processing on each video frame based on the adjusted position information corresponding to each video frame in the first anti-shake path to obtain a processed video frame.

[0061] For example, Figure 2 As shown, in the first stage, the electronic device first collects the first video and the first anti-shake parameters corresponding to each video frame through the camera, and saves the first video and the first anti-shake parameters corresponding to each video frame; then in the second stage, the electronic device can decode the first video to obtain N video frames included in the first video, and parse the first anti-shake parameters corresponding to the N video frames; then the electronic device can pass the M+1 first anti-shake parameters corresponding to the i-th video frame to the i+M-th video frame to the EIS module, the path calculation module in the EIS module can plan to obtain the first anti-shake path, and pass the adjusted position information corresponding to the i-th video frame to the synthesis module in the EIS module, and at the same time, the electronic device can pass the decoded i-th video frame to the synthesis module, so that the synthesis module can be based on The adjusted position information corresponding to the i-th video frame is used to perform anti-shake processing on the i-th video frame to obtain the processed i-th video frame; then the path calculation module can continue to pass the adjusted position information corresponding to the i+1-th video frame to the synthesis module in the EIS module. At the same time, the electronic device can pass the decoded i+1-th video frame to the synthesis module, so that the synthesis module can perform anti-shake processing on the i+1-th video frame based on the adjusted position information corresponding to the i+1-th video frame to obtain the processed i+1-th video frame; it should be noted that for the anti-shake processing method for other video frames, please refer to the anti-shake processing for the i-th video frame, which will not be repeated here. Finally, the electronic device can encode the processed N video frames to obtain a second video.

[0062] It should be noted that for detailed steps of the electronic device performing anti-shake processing on the first video frame based on the first anti-shake path, reference can be made to the description of performing anti-shake processing on the video frame based on the anti-shake path in the related art, which will not be repeated here.

[0063] In some embodiments of the present application, after performing anti-shake processing on the first video frame, the electronic device can plan a second anti-shake path based on the first anti-shake parameter corresponding to the second video frame among N video frames, and then the electronic device can perform anti-shake processing on the second video frame based on the second anti-shake path.

[0064] Exemplarily, the second video frames are the (i+1)th video frame to the (i+M+1)th video frame among the N video frames.

[0065] Exemplarily, the second anti-shake path includes adjusted position information corresponding to the second video frame.

[0066] In some embodiments of the present application, in the entire processing flow, if the electronic device performs multiple anti-shake processes on any video frame among N video frames, the video frame after the last anti-shake process is retained.

[0067] It should be noted that for detailed steps of the electronic device performing anti-shake processing on the second video frame based on the second anti-shake path, reference can be made to the description of performing anti-shake processing on video frames based on the anti-shake path in the related art, which will not be repeated here.

[0068] In this way, since the electronic device performs anti-shake processing on the first video after acquiring the first video, the anti-shake processing process is not limited by the camera's running memory, so the value of M is not limited (for example, M can be 100). The electronic device can plan an anti-shake path based on the 100 first anti-shake parameters corresponding to every 100 video frames to perform anti-shake processing on the 100 video frames. Compared with the related art, which can only cache a small number of video frames (for example, 30 video frames) in the process of video acquisition to plan an anti-shake path, the anti-shake effect of the electronic device is improved, thereby improving the shooting quality of the electronic device.

[0069] In some embodiments of the present application, before the step 202 in which "the electronic device performs anti-shake processing on N video frames based on N first anti-shake parameters", the video anti-shake processing method provided in the embodiment of the present application further includes the following step 301. Furthermore, the step 202 in which "the electronic device performs anti-shake processing on N video frames based on N first anti-shake parameters" can be specifically implemented by the following step 202d.

[0070] Step 301: When displaying a video playback interface of a first video, the electronic device obtains a second anti-shake parameter input by a user in the video playback interface.

[0071] In some embodiments of the present application, the second anti-shake parameter includes at least one of the following: a first value, an anti-shake strength of the video, and a field of view (FOV) corresponding to the video frame.

[0072] In some embodiments of the present application, the first value is used to indicate the number of first anti-shake parameters used when anti-shake processing is performed on any one of the N video frames.

[0073] In some embodiments of the present application, the first value may also be understood as the number of first anti-shake parameters used each time an anti-shake path is planned.

[0074] It can be understood that the above first value is used to determine the value of M.

[0075] For example, when the first value is 100, the value of M is 99.

[0076] In some embodiments of the present application, the field of view corresponding to the video frame is used to adjust the image range of the video frame, which can also be understood as adjusting the field of view of the camera.

[0077] In some embodiments of the present application, the above-mentioned video playback interface includes an anti-shake control, and the electronic device can receive the user's input to the anti-shake control and obtain the second anti-shake parameter input by the user in the video playback interface.

[0078] In some embodiments of the present application, the anti-shake control includes a first control, and the electronic device can receive a user input to the first control to obtain the anti-shake strength of the video input by the user.

[0079] Exemplarily, the first control is used to set the anti-shake strength when performing anti-shake processing on a video.

[0080] In some embodiments of the present application, the anti-shake control includes a second control, and the electronic device can receive user input to the second control to obtain the field of view angle corresponding to the video frame input by the user.

[0081] Exemplarily, the second control is used to set the field of view angle corresponding to the video frame when anti-shake processing is performed on the video.

[0082] In some embodiments of the present application, the anti-shake control includes a third control, and the electronic device can receive a user input to the third control to obtain a first value input by the user.

[0083] Exemplarily, the third control is used to set the number of first anti-shake parameters used when anti-shake processing is performed on any video frame of the video.

[0084] For example, Figure 3 As shown, a video playback interface 11 of a first video is displayed, and the video playback interface includes anti-shake controls: an anti-shake intensity control 12 (i.e., the first control mentioned above), an Fov control 13 (i.e., the second control mentioned above), and a frame number control 14 (i.e., the third control mentioned above); a user can input at least one anti-shake control, so that the electronic device can obtain the second anti-shake parameter input by the user in the video playback interface.

[0085] Step 202d: The electronic device performs anti-shake processing on the N video frames based on the N first anti-shake parameters and the second anti-shake parameters.

[0086] In some embodiments of the present application, the electronic device can determine the value of M based on the first numerical value, and then the EIS module in the electronic device can plan a first anti-shake path based on the set anti-shake strength of the video and the field of view corresponding to the video frame, and M+1 first anti-shake parameters corresponding to the i-th video frame to the i+M-th video frame, and perform anti-shake processing on the i-th video frame to the i+M-th video frame based on the adjusted position information corresponding to each video frame in the first anti-shake path to obtain a processed video frame.

[0087] In some embodiments of the present application, when the electronic device performs anti-shake processing on N video frames to obtain N processed video frames, the processed N video frames can be encoded to obtain a second video.

[0088] Furthermore, the electronic device can play the second video in the video playback interface. If the user is not satisfied with the playback effect of the second video, the user can input the anti-shake control again to trigger the electronic device to obtain the third anti-shake parameter input by the user in the video playback interface, and then re-anti-shake the N video frames based on the N first anti-shake parameters and the third anti-shake parameter, until the user is satisfied with the playback effect of the second video.

[0089] In some embodiments of the present application, the third anti-shake parameter includes at least one of the following: a second value, an anti-shake strength of the video, and a field of view angle corresponding to the video frame.

[0090] In some embodiments of the present application, the second value is used to indicate the number of first anti-shake parameters used when anti-shake processing is performed on any one of the N video frames.

[0091] In this way, since users can customize anti-shake parameters and select anti-shake effects, and can re-perform anti-shake processing if they are not satisfied with the results, the flexibility of electronic devices in anti-shake processing of videos is improved compared to the method of using fixed anti-shake parameters to perform anti-shake processing on videos in related technologies.

[0092] In some embodiments of the present application, after the above step 201, the video stabilization processing method provided by the embodiment of the present application further includes the following steps 401 and 402.

[0093] Step 401: When the first video is captured, the electronic device sends indication information, N video frames, and N first anti-shake parameters to a server of the electronic device.

[0094] In an embodiment of the present application, the above indication information is used to instruct the server to perform anti-shake processing on N video frames using N first anti-shake parameters.

[0095] In some embodiments of the present application, the electronic device may establish a connection with a server, and then send indication information, N video frames, and N first anti-shake parameters to the server.

[0096] In some embodiments of the present application, the electronic device may establish a connection with the server using a wireless network or an operator network.

[0097] In some embodiments of the present application, the electronic device may divide N video frames into multiple data packets and send the multiple data packets to a server using a network protocol (such as Hypertext Transfer Protocol (HTTP), Hypertext Transfer Protocol Secure (HTTPS), etc.).

[0098] It should be noted that for the detailed steps of the server performing anti-shake processing on N video frames through N first anti-shake parameters, please refer to the description of the electronic device performing anti-shake processing on N video frames based on N first anti-shake parameters in the above embodiment, which will not be repeated here.

[0099] In some embodiments of the present application, the server may also use a frame matching algorithm to plan an anti-shake path to perform anti-shake processing on the video frames, thereby achieving a better improvement effect.

[0100] It should be noted that for the detailed steps of planning the anti-shake path using the frame matching algorithm, please refer to the description of planning the anti-shake path using the frame matching algorithm in the related art, which will not be repeated here.

[0101] In some embodiments of the present application, due to the strong computing power of the server, an anti-shake path can be planned directly based on the N first anti-shake parameters corresponding to the N video frames, and then the N video frames can be anti-shake processed based on the anti-shake path.

[0102] Step 402: The electronic device receives a second video sent by the server.

[0103] In an embodiment of the present application, the second video includes N processed video frames.

[0104] In some embodiments of the present application, the electronic device can download the second video to the electronic device through a wireless network or an operator network.

[0105] In this way, since the first video can be anti-shake processed through the cloud server, a better anti-shake effect can be achieved while saving the computing power of the algorithm.

[0106] For example, Figure 4 As shown, in the first stage, the electronic device first collects the first video and the first anti-shake parameters corresponding to each video frame through the camera, and saves the first video and the first anti-shake parameters corresponding to each video frame; then the electronic device can send the saved first video and the first anti-shake parameters corresponding to each video frame to the server, and in the second stage the server can decode the first video, obtain N video frames included in the first video, and parse the first anti-shake parameters corresponding to the N video frames; then the server can pass the M+1 first anti-shake parameters corresponding to the i-th video frame to the EIS module, the path calculation module in the EIS module can plan the first anti-shake path, and pass the adjusted position information corresponding to the i-th video frame to the synthesis module in the EIS module, and at the same time, the server can pass the decoded i-th video frame to the synthesis module in the EIS module. The synthesis module is passed to the synthesis module, so that the synthesis module can perform anti-shake processing on the i-th video frame based on the adjusted position information corresponding to the i-th video frame to obtain the processed i-th video frame; then the path calculation module can continue to pass the adjusted position information corresponding to the i+1-th video frame to the synthesis module in the EIS module. At the same time, the server can pass the decoded i+1-th video frame to the synthesis module, so that the synthesis module can perform anti-shake processing on the i+1-th video frame based on the adjusted position information corresponding to the i+1-th video frame to obtain the processed i+1-th video frame; it should be noted that for the anti-shake processing method for other video frames, please refer to the anti-shake processing for the i-th video frame, which will not be repeated here. Finally, the server can encode the processed N video frames to obtain the second video.

[0107] It should be noted that the above-mentioned method embodiments, or various possible implementation methods in each method embodiment, can be executed separately, or, under the premise that there is no contradiction, can also be executed in combination with each other. The specific implementation can be determined according to actual usage requirements, and the embodiments of the present application do not limit this.

[0108] It should be noted that the video stabilization processing method provided in the embodiment of the present application can be executed by a video stabilization processing device. In the embodiment of the present application, the video stabilization processing device executing the video stabilization processing method is taken as an example to illustrate the video stabilization processing device provided in the embodiment of the present application.

[0109] Figure 5 A possible structural diagram of a video anti-shake processing device involved in an embodiment of the present application is shown. Figure 5As shown, the video anti-shake processing device 70 may include: an acquisition module 71 and a processing module 72.

[0110] The acquisition module 71 is used to acquire N first anti-shake parameters in the process of capturing the first video, where the N first anti-shake parameters are anti-shake parameters corresponding to the N video frames included in the first video, and the N video frames correspond to the N first anti-shake parameters one by one; N is an integer greater than 1;

[0111] The processing module 72 is used to perform anti-shake processing on N video frames based on the N first anti-shake parameters obtained by the obtaining module 71 when the first video is collected, so as to obtain N processed video frames.

[0112] The embodiment of the present application provides a video anti-shake processing device. Since the video anti-shake processing device performs anti-shake processing on the first video after the first video is acquired, it is not limited by the camera memory. The video anti-shake processing device can select a larger number of video frames and continuously plan the anti-shake path of the electronic device to perform anti-shake processing on the first video. Therefore, the anti-shake effect of the video anti-shake processing device can be improved, thereby improving the shooting quality of the video anti-shake processing device.

[0113] In one possible implementation, the processing module 72 is specifically used to decode the first video to obtain N video frames; and plan a first anti-shake path based on a first anti-shake parameter corresponding to a first video frame in the N video frames through a path calculation module in the electronic device, the first video frame includes the i-th video frame to the i+M-th video frame in the N video frames, the first anti-shake path includes the adjusted position information corresponding to the first video frame, i is a positive integer, M is an integer greater than 1, M<N; and perform anti-shake processing on the first video frame based on the first anti-shake path through a synthesis processing module in the electronic device.

[0114] In a possible implementation, the acquisition module 71 is further configured to, before the processing module 72 performs anti-shake processing on the N video frames based on the N first anti-shake parameters, obtain the second anti-shake parameter input by the user in the video playback interface when the video playback interface of the first video is displayed. The processing module 72 is specifically configured to perform anti-shake processing on the N video frames based on the N first anti-shake parameters and the second anti-shake parameters obtained by the acquisition module 71.

[0115] In one possible implementation, the second anti-shake parameter includes at least one of the following: a first numerical value, an anti-shake strength of the video, and a field of view angle corresponding to the video frame; wherein the first numerical value is used to indicate the number of first anti-shake parameters used when performing anti-shake processing on any one of N video frames.

[0116] In a possible implementation, the interface display device 70 provided in the embodiment of the present application also includes: a sending module and a receiving module; the sending module is used to send indication information, N video frames and N first anti-shake parameters to the server of the electronic device after the acquisition module 71 acquires N first anti-shake parameters during the process of acquiring the first video, and when the acquisition of the first video is completed, the indication information is used to instruct the server to perform anti-shake processing on the N video frames through the N first anti-shake parameters; the receiving module is used to receive the second video sent by the server, and the second video includes the processed N video frames.

[0117] The video anti-shake processing device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (Augmented Reality, AR) / virtual reality (Virtual Reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (Ultra-Mobile Personal Computer, UMPC), a netbook or a personal digital assistant (Personal Digital Assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (Personal Computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0118] The video stabilization processing device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0119] The video stabilization processing device provided in the embodiment of the present application can implement each process implemented in the above method embodiment, and will not be described again here to avoid repetition.

[0120] Alternatively, if Figure 6 As shown, an embodiment of the present application also provides an electronic device 900, including a processor 901 and a memory 902, wherein the memory 902 stores programs or instructions that can be executed on the processor 901, and when the program or instructions are executed by the processor 901, the various steps of the above-mentioned method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not described here.

[0121] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0122] Figure 7 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.

[0123] The electronic device 100 includes but is not limited to components such as a radio frequency unit 101, a network module 102, an audio output unit 103, an input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, and a processor 110.

[0124] Those skilled in the art will appreciate that the electronic device 100 may also include a power source (such as a battery) for supplying power to various components, and the power source may be logically connected to the processor 110 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 7 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0125] Among them, the processor 110 is used to obtain N first anti-shake parameters during the process of capturing the first video, where the N first anti-shake parameters are anti-shake parameters corresponding to the N video frames included in the first video, and the N video frames correspond one-to-one to the N first anti-shake parameters; N is an integer greater than 1; and when the first video is captured, anti-shake processing is performed on the N video frames based on the N first anti-shake parameters obtained by the acquisition module 71 to obtain N processed video frames.

[0126] The embodiment of the present application provides an electronic device, which performs anti-shake processing on the first video after the electronic device acquires the first video, and is not limited by the camera memory. The electronic device can select a larger number of video frames and continuously plan the anti-shake path of the electronic device to perform anti-shake processing on the first video. This can improve the anti-shake effect of the electronic device, and further improve the shooting quality of the electronic device.

[0127] In some embodiments of the present application, the processor 110 is specifically used to decode the first video to obtain N video frames, and plan a first anti-shake path based on a first anti-shake parameter corresponding to a first video frame among the N video frames through a path calculation module in the electronic device, where the first video frame includes the i-th video frame to the i+M-th video frame among the N video frames, and the first anti-shake path includes adjusted position information corresponding to the first video frame, where i is a positive integer, M is an integer greater than 1, and M<N; and anti-shake processing is performed on the first video frame based on the first anti-shake path through a synthesis processing module in the electronic device.

[0128] In some embodiments of the present application, the processor 110 is further used to obtain a second anti-shake parameter input by a user in the video playback interface when displaying the video playback interface of the first video before performing anti-shake processing on N video frames based on N first anti-shake parameters.

[0129] The processor 110 is specifically configured to perform anti-shake processing on N video frames based on N first anti-shake parameters and second anti-shake parameters.

[0130] In some embodiments of the present application, the second anti-shake parameter includes at least one of the following: a first numerical value, the anti-shake strength of the video, and the field of view angle corresponding to the video frame; wherein the first numerical value is used to indicate the number of first anti-shake parameters used when performing anti-shake processing on any one of N video frames.

[0131] In some embodiments of the present application, the RF unit 101 is used to send indication information, N video frames and N first anti-shake parameters to a server of the electronic device after the processor 110 obtains N first anti-shake parameters during the process of capturing the first video, when the capture of the first video is completed, wherein the indication information is used to instruct the server to perform anti-shake processing on the N video frames through the N first anti-shake parameters; and receive a second video sent by the server, the second video including the processed N video frames.

[0132] The electronic device provided in the embodiment of the present application can implement each process implemented in the above method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described here.

[0133] The beneficial effects of various implementations in this embodiment can be specifically referred to the beneficial effects of the corresponding implementations in the above method embodiment. To avoid repetition, they will not be described again here.

[0134] It should be understood that in the embodiment of the present application, the input unit 104 may include a graphics processor (Graphics Processing Unit, GPU) 1041 and a microphone 1042, and the graphics processor 1041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 107 includes a touch panel 1071 and at least one of other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include two parts: a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0135] The memory 109 can be used to store software programs and various data. The memory 109 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 109 may include a volatile memory or a non-volatile memory, or the memory 109 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 109 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0136] The processor 110 may include one or more processing units; optionally, the processor 110 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 110.

[0137] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0138] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0139] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0140] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0141] An embodiment of the present application provides a computer program / program product, which is stored in a storage medium. The program / program product is executed by at least one processor to implement the various processes of the above-mentioned method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described here.

[0142] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

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

[0144] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A video anti-shake processing method, characterized in that: The method comprises: In the process of capturing the first video, N first anti-shake parameters are obtained, where the N first anti-shake parameters are anti-shake parameters corresponding to N video frames included in the first video, and the N video frames correspond to the N first anti-shake parameters one by one; N is an integer greater than 1; When the first video is captured, anti-shake processing is performed on the N video frames based on the N first anti-shake parameters to obtain the processed N video frames.

2. The method according to claim 1, characterized in that The performing anti-shake processing on the N video frames based on the N first anti-shake parameters includes: Decoding the first video to obtain the N video frames; A first anti-shake path is planned by a path calculation module in the electronic device based on a first anti-shake parameter corresponding to a first video frame among the N video frames, wherein the first video frame includes an i-th video frame to an i+M-th video frame among the N video frames, and the first anti-shake path includes adjusted position information corresponding to the first video frame, where i is a positive integer and M is an integer greater than 1; The first video frame is subjected to anti-shake processing based on the first anti-shake path by a synthesis processing module in the electronic device.

3. The method according to claim 1, characterized in that Before performing anti-shake processing on the N video frames based on the N first anti-shake parameters, the method further includes: When displaying a video playback interface of the first video, obtaining a second anti-shake parameter input by a user in the video playback interface; The performing anti-shake processing on the N video frames based on the N first anti-shake parameters includes: Anti-shake processing is performed on the N video frames based on the N first anti-shake parameters and the second anti-shake parameters.

4. The method according to claim 3, characterized in that The second anti-shake parameter includes at least one of the following: a first value, an anti-shake strength of the video, and a field of view angle corresponding to the video frame; The first value is used to indicate the number of first anti-shake parameters used when anti-shake processing is performed on any one of the N video frames.

5. The method according to claim 1, characterized in that In the process of capturing the first video, after obtaining N first anti-shake parameters, the method further includes: When the first video is captured, sending instruction information, the N video frames, and the N first anti-shake parameters to a server of the electronic device, wherein the instruction information is used to instruct the server to perform anti-shake processing on the N video frames using the N first anti-shake parameters; A second video sent by the server is received, where the second video includes the processed N video frames.

6. A video anti-shake processing device, characterized in that: The device comprises: an acquisition module and a processing module; The acquisition module is used to acquire N first anti-shake parameters during the process of capturing the first video, where the N first anti-shake parameters are anti-shake parameters corresponding to N video frames included in the first video, and the N video frames correspond to the N first anti-shake parameters one by one; N is an integer greater than 1; The processing module is used to perform anti-shake processing on the N video frames based on the N first anti-shake parameters obtained by the acquisition module when the first video is acquired, so as to obtain the processed N video frames.

7. The device according to claim 6, characterized in that The processing module is specifically used to decode the first video to obtain the N video frames; and plan a first anti-shake path based on a first anti-shake parameter corresponding to a first video frame among the N video frames through a path calculation module in the electronic device, wherein the first video frame includes an i-th video frame to an i+M-th video frame among the N video frames, and the first anti-shake path includes adjusted position information corresponding to the first video frame, where i is a positive integer, M is an integer greater than 1, and M<N; And the first video frame is subjected to anti-shake processing based on the first anti-shake path by a synthesis processing module in the electronic device.

8. The device according to claim 6, characterized in that The acquisition module is further configured to acquire, before the processing module performs anti-shake processing on the N video frames based on the N first anti-shake parameters, a second anti-shake parameter input by a user in the video playback interface when the video playback interface of the first video is displayed; The processing module is specifically configured to perform anti-shake processing on the N video frames based on the N first anti-shake parameters and the second anti-shake parameters acquired by the acquisition module.

9. The device according to claim 8, characterized in that The second anti-shake parameter includes at least one of the following: a first value, an anti-shake strength of the video, and a field of view angle corresponding to the video frame; The first value is used to indicate the number of first anti-shake parameters used when anti-shake processing is performed on any one of the N video frames.

10. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the video stabilization processing method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Video playing method, video playing device and electronic equipment

    CN115242981A

  • Video anti-shake method and related equipment

    CN117278855A

  • Video processing method, video processing apparatus, and electronic device

    WO2021233032A1