Video recording method and device, electronic equipment and storage medium

CN116132617BActive Publication Date: 2026-08-21VIVO MOBILE COMM CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310153417.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-21
Publication Date
2026-08-21
Estimated Expiration
2043-02-21

AI Technical Summary

Technical Problem

[0004]本申请实施例的目的是提供一种视频录制方法、装置、电子设备及存储介质,能够解决若用户无法较好的适应预先写入到终端设备中的防抖参数,录制的视频画面抖动较为严重的问题

Benefits of technology

[0015] In this embodiment, by importing a first video pre-shot by the user, multiple sets of video frame data are constructed based on N preview frames and different numbers of cached frames in the first video. Multiple sets of shake intensity adjustment coefficients that better suit the user's shooting habits are generated based on the multiple sets of video frame data. Furthermore, the corresponding shake intensity adjustment indicator is displayed on the video recording interface, so that the user can choose the shake intensity adjustment coefficient that suits their needs when recording video, effectively ensuring the stability of the recorded video.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116132617B_ABST
    Figure CN116132617B_ABST
Patent Text Reader

Abstract

The application discloses a video recording method and device, electronic equipment and storage medium, and belongs to the technical field of image processing. The method comprises the following steps: receiving a first input of a first video, wherein the first video comprises N preview frames and M cache frames; in response to the first input, displaying P shaking intensity adjustment identifiers on a video recording preview interface; wherein each shaking intensity adjustment identifier points to a group of shaking intensity adjustment coefficients, the shaking intensity adjustment coefficients are used for compensating for video shaking occurring in a video recording process, the shaking intensity adjustment coefficients are generated according to a video frame data group, each video frame data group comprises N preview frames and a cache frame set, the number of cache frames in each cache frame set is different, and M, N and P are all positive integers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of image processing technology, specifically relating to a video recording method, apparatus, electronic device, and storage medium. Background Technology

[0002] With the continuous development of terminal device technology, more and more users will use terminal devices to record videos. In order to ensure the quality of the recorded videos, video stabilization is very important.

[0003] In related technologies, the stabilization parameters used for video stabilization are often pre-written into the terminal device. However, different users have different levels of adaptability to the stabilization parameters when recording video with a handheld terminal device. If users cannot adapt well to the stabilization parameters pre-written into the terminal device, the final recorded video may have severe shaking. Summary of the Invention

[0004] The purpose of this application is to provide a video recording method, apparatus, electronic device, and storage medium that can solve the problem that if the user cannot adapt well to the anti-shake parameters pre-written into the terminal device, the recorded video image will be severely shaky.

[0005] In a first aspect, embodiments of this application provide a video recording method, the method comprising:

[0006] Receive a first input to a first video, the first video comprising N preview frames and M buffer frames;

[0007] In response to the first input, P jitter intensity adjustment markers are displayed on the video recording preview interface; wherein each jitter intensity adjustment marker points to a set of jitter intensity adjustment coefficients, which are used to compensate for video jitter that occurs during video recording. The jitter intensity adjustment coefficients are generated based on a video frame data group, each video frame data group including N preview frames and a set of buffered frames, and the number of buffered frames in each set of buffered frames is different, where M, N and P are all positive integers.

[0008] Secondly, embodiments of this application provide a video recording apparatus, including:

[0009] The first receiving module is used to receive a first input to a first video, the first video including N preview frames and M buffer frames;

[0010] A first display module is configured to respond to the first input by displaying P jitter intensity adjustment identifiers on a video recording preview interface; wherein each jitter intensity adjustment identifier points to a set of jitter intensity adjustment coefficients, the jitter intensity adjustment coefficients are used to compensate for video jitter that occurs during video recording, the jitter intensity adjustment coefficients are generated based on a video frame data group, each video frame data group includes N preview frames and a set of buffered frames, the number of buffered frames in each set of buffered frames is different, and M, N and P are all positive integers.

[0011] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, wherein the memory stores programs or instructions executable on the processor, and the programs or instructions, when executed by the processor, implement the steps of the method described in the first aspect.

[0012] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.

[0013] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the method as described in the first aspect.

[0014] In a sixth aspect, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the method described in the first aspect.

[0015] In this embodiment, by importing a first video pre-shot by the user, multiple sets of video frame data are constructed based on N preview frames and different numbers of cached frames in the first video. Multiple sets of shake intensity adjustment coefficients that better suit the user's shooting habits are generated based on the multiple sets of video frame data. Furthermore, the corresponding shake intensity adjustment indicator is displayed on the video recording interface, so that the user can choose the shake intensity adjustment coefficient that suits their needs when recording video, effectively ensuring the stability of the recorded video. Attached Figure Description

[0016] Figure 1 This is a schematic flowchart of the video recording method provided in the embodiments of this application;

[0017] Figure 2 This is one of the display schematic diagrams provided in the embodiments of this application;

[0018] Figure 3 This is a second schematic diagram provided for an embodiment of this application;

[0019] Figure 4 This is the third schematic diagram provided for an embodiment of this application;

[0020] Figure 5 This is the fourth schematic diagram provided for an embodiment of this application;

