Video processing method and apparatus, and device, computer-readable storage medium and product
By displaying the position locking control on the video processing page, the user is allowed to customize the locking area and adjust the video frame to be processed based on the locking area, the problem of inaccurate recognition of the target subject when the video quality is poor in the prior art is solved, and a stable and efficient video processing effect is achieved.
Patent Information
- Application Number
- PCT/CN2024/138032
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-12-22
- Filing Date
- 2024-12-10
- Publication Date
- 2025-06-26
AI Technical Summary
Existing video processing methods cannot accurately identify the target subject when the video quality is poor, resulting in poor video jitter and processing effects.
By displaying the position lock control on the video processing page, the user allows the locking area to be customized and adjust the video frame to be processed based on the locking area to ensure that the display position of the target area in the target video frame is consistent.
Effectively avoid video jitter and improve the accuracy and effectiveness of video processing, especially in the case of poor video quality.
Smart Images

Figure CN2024138032_26062025_PF_FP_ABST
Abstract
Description
Video processing method, device, equipment, computer-readable storage medium and product
[0001] This application claims priority to Chinese patent application No. 202311790278.9 filed on December 22, 2023, and the contents of the above-mentioned Chinese patent application disclosure are hereby incorporated by reference in their entirety as a part of this application. Technical Field
[0002] The embodiments of the present disclosure relate to a video processing method, apparatus, device, computer-readable storage medium, and product. Background Art
[0003] Users can capture and edit videos on their devices. To avoid video jitter, during the video editing process, the target subject in the video, such as the body or hands, is generally automatically identified and tracked.
[0004] However, when the video quality is poor, such as when the video brightness is low, the target subject moves quickly, or the target subject is obscured, the above solution cannot accurately track the target subject, and the problem of video jitter cannot be avoided, resulting in poor video processing effect. Summary of the Invention
[0005] Embodiments of the present disclosure provide a video processing method, apparatus, device, computer-readable storage medium, and product.
[0006] In a first aspect, an embodiment of the present disclosure provides a video processing method, including:
[0007] Displaying a video processing page, wherein the video to be processed and a position locking control are displayed on the video processing page;
[0008] In response to a user triggering operation on the position locking control, obtaining a locking area determined by the user in a target video frame of the video to be processed;
[0009] Determining a first display position of the locked area in the target video frame;
[0010] The video frame to be processed in the video to be processed is adjusted based on the first display position and the locked area to obtain a target video, wherein the display position of the target area associated with the locked area in the target video in the corresponding video frame matches the first display position.
[0011] In a second aspect, an embodiment of the present disclosure provides a video processing device, including:
[0012] A display module is used to display a video processing page, wherein the video to be processed and a position locking control are displayed on the video processing page;
[0013] an acquisition module, configured to acquire, in response to a user triggering operation on the position lock control, a locked area determined by the user in a target video frame of the video to be processed;
[0014] a determining module, configured to determine a first display position of the locked area in the target video frame;
[0015] A processing module is used to adjust the video frame to be processed in the video to be processed based on the first display position and the locked area to obtain a target video, wherein the display position of the target area associated with the locked area in the target video in the corresponding video frame matches the first display position.
[0016] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: a processor and a memory;
[0017] The memory stores computer-executable instructions;
[0018] The processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the video processing method described in the first aspect and various possible designs of the first aspect.
[0019] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the video processing method described in the first aspect and various possible designs of the first aspect is implemented.
[0020] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the video processing method described in the first aspect and various possible designs of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, a brief introduction will be given below to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0022] FIG1 is a flow chart of a video processing method according to an embodiment of the present disclosure;
[0023] FIG2 is a flow chart of a video processing method provided by another embodiment of the present disclosure;
[0024] FIG3 is a schematic diagram of an interface interaction provided by an embodiment of the present disclosure;
[0025] FIG4 is a flow chart of a video processing method provided by another embodiment of the present disclosure;
[0026] FIG5 is a schematic diagram of a target video frame provided by an embodiment of the present disclosure;
[0027] FIG6 is a schematic diagram of a cropping area provided in an embodiment of the present disclosure;
[0028] FIG7 is a flow chart of a video processing method provided by yet another embodiment of the present disclosure;
[0029] FIG8 is a schematic structural diagram of a video processing device provided by an embodiment of the present disclosure; and
[0030] FIG9 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0031] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present disclosure without making any creative efforts shall fall within the scope of protection of the present disclosure.
[0032] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0033] For example, in response to a user's active request, a prompt message is sent to the user to clearly inform the user that the operation requested will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operations of the disclosed technical solution based on the prompt message.
[0034] As an optional but non-limiting implementation, in response to receiving a user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. Furthermore, the pop-up window may also contain a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0035] It is understandable that the above notification and user authorization process are merely illustrative and do not limit the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0036] In order to solve the technical problem that subject tracking methods have poor tracking effects, the present disclosure provides a video processing method, apparatus, device, computer-readable storage medium, and product.
[0037] It should be noted that the video processing method, apparatus, device, computer-readable storage medium, and product provided by the present disclosure can be applied in any video processing scenario.
[0038] Current video processing methods generally automatically identify the target subject in a video and then perform video processing based on the recognition results to achieve tracking of the target subject. However, these methods often fail to achieve adequate tracking results. For example, when the target subject is small, the video is dimly lit, the target subject is obscured, or the target subject is moving rapidly, accurate identification of the target subject is impossible, and video processing based on the target subject's position is therefore impossible.
[0039] In the process of solving the above technical problems, the inventors discovered through research that in order to avoid the problem of inaccurate target subject recognition results due to video quality issues, users can customize the lock area to be locked according to actual needs. Therefore, video processing can be performed based on the user-specified lock area.
[0040] In addition, in order to avoid video jitter, after determining the user-specified locked area, the sizes of other video frames in the processed video can be adjusted based on the display position of the locked area in the target video frame, so that in the video frame corresponding to the adjusted target video, the display position of the target area matching the locked area matches the display position of the locked area in the target video frame.
[0041] FIG1 is a flow chart of a video processing method provided by an embodiment of the present disclosure. As shown in FIG1 , the method includes:
[0042] Step 101: Display a video processing page, in which a video to be processed and a position locking control are displayed.
[0043] The embodiment of the present invention is implemented by a video processing device. The video processing device can be coupled to a terminal device, thereby determining a locked region based on a user triggering operation on the terminal device, and adjusting the display size of a to-be-processed video frame in a to-be-processed video based on the locked region to obtain a target video, such that the display position of the target region associated with the locked region in the video frame corresponding to the target video matches the first display position.
[0044] Optionally, the video processing device may be coupled to a server in communication with the terminal device, thereby being able to determine a locked region in a target video frame based on a video processing request sent by the terminal device, and adjust the display size of the to-be-processed video frame in the to-be-processed video based on the locked region to obtain the target video.
[0045] In this embodiment, a user can trigger a video processing operation for a video to be processed. In response to the video processing operation, a video processing page can be displayed, wherein the video to be processed and a position lock control can be displayed on the video processing page. The user can customize the lock area to be locked based on the triggering operation of the position lock control.
[0046] Step 102: In response to a user triggering operation on the position lock control, obtaining a lock area determined by the user in a target video frame of the video to be processed.
[0047] In this embodiment, the video to be processed includes a plurality of video frames to be processed. In response to a user triggering operation on the position locking control, a locking area can be determined in a target video frame in the video to be processed based on the user's selection operation.
[0048] The target video frame can be a video frame selected by the user from the video frames to be processed based on actual needs, or it can be a video frame at a preset position in the video to be processed. For example, it can be the first video frame in the video to be processed, or it can be the Nth video frame in the video to be processed. Alternatively, the user can select any video frame from multiple video frames to be processed as the target video frame based on actual needs. The present disclosure does not limit the method for determining the target video frame.
[0049] Furthermore, in order to make the locked area more in line with the user's personalized needs, the user can also determine the locked area in the target video frame according to actual needs. Among them, the display position and display size of the locked area can be customized by the user.
[0050] Step 103: Determine a first display position of the locked area in the target video frame.
[0051] In this embodiment, after the locked area is determined, the target area associated with the locked area in the processed target video can always be in the same relative position with the locked area, and the first display position of the locked area in the target video frame is also determined.
[0052] Step 104: Adjust the to-be-processed video frame in the to-be-processed video based on the first display position and the locked area to obtain a target video, wherein the display position of the target area associated with the locked area in the target video in the corresponding video frame matches the first display position.
[0053] In this embodiment, after determining the first display position of the locked region in the target video frame, the target video frame can be adjusted based on the first display position and the locked region to obtain an adjusted video frame. The target video is formed from multiple adjusted video frames, wherein the display position of the target region associated with the locked region in the video frame corresponding to the target video matches the first display position. In other words, the target region and the locked region are in the same relative position, thereby preventing significant jitter in the target video.
[0054] The adjustment operations on the video frame to be processed include but are not limited to cropping operations and boundary filling operations.
[0055] The video processing method provided in this embodiment obtains the target video frame determined by the user in the video to be processed and the locked area determined in the target video frame in response to the trigger operation of the user's opposite lock control, and adjusts the display size of the video frame to be processed in the video to be processed based on the first display position and the locked area so that the display position of the target area associated with the locked area in the video frame corresponding to the target video matches the first display position, thereby being able to perform video processing operations based on the locked area specified by the user, avoiding the problem of being unable to accurately identify the content body due to poor video quality during content tracking, and enabling the target area associated with the locked area in the target video to always be in the same relative position, thereby avoiding significant jitter in the video and improving the effect of video processing.
[0056] FIG2 is a flow chart of a video processing method provided by another embodiment of the present disclosure. Based on any of the above embodiments, as shown in FIG3 , step 101 includes:
[0057] Step 201: In response to a user triggering operation on the position lock control, multiple video frames corresponding to the video to be processed are displayed.
[0058] Step 202: In response to the user's selection operation among the multiple video frames, determine the video frame selected by the user as the target video frame.
[0059] Step 203: Acquire the target processing type determined by the user, and determine the locked area in the target video frame based on the target processing type.
[0060] In this embodiment, the video to be processed includes multiple video frames to be processed. The user can select any one video frame from the multiple video frames to be processed as the target video frame based on actual needs.
[0061] Optionally, in response to a user triggering operation on a position lock control, multiple video frames corresponding to the video to be processed are displayed. In response to a user selecting operation from the multiple video frames, the video frame selected by the user is determined as the target video frame.
[0062] Furthermore, after determining the target video frame, the user can also select a lock region in the target video frame. To enrich the method of determining the lock region, different lock region processing types can be pre-set, and the target processing type can be determined based on the user's selection operation, and the lock region in the target video frame can be determined based on the target processing type.
[0063] The video processing method provided in this embodiment determines a target video frame based on a user's selection operation among multiple video frames corresponding to the video to be processed, and determines a locked area in the target video frame based on a target processing type determined by the user, thereby enabling the selection of the locked area to be more in line with the user's personalized needs.
[0064] Further, based on any of the above embodiments, step 203 includes:
[0065] A preset type selection list is displayed, wherein the selection list includes automatic selection types and custom selection types.
[0066] The target processing type is determined based on a selection operation triggered by the user in the selection list.
[0067] In this embodiment, in order to enrich the method of determining the locked area, after the user determines the target video frame, the target processing type may also be determined, so as to determine the locked area based on the target processing type.
[0068] Optionally, a preset type selection list may be displayed, wherein the selection list includes automatic selection types and custom selection types. Automatic selection types include, but are not limited to, hand recognition types and body recognition types. The target processing type is determined based on a selection operation triggered by the user in the selection list.
[0069] The video processing method provided in this embodiment displays a preset type selection list so that the user can flexibly select the target processing type based on the type selection list, and then can determine the locked area in the target video frame that better meets the user's personalized needs based on the target processing type.
[0070] Further, based on any of the above embodiments, the target processing type includes the automatic selection type, and step 203 includes:
[0071] A target object of the automatic selection type association is determined.
[0072] A target object in the target video frame is identified, and a display area corresponding to the target object is determined as the locked area.
[0073] Alternatively, the target processing type includes a user-defined processing type. Step 203 includes:
[0074] A preset lock control is displayed in the target video frame.
[0075] Based on the adjustment operation triggered by the user on the locked control, the display parameters of the locked control are adjusted to obtain an adjusted locked control, wherein the display parameters include a display position and a display size.
[0076] The display area where the adjusted locked control is located is determined as the locked area.
[0077] In this embodiment, the target processing type includes an automatic selection type. The automatic selection type may be associated with a target object. For example, the target object includes, but is not limited to, a head, a body, a hand, and the like. When the user selects the automatic selection type as the target processing type, the target object associated with the automatic selection type may be determined. The target object in the target video frame is identified, and the display area corresponding to the target object is determined as the locked area. Different recognition algorithms may be used to identify different target objects, and this disclosure does not impose any restrictions on this.
[0078] In this embodiment, the target processing type includes a custom processing type. When the user selects the custom processing type as the target processing type, the user can manually determine the locked area in the target video frame.
[0079] Optionally, a preset locked control may be displayed in the target video frame. The locked control has a preset display size. Based on an adjustment operation triggered by the user on the locked control, display parameters of the locked control are adjusted to obtain an adjusted locked control, where the display parameters include a display position and a display size. The display area where the adjusted locked control is located is determined as the locked area.
[0080] For example, the user can adjust the display position of the locked control by dragging, or adjust the display size of the locked control by pinching. Alternatively, the user can determine the display parameters through a preset parameter input box, which is not limited in this disclosure.
[0081] FIG3 is a schematic diagram of the interface interaction provided by an embodiment of the present disclosure. As shown in FIG3 , a video to be processed 32 and a position lock control 33 are displayed in a video processing page 31. In response to the user's triggering operation on the position lock control 33, multiple video frames 34 corresponding to the video to be processed 32 are displayed. In response to the user's selection operation among the multiple video frames 34, the video frame selected by the user is determined as the target video frame 35, and the target video frame 35 is displayed. A preset lock control 36 is displayed in the target video frame 35. Based on the adjustment operation triggered by the user on the lock control 36, the display parameters of the lock control 36 are adjusted. For example, the display size of the lock control can be adjusted by pinching to obtain an adjusted lock control, wherein the display parameters include the display position and the display size. The display area where the adjusted lock control is located is determined as the lock area.
[0082] The video processing method provided in this embodiment manually determines the locked area, so that video processing operations can be performed based on the locked area specified by the user, avoiding the problem of being unable to accurately identify the content body due to poor video quality during content tracking.
[0083] FIG4 is a flow chart of a video processing method provided by another embodiment of the present disclosure. Based on any of the above embodiments, as shown in FIG4 , step 104 includes:
[0084] Step 401: For the video frame to be processed, determine a second display position of a target area associated with the locked area in the video frame to be processed.
[0085] Step 402: Determine a target cropping frame in the to-be-processed video frame based on the second display position, so that the display position of the target area in the target cropping frame matches the first display position.
[0086] Step 403: Perform a cropping operation on the to-be-processed video frame based on the target cropping frame to obtain an adjusted video frame.
[0087] Step 404: Determine a target video according to the adjusted video frame.
[0088] In this embodiment, for each video frame to be processed, a target region in the video frame to be processed that matches the locked region can be determined, and a second display position corresponding to the target region can be determined. The target region identification operation can be implemented using a preset algorithm such as an optical flow algorithm or an image recognition algorithm, and this disclosure does not impose any limitations on this.
[0089] Furthermore, after determining the second display position, a target cropping frame can be determined in the video frame to be processed based on the second display position, so that the display position of the target area in the target cropping frame matches the first display position. The target cropping frame is located within the video frame to be processed. A cropping operation is performed on the video frame to be processed based on the target cropping frame to obtain an adjusted video frame. A target video is determined based on the adjusted video frame.
[0090] FIG5 is a schematic diagram of a target video frame provided by an embodiment of the present disclosure. As shown in FIG5 , the target video frame 51 includes a locked region 52 predetermined by the user. FIG6 is a schematic diagram of a cropping region provided by an embodiment of the present disclosure. As shown in FIG6 , after determining the locked region determined by the user, the display position of the locked region in the target video frame can be determined. Based on the display position, a target cropping frame 62 in a video frame to be processed 61 is determined, so that the display position of the target region in the target cropping frame 62 matches the first display position of the locked region in the target video frame.
[0091] The video processing method provided in this embodiment determines, for a video frame to be processed, a second display position of a target area associated with a locked area in the video frame to be processed. Based on the second display position, a target cropping frame is determined in the video frame to be processed, so that the display position of the target area in the target cropping frame matches the first display position. Furthermore, after cropping the video frame to be processed based on the target cropping frame, the target area associated with the locked area in the target video can always be in the same relative position, thereby avoiding significant video jitter and improving the video processing effect.
[0092] Further, based on any of the above embodiments, step 403 includes:
[0093] A cropping ratio corresponding to the to-be-processed video frame is determined based on the target cropping frame.
[0094] The global cropping ratio corresponding to the video to be processed is determined according to the cropping ratios corresponding to at least two video frames to be processed in the video to be processed according to a preset statistical algorithm.
[0095] A cropping operation is performed on the to-be-processed video frame corresponding to the to-be-processed video according to the global cropping ratio to obtain an adjusted video frame.
[0096] In this embodiment, after determining the target cropping frame corresponding to each video frame to be processed, the cropping ratio corresponding to the video frame to be processed can be calculated based on the display size of the target cropping frame and the display size of the video frame to be processed. Among them, if the cropping ratio is large, directly cropping the video to be processed based on the target cropping frame will not affect the display effect of the processed video frame. Conversely, if the cropping ratio corresponding to the video frame to be processed is too small, the size of the adjusted video frame obtained by cropping may be too small, the picture may be distorted, and the video quality may be affected. Therefore, a global cropping ratio can be determined based on the cropping size corresponding to each video frame to be processed to ensure that the size of all adjusted video frames after cropping remains consistent.
[0097] Optionally, a global cropping ratio corresponding to the video to be processed can be determined based on the cropping ratios corresponding to at least two video frames to be processed in the video to be processed according to a preset statistical algorithm. The preset statistical algorithm can be a histogram statistics and adaptive threshold segmentation algorithm. Using this global cropping ratio to crop the video to be processed can ensure that 90% of the video frames to be processed maintain a normal locking effect. The video frames corresponding to the video to be processed are cropped according to the global cropping ratio to obtain adjusted video frames.
[0098] Furthermore, based on any of the above embodiments, the cropping operation on the to-be-processed video frame corresponding to the to-be-processed video according to the global cropping ratio includes:
[0099] The cropping area corresponding to the video frame to be processed is determined according to the second display position of the target area in the video frame to be processed and the global cropping ratio.
[0100] A cropping operation is performed on the to-be-processed video frame based on the cropping area.
[0101] In this embodiment, after determining the global cropping ratio, in order to accurately perform a cropping operation on the video frame to be processed based on the global cropping ratio, a cropping area corresponding to each video frame to be processed may also be determined based on the global cropping ratio.
[0102] Optionally, a second display position of the target area in the video frame to be processed may be determined, and a cropping area corresponding to the video frame to be processed may be determined based on the second display position and a global cropping ratio.
[0103] The video processing method provided in this embodiment determines a global cropping ratio based on the cropping ratios corresponding to all video frames to be processed, so that the target area associated with the locked area in the adjusted video frame obtained after cropping based on the global cropping ratio is always in the same relative position, and the display ratio of the target area in the video frame is consistent, thereby improving the quality of the processed target video.
[0104] Optionally, based on any of the above embodiments, step 403 includes:
[0105] A cropping ratio corresponding to the to-be-processed video frame is determined based on the target cropping frame.
[0106] The global cropping ratio corresponding to the video to be processed is determined according to the cropping ratios corresponding to at least two video frames to be processed in the video to be processed according to a preset statistical algorithm.
[0107] For a to-be-processed video frame whose cropping ratio exceeds a preset range, the to-be-processed video frame is cropped using the global cropping ratio to obtain an adjusted video frame.
[0108] For the to-be-processed video frames whose cropping ratios are within the preset range, a cropping operation is performed according to the cropping ratios corresponding to the to-be-processed video frames to obtain adjusted video frames.
[0109] In this embodiment, if the cropping ratio for each video frame to be processed is too small, the resulting adjusted video frame size may be too small, resulting in image distortion and poor video quality. Therefore, to improve the content quality of the target video, a preset range can be pre-set, and the cropping operation on the video frame to be processed can be performed based on the preset range.
[0110] Optionally, the cropping ratio corresponding to the video frame to be processed can be determined based on the target cropping frame. The cropping ratio can be determined based on the display size of the target cropping frame and the display size of the video frame to be processed. The global cropping ratio corresponding to the video to be processed is determined based on the cropping ratios corresponding to at least two video frames to be processed in the video to be processed according to a preset statistical algorithm. The preset statistical algorithm can be a histogram statistics and an adaptive threshold segmentation algorithm. Cropping the video to be processed using the global cropping ratio can ensure that 90% of the video frames to be processed maintain a normal locking effect.
[0111] Furthermore, for the video frames to be processed whose cropping ratio exceeds the preset range, the global cropping ratio is used to crop the video frames to be processed to obtain adjusted video frames. For the video frames to be processed whose cropping ratio is within the preset range, the cropping ratio is used to crop the video frames to obtain adjusted video frames.
[0112] The video processing method provided in this embodiment pre-sets a range interval, so that the cropping ratio corresponding to each video frame to be processed can be accurately determined based on the range interval, and then the video to be processed can be accurately cropped based on the cropping ratio, so that the target area associated with the locked area in the adjusted video frame is always in the same relative position, avoiding jitter in the target video.
[0113] Furthermore, based on any of the above embodiments, after step 403, the following steps may be further included:
[0114] A scaling operation is performed on the display size of the adjusted video frame based on the display size of the target video frame, so that the display size of the target video frame is the same as the display size of the adjusted video frame.
[0115] In this embodiment, after the video frame to be processed is cropped, the display size of the adjusted video frame to be processed is inconsistent with the display size of the target video frame. Therefore, directly determining the target video based on the adjusted video frame to be processed may cause the video to jitter and the effect of inconsistent picture size.
[0116] Therefore, in order to further improve the content quality of the target video, the display size of the adjusted video frame may be scaled based on the display size of the target video frame so that the display size of the target video frame is the same as the display size of the adjusted video frame.
[0117] The video processing method provided in this embodiment can make each video frame in the target video have the same display size by performing a size scaling operation on the target video frame based on the display size of the target video frame after cropping the target video frame.
[0118] FIG7 is a flow chart of a video processing method provided by another embodiment of the present disclosure. Based on any of the above embodiments, as shown in FIG7 , step 104 includes:
[0119] Step 701: For the video frame to be processed, determine a second display position of a target area associated with the locked area in the video frame to be processed.
[0120] Step 702: Adjust the display position of the preset processing frame based on the second display position so that the display position of the target area in the preset processing frame matches the first display position, wherein the display size of the preset processing frame is the same as the display size of the video frame to be processed.
[0121] Step 703: Determine the black edge area in the preset processing frame except the video frame to be processed.
[0122] Step 704: Fill the black border area to obtain an adjusted video frame.
[0123] Step 705: Determine a target video according to the adjusted video frame.
[0124] In this embodiment, after determining the first display position of the locked area in the target video frame, other to-be-processed video frames in the to-be-processed video can be adjusted based on the first display position so that the display position of the target area associated with the locked area in the preset processing frame matches the first display position to avoid video jitter.
[0125] For each video frame to be processed, a second display position of the target area associated with the locked area in the video frame to be processed is determined. To adjust the size of the video frame to be processed, a preset processing frame having the same display size as the video frame to be processed can be pre-set. By adjusting the display position of the preset processing frame, the target display position corresponding to the preset processing frame can be determined. When the preset processing frame is at the preset display position, the display position of the target area in the preset processing frame matches the first display position.
[0126] After determining the target display position, in order to avoid the appearance of a black border region in the video frame, a black border region is determined in a preset processing frame, excluding the video frame to be processed. A filling operation is performed on the black border region to obtain an adjusted video frame. The black border region can be filled using a preset pixel value. Alternatively, the black border region can be filled using a preset filling model based on the video frame to be processed, which is not limited in this disclosure.
[0127] Therefore, after each to-be-processed video frame is resized to obtain the resized video frames, the target video can be determined based on the multiple resized video frames.
[0128] The video processing method provided in this embodiment determines a second display position of a target area associated with a locked area in a video frame to be processed, adjusts the display position of a preset processing frame based on the second display position so that the display position of the target area in the preset processing frame matches the first display position, and determines a black-bordered area in the preset processing frame excluding the video frame to be processed. The black-bordered area is then filled to obtain an adjusted video frame. This ensures that the target area associated with the locked area in the adjusted video frame remains in the same relative position, thereby avoiding the appearance of black borders in the resized image and ensuring the content quality of the target video.
[0129] FIG8 is a schematic structural diagram of a video processing device provided by an embodiment of the present disclosure. As shown in FIG8 , the device includes: a display module 81, an acquisition module 82, a determination module 83, and a processing module 84. The display module 81 is used to display a video processing page, in which the video to be processed and a position lock control are displayed. The acquisition module 82 is used to obtain a lock area determined by the user in the target video frame of the video to be processed in response to a user triggering operation on the position lock control. The determination module 83 is used to determine a first display position of the lock area in the target video frame. The processing module 84 is used to adjust the video frame to be processed in the video to be processed based on the first display position and the lock area to obtain a target video, wherein the display position of the target area associated with the lock area in the target video in the corresponding video frame matches the first display position.
[0130] Furthermore, based on any of the above embodiments, the acquisition module is configured to: in response to a user triggering the position lock control, display multiple video frames corresponding to the video to be processed; in response to the user selecting a frame from the multiple video frames, determine the video frame selected by the user as the target video frame; obtain the target processing type determined by the user, and determine the lock region in the target video frame based on the target processing type.
[0131] Furthermore, based on any of the above embodiments, the acquisition module is configured to: display a preset type selection list, wherein the selection list includes an automatic selection type and a custom selection type, and determine the target processing type based on a selection operation triggered by the user in the selection list.
[0132] Furthermore, based on any of the above embodiments, the acquisition module is used to: determine the target object associated with the automatic selection type. Identify the target object in the target video frame, and determine the display area corresponding to the target object as the locked area. Alternatively, the acquisition module is used to: display a preset locked control in the target video frame. Based on the adjustment operation triggered by the user on the locked control, adjust the display parameters of the locked control to obtain an adjusted locked control, wherein the display parameters include display position and display size. Determine the display area where the adjusted locked control is located as the locked area.
[0133] Further, based on any of the above embodiments, the processing module is configured to: determine, for the video frame to be processed, a second display position of a target area associated with the locked area in the video frame to be processed; determine a target cropping frame in the video frame to be processed based on the second display position, so that the display position of the target area in the target cropping frame matches the first display position; perform a cropping operation on the video frame to be processed based on the target cropping frame to obtain an adjusted video frame; and determine a target video based on the adjusted video frame.
[0134] Furthermore, based on any of the above embodiments, the processing module is configured to: determine a cropping ratio corresponding to the to-be-processed video frame based on the target cropping frame; determine a global cropping ratio corresponding to the to-be-processed video frame based on the cropping ratios corresponding to at least two to-be-processed video frames in the to-be-processed video frame according to a preset statistical algorithm; and perform a cropping operation on the to-be-processed video frame corresponding to the to-be-processed video frame according to the global cropping ratio to obtain an adjusted video frame.
[0135] Furthermore, based on any of the above embodiments, the processing module is configured to: determine a cropping region corresponding to the video frame to be processed according to the second display position of the target region in the video frame to be processed and the global cropping ratio, and perform a cropping operation on the video frame to be processed based on the cropping region.
[0136] Furthermore, based on any of the above embodiments, the processing module is used to: determine the cropping ratio corresponding to the to-be-processed video frame based on the target cropping frame. Determine the global cropping ratio corresponding to the to-be-processed video frame according to the cropping ratios corresponding to at least two to-be-processed video frames in the to-be-processed video based on a preset statistical algorithm. For to-be-processed video frames whose cropping ratios exceed a preset range, the to-be-processed video frame is cropped using the global cropping ratio to obtain an adjusted video frame. For to-be-processed video frames whose cropping ratios are within the preset range, a cropping operation is performed according to the cropping ratio corresponding to the to-be-processed video frame to obtain an adjusted video frame.
[0137] Furthermore, based on any of the above embodiments, the processing module is also used to: perform a scaling operation on the display size of the adjusted video frame based on the display size of the target video frame so that the display size of the target video frame is the same as the display size of the adjusted video frame.
[0138] Furthermore, based on any of the above embodiments, the processing module is configured to: determine, for the video frame to be processed, a second display position of a target area associated with the locked area in the video frame to be processed; adjust the display position of a preset processing frame based on the second display position so that the display position of the target area in the preset processing frame matches the first display position, wherein the display size of the preset processing frame is the same as the display size of the video frame to be processed; determine a black border area in the preset processing frame excluding the video frame to be processed; perform a filling operation on the black border area to obtain an adjusted video frame; and determine a target video based on the adjusted video frame.
[0139] The device provided in this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effects are similar and will not be described in detail in this embodiment.
[0140] In order to implement the above embodiments, the embodiments of the present disclosure further provide a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the video processing method described in any of the above embodiments is implemented.
[0141] In order to implement the above embodiments, the embodiments of the present disclosure further provide a computer program product, including a computer program, which implements the video processing method as described in any of the above embodiments when executed by a processor.
[0142] In order to implement the above embodiment, the present disclosure further provides an electronic device, including: a processor and a memory;
[0143] The memory stores computer-executable instructions;
[0144] The processor executes the computer-executable instructions stored in the memory, so that the processor performs the video processing method as described in any of the above embodiments.
[0145] FIG9 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. The electronic device 900 may be a terminal device or a server. The terminal device may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), vehicle-mounted terminals (e.g., vehicle-mounted navigation terminals), and fixed terminals such as digital TVs and desktop computers. The electronic device shown in FIG9 is merely an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0146] As shown in Figure 9, the electronic device 900 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. Various programs and data required for the operation of the electronic device 900 are also stored in the RAM 903. The processing device 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0147] Typically, the following devices may be connected to the I / O interface 905: an input device 906 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 908 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 909. The communication device 909 may allow the electronic device 900 to communicate with other devices wirelessly or by wire to exchange data. Although FIG9 shows an electronic device 900 with various devices, it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
[0148] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication device 909, or installed from the storage device 908, or installed from the ROM 902. When the computer program is executed by the processing device 901, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0149] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0150] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0151] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.
[0152] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet Service Provider).
[0153] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0154] The units involved in the embodiments described in this disclosure may be implemented in software or hardware. In some cases, the name of a unit does not limit the unit itself. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses."
[0155] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0156] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0157] The embodiments described above are merely illustrative of the technical principles employed in this disclosure. Those skilled in the art should understand that the scope of disclosure involved in this disclosure is not limited to technical solutions formed by a specific combination of the above-mentioned technical features, but also encompasses other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
[0158] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0159] Although the present disclosure has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. A video processing method, comprising: Displaying a video processing page, in which the video to be processed and a position locking control are displayed; In response to a trigger operation of the position locking control by a user, acquiring a locking area determined by the user in a target video frame of the video to be processed; Determining a first display position of the locked area in the target video frame; The video frame to be processed in the video to be processed is adjusted based on the first display position and the locked area to obtain a target video, wherein the display position of a target area associated with the locked area in the target video in a corresponding video frame matches the first display position.
2. The method according to claim 1, wherein: The step of obtaining, in response to a user triggering operation on the position locking control, a locking area determined by the user in a target video frame of the video to be processed comprises: In response to the user's triggering operation on the position locking control, displaying a plurality of video frames corresponding to the video to be processed; In response to a selection operation of the user among the plurality of video frames, determining the video frame selected by the user as the target video frame; The target processing type determined by the user is obtained, and a locked area in the target video frame is determined based on the target processing type.
3. The method according to claim 2, wherein: The obtaining the target processing type determined by the user includes: Display a preset type selection list, wherein the selection list includes automatic selection types and custom selection types; The target processing type is determined based on a selection operation triggered by the user in the selection list.
4. The method according to claim 3, wherein: The target processing type includes the automatic selection type, and determining the locked area in the target video frame based on the target processing type includes: Determining a target object of the automatically selected type association; Identifying a target object in the target video frame, and determining a display area corresponding to the target object as the locked area; Alternatively, the target processing type includes a custom processing type; and determining the locked area in the target video frame based on the target processing type includes: Displaying a preset lock control in the target video frame; Based on the adjustment operation triggered by the user on the locked control, the display parameters of the locked control are adjusted to obtain an adjusted locked control, wherein the display parameters include a display position and a display size; The display area where the adjusted locked control is located is determined as the locked area.
5. The method according to any one of claims 1 to 4, wherein: The step of adjusting the to-be-processed video frame in the to-be-processed video based on the first display position and the locked area to obtain a target video includes: For the video frame to be processed, determining a second display position of a target area associated with the locked area in the video frame to be processed; Determining a target cropping frame in the to-be-processed video frame based on the second display position, so that a display position of the target area in the target cropping frame matches the first display position; Performing a cropping operation on the to-be-processed video frame based on the target cropping frame to obtain an adjusted video frame; A target video is determined according to the adjusted video frame.
6. The method according to claim 5, wherein: The step of performing a cropping operation on the to-be-processed video frame based on the target cropping frame to obtain an adjusted video frame includes: Determining a cropping ratio corresponding to the to-be-processed video frame based on the target cropping frame; Determining a global cropping ratio corresponding to the video to be processed according to cropping ratios corresponding to at least two video frames to be processed in the video to be processed according to a preset statistical algorithm; A cropping operation is performed on the to-be-processed video frame corresponding to the to-be-processed video according to the global cropping ratio to obtain an adjusted video frame.
7. The method according to claim 6, wherein: The step of performing a cropping operation on the to-be-processed video frame corresponding to the to-be-processed video according to the global cropping ratio includes: Determining a cropping area corresponding to the video frame to be processed according to a second display position of the target area in the video frame to be processed and the global cropping ratio; A cropping operation is performed on the to-be-processed video frame based on the cropping area.
8. The method according to claim 5, wherein: The step of performing a cropping operation on the to-be-processed video frame based on the target cropping frame to obtain an adjusted video frame includes: Determining a cropping ratio corresponding to the to-be-processed video frame based on the target cropping frame; Determining a global cropping ratio corresponding to the video to be processed according to cropping ratios corresponding to at least two video frames to be processed in the video to be processed according to a preset statistical algorithm; For a to-be-processed video frame whose cropping ratio exceeds a preset range, the to-be-processed video frame is cropped using the global cropping ratio to obtain an adjusted video frame; For the to-be-processed video frames whose cropping ratios are within the preset range, a cropping operation is performed according to the cropping ratios corresponding to the to-be-processed video frames to obtain adjusted video frames.
9. According to the method of any one of claims 5 to 8, after performing a cropping operation on the to-be-processed video frame based on the target cropping frame to obtain an adjusted video frame, the method further comprises: A scaling operation is performed on the display size of the adjusted video frame based on the display size of the target video frame, so that the display size of the target video frame is the same as the display size of the adjusted video frame.
10. The method according to any one of claims 1 to 4, wherein: The step of adjusting the to-be-processed video frame in the to-be-processed video based on the first display position and the locked area to obtain a target video includes: For the video frame to be processed, determining a second display position of a target area associated with the locked area in the video frame to be processed; adjusting the display position of the preset processing frame based on the second display position so that the display position of the target area in the preset processing frame matches the first display position, wherein the display size of the preset processing frame is the same as the display size of the video frame to be processed; Determine a black border area in the preset processing frame except the video frame to be processed; Performing a filling operation on the black border area to obtain an adjusted video frame; A target video is determined according to the adjusted video frame.
11. A video processing device, comprising: A display module is configured to display a video processing page, in which the video to be processed and a position locking control are displayed; An acquisition module, configured to acquire a locked area determined by the user in a target video frame of the video to be processed in response to a trigger operation of the user on the position locking control; A determination module, configured to determine a first display position of the locked area in the target video frame; A processing module is configured to adjust the video frame to be processed in the video to be processed based on the first display position and the locked area to obtain a target video, wherein the display position of the target area associated with the locked area in the target video in the corresponding video frame matches the first display position.
12. An electronic device comprising: processor and memory, wherein The memory is configured to store computer-executable instructions; The processor is configured to execute the computer-executable instructions stored in the memory, so that the processor performs the video processing method according to any one of claims 1 to 10.
13. A computer-readable storage medium storing computer-executable instructions, wherein: When the processor executes the computer-executable instruction, the video processing method according to any one of claims 1 to 10 is implemented.
Citation Information
Patent Citations
Video processing method and device, air vehicle, and system
CN108476289A
Video processing method, device and equipment, computer readable storage medium and product
CN117768720A
Method of generating a framed video system
US20160057446A1