Video processing method, device, computer storage medium and electronic device
By building and configuring the control settings interface during the video production process, and using the html engine to generate control configuration data packets, the problem of single video playback effect is solved, and the diversity and interactivity of video playback effect is achieved.
Patent Information
- Application Number
- CN202111214943.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-19
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2041-10-19
AI Technical Summary
The video playback effect caused by the existing video production methods is single and cannot meet user needs.
Through the display control settings interface, use the html engine to build and configure various controls, including rich text and multimedia controls, generate control configuration data packets, and generate videos in combination with video packets.
Improve the video playback effect and enhance the diversity and interactivity of the video.
Smart Images

Figure CN113873329B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information technology, and in particular, to a video processing method, apparatus, computer storage medium, and electronic device. Background Art
[0002] Currently, the most commonly used video production method in the prior art is mainly to obtain a new video by editing, splicing, or reorganizing multiple videos. However, the video playback effect obtained by using the above prior art is relatively single and can no longer meet the needs of users.
[0003] Therefore, there is an urgent need for a video processing method that can improve the video playback effect. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a video processing method, apparatus, computer storage medium, and electronic device to achieve the purpose of improving the video playback effect.
[0005] To achieve the above object, the embodiments of the present invention provide the following technical solutions:
[0006] The first aspect of the embodiments of the present invention discloses a video processing method, the method comprising:
[0007] In response to the trigger of a control setting request, display a control setting interface, the control setting interface at least including a control panel and a video preview drawing board, the video preview drawing board being used to display the video frame image of the current control to be added in the video to be produced, and the control panel being used to display controls;
[0008] In response to the trigger of a first operation instruction of the user for the control, use an html engine to construct a new control displayed on the video frame image of the current control to be added;
[0009] Obtain a second operation instruction for the new control, and generate control configuration information of the new control based on the second operation instruction;
[0010] Generate a control configuration data packet based on all new controls and the control configuration information of the new controls;
[0011] Generate a video according to the video data packet corresponding to the video to be produced and the control configuration data packet.
[0012] Preferably, if the control includes a rich text control, the step of using an html engine to construct a new control displayed on the video frame image of the current control to be added in response to the trigger of a first operation instruction of the user for the control includes:
[0013] Obtain the dragging instruction of the user for the rich text control, and based on the dragging instruction, copy the basic style parameters of the rich text control;
[0014] Use the html engine to construct a rich text control with the basic style parameters on the video frame image of the currently to-be-added control according to the basic style parameters.
[0015] Preferably, if the control template includes a multimedia control, in response to the triggering of the first operation instruction of the user for the control template, using the html engine to construct a new control displayed on the video frame image of the currently to-be-added control includes:
[0016] Obtain the dragging instruction of the user for the multimedia control, and based on the dragging instruction, upload the multimedia resource corresponding to the multimedia control;
[0017] Use the html engine to construct a playback control corresponding to the multimedia resource on the video frame image of the currently to-be-added control according to the multimedia resource.
[0018] Preferably, the control setting interface further includes a control configuration panel, obtain the second operation instruction for the new control, and generate the control configuration information of the new control based on the second operation instruction, including:
[0019] Obtain the starting and ending mouse coordinates of dragging the new control to move on the video frame image of the currently to-be-added control;
[0020] Calculate the dragging coordinates based on the starting and ending mouse coordinates;
[0021] Set the position of the new control on the video frame image of the currently to-be-added control according to the dragging coordinates to obtain the position configuration information of the new control, and display the dragging coordinates on the control configuration panel.
[0022] Preferably, the control setting interface further includes a control configuration panel, obtain the second operation instruction for the new control, and generate the control configuration information of the new control based on the second operation instruction, including:
[0023] Determine the rectangular coordinate system established with the center point of the new control itself as the origin on the video frame image of the currently to-be-added control;
[0024] Obtain the starting and ending mouse coordinates for rotating the new control based on the rectangular coordinate system;
[0025] Determine the quadrant where the current mouse coordinate is located in the rectangular coordinate system based on the starting and ending mouse coordinates;
[0026] Calculate the rotation angle of the new control according to the current mouse coordinates and the quadrant where it is located;
[0027] Based on the rotation angle, set the display angle of the new control on the video frame image of the currently to-be-added control to obtain the angle configuration information of the new control.
[0028] Preferably, the control setting interface further includes a control configuration panel. Obtain a second operation instruction for the new control, and generate the control configuration information of the new control based on the second operation instruction, including:
[0029] Obtain the style setting parameters of the new control by the user based on the control configuration panel. The style setting parameters include at least one or a combination of width, height, length, transparency, line shape, fill color, display effect, and border style;
[0030] Generate the style configuration information of the new control based on the style setting parameters.
[0031] Preferably, the control setting interface further includes a video time window. The video time window includes a timeline, a video track, and a control track. The video track is used to display the video frame images that make up the to-be-produced video in the order of the timeline. The control track is used to set the duration of the new control. The obtaining of the second operation instruction for the new control and generating the control configuration information of the new control based on the second operation instruction include:
[0032] Determine the start time point of the timeline corresponding to the start position of the new control on the control track to obtain the display time of the new control;
[0033] Obtain the time period from the start position to the end position of the new control dragged on the timeline corresponding to the end position to obtain the duration of the new control;
[0034] Generate time configuration information based on the display time and the duration of the new control.
[0035] Preferably, the control setting interface further includes an action panel. The action panel is used to input the action description information of the target object. The video time window further includes an action track. The method further includes:
[0036] Obtain the action description information of the target object. The action description information of the target object includes at least the target object and the action description information of the target object;
[0037] Determine the position of the video frame image where the target object is located on the timeline, and display the action description information of the target object on the action track corresponding to the position;
[0038] Edit the video frame image where the target object is located based on the action description information executed by the target object to obtain a video frame data packet corresponding to the new video frame image;
[0039] Update the video data packet of the video to be produced according to the video frame data packet.
[0040] A second aspect of the present invention discloses a video processing device, the device includes:
[0041] A first response module, configured to display a control setting interface in response to the trigger of a control setting request, the control setting interface at least includes a control panel and a video preview drawing board, the video preview drawing board is used to display the video frame image of the currently to-be-added control in the video to be produced, and the control panel is used to display controls;
[0042] A second response module, configured to construct a new control displayed on the video frame image of the currently to-be-added control by using an html engine in response to the trigger of a first operation instruction of the user for the control;
[0043] An acquisition module, configured to acquire a second operation instruction for the new control and generate control configuration information of the new control based on the second operation instruction;
[0044] A generation module, configured to generate a video according to the video data packet corresponding to the video to be produced and all the control configuration information.
[0045] A third aspect of the present invention discloses a computer storage medium, the storage medium includes a stored program, wherein when the program runs, it controls the device where the storage medium is located to execute the video processing method disclosed in the first aspect of the present invention.
[0046] A fourth aspect of the present invention discloses an electronic device, the electronic device is used to run a program, wherein when the program runs, it executes the video processing method disclosed in the first aspect of the present invention.
[0047] Based on the video processing method, device, computer storage medium, and electronic device provided in the embodiments of the present invention above, by responding to the trigger of a control setting request, a control setting interface is displayed. The control setting interface at least includes a control panel and a video preview drawing board. The video preview drawing board is used to display the video frame image of the current control to be added in the video to be produced, and the control panel is used to display controls; in response to the trigger of the user's first operation instruction for the control, an html engine is used to construct a new control displayed on the video frame image of the current control to be added; a second operation instruction for the new control is obtained, and control configuration information of the new control is generated based on the second operation instruction; a control configuration data packet is generated based on all the new controls and the control configuration information of the new controls; a video is generated according to the video data packet corresponding to the video to be produced and the control configuration data packet. In this solution, in response to the control setting request, the video frame image of the current control to be added is displayed in the video preview drawing board, and the control data is obtained in response to the user's operation on the control, and a new control with the control data is created using the html engine. In the video preview drawing board, the control configuration information of the new control is generated in response to the second operation instruction for the new control, and a control configuration data packet is generated based on the new control and the control configuration information of the new control; finally, a video with the corresponding control added is generated according to the video data packet corresponding to the video to be produced and the control configuration data packet, and a video showing the corresponding effect of the control is obtained when playing the video, so as to achieve the purpose of improving the video playback effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained according to the provided drawings.
[0049] Figure 1 FIG. is a schematic diagram of an application environment applicable to the embodiments of the present application disclosed in the embodiments of the present invention;
[0050] Figure 2 FIG. is a schematic flowchart of a video processing method disclosed in the embodiments of the present invention;
[0051] Figure 3 FIG. is a schematic flowchart of a process for constructing a rich text control disclosed in the embodiments of the present invention;
[0052] Figure 4 FIG. is a schematic diagram of an application scenario for constructing a rich text control disclosed in the embodiments of the present invention;
[0053] Figure 5 FIG. is a schematic flowchart of a process for constructing a multimedia control disclosed in the embodiments of the present invention;
[0054] Figure 6 Schematic flowchart of a method for setting control position configuration information disclosed in an embodiment of the present invention;
[0055] Figure 7 Schematic diagram of an application scenario for setting control position configuration information disclosed in an embodiment of the present invention;
[0056] Figure 8 Schematic flowchart of a method for setting control angle configuration information disclosed in an embodiment of the present invention;
[0057] Figure 9 Schematic diagram of an application scenario for setting control angle configuration information disclosed in an embodiment of the present invention;
[0058] Figure 10 Schematic flowchart of a method for setting control style configuration information disclosed in an embodiment of the present invention;
[0059] Figure 11 Schematic diagram of a control configuration panel disclosed in an embodiment of the present invention;
[0060] Figure 12 Schematic flowchart of a method for setting the display duration of a new control disclosed in an embodiment of the present invention;
[0061] Figure 13 Flowchart of another video processing method disclosed in an embodiment of the present invention;
[0062] Figure 14 Schematic diagram of the structure of a video processing device disclosed in an embodiment of the present invention;
[0063] Figure 15 Schematic diagram of an application for video production disclosed in an embodiment of the present invention;
[0064] Figure 16 Schematic diagram of the structure of an electronic device disclosed in an embodiment of the present invention. Detailed implementation manners
[0065] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0066] In this application, the terms "comprising", "including" or any other variant thereof are intended to cover non-exclusive inclusion, such that a process, method, article or apparatus comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or apparatus. Without further limitation, an element defined by the phrase "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising the element.
[0067] As can be seen from the background art, the playback effect of the new video obtained based on the existing video production method is relatively single and can no longer meet the needs of users.
[0068] Therefore, the embodiments of the present invention disclose a video processing method, apparatus, computer storage medium and electronic device, which display a control setting interface in response to the trigger of a control setting request. The control setting interface at least includes a control panel and a video preview panel with html drawing board function. The video preview panel is used to display the video frame image of the current control to be added in the video to be produced; in response to the user's operation on the control, corresponding control data is obtained, and a new control is created using the html engine and the obtained control data and displayed on the video frame image of the current control to be added. According to the video data packet corresponding to the video to be produced, and in response to the configuration operation on the new control, a control configuration data packet is generated to produce a video with the corresponding control added, and when the video is played, a video showing the corresponding effect of the control is obtained, so as to achieve the purpose of improving the video playback effect. Specific details are described in the following embodiments.
[0069] Please refer to Figure 1 , which shows a schematic diagram of an application environment applicable to the embodiments of the present application. The video processing method provided by the embodiments of the present application can be applied to an interaction system 100 as shown in Figure 1 . The interaction system 100 includes a terminal device 101 and a server 102, and the server 102 is communicatively connected to the terminal device 101. Among them, the server 102 can be a traditional server or a cloud server, and no specific limitation is made here.
[0070] Among them, the terminal device 101 can be various electronic devices with a display screen, a data processing module, a camera, audio input / output, etc. functions, and supporting data input, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, self-service terminals and wearable electronic devices, etc. Specifically, the data input can be voice input based on the voice module on the electronic device, character input through the character input module, etc.
[0071] Optionally, the terminal device may integrate corresponding input devices, such as a radio device, a touch device, etc. The terminal device 101 may also be separately connected to a peripheral device to perform an input operation through the peripheral device. For example, the peripheral device may be an input device such as a writing tablet, a mouse, etc.
[0072] Among them, a client application may be installed on the terminal device 101. A user may, based on the client application (such as an APP, a WeChat mini-program, etc.), where the video editor involved in this embodiment is also a client application configured in the terminal device 101. The user may register a user account with the server 102 based on the client application, or may use a temporary user account as a guest and communicate with the server 102 based on the user account. For example, the user logs in to the user account in the client application and, based on the user account, inputs through the client application, and may input text information, voice information, etc., or may also perform corresponding click or drag and drop input operations based on the peripheral device. After the client application receives the information input by the user, it may send the information to the server 102, so that the server 102 can receive the information, process and store it, and the server 102 may also receive the information and return a corresponding output information to the terminal device 101 according to the information.
[0073] In some embodiments, the device for processing the video data to be processed may also be provided on the terminal device 101, so that the terminal device 101 can achieve interaction with the user without relying on the server 102 to establish communication. At this time, the interaction system 100 may only include the terminal device 101.
[0074] Please refer to Figure 2 , which shows a schematic flowchart of a video processing method. The video processing method mainly includes:
[0075] S201: In response to the triggering of a control setting request, display a control setting interface.
[0076] In this S201, the control setting interface at least includes a control panel and a video preview drawing board.
[0077] The video preview drawing board is used to display the video frame image of the current control to be added in the video to be produced.
[0078] In one embodiment, after the user selects the video frame image to which a control needs to be added in the video to be produced, the video frame image is displayed on the video preview drawing board.
[0079] The video preview drawing board has the function of an html drawing board and also has play and pause functions.
[0080] The control panel is used to display controls. The controls include, but are not limited to, specific text, pictures, shapes, etc., and corresponding controls can also be added according to user needs. For example, rich text controls and multimedia controls, etc.
[0081] S202: In response to the triggering of the first operation instruction by the user for the control, use the html engine to construct a new control to be displayed on the video frame image of the currently to-be-added control.
[0082] In the specific implementation of S202, in response to the first operation instruction of the user for any control, copy the control data of the control, and use the html engine on the video preview drawing board to construct a new control that can be displayed on the video frame image of the currently to-be-added control.
[0083] S203: Obtain the second operation instruction for the new control, and generate the control configuration information of the new control based on the second operation instruction.
[0084] In the specific implementation of S203, execute the second operation instruction for the new control displayed on the video frame image of the currently to-be-added control to complete the configuration of the new control, and obtain the control configuration information of the new control.
[0085] It should be noted that the second operation instruction can be generated by inputting information or obtaining touch operation information for the new control.
[0086] Optionally, the second operation instruction includes, but is not limited to, instructions for setting the name, style, display effect, appearance time, etc. of the control.
[0087] S204: Generate a control configuration data packet based on all the new controls and the control configuration information of the new controls.
[0088] In the specific implementation of S204, collect all the new controls and the corresponding control configuration information of the new controls to generate a control configuration data packet.
[0089] Optionally, the new control is constructed based on the html engine, and the control configuration information is also set based on the video preview drawing board. Therefore, the control configuration data packet can be output in html format.
[0090] S205: Generate a video according to the video data packet corresponding to the to-be-produced video and the control configuration data packet.
[0091] In the specific implementation of S205, based on the control configuration information of all the new controls included in the control configuration data packet, and each video frame image in the video data packet corresponding to the to-be-produced video, perform video rendering, and finally obtain a video with the display effect of the new controls.
[0092] In the video processing method disclosed in the embodiments of the present invention, in response to a control setting request, a video frame image of the currently to-be-added control is displayed in the video preview panel, and control data is obtained in response to a user's operation on the control. Then, a new control with the control data is created using an html engine, and control configuration information for the new control is generated in response to a second operation instruction on the new control in the video preview panel. A control configuration data packet is generated based on the new control and the control configuration information of the new control. Finally, a video with the corresponding control added is generated according to the video data packet corresponding to the to-be-produced video and the control configuration data packet, and a video showing the corresponding effect of the control is obtained when playing the video, thereby achieving the purpose of improving the video playback effect.
[0093] Based on the video processing method disclosed in the above embodiments of the present invention, if the control includes a rich text control, the rich text control includes various formats of controls such as a text control, an image control, a shape control, a table control, and a list control.
[0094] Figure 2 The specific implementation manner of S202 disclosed for constructing a new control displayed on the video frame image of the currently to-be-added control in response to the triggering of a user's first operation instruction on the control by using an html engine, such as Figure 3 The generation process of the rich text control shown, mainly includes:
[0095] S301: Obtain a drag instruction of the user for the rich text control, and based on the drag instruction, copy the basic style parameters of the rich text control.
[0096] In the specific implementation process of S301, in response to the user dragging the rich text control on the control panel to the video preview panel based on a device such as a mouse or a touchpad, and copying the basic style parameters of the rich text control based on the drag instruction.
[0097] S302: Use the html engine to construct a rich text control with the basic style parameters on the video frame image of the currently to-be-added control according to the basic style parameters.
[0098] In the specific implementation process of S302, use the html engine on the video preview panel to render the control according to the copied basic style parameters of the rich text control, and construct the rich text control in the video preview panel through two markup languages, html (HyperText Markup Language) and CSS (Cascading Style Sheets).
[0099] Take Figure 4 as an example for illustration. Figure 4In the middle is an interface 400 for setting a control, including a control panel 401 and a video preview drawing board 402. The rich text controls displayed on the control panel 401 are graphic controls, including three controls: a square, a circle, and a rounded rectangle. Other controls such as text controls and table controls are displayed on the control panel in the form of tabs.
[0100] On the video preview drawing board 402, a video frame image of the currently to-be-added control is displayed. The video frame image of the currently to-be-added control is the bottom layer.
[0101] The user executes a drag instruction for the circular control. Based on the drag instruction, the basic style parameters of the circular control are copied. On the video preview drawing board, the control is rendered using the html engine according to the copied basic style parameters of the circular control, and the circular control is constructed through two markup languages, html and CSS. Finally, the circular control is displayed on the video frame image of the currently to-be-added control on the video preview drawing board.
[0102] It should be noted that the layer of the circular control is above the bottom layer of the video frame image.
[0103] In the embodiment of the present invention, if the control includes a rich text control, the basic style parameters of the rich text control are copied according to the drag instruction, and the control is rendered using the html engine. The rich text control is constructed through two markup languages, html and CSS, in the video preview drawing board, so that the rich text control can be quickly added to the video frame image.
[0104] Based on the video processing method disclosed in the above embodiment of the present invention, if the control includes a multimedia control. The multimedia control includes controls such as videos and animated gifs.
[0105] Figure 2 The specific implementation manner of S202 disclosed for constructing a new control displayed on the video frame image of the currently to-be-added control in response to the trigger of the user's first operation instruction for the control, such as Figure 5 The generation process of the media control shown mainly includes:
[0106] S501: Obtain the drag instruction of the user for the multimedia control, and based on the drag instruction, upload the multimedia resource corresponding to the multimedia control.
[0107] In the specific implementation process of S501, in response to the user dragging the multimedia control on the control panel to the video preview drawing board based on a device such as a mouse or a touchpad, and upload the multimedia resource corresponding to the multimedia control based on the drag instruction.
[0108] S502: Use the html engine to construct a playback control corresponding to the multimedia resource on the video frame image of the currently to-be-added control according to the multimedia resource.
[0109] In the specific implementation of S502, use the multimedia control provided by the html engine to generate a playback control for playing the multimedia resource on the video preview panel based on the uploaded multimedia resource.
[0110] In the embodiment of the present invention, if the control includes a multimedia control, upload the multimedia resource corresponding to the multimedia control according to the drag instruction, and use the multimedia playback control provided by the html engine to generate a playback control for playing the uploaded multimedia resource, so that the multimedia control can be quickly added to the video frame image.
[0111] In one embodiment, in combination with the video processing method disclosed in the above embodiment of the present invention, if the control setting interface further includes a control configuration panel for specifically configuring the control, Figure 2 obtain the second operation instruction for the new control in S203 shown in and generate the control configuration information of the new control based on the second operation instruction. The specific implementation method is as Figure 6 shown, mainly including:
[0112] S601: Obtain the starting and ending mouse coordinates of dragging the new control to move on the video frame image of the currently to-be-added control.
[0113] In the specific implementation of S601, obtain the starting mouse coordinates generated when dragging the new control based on the mouse, and when the dragging operation stops, obtain the ending mouse coordinates generated when stopping dragging the new control.
[0114] S602: Calculate the dragging coordinates based on the starting and ending mouse coordinates.
[0115] In S602, the dragging coordinates = ending mouse coordinates - starting mouse coordinates.
[0116] Since the starting and ending mouse coordinates are relative coordinates, the dragging coordinates can also be the current mouse coordinates and the coordinates of the mouse moving relative to the original position of the control.
[0117] S603: Set the position of the new control on the video frame image of the currently to-be-added control according to the dragging coordinates to obtain the position configuration information of the new control, and display the dragging coordinates on the control configuration panel.
[0118] In the process of specifically implementing S603, the position configuration information of the new control can be obtained according to the dragging coordinates, and at the same time, the dragging coordinates are displayed on the control configuration panel. On the one hand, it enables the user to intuitively understand the position of the new control on the video frame image. On the other hand, it also enables the user to initiate a dragging operation to adjust the position of the new control again with reference to the dragging coordinates displayed on the control configuration panel.
[0119] It should be noted that the coordinate display area on the control configuration panel can display the current mouse coordinates in real time during the mouse dragging process.
[0120] Combined with Figure 4 for illustration. As Figure 7 shown, Figure 7 There is a video preview drawing board 402 and a control configuration panel 403. A video frame image of the current control to be added and a circular control constructed by the html engine are displayed on the video preview drawing board 402.
[0121] The user executes a dragging instruction on the circular control on the video preview drawing board 402, first obtains the starting mouse coordinates of the circular control. Figure 7 The starting position of the circular control is represented by a dotted line in Figure 7 When the dragging operation stops, the ending mouse coordinates generated when the circular control stops being dragged are obtained.
[0122] In an embodiment of the present invention, according to the mouse coordinates corresponding to the control before and after dragging the control, that is, the starting and ending mouse coordinates, the dragging coordinates of the new control are determined, and based on this, the position configuration information of the new control is determined, and further the position of the new control on the video frame image is determined.
[0123] In an embodiment, combined with the video processing method disclosed in the above embodiment of the present invention, if the control setting interface further includes a control configuration panel for specifically configuring the control, Figure 2 as shown in Figure 8 S203 obtains a second operation instruction for the new control and generates the control configuration information of the new control based on the second operation instruction. The specific implementation manner is as
[0124] S801: Determine the rectangular coordinate system established with the center point of the new control as the origin on the video frame image of the current control to be added.
[0125] In S801, the rectangular coordinate system is composed of the X-axis and the Y-axis, and has a total of four quadrants: the first quadrant, the second quadrant, the third quadrant, and the fourth quadrant.
[0126] S802: Obtain the starting and ending mouse coordinates for rotating the new control based on the rectangular coordinate system.
[0127] S803: Determine the quadrant in the rectangular coordinate system where the current mouse coordinate is located based on the starting and ending mouse coordinates.
[0128] In the specific implementation of S804, determine the current mouse coordinate according to the starting and ending mouse coordinates, and determine the quadrant of the current mouse coordinate in the rectangular coordinate system.
[0129] It should be noted that the ending mouse coordinate can also be directly used as the current mouse coordinate.
[0130] S804: Calculate the rotation angle of the new control according to the current mouse coordinate and the quadrant where it is located.
[0131] In the specific implementation of S804, calculate the rotation angle of the new control according to the current mouse coordinate and the quadrant where it is located.
[0132] Among them, if the current mouse coordinate is in the first quadrant: rotation angle = the angle between the current mouse coordinate and the X-axis.
[0133] If the current mouse coordinate is in the second quadrant: rotation angle = the angle between the current mouse coordinate and the Y-axis + 90 degrees.
[0134] If the current mouse coordinate is in the third quadrant: rotation angle = the angle between the current mouse coordinate and the X-axis + 180 degrees.
[0135] If the current mouse coordinate is in the fourth quadrant: rotation angle = the angle between the current mouse coordinate and the Y-axis + 270 degrees.
[0136] S805: Set the display angle of the new control on the video frame image of the current control to be added based on the rotation angle to obtain the angle configuration information of the new control.
[0137] It should be noted that in the angle display area on the control configuration panel, the rotation angle of the new control can be displayed in real time during the process of rotating the new control by dragging the mouse.
[0138] Combined with Figure 4 for illustration, as Figure 9 shown, Figure 9In the middle is a video preview drawing board 402. A video frame image of the currently to-be-added control and a circular control constructed by an html engine are displayed on the video preview drawing board 402. Optionally, the position configuration information of the circular control on the video frame image displayed on the video preview drawing board 402 can also be a circular control with set position configuration information.
[0139] The user executes a rotation instruction on the circular control on the video preview drawing board 402. First, obtain the starting mouse coordinates for rotating the circular control. Figure 9 In the middle, the starting position before the rotation of the circular control is represented by a solid origin. When the dragging operation stops, obtain the ending mouse coordinates generated when stopping the rotation of the circular control. Figure 9 In the middle, the ending position after the rotation of the circular control is represented by a hollow origin. Then, determine the quadrant in the rectangular coordinate system where the current mouse coordinate is located based on the starting and ending mouse coordinates. Calculate the rotation angle of the new control according to the current mouse coordinate and its quadrant. Set the display angle of the new control on the video frame image of the currently to-be-added control based on the rotation angle to obtain the angle configuration information of the new control. If the finally obtained rotation angle is 80 degrees, display the above rotation angle in the control configuration panel 403.
[0140] In the embodiment of the present invention, a rectangular coordinate system is established with the center point of the new control itself as the origin. According to the current mouse coordinate corresponding to the control determined after rotating the control and its quadrant, determine the rotation angle of the new control to obtain the angle configuration information of the new control, and further determine the angle of the new control on the video frame image.
[0141] In one embodiment, in combination with the video processing method disclosed in the above embodiment of the present invention, if the control setting interface further includes a control configuration panel for specifically configuring the control, Figure 2 As shown in S203, obtain a second operation instruction for the new control, and generate the control configuration information of the new control based on the second operation instruction. The specific implementation manner is as Figure 10 shown, and mainly includes:
[0142] S1001: Obtain the style setting parameters of the new control based on the control configuration panel by the user.
[0143] The style setting parameters include at least one or more combinations of width, height, length, transparency, line type, fill color, display effect, and border style.
[0144] S1002: Generate the style configuration information of the new control based on the style setting parameters.
[0145] As Figure 11 shown, the Figure 11Configure a control panel. It includes input boxes for width, height, length, transparency, line style, fill color, and display effect.
[0146] Figure 11 These are only examples and are not limited to the above - style input boxes. Nor are they limited to being displayed in the form of input boxes.
[0147] In the embodiments of the present invention, through the input boxes or selection boxes for various style setting parameters provided by the control configuration panel, the style parameters of the new control can be freely set. Thus, the style of the new control displayed on the video frame image is made more diverse.
[0148] In one embodiment, in combination with the video processing method disclosed in the above - mentioned embodiments of the present invention, if the control setting interface further includes a video time window, the video time window includes a time axis, a video track, and a control track. The video track is used to display video frame images constituting the to - be - produced video in the order of the time axis, and the control track is used to set the duration of the new control. Figure 2 In S203 shown in [reference], obtain a second operation instruction for the new control and generate control configuration information for the new control based on the second operation instruction. The specific implementation method is as Figure 12 shown.
[0149] S1201: Determine the start time point of the time axis corresponding to the start position of the new control on the control track to obtain the display time of the new control.
[0150] In the process of specifically implementing S1201, from the perspective of the time axis, the earlier the control appears, the closer it is to the left side of the time axis; the later the control appears, the closer it is to the right side of the time axis.
[0151] S1202: Obtain the time period of the time axis corresponding to dragging the new control from the start position to the end position to obtain the duration of the new control.
[0152] In the process of specifically implementing S1202, with the time axis and the start time point as references, it can be dragged to the left or to the right.
[0153] If dragged to the right, the time period of the time axis between the time point corresponding to the end position and the start time point is the duration of the new control's appearance.
[0154] If dragged to the left, the time point corresponding to the end position is the actual appearance time point of the control. That is to say, dragging the control to the left advances its appearance time. Similarly, the time period of the time axis between the time point corresponding to the end position and the original start time point is the duration of the new control's appearance.
[0155] It should be noted that by stretching the above-determined time period, the duration of the new control can be adjusted again. Among them, stretching increases the duration of the appearance of the new control, and compression reduces the duration of the appearance of the new control.
[0156] S1203: Generate time configuration information based on the display time of the new control and the duration.
[0157] It should be noted that controls that conflict with each other in terms of display time are located in different control layers, that is, the layer or panel layer.
[0158] In the embodiment of the present invention, based on the timeline, the appearance duration of the new control can be flexibly adjusted or set, making the display of the control on the video frame image more flexible and not limited to a single video frame image.
[0159] In one embodiment, in combination with the video processing method disclosed in the embodiment of the present invention, if the control setting interface further includes an action panel for inputting action description information of the target object, and the video time window further includes an action track, the video processing method, as Figure 13 shown, further includes:
[0160] S1301: Obtain the action description information of the target object.
[0161] In S1301, the action description information of the target object at least includes the target object and the action description information executed by the target object.
[0162] S1302: Determine the position of the video frame image where the target object is located on the timeline, and display the action description information executed by the target object on the action track corresponding to the position.
[0163] S1303: Edit the video frame image where the target object is located based on the action description information executed by the target object to obtain a video frame data packet corresponding to the new video frame image.
[0164] S1304: Update the video data packet of the video to be produced according to the video frame data packet.
[0165] In the embodiment of the present invention, by setting the action description information of the target object, the action of the target object in the video to be produced can be set, thereby changing the original video frame image, and replacing the original video frame data packet with the video frame data packet corresponding to the new video frame image, so that the display effect of the video is more diverse and does not display based on the original video material.
[0166] Based on the video processing method disclosed in the above embodiment of the present invention, the embodiment of the present invention also discloses a video processing device. Please refer toFigure 14 The figure is a schematic structural diagram of a video processing device disclosed in an embodiment of the present invention.
[0167] The video processing device 1400 includes: a first response module 1401, a second response module 1402, an acquisition module 1403, and a generation module 1404.
[0168] The first response module 1401 is configured to display a control setting interface in response to the trigger of a control setting request. The control setting interface includes at least a control panel and a video preview drawing board. The video preview drawing board is configured to display a video frame image of the current control to be added in the video to be produced, and the control panel is configured to display controls.
[0169] The second response module 1402 is configured to build a new control displayed on the video frame image of the current control to be added by using an html engine in response to the trigger of a first operation instruction of the user for the control.
[0170] The acquisition module 1403 is configured to acquire a second operation instruction for the new control and generate control configuration information of the new control based on the second operation instruction.
[0171] The generation module 1404 is configured to generate a video according to the video data packet corresponding to the video to be produced and all the control configuration information.
[0172] In an embodiment, if the control template includes a rich text control, the second response module 1402 is configured to acquire a drag instruction of the user for the rich text control, and based on the drag instruction, copy basic style parameters of the rich text control; use the html engine to build a rich text control with the basic style parameters on the video frame image of the current control to be added according to the basic style parameters.
[0173] In an embodiment, if the control template includes a multimedia control, the second response module 1402 is configured to acquire a drag instruction of the user for the multimedia control, and based on the drag instruction, upload a multimedia resource corresponding to the multimedia control; use the html engine to build a playback control corresponding to the multimedia resource on the video frame image of the current control to be added according to the multimedia resource.
[0174] In an embodiment, if the control setting interface further includes a control configuration panel, the acquisition module 1403 is configured to acquire start and end mouse coordinates of dragging the new control to move on the video frame image of the current control to be added; calculate a drag coordinate based on the start and end mouse coordinates; set a position of the new control on the video frame image of the current control to be added according to the drag coordinate to obtain position configuration information of the new control, and display the drag coordinate on the control configuration panel.
[0175] In one embodiment, if the control setting interface further includes a control configuration panel, an acquisition module 1403 is configured to determine a rectangular coordinate system established with the center point of itself as the origin on the video frame image of the current control to be added for the new control; acquire the start and end mouse coordinates for rotating the new control based on the rectangular coordinate system; determine the quadrant in which the current mouse coordinate is located in the rectangular coordinate system based on the start and end mouse coordinates; calculate the rotation angle of the new control according to the current mouse coordinate and the quadrant where it is located; and set the display angle of the new control on the video frame image of the current control to be added based on the rotation angle to obtain the angle configuration information of the new control.
[0176] In one embodiment, if the control setting interface further includes a control configuration panel, an acquisition module 1403 is configured to acquire style setting parameters of the new control by the user based on the control configuration panel, where the style setting parameters at least include one or more combinations of width, height, length, transparency, line type, fill color, display effect, and border style; and generate style configuration information of the new control based on the style setting parameters.
[0177] In one embodiment, if the control setting interface further includes a video time window, the video time window includes a time axis, a video track, and a control track, the video track is configured to display video frame images constituting the video to be produced in the order of the time axis, and the control track is configured to set the duration of the new control. An acquisition module 1403 is configured to determine the start time point of the time axis corresponding to the start position of the new control on the control track to obtain the display time of the new control; acquire the time period of the time axis corresponding to dragging the new control from the start position to the end position to obtain the duration of the new control; and generate time configuration information based on the display time and the duration of the new control.
[0178] In one embodiment, if the control setting interface further includes an action panel for inputting action description information of a target object, and the video time window further includes an action track, the acquisition module 1403 is further configured to acquire the action description information of the target object, where the action description information of the target object at least includes the target object and the action description information executed by the target object; determine the position of the video frame image where the target object is located on the time axis, and display the action description information executed by the target object on the action track corresponding to the position.
[0179] The generating module 1404 is further configured to edit the video frame image where the target object is located based on the action description information executed by the target object to obtain a video frame data packet corresponding to the new video frame image; and update the video data packet of the video to be produced according to the video frame data packet.
[0180] In the video processing apparatus disclosed in the embodiments of the present invention, the response module responds to the trigger of the control setting request to display a control setting interface, obtains corresponding control data in response to the user's operation on the control, creates a new control displayed on the video frame image of the currently to-be-added control by using an html engine and the obtained control data, generates a video with the added corresponding control according to the video data packet corresponding to the video to be produced and the control configuration data packet obtained in response to the configuration operation on the new control, and obtains a video showing the corresponding effect of the control when playing the video, thereby achieving the purpose of improving the video playing effect.
[0181] Based on the video processing method and apparatus disclosed in the above embodiments of the present invention, please refer to Figure 15 , which is an application schematic diagram of a video production disclosed in the embodiments of the present invention, and is applicable to a video editor 1500.
[0182] The video editor 1500 at least includes a basic content setting interface 1501 and a control setting interface 1502.
[0183] The basic content setting interface 1501 and the control setting interface 1502 are displayed in the form of tabs, and the corresponding interface is displayed when a corresponding operation is triggered.
[0184] The basic content setting interface 1501 is used to display components for setting the basic content of the video.
[0185] Currently Figure 15 What is displayed is the control setting interface 1502.
[0186] The control setting interface 1502 at least includes a control panel 15011, a video preview drawing board 15012, a control configuration panel 15013, and a video time window 15014.
[0187] The control panel 15011 is used to display controls, and the controls include but are not limited to text, pictures, and shapes, and corresponding controls can be added according to user needs. By adding multimedia controls, etc.
[0188] The video preview drawing board 15012 is used to display the video frame image of the currently to-be-added control in the video to be produced.
[0189] The control configuration panel 15013 is used to display components for setting the name, style, display effect, appearance time, etc. of the control.
[0190] During the specific process of video production, in response to the trigger of a control setting request, a control setting interface 1502 is displayed.
[0191] On the video time window 15014, a timeline is displayed, and each video frame image constituting the video to be produced is displayed on the main video track based on the timeline.
[0192] The user executes the video processing method disclosed in the embodiments of the present invention based on the control panel 15011, the video preview drawing board 15012, the control configuration panel 15013, and the video time window 15014. A first rich text control, a second rich text control, a third rich text control, action description information, and a first multimedia control are added to the video frame image of the video to be produced, and the corresponding configuration information is displayed on the control track corresponding to the control layer of the video time window 15014 and on the action track corresponding to the action layer.
[0193] Based on the video processing device disclosed in the embodiments of the present disclosure, each of the above modules can be implemented by a hardware device composed of a processor and a memory. Specifically, each of the above modules is stored in the memory as a program unit, and the processor executes the above program unit stored in the memory to implement thread control.
[0194] Among them, the processor contains a kernel, and the kernel retrieves the corresponding program unit from the memory. One or more kernels can be set, and database expansion can be achieved by adjusting the kernel parameters.
[0195] The embodiments of the present disclosure provide a computer storage medium. The storage medium includes a stored program, and during the running of the program, the device where the storage medium is located is controlled to execute the video processing method disclosed in the embodiments of the present invention.
[0196] Computer-readable media includes both permanent and non-permanent, removable and non-removable media and can store information by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.
[0197] An embodiment of the present disclosure provides an electronic device for running a program. When the program runs, it executes the video processing method disclosed in the foregoing embodiments of the present invention.
[0198] As Figure 16 shown, it is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
[0199] The electronic device 1600 in the embodiments of the present disclosure may be a server, a PC, a PAD, a mobile phone, etc.
[0200] The electronic device 1600 includes at least one processor 1601, at least one memory 1602 connected to the processor, and a bus 1603.
[0201] The processor 1601 and the memory 1602 communicate with each other through the bus 1603.
[0202] The processor 1601 is configured to execute a program stored in the memory.
[0203] The memory 1602 is configured to store a program, which is at least used for:
[0204] In response to the trigger of a control setting request, display a control setting interface, where the control setting interface includes at least a control panel and a video preview drawing board. The video preview drawing board is used to display the video frame image of the currently to-be-added control in the to-be-produced video, and the control panel is used to display controls; in response to the trigger of a first operation instruction of the user for the control, use an html engine to construct a new control displayed on the video frame image of the currently to-be-added control; obtain a second operation instruction for the new control, and generate control configuration information of the new control based on the second operation instruction; generate a control configuration data packet based on all the new controls and the control configuration information of the new controls; generate a video according to the video data packet corresponding to the to-be-produced video and the control configuration data packet.
[0205] In a typical configuration, the device includes one or more processors (CPUs), a memory, and a bus. The device may also include an input / output interface, a network interface, etc.
[0206] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of, for example, read-only memory (ROM) or flash memory (flash RAM). The memory includes at least one storage chip. The memory is an example of a computer-readable medium.
[0207] Each embodiment in this specification is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other, and the key point of each embodiment is to illustrate the differences from other embodiments. In particular, for a system or system embodiment, since it is basically similar to a method embodiment, the description is relatively simple, and for the relevant parts, reference can be made to the corresponding description in the method embodiment. The systems and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative efforts.
[0208] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0209] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but will be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A video processing method, characterized in that, the method includes: responding to the triggering of a control setting request, displaying a control setting interface, the control setting interface at least including a video time window, an action panel, a control panel, and a video preview drawing board, the video time window including a timeline and an action track, the video preview drawing board being used to display the video frame image of the current control to be added in the video to be produced, the control panel being used to display controls; the action panel being used to input target object action description information; responding to the triggering of a first operation instruction of the user for the control, using an html engine to construct a new control displayed on the video frame image of the current control to be added; obtaining a second operation instruction for the new control, and generating control configuration information of the new control based on the second operation instruction; generating a control configuration data packet based on all the new controls and the control configuration information of the new controls; obtaining the target object action description information, the target object action description information at least including a target object and action description information executed by the target object; the target object being an object in the video to be produced; determining the position of the video frame image where the target object is located on the timeline, and displaying the action description information executed by the target object on the action track corresponding to the position; editing the video frame image where the target object is located based on the action description information executed by the target object to obtain a video frame data packet corresponding to the new video frame image; updating the video data packet of the video to be produced according to the video frame data packet; generating a video according to the video data packet corresponding to the video to be produced and the control configuration data packet.
2. The method according to claim 1, characterized in that, if the control includes a rich text control, the responding to the triggering of a first operation instruction of the user for the control, using an html engine to construct a new control displayed on the video frame image of the current control to be added, includes: obtaining a drag instruction of the user for the rich text control, and based on the drag instruction, copying the basic style parameters of the rich text control; using an html engine to construct a rich text control with the basic style parameters on the video frame image of the current control to be added according to the basic style parameters.
3. The method according to claim 1, characterized in that, if the control includes a multimedia control, the responding to the triggering of a first operation instruction of the user for the control, using an html engine to construct a new control displayed on the video frame image of the current control to be added, includes: obtaining a drag instruction of the user for the multimedia control, and based on the drag instruction, uploading the multimedia resource corresponding to the multimedia control; using an html engine to construct a playback control corresponding to the multimedia resource on the video frame image of the current control to be added according to the multimedia resource.
4. The method according to any one of claims 1 to 3, characterized in that, The control setting interface further includes a control configuration panel, which obtains a second operation instruction for the new control and generates control configuration information for the new control based on the second operation instruction, including: Obtaining the starting and ending mouse coordinates of dragging the new control to move on the video frame image of the currently to-be-added control; Calculating the dragging coordinates based on the starting and ending mouse coordinates; Setting the position of the new control on the video frame image of the currently to-be-added control according to the dragging coordinates to obtain the position configuration information of the new control, and displaying the dragging coordinates on the control configuration panel.
5. The method according to any one of claims 1 to 3, wherein, The control setting interface further includes a control configuration panel, which obtains a second operation instruction for the new control and generates control configuration information for the new control based on the second operation instruction, including: Determining a rectangular coordinate system established with the center point of the new control itself as the origin on the video frame image of the currently to-be-added control; Obtaining the starting and ending mouse coordinates of rotating the new control based on the rectangular coordinate system; Determining the quadrant where the current mouse coordinate is located in the rectangular coordinate system based on the starting and ending mouse coordinates; Calculating the rotation angle of the new control according to the current mouse coordinate and the quadrant where it is located; Setting the display angle of the new control on the video frame image of the currently to-be-added control based on the rotation angle to obtain the angle configuration information of the new control.
6. The method according to any one of claims 1 to 3, wherein, The control setting interface further includes a control configuration panel, which obtains a second operation instruction for the new control and generates control configuration information for the new control based on the second operation instruction, including: Obtaining style setting parameters for the new control by the user based on the control configuration panel, where the style setting parameters at least include one or more combinations of width, height, length, transparency, line type, fill color, display effect, and border style; Generating style configuration information for the new control based on the style setting parameters.
7. The method according to any one of claims 1 to 3, wherein, The control setting interface further includes a video time window, which includes a timeline, a video track, and a control track. The video track is used to display video frame images constituting the to-be-produced video in the order of the timeline, and the control track is used to set the duration of the new control. The obtaining of the second operation instruction for the new control and the generation of control configuration information for the new control based on the second operation instruction include: Determining the starting time point corresponding to the starting position of the new control on the control track on the timeline to obtain the display time of the new control; Obtaining the time period corresponding to dragging the new control from the starting position to the ending position on the timeline to obtain the duration of the new control; Generating time configuration information based on the display time and the duration of the new control.
8. A video processing device, wherein, The device includes: The first response module is used to display a control setting interface in response to the trigger of a control setting request. The control setting interface at least includes a video time window, an action panel, a control panel, and a video preview drawing board. The video time window includes a timeline and an action track. The video preview drawing board is used to display the video frame image of the current control to be added in the video to be produced. The control panel is used to display controls. The action panel is used to input target object action description information. The second response module is used to construct a new control displayed on the video frame image of the current control to be added by using an html engine in response to the trigger of the first operation instruction of the user for the control. The acquisition module is used to acquire a second operation instruction for the new control and generate control configuration information of the new control based on the second operation instruction. The acquisition module is further used to acquire the target object action description information. The target object action description information at least includes a target object and action description information executed by the target object. The target object is an object in the video to be produced. Determine the position of the video frame image where the target object is located on the timeline, and display the action description information executed by the target object on the action track corresponding to the position. The generation module is used to edit the video frame image where the target object is located based on the action description information executed by the target object to obtain a video frame data packet corresponding to the new video frame image. Update the video data packet of the video to be produced according to the video frame data packet. The generation module is used to generate a video according to the video data packet corresponding to the video to be produced and all the control configuration information.
9. A computer storage medium, characterized in that, the storage medium includes a stored program. When the program runs, it controls the device where the storage medium is located to execute the video processing method according to any one of claims 1 to 7.
10. An electronic device, characterized in that, the electronic device is used to run a program. When the program runs, it executes the video processing method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method and device for adding visual object into video, electronic equipment and storage medium
CN110636382A