[0021] Figure 6 This is a schematic diagram of the video recording device provided in an embodiment of this application;

[0022] Figure 7 This is a schematic diagram of the electronic device structure provided in the embodiments of this application;

[0023] Figure 8 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application. Detailed Implementation

[0024] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0025] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0026] The video recording method, apparatus, electronic device, and storage medium provided in this application will be described in detail below with reference to the accompanying drawings and through specific embodiments and application scenarios.

[0027] Figure 1 This is a schematic diagram of the video recording method provided in the embodiments of this application, such as... Figure 1 As shown, it includes:

[0028] Step 110: Receive the first input to the first video, which includes N preview frames and M buffer frames;

[0029] The first video described in this application embodiment may specifically be a video pre-recorded by a user who is currently recording a video. In one embodiment, the first video may also be part of the video content in a continuously shot video.

[0030] The first video can be a video stored locally on the terminal device or a video stored on a cloud server.

[0031] During video recording, a video preview is often included to help users understand the recorded video content. However, video preview has high real-time requirements, and it is often impossible to preview all video frames captured during the recording process. Only a portion of the video frames can be previewed. The frames used for video preview are called preview frames, while cached frames can be video frames that are cached during the preview process. In other words, the video frames that are recorded but not previewed are called cached frames.

[0032] The N-frame preview frames described in this application embodiment are video frames used for video preview in the first recorded video, while the M-frame cache frames are video frames in the first recorded video that are not used for video preview. It can be understood that the cache frames can be video frames recorded between various preview frames.

[0033] The terminal device receives a first input to the first video. The terminal device can be a device with video recording function, such as a mobile phone, camera, tablet computer, etc. This application embodiment does not specifically limit the type of terminal device.

[0034] In an optional embodiment, the first input may also be an operation during video recording where a portion of the video content that has already been recorded is used as the first video, and multiple sets of jitter intensity adjustment coefficients are generated based on the first video.

[0035] In another alternative embodiment, the first input mentioned above may be an operation for importing a first video and generating multiple sets of jitter intensity adjustment coefficients based on the first video, and the first input may be a first operation.

[0036] For example, the video recording preview interface may include a video import icon. The first operation includes, but is not limited to, the user clicking the video import icon with a finger or stylus, selecting the video file corresponding to the first video, and confirming the import. Alternatively, the first input may be a voice command input by the user, a specific gesture input by the user, or other feasible inputs. The specific input can be determined according to actual usage needs, and this embodiment of the invention does not limit it. The specific gesture in this application embodiment can be any one of a single-click gesture, a swipe gesture, a drag gesture, a pressure recognition gesture, a long-press gesture, an area change gesture, a double-press gesture, or a double-click gesture. The click input in this application embodiment can be a single-click input, a double-click input, or any number of clicks.

[0037] Step 120: In response to the first input, display P jitter intensity adjustment markers on the video recording preview interface; wherein each jitter intensity adjustment marker points to a set of jitter intensity adjustment coefficients, the jitter intensity adjustment coefficients are used to compensate for video jitter that occurs during video recording, the jitter intensity adjustment coefficients are generated based on a video frame data group, each video frame data group includes N preview frames and a set of buffered frames, the number of buffered frames in each set of buffered frames is different, and M, N and P are all positive integers.

[0038] In response to the first input, after importing the first video, the terminal device can further generate multiple sets of video frame data based on the N preview frames and different numbers of cached frames in the first video.

[0039] In some embodiments, the number of buffered frames in a video frame data group can be set by the user or generated according to a certain preset scheme. For example, each video frame data group introduces 3 more buffered frames than the previous frame data group. Theoretically, the more buffered frames used in a video frame data group, the smaller the generated jitter intensity adjustment coefficient and the higher the jitter stabilization intensity.

[0040] For example, the first video includes 5 preview frames and 50 cached frames, generating three sets of video frame data groups. The first set of video frame data groups may include 5 preview frames and 3 cached frames adjacent to each preview frame, i.e., 15 cached frames; the second set of video frame data groups includes 5 preview frames and 5 cached frames adjacent to each preview frame, i.e., 25 cached frames; and the third set of video frame data groups includes 5 preview frames and 7 cached frames adjacent to each preview frame, i.e., 35 cached frames.

[0041] In this embodiment of the application, after generating multiple sets of video frame data groups based on N preview frames of the first video and different numbers of cached frames, a corresponding jitter intensity adjustment coefficient can be generated based on each set of video frame data groups. For example, if the first video generates 5 sets of video frame data groups, 5 sets of jitter intensity adjustment coefficients can be generated.

[0042] In an optional embodiment, the jitter intensity adjustment coefficient is a coefficient used to compensate for video jitter occurring during video recording. This jitter intensity adjustment coefficient can be a stabilization coefficient matrix, which may include stabilization adjustment coefficients in the X, Y, pitch, yaw, and roll directions. During video recording, this stabilization intensity adjustment coefficient can simultaneously compensate for jitter in the X, Y, pitch, yaw, and roll directions, thereby effectively ensuring the stability of video shooting. In an optional embodiment, after generating multiple sets of jitter intensity adjustment coefficients, they can be sorted according to the number of buffered frames corresponding to each jitter intensity adjustment coefficient to generate corresponding jitter level information. For example, the jitter intensity adjustment coefficient obtained without utilizing buffered frames is set to level 0, the jitter intensity coefficient obtained using 15 buffered frames is set to level 1, and the jitter intensity coefficient obtained using 30 buffered frames is set to level 2, thereby obtaining the corresponding jitter level information. The jitter intensity adjustment identifier described in this embodiment can be an identifier including jitter level information, allowing the user to select the corresponding jitter intensity adjustment coefficient.

[0043] In an optional embodiment, after generating multiple sets of jitter intensity adjustment coefficients, they are sorted according to the magnitude of their adjustment values ​​to generate corresponding sorting information. The jitter intensity adjustment identifier described in this embodiment may include this sorting information, and the user can select the corresponding jitter intensity adjustment coefficient by selecting the sorting result.

[0044] In an optional embodiment, the P jitter intensity adjustment indicators in the video recording preview interface can be displayed on a scrollable bar page, allowing the user to select different jitter intensity adjustment indicators by scrolling through the page.

[0045] In an optional embodiment, the P jitter intensity adjustment icons in the video recording preview interface can be displayed separately, and the user can click or long-press the jitter intensity adjustment icon they wish to select to set the corresponding jitter intensity adjustment coefficient.

[0046] In this embodiment of the application, during the video recording process, the terminal device's display screen can show a video recording preview interface. Users can view the preview frames of the recorded video through this video recording preview interface, thereby effectively understanding the content of the captured video. Furthermore, the video recording preview interface can also display a jitter intensity adjustment indicator for adjusting video recording parameters, so that users can make adjustments during the video recording process.

[0047] Because users have different perceptions of shake intensity, they can adjust the shake intensity during video recording using the shake intensity adjustment indicator, and select the shake intensity adjustment coefficient that best suits their own visual perception to record the video and obtain the final video output.

[0048] In an optional embodiment, after the user sets the shake intensity adjustment coefficient, the shake stabilization will be performed by default when the user records video again through the mobile terminal.

[0049] In this embodiment, a first video pre-shot by the user is imported, and then multiple sets of video frame data groups are constructed using N preview frames and different numbers of cached frames in the first video. Based on these multiple sets of video frame data groups, multiple sets of shake intensity adjustment coefficients that better suit the user's shooting habits are generated. Furthermore, the corresponding shake intensity adjustment indicator is displayed on the video recording interface, allowing the user to select a shake intensity adjustment coefficient that suits their needs when recording video, effectively ensuring the stability of the recorded video footage.

[0050] Optionally, the method for generating the jitter intensity adjustment coefficient is as follows:

[0051] Obtain the first motion offset of each cached frame and each preview frame in the video frame data group, and determine the first difference between each first motion offset and the target motion offset, wherein the target motion offset is the minimum value among each first motion offset;

[0052] The jitter intensity adjustment coefficient is determined based on the total number of cached frames and preview frames in the video frame data group, and the absolute value of each of the first differences.

[0053] In this embodiment, the first motion offset is the motion estimate of the recorded buffer frame or preview frame relative to the first video frame of the video recording. The minimum offset among the first motion offset of each buffer frame of each video frame data group and the first motion offset of each preview frame is selected, and the minimum offset is used as the target motion offset. It can be understood that since the preview frames contained in each video frame data group are different, the minimum offset of each video frame data group may be different.

[0054] In one embodiment, a motion estimation curve for each video frame data group is constructed based on the first motion offset of each buffered frame and the first motion offset of each preview frame in a video frame data group, and the minimum value of the motion estimation curve is taken as the target motion offset corresponding to the data frame group.

[0055] In this embodiment of the application, specifically, the first motion offset P of each cached frame and preview frame can be used. i For the target motion offset P min The difference is calculated, resulting in multiple first difference values ​​(P). i -P min ).

[0056] In one embodiment, the total number of cached frames and preview frames in a video frame data group refers to the sum of the number of cached frames and the number of preview frames in a video data group.

[0057] In one embodiment, the absolute values ​​of the first differences in a video data set can be summed to obtain a sum. Then, the sum can be divided by the total number of frames to obtain the jitter intensity adjustment coefficient calculated for that video frame data set. Specifically, it can be:

[0058]

[0059] Where frame represents the total number of frames in the video frame data group, specifically the sum of the number of preview frames and cached frames in the video frame data group, P i P is the first motion offset. min Let be the target motion offset, and i represent the i-th frame of the video recording.

[0060] In the embodiments of this application, different video frame data groups include different preview frames, so different jitter intensity adjustment coefficients can be obtained in the manner described above.

[0061] In one embodiment, since the terminal device needs to stabilize in the X, Y, pitch, yaw, and roll directions, when acquiring the first motion offset, the corresponding motion offsets in the X, Y, pitch, yaw, and roll directions are also acquired. The resulting jitter intensity adjustment coefficient is a matrix K, which includes jitter intensity adjustment values ​​in the X, Y, pitch, yaw, and roll directions, specifically in the following form:

[0062] K = (k x ,k y ,k pitch ,k yaw ,k roll ) T

[0063] In this embodiment, the jitter intensity adjustment coefficient is effectively calculated by using the total number of cached frames and preview frames in the video frame data group, and the first difference between the first motion offset of the cached frames and each preview frame and the target motion offset. Multiple jitter intensity coefficients can be calculated using different numbers of cached frames in each video frame data group, providing users with more options during video recording.

[0064] Optionally, in response to the first input, after displaying P jitter intensity adjustment indicators on the video recording preview interface, the method further includes:

[0065] Receive a second input for the target jitter intensity adjustment flag among the P jitter intensity adjustment flags;

[0066] In response to the second input, video recording is performed according to the first jitter intensity adjustment coefficient corresponding to the target jitter intensity adjustment identifier, wherein the first jitter intensity adjustment coefficient is used to compensate for jitter in the recorded video during the video recording process.

[0067] In one embodiment, the terminal device receives a second input from the user for a target jitter intensity adjustment identifier among the P jitter intensity adjustment identifiers. The second input is used to determine the target jitter intensity adjustment identifier to be selected. The second input may be a click input, a long press input, or a swipe input, or a voice command input that can realize a response function, or other inputs. This application embodiment does not limit this.

[0068] In response to the user's second input, the terminal device will record video according to the first jitter intensity adjustment coefficient corresponding to the target jitter intensity adjustment identifier. It is understood that, since the preview frame in this embodiment has strong real-time characteristics, the first jitter intensity adjustment coefficient is not an adjustment coefficient that is adjusted only for the preview frame, but rather a jitter compensation for all recorded and saved video frames.

[0069] After the user completes the settings, the first jitter intensity adjustment factor will be used as the default parameter for video recording on the terminal device, which can avoid the user having to make additional settings every time they record a video, effectively reducing the number of steps the user has to take.

[0070] In an optional embodiment, Figure 2 This is one of the display diagrams provided in the embodiments of this application, such as... Figure 2 As shown, the video recording preview interface 21 can display a stabilization intensity setting indicator 211. After the user clicks the stabilization intensity setting indicator 211, the terminal device responds to the input and displays a video import interface 22. After the user imports the first video in the video import interface 22, P shake intensity adjustment indicators 212 will be displayed in the video recording preview interface 21.

[0071] In this embodiment, the user can continuously switch between the target jitter intensity adjustment flags among P jitter intensity adjustment flags, thereby effectively selecting the appropriate jitter intensity adjustment coefficient for the user, effectively ensuring the stability of the final video recording, and ensuring the quality of the video recording.

[0072] Optionally, after the step of recording video according to the first jitter intensity adjustment coefficient corresponding to the target jitter intensity adjustment identifier, the method further includes:

[0073] Receive a third input, which is used to magnify the target shooting area in the video recording preview interface according to the target magnification ratio;

[0074] In response to the third input, during the process of zooming in on the target shooting area, the first center point of the video recording preview interface is controlled to move closer to the second center point of the target shooting area in the recorded video.

[0075] In this embodiment, since the preview frame has high real-time requirements, the jitter intensity adjustment coefficient of the preview frame displayed in the video recording preview interface cannot be calculated using cached frames. However, the calculation of the jitter intensity adjustment coefficient of the video recording involves cached frames. Therefore, the jitter stabilization intensity of the preview is often much lower than that of the video recording. Furthermore, during the process of enlarging the recorded video, the lower the jitter stabilization intensity, the greater the overall video offset during the enlargement process.

[0076] The terminal device receives a third input, which is an operation to magnify the target shooting area in the video recording preview interface according to the target magnification ratio. The target magnification ratio can be the magnification ratio of the target shooting area. For example, the target magnification ratio can be a 2x magnification ratio, that is, to magnify the target shooting area by two times.

[0077] In one embodiment, the target shooting area is an area that appears in the video shooting preview interface, and the target shooting area can also be the focus area during the video recording process.

[0078] In one embodiment, the third input may specifically be a two-finger sliding motion to zoom in on the target shooting area, a dragging motion of the zoom level indicator, or a voice command input that can provide a response function.

[0079] In response to the third input, the terminal device zooms in on the target shooting area. During this zooming process, in one embodiment, since the jitter intensity adjustment factor for the video preview is determined based on the preview frame, while the jitter intensity adjustment factor for video recording is calculated jointly by the buffered frames and the preview frame, different jitter intensity adjustment factors can cause the preview and recorded images to shift during zooming. In this case, the discrepancy between the preview and recorded images can be adjusted according to the user-set first jitter intensity adjustment factor.

[0080] In one embodiment, the first center point may refer to the center point of the video recording preview interface. Alternatively, in another embodiment, the first center point may be a center point set by the user in the video preview interface.

[0081] In one embodiment, the second center point can be the focus point of the terminal device in the target shooting area during video recording. Alternatively, in one embodiment, it can also be a point manually selected by the user.

[0082] In this embodiment, the discrepancy between the preview and the recorded image may be due to a shift in the preview or a shift in the recorded image. Therefore, in this embodiment, the first center point of the video recording preview interface can be brought closer to the second center point of the target shooting area in the recorded video frame. At this time, the video preview image in the video preview interface and the recorded video image will also shift in the corresponding direction, thereby solving the problem of discrepancy between the preview and the recorded image to a certain extent.

[0083] Optionally, controlling the first center point of the video recording preview interface to be closer to the second center point of the target shooting area in the recorded video frame includes:

[0084] Based on the first jitter intensity adjustment coefficient and the preview jitter intensity adjustment coefficient, the first offset of the first center point and the second offset of the second center point are determined. The preview jitter intensity adjustment coefficient is a jitter intensity adjustment coefficient generated based on a video frame data group containing only N preview frames.

[0085] Control the direction of the first center point toward the second center point, and adjust the offset according to the first offset amount. Control the direction of the second center point toward the first center point, and adjust the offset according to the second offset amount.

[0086] In this embodiment, the preview jitter intensity adjustment coefficient is the jitter intensity adjustment coefficient of the video preview, which is calculated based on the preview frames in the first video. Specifically, it is calculated based on a video frame data group that includes only all the preview frames in the first video using the above-mentioned jitter intensity adjustment coefficient calculation method.

[0087] In this embodiment of the application, since there may be additional cached frames in the video frame data group that generates the first jitter intensity adjustment coefficient, there may be a difference between the first jitter intensity adjustment coefficient and the preview jitter intensity adjustment coefficient.

[0088] In this embodiment of the application, the offset of the video preview screen in the video recording preview interface relative to the video recording screen is T, where T = K1 - K2, K1 is the first jitter intensity adjustment coefficient, and K2 is the preview jitter intensity adjustment coefficient.

[0089] In one embodiment, during the magnification process, the magnification ratio also affects the offset of the video preview screen in the video recording preview interface relative to the video recording screen. The larger the magnification ratio, the larger the offset, which can be expressed as magnification ratio * T. For example, if the magnification ratio is 2x, the corresponding offset is 2 * T.

[0090] Figure 3 This is a second schematic diagram provided for an embodiment of this application, as shown below. Figure 3 As shown, including a first center point 31 and a second center point 32, during the process of magnification, the first center point and the second center point will be offset.

[0091] In the embodiments of this application, the values ​​of the first offset and the second offset may be different, and when the degree of each offset cannot be determined, the values ​​of the first offset and the second offset may also be the same.

[0092] After determining the first offset and the second offset, the first center point of the video recording preview interface can be further controlled to shift towards the second center point according to the first offset during the magnification process. Correspondingly, the second center point of the target shooting area in the video recording screen will also shift towards the first center point according to the second offset. In other words, the first center point and the second center point will approach each other during the magnification process, and the video preview image in the corresponding video preview interface and the video frame of the video recording will also be adjusted accordingly.

[0093] In one embodiment, after the magnification adjustment is completed and the first and second center points are also offset accordingly, the adjusted first and second center points can coincide in the final display interface. That is, after the magnification is completed, the content displayed in the video preview interface is the same as the video frame content of the video recording, avoiding the situation where the content of the video preview is inconsistent with the content of the video recording after magnification due to different jitter intensity adjustment coefficients.

[0094] Figure 4 This is the third schematic diagram provided for an embodiment of this application, as shown below. Figure 4 As shown, the first center point 31 and the second center point 32 can be displayed in the original video recording preview interface 21. Assuming that the offset between the first center point 31 and the second center point 32 is T before magnification, if the offset is not adjusted, the offset between the first center point 31 and the second center point 32 is 2T in the video recording preview interface 41 that is magnified twice.

[0095] Figure 5 This is the fourth schematic diagram provided for an embodiment of this application, as shown below. Figure 5 As shown, in the original video recording preview interface 21, during the zoom-in process, if the second center point 32 of the target shooting area is in the lower left corner of the video recording preview interface 21, then the first center point 31 is shifted to the lower left corner accordingly. The shifted first center point 33 is obtained in the video recording preview interface 41 after zooming in twice. Similarly, if the first center point 31 is in the upper right corner of the target shooting area 51 during the zoom-in process, then the second center point 32 is shifted to the upper right corner of the target shooting area 51. The shifted second center point 34 is obtained in the target shooting area 52 after zooming in twice. Finally, in the video recording preview interface 41 after zooming in twice, the shifted second center point 34 and the shifted first center point 33 can coincide. The scene that the user wants to zoom in on is in the same position in both the preview interface and the recording interface, eliminating the problem of inconsistency between the preview and recording under high zoom levels.

[0096] In this embodiment of the application, since the offset adjustment process begins when the user starts to zoom in and stops when the zooming ends, the screen offset caused by the offset compensation will be synchronized with the zooming process, so the user will not experience any visual discomfort.

[0097] Optionally, based on the first jitter intensity adjustment coefficient and the preview jitter intensity adjustment coefficient, determining the first offset of the first center point and the second offset of the second center point includes:

[0098] Based on the difference between the first jitter intensity adjustment coefficient and the preview jitter intensity adjustment coefficient, the offset degree information is obtained;

[0099] Based on the magnification factor of the target shooting area and the offset information, a first offset of the first center point and a second offset of the second center point are determined, wherein the first offset and the second offset are equal.

[0100] In this embodiment of the application, since there may be some difference between the preview video frame during the video shooting process and the actual enlarged recorded image, it can be adjusted by the first jitter intensity adjustment coefficient and the preview jitter intensity adjustment coefficient.

[0101] In this embodiment of the application, the degree of offset of the recorded video frame relative to the preview video frame can be obtained by the difference between the first jitter intensity adjustment coefficient and the preview jitter intensity adjustment coefficient, thus obtaining the offset degree information.

[0102] In this embodiment, since different magnification factors will further affect the amount of the recorded video frame relative to the preview video frame, the overall offset can be determined by multiplying the magnification factor of the target shooting area by the offset information.

[0103] In an optional embodiment, since both the first center point and the second center point need to be adjusted, in order to ensure that the adjustment offset is appropriate, the first offset and the second offset can be made equal, that is, the first offset and the second offset are both half of the overall offset. At this time, the first offset of the first center point and the second offset of the second center point are determined.

[0104] In this embodiment, the overall offset is determined by the difference between the first jitter intensity adjustment coefficient and the preview jitter intensity adjustment coefficient, combined with the magnification of the target shooting area. Then, the first offset of the first center point and the second offset of the second center point are obtained by the overall offset, which effectively avoids the situation where the content of the video preview and the content of the video recording are inconsistent after magnification due to different jitter intensity adjustment coefficients.

[0105] The video recording method provided in this application can be executed by a video recording device. This application uses a video recording device executing the video recording method as an example to illustrate the video recording device provided in this application.

[0106] Figure 6 This is a schematic diagram of the video recording device structure provided in the embodiments of this application, such as... Figure 6 As shown, it includes:

[0107] The first receiving module 610 is used to receive a first input to a first video, the first video including N preview frames and M buffer frames;

[0108] The first display module 620 is configured to respond to the first input by displaying P jitter intensity adjustment identifiers on the video recording preview interface; wherein each jitter intensity adjustment identifier points to a set of jitter intensity adjustment coefficients, the jitter intensity adjustment coefficients are used to compensate for video jitter that occurs during video recording, the jitter intensity adjustment coefficients are generated based on a video frame data group, each video frame data group includes N preview frames and a set of buffered frames, the number of buffered frames in each set of buffered frames is different, and M, N and P are all positive integers.

[0109] Optionally, the method for generating the jitter intensity adjustment coefficient is as follows:

[0110] Obtain the first motion offset of each cached frame and each preview frame in the video frame data group, and determine the first difference between each first motion offset and the target motion offset, wherein the target motion offset is the minimum value among each first motion offset;

[0111] The jitter intensity adjustment coefficient is determined based on the total number of cached frames and preview frames in the video frame data group, and the absolute value of each of the first differences.

[0112] Optionally, the device further includes:

[0113] The second receiving module is used to receive a second input to the target jitter intensity adjustment identifier among the P jitter intensity adjustment identifiers;

[0114] The recording module is configured to respond to the second input and record video according to the first jitter intensity adjustment coefficient corresponding to the target jitter intensity adjustment identifier, wherein the first jitter intensity adjustment coefficient is used to perform jitter compensation on the recorded video during the video recording process.

[0115] Optionally, the device further includes:

[0116] The third receiving module is used to receive a third input, which is used to magnify the target shooting area in the video recording preview interface according to the target magnification ratio;

[0117] The control module is used to respond to the third input and, during the process of zooming in on the target shooting area, control the first center point of the video recording preview interface to move closer to the second center point of the target shooting area in the recorded video frame.

[0118] Optionally, the control module is specifically used for:

[0119] Based on the first jitter intensity adjustment coefficient and the preview jitter intensity adjustment coefficient, the first offset of the first center point and the second offset of the second center point are determined. The preview jitter intensity adjustment coefficient is a jitter intensity adjustment coefficient generated based on a video frame data group containing only N preview frames.

[0120] Control the direction of the first center point toward the second center point, and adjust the offset according to the first offset amount. Control the direction of the second center point toward the first center point, and adjust the offset according to the second offset amount.

[0121] Optionally, the control module is specifically used for:

[0122] Based on the difference between the first jitter intensity adjustment coefficient and the preview jitter intensity adjustment coefficient, the offset degree information is obtained;

[0123] Based on the magnification factor of the target shooting area and the offset information, a first offset of the first center point and a second offset of the second center point are determined, wherein the first offset and the second offset are equal.

[0124] In this embodiment, a first video pre-shot by the user is imported, and then multiple sets of video frame data groups are constructed using N preview frames and different numbers of cached frames in the first video. Based on these multiple sets of video frame data groups, multiple sets of shake intensity adjustment coefficients that better suit the user's shooting habits are generated. Furthermore, the corresponding shake intensity adjustment indicator is displayed on the video recording interface, allowing the user to select a shake intensity adjustment coefficient that suits their needs when recording video, effectively ensuring the stability of the recorded video footage.

[0125] The video recording device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television set (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the device.

[0126] The video recording device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system used.

[0127] The video recording device provided in this application embodiment can achieve... Figures 1 to 5 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.

[0128] Optionally, Figure 7 This is a schematic diagram of the electronic device structure provided in the embodiments of this application, such as... Figure 7 As shown, this application embodiment also provides an electronic device 700, including a processor 701 and a memory 702. The memory 702 stores a program or instructions that can run on the processor 701. When the program or instructions are executed by the processor 701, they implement the various steps of the above-described video recording method embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.

[0129] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.

[0130] Figure 8 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application.

[0131] The electronic device 800 includes, but is not limited to, components such as: radio frequency unit 801, network module 802, audio output unit 803, input unit 804, sensor 805, display unit 806, user input unit 807, interface unit 808, memory 809, and processor 810.

[0132] Those skilled in the art will understand that the electronic device 800 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 810 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 8 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.

[0133] User input unit 807 is used to receive a first input to a first video, the first video including N preview frames and M buffer frames;

[0134] The display unit 806 is configured to respond to the first input by displaying P jitter intensity adjustment identifiers on the video recording preview interface; wherein each jitter intensity adjustment identifier points to a set of jitter intensity adjustment coefficients, the jitter intensity adjustment coefficients are used to compensate for video jitter that occurs during video recording, the jitter intensity adjustment coefficients are generated based on a video frame data group, each video frame data group includes N preview frames and a set of buffer frames, the number of buffer frames in each set of buffer frames is different, and M, N and P are all positive integers.

[0135] Processor 810 is used to obtain the first motion offset of each of the buffered frames and each of the preview frames in the video frame data group, and determine the first difference between each of the first motion offsets and the target motion offset, wherein the target motion offset is the minimum value among the first motion offsets;

[0136] The jitter intensity adjustment coefficient is determined based on the total number of cached frames and preview frames in the video frame data group, and the absolute value of each of the first differences.

[0137] User input unit 807 is used to receive a second input for the target jitter intensity adjustment identifier among the P jitter intensity adjustment identifiers;

[0138] The processor 810 is configured to, in response to the second input, perform video recording according to a first jitter intensity adjustment coefficient corresponding to the target jitter intensity adjustment identifier, wherein the first jitter intensity adjustment coefficient is used to perform jitter compensation on the recorded video during the video recording process.

[0139] The user input unit 807 is used to receive a third input, which is used to magnify the target shooting area in the video recording preview interface according to the target magnification.

[0140] The processor 810 is configured to respond to the third input and, during the process of zooming in on the target shooting area, control the first center point of the video recording preview interface to move closer to the second center point of the target shooting area in the recorded video frame.

[0141] The processor 810 is used to determine a first offset of the first center point and a second offset of the second center point based on the first jitter intensity adjustment coefficient and the preview jitter intensity adjustment coefficient, wherein the preview jitter intensity adjustment coefficient is a jitter intensity adjustment coefficient generated based on a video frame data group containing only N frames of the preview frames;

[0142] Control the direction of the first center point toward the second center point, and adjust the offset according to the first offset amount. Control the direction of the second center point toward the first center point, and adjust the offset according to the second offset amount.

[0143] The processor 810 is used to obtain offset information based on the difference between the first jitter intensity adjustment coefficient and the preview jitter intensity adjustment coefficient;

[0144] Based on the magnification factor of the target shooting area and the offset information, a first offset of the first center point and a second offset of the second center point are determined, wherein the first offset and the second offset are equal.

[0145] In this embodiment, a first video pre-shot by the user is imported, and then multiple sets of video frame data groups are constructed using N preview frames and different numbers of cached frames in the first video. Based on these multiple sets of video frame data groups, multiple sets of shake intensity adjustment coefficients that better suit the user's shooting habits are generated. Furthermore, the corresponding shake intensity adjustment indicator is displayed on the video recording interface, allowing the user to select a shake intensity adjustment coefficient that suits their needs when recording video, effectively ensuring the stability of the recorded video footage.

[0146] It should be understood that, in this embodiment, the input unit 804 may include a graphics processing unit (GPU) 8041 and a microphone 8042. The GPU 8041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 806 may include a display panel 8061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 807 includes at least one of a touch panel 8071 and other input devices 8072. The touch panel 8071 is also called a touch screen. The touch panel 8071 may include a touch detection device and a touch controller. Other input devices 8072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.

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

[0148] Processor 810 may include one or more processing units; optionally, processor 810 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 810.

[0149] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described video recording method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0150] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0151] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above video recording method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0152] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0153] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the video recording method embodiments described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0154] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0155] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0156] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. A video recording method, characterized in that, include: Receive a first input to a first video, the first video comprising N preview frames and M buffer frames; In response to the first input, P jitter intensity adjustment markers are displayed on the video recording preview interface; wherein each jitter intensity adjustment marker points to a set of jitter intensity adjustment coefficients, which are used to compensate for video jitter that occurs during video recording. The jitter intensity adjustment coefficients are generated based on a video frame data group, each video frame data group including N preview frames and a set of buffer frames, and the number of buffer frames in each set of buffer frames is different, where M, N and P are all positive integers. In response to the first input, after displaying P jitter intensity adjustment indicators on the video recording preview interface, the method further includes: Receive a second input for the target jitter intensity adjustment flag among the P jitter intensity adjustment flags; In response to the second input, video recording is performed according to the first jitter intensity adjustment coefficient corresponding to the target jitter intensity adjustment identifier, wherein the first jitter intensity adjustment coefficient is used to perform jitter compensation on the recorded video during the video recording process; The step of recording video according to the first jitter intensity adjustment coefficient corresponding to the target jitter intensity adjustment identifier further includes: Receive a third input, which is used to magnify the target shooting area in the video recording preview interface according to the target magnification ratio; In response to the third input, during the process of zooming in on the target shooting area, the first center point of the video recording preview interface is controlled to move closer to the second center point of the target shooting area in the recorded video frame.

2. The video recording method according to claim 1, characterized in that, The method for generating the jitter intensity adjustment coefficient is as follows: Obtain the first motion offset of each cached frame and each preview frame in the video frame data group, and determine the first difference between each first motion offset and the target motion offset, wherein the target motion offset is the minimum value among each first motion offset; The jitter intensity adjustment coefficient is determined based on the total number of cached frames and preview frames in the video frame data group, and the absolute value of each of the first differences.

3. The video recording method according to claim 1, characterized in that, Controlling the first center point of the video recording preview interface to move closer to the second center point of the target shooting area in the recorded video frame includes: Based on the first jitter intensity adjustment coefficient and the preview jitter intensity adjustment coefficient, the first offset of the first center point and the second offset of the second center point are determined. The preview jitter intensity adjustment coefficient is a jitter intensity adjustment coefficient generated based on a video frame data group containing only N preview frames. Control the direction of the first center point toward the second center point, and adjust the offset according to the first offset amount. Control the direction of the second center point toward the first center point, and adjust the offset according to the second offset amount.

4. The video recording method according to claim 3, characterized in that, Based on the first jitter intensity adjustment coefficient and the preview jitter intensity adjustment coefficient, determine the first offset of the first center point and the second offset of the second center point, including: Based on the difference between the first jitter intensity adjustment coefficient and the preview jitter intensity adjustment coefficient, the offset degree information is obtained; Based on the magnification factor of the target shooting area and the offset information, a first offset of the first center point and a second offset of the second center point are determined, wherein the first offset and the second offset are equal.

5. A video recording device, characterized in that, include: The first receiving module is used to receive a first input to a first video, the first video including N preview frames and M buffer frames; A first display module is configured to respond to the first input by displaying P jitter intensity adjustment markers on a video recording preview interface; wherein each jitter intensity adjustment marker points to a set of jitter intensity adjustment coefficients, the jitter intensity adjustment coefficients are used to compensate for video jitter that occurs during video recording, the jitter intensity adjustment coefficients are generated based on a video frame data group, each video frame data group includes N preview frames and a set of buffer frames, the number of buffer frames in each set of buffer frames is different, and M, N and P are all positive integers; The device further includes: The second receiving module is used to receive a second input to the target jitter intensity adjustment identifier among the P jitter intensity adjustment identifiers; The recording module is configured to respond to the second input and record video according to the first jitter intensity adjustment coefficient corresponding to the target jitter intensity adjustment identifier, wherein the first jitter intensity adjustment coefficient is used to perform jitter compensation on the recorded video during the video recording process; The device further includes: The third receiving module is used to receive a third input, which is used to magnify the target shooting area in the video recording preview interface according to the target magnification ratio; The control module is used to respond to the third input and, during the process of zooming in on the target shooting area, control the first center point of the video recording preview interface to move closer to the second center point of the target shooting area in the recorded video frame.

6. The video recording apparatus according to claim 5, characterized in that, The method for generating the jitter intensity adjustment coefficient is as follows: Obtain the first motion offset of each of the cached frames and each of the preview frames in the video frame data group, and determine the first difference between each of the first motion offsets and the target motion offset, wherein the target motion offset is the minimum value among the first motion offsets; The jitter intensity adjustment coefficient is determined based on the total number of cached frames and preview frames in the video frame data group, and the absolute value of each of the first differences.

7. The video recording apparatus according to claim 5, characterized in that, The control module is specifically used for: Based on the first jitter intensity adjustment coefficient and the preview jitter intensity adjustment coefficient, the first offset of the first center point and the second offset of the second center point are determined. The preview jitter intensity adjustment coefficient is a jitter intensity adjustment coefficient generated based on a video frame data group containing only N preview frames. Control the direction of the first center point toward the second center point, and adjust the offset according to the first offset amount. Control the direction of the second center point toward the first center point, and adjust the offset according to the second offset amount.

8. The video recording apparatus according to claim 7, characterized in that, The control module is specifically used for: Based on the difference between the first jitter intensity adjustment coefficient and the preview jitter intensity adjustment coefficient, the offset degree information is obtained; Based on the magnification factor of the target shooting area and the offset information, a first offset of the first center point and a second offset of the second center point are determined, wherein the first offset and the second offset are equal.

9. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the steps of the video recording method as described in any one of claims 1-4.

10. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the video recording method as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Video anti-shake method and device

    CN112653842A

  • Camera anti-shake prompting method and device and electronic equipment

    CN112689094A