Disclosure of Invention
The embodiment of the invention provides a video shooting error correction method and a related product, which can realize error correction of places where video shooting errors occur and have the advantage of improving user experience.
In a first aspect, an embodiment of the present invention provides a video shooting error correction method, where the method includes the following steps:
the mobile terminal receives a short video shooting request of a user and executes short video shooting to obtain a first video file;
the mobile terminal extracts background music of the first video file and determines a first time period and a second time period corresponding to the same paragraph in the background music;
the mobile terminal compares a second video in a first time period and a third video in a second time period in the first video file to determine different parts of the second video and the third video, and performs error correction processing on the different parts of the first video file to obtain an error-corrected fourth video file.
Optionally, the same paragraph specifically includes:
the same parts of the lyrics of the music file.
Optionally, the comparing the second video with the third video to determine different parts of the second video and the third video specifically includes:
dividing the second video into n parts according to each word of the lyrics of the same paragraph, dividing the third video into n parts according to each word of the lyrics of the same paragraph, comparing the video frames of the two parts of the same word to determine whether the video frames are consistent, if so, determining the video frames are the same, and if not, determining the video frames are not the same.
Optionally, the obtaining of the fourth video file after error correction by performing error correction processing on the different parts of the first video file specifically includes:
deleting videos of the time periods corresponding to the different parts of the first video file to obtain an error-corrected fourth video file;
or selecting the videos of the first time period and the second time period of the first video file as the second video or the third video.
In a second aspect, a terminal is provided, which includes: a camera, a processor, a memory and a display screen,
the camera is used for executing short video shooting to obtain a first video file when the display screen acquires a short video shooting request of a user;
the processor is used for extracting background music of the first video file and determining a first time period and a second time period corresponding to the same paragraph in the background music;
the processor is further configured to compare a second video in a first time period and a third video in a second time period in the first video file with the third video to determine different portions of the second video and the third video, and perform error correction processing on the different portions of the first video file to obtain an error-corrected fourth video file.
Optionally, the same paragraph specifically includes: the same parts of the lyrics of the music file.
Optionally, the processor is specifically configured to divide the second video into n portions according to each word of the lyrics of the same paragraph, divide the third video into n portions according to each word of the lyrics of the same paragraph, compare video frames of the two portions of the same word to determine whether the video frames are consistent, if so, determine that the video frames are the same portion, if not, determine that the video frames are not the same portion.
Optionally, the processor is specifically configured to delete the videos of the different portions of the first video file in the time period to obtain an error-corrected fourth video file; or selecting the videos of the first time period and the second time period of the first video file as the second video or the third video.
Optionally, the terminal is: tablet computers or smart phones.
In a third aspect, a computer-readable storage medium is provided, which stores a program for electronic data exchange, wherein the program causes a terminal to execute the method provided in the first aspect.
The embodiment of the invention has the following beneficial effects:
it can be seen that, after the shot first video file is determined, the second video and the third video of the same section in the first video file are compared to determine different parts, and then the different parts are corrected, so that the error correction processing on the video can be realized.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," "third," and "fourth," etc. in the description and claims of the invention and in the accompanying drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, result, or characteristic described in connection with the embodiment can be included in at least one embodiment of the invention. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
Referring to fig. 1, fig. 1 provides a mobile terminal, which may specifically be a smart phone, where the smart phone may be a mobile terminal of an IOS system, an android system, and the mobile terminal may specifically include: the device comprises a processor, a memory, a camera and a display screen, wherein the components can be connected through a bus or in other ways, and the application is not limited to the specific way of the connection.
Referring to fig. 2, fig. 2 provides a video photographing error correction method, which is shown in fig. 2 and is performed by the mobile terminal shown in fig. 1, and which includes the steps of:
step S201, a mobile terminal receives a short video shooting request of a user and executes short video shooting to obtain a first video file;
step S202, the mobile terminal extracts background music of the first video file and determines a first time period and a second time period corresponding to the same paragraph in the background music;
the background music may be regular music, and the same section, i.e. the section with the same lyrics inside the music, such as "learning cat shout" we learn cat shout together, and meow "belongs to the same section, and has the same section for most of music.
Step S203, comparing the second video and the third video in the first video file of the mobile terminal in the first time period and the third video in the second time period to determine different parts of the second video and the third video, and performing error correction processing on the different parts of the first video file to obtain an error-corrected fourth video file.
According to the technical scheme, after the shot first video file is determined, the second video and the third video of the same section in the first video file are compared to determine different parts, and then the different parts are corrected, so that the error correction processing on the video can be realized.
The principle of the application is that for shooting videos, the videos with the same action can be directly corrected on the basis that the videos with the same action are provided, and the action with the same paragraph is the same through analysis of big data, so that different parts are determined by comparing the videos corresponding to two same paragraphs, and then the fourth video file after error correction can be obtained through error correction processing of the different parts, so that the experience degree of a user on video processing is improved, and shooting is not needed again.
The determining of the different portions of the second video and the third video by comparing the second video and the third video may specifically include:
dividing the second video into n parts (n is the lyric word number or letter number of the same paragraph) according to each word of the lyric of the same paragraph, dividing the third video into n parts according to each word of the lyric of the same paragraph, comparing the video frames of the two parts of the same word to determine whether the video frames are consistent, if so, determining the video frames are the same part, if not, determining the video frames are different parts.
The above comparison of the video frames of two parts of the same word to determine whether the video frames are consistent can be determined by the existing video comparison method.
Optionally, the performing error correction processing on the different parts of the first video file to obtain an error-corrected fourth video file may specifically include:
deleting videos of the time periods corresponding to the different parts of the first video file to obtain an error-corrected fourth video file;
or selecting the videos of the first time period and the second time period of the first video file as the second video or the third video.
The first way is to delete different parts directly, so that it is not necessary to determine which different parts belong to the wrong place, which has the disadvantage that the video effect is affected, and the second way is to select the same video in the same time period, because the video action is the same for the same time period, this selection will improve the video effect.
The manner of selecting the second video or the third video may specifically be that the fluency of the second video and the third video is determined, and the second video with higher fluency is selected to replace the third video with lower fluency.
The method for determining fluency may specifically be that adjacent frames of the second video are compared to determine whether the adjacent frames are the first number of consistent image frames, and adjacent frames of the third video are compared to determine whether the adjacent frames are the second number of consistent image frames, and if the first number is smaller than the second number, it is determined that the fluency of the second video is greater than that of the third video.
The principle is based on the principle that for video shooting, the more consecutive the motion is, the smaller the probability that the adjacent frames are consistent, whereas if there is an error, the person has a certain pause at the time of the erroneous motion, so that the same adjacent frames occur, and the more such cases, the poorer the fluency is.
Optionally, the method may further include:
and carrying out flattening processing on the video frames with double chin in the fourth video file.
The above-mentioned flattening processing of the video frame with double chin may specifically include:
extracting a p video frame of a fourth video file, obtaining a p video frame line route, determining a region with 2 adjacent line lines and the distance between the 2 line lines being less than a set distance as a region to be determined, constructing an equidistant line of lambda line routes for the region to be determined, extracting pictures between the equidistant lines, comparing and determining whether the two lines are consistent, if so, determining that the two lines are consistent (if the two lines are non-double chin regions, the pictures are consistent, the picture comparison method can be realized through the existing comparison method), determining that the region to be determined is non-double chin regions, if not, determining that the two lines are non-double chin regions (if the two lines are non-uniform in distribution of meat, pictures in each region are different), determining that the region to be determined is double chin regions, constructing an upper equidistant line in the upper region of the double chin regions, extracting a gamma picture between the upper equidistant line and the upper line, and replacing the gamma picture with the gamma line after extending downwards by lambda-1 (namely, each equidistant line is replaced by the gamma picture), replacing the gamma picture with the gamma picture in the gamma line region to And (6) processing.
The obtaining of the pth video frame texture line may specifically include:
marking the RGB values of all pixel points of the pth video frame into different colors, determining different color line segments in the same color, if the number of the different color line segments in the same color exceeds 2, obtaining the distance between the different color line segments, and if the distance is smaller than a set distance threshold, determining the different color line segments as grain lines.
For the line path, it divides the skin into a plurality of areas, the RGB value of the areas is the same because it is the skin, then when marking with color, the color of the skin is the same color, but for the line path, because of its folding and light, the line path is different from the RGB value of the skin, because of marking different color, the color of the line path is inconsistent with the color of the skin area, and it is a line segment, in addition, the line path with double chin has at least 2 or more, therefore the number is also more than 2. The grain lines can be distinguished by this method.
Referring to fig. 3, fig. 3 provides a terminal including: a camera, a processor and a display screen,
the camera is used for executing short video shooting to obtain a first video file when the display screen acquires a short video shooting request of a user;
the processor is used for extracting background music of the first video file and determining a first time period and a second time period corresponding to the same paragraph in the background music;
the processor is further configured to compare a second video in a first time period and a third video in a second time period in the first video file with the third video to determine different portions of the second video and the third video, and perform error correction processing on the different portions of the first video file to obtain an error-corrected fourth video file.
Embodiments of the present invention also provide a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program causes a computer to execute part or all of the steps of any one of the video shooting error correction methods as recited in the above method embodiments.
Embodiments of the present invention also provide a computer program product comprising a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any one of the video capture error correction methods as recited in the above method embodiments.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are exemplary embodiments and that the acts and modules illustrated are not necessarily required to practice the invention.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of some interfaces, devices or units, and may be an electric or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in the form of hardware, or may be implemented in the form of a software program module.
The integrated units, if implemented in the form of software program modules and sold or used as stand-alone products, may be stored in a computer readable memory. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a memory and includes several instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned memory comprises: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable memory, which may include: flash Memory disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The above embodiments of the present invention are described in detail, and the principle and the implementation of the present invention are explained by applying specific embodiments, and the above description of the embodiments is only used to help understanding the method of the present invention and the core idea thereof; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.