CN114140389A - Video detection method and device, electronic equipment and storage medium - Google Patents

Video detection method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114140389A
CN114140389A CN202111277693.5A CN202111277693A CN114140389A CN 114140389 A CN114140389 A CN 114140389A CN 202111277693 A CN202111277693 A CN 202111277693A CN 114140389 A CN114140389 A CN 114140389A
Authority
CN
China
Prior art keywords
video
detected
transition
time
resolution
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111277693.5A
Other languages
Chinese (zh)
Inventor
磯部駿
陶鑫
戴宇荣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202111277693.5A priority Critical patent/CN114140389A/en
Publication of CN114140389A publication Critical patent/CN114140389A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence

Landscapes

  • Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

The present disclosure relates to a video detection method, apparatus, electronic device and storage medium, the method comprising: the method comprises the steps of carrying out resolution reduction processing on a video to be detected to obtain a video with reduced resolution, carrying out pixel value statistics on each video picture included in the video with reduced resolution respectively, determining the number of pixels with the same pixel value and the proportion of the number of the pixels to the total number of the pixels of the video picture, determining the video picture with the proportion larger than a first preset threshold value as a pure color video picture, and determining that the video to be detected comprises a transition video when the video with reduced resolution comprises a plurality of continuous pure color video pictures. Before the characteristic statistics is carried out on the video to be detected, the resolution ratio of the video to be detected is reduced firstly, then the characteristic statistics is carried out on the video with the reduced resolution ratio, so that the data statistics amount is reduced, the data statistics speed is increased, whether the transition video is contained in the video to be detected or not can be detected quickly, and the detection rate is increased.

Description

Video detection method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to video processing technologies, and in particular, to a video detection method and apparatus, an electronic device, and a storage medium.
Background
In the age of information interconnection, video content tends to be shared, that is, a piece of video is shared by creators on multiple platforms, however, some platforms add advertisements to the exported video, which affects video quality and user viewing experience.
In the related art, the advertisement in the video is detected by using the statistical characteristics of the image so as to be able to remove the advertisement in the video, however, for the high-resolution video, the statistic is larger, resulting in a lower detection rate.
Disclosure of Invention
The present disclosure provides a video detection method, apparatus, electronic device, and storage medium, to at least solve the problem of low detection rate in the related art. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a video detection method, including:
performing resolution reduction processing on a video to be detected to obtain a video with reduced resolution;
respectively carrying out pixel value statistics on each video picture included in the video with the reduced resolution, and determining the number of pixels with the same pixel value and the proportion of the number of the pixels to the total number of the pixels of the video picture;
determining the video picture with the proportion larger than a first preset threshold value as a pure color video picture;
and when the video with the reduced resolution comprises a plurality of continuous pure-color video pictures, determining that the video to be detected comprises a transition video.
Optionally, the method further comprises:
determining a video clip consisting of the continuous pure-color video pictures as a transition video in the video to be detected;
and when the transition video is detected to contain a preset identification, removing the preset identification from the transition video, or deleting the transition video.
Optionally, after determining a video segment composed of the consecutive plurality of pure color video pictures as a transition video in the video to be detected, the method further includes:
when the ratio of the time length from the starting time of the transition video to the starting time of the video to be detected to the total time length of the video to be detected is greater than a second preset threshold value, and the time length from the ending time of the transition video to the ending time of the video to be detected is less than a third preset threshold value, determining that the transition video is the trailer of the video to be detected;
and when the ratio of the time length from the end time of the transition video to the end time of the video to be detected to the total time length of the video to be detected is greater than a fourth preset threshold value, and the time length from the start time of the transition video to the start time of the video to be detected is less than a fifth preset threshold value, determining that the transition video is the title of the video to be detected.
Optionally, performing resolution reduction processing on the video to be detected to obtain a video with reduced resolution, including:
intercepting a video clip with preset duration from the video to be detected, wherein the starting time of the video clip is the starting time of the video to be detected, or the ending time of the video clip is the ending time of the video to be detected, or the starting and ending time of the video clip is the appointed starting and ending time;
and performing resolution reduction processing on the video clips with the preset duration to obtain the video clips with reduced resolution.
Optionally, performing resolution reduction processing on the video to be detected to obtain a video with reduced resolution, including:
acquiring each video picture included in the video to be detected;
performing line compression and column compression on each video picture based on an interpolation algorithm of a preset down-sampling multiple to obtain a plurality of compressed video pictures;
and combining the plurality of compressed video pictures to obtain the video with the reduced resolution.
According to a second aspect of the embodiments of the present disclosure, there is provided a video detection apparatus including:
the resolution reducing module is configured to perform resolution reducing processing on the video to be detected to obtain a video with reduced resolution;
the counting module is configured to perform pixel value counting on each video picture included in the video with the reduced resolution respectively, and determine the number of pixels with the same pixel value and the proportion of the number of pixels in the total number of pixels of the video picture;
the first determining module is configured to determine the video picture with the proportion larger than a first preset threshold value as a pure color video picture;
a second determining module configured to determine that the video to be detected includes a transition video when the video with the reduced resolution includes a plurality of continuous pure color video pictures.
Optionally, the apparatus further comprises:
a third determining module, configured to determine a video clip composed of the continuous multiple pure color video pictures as a transition video in the video to be detected;
and the removing or deleting module is configured to remove the preset identification from the transition video or delete the transition video when the transition video is detected to contain the preset identification.
Optionally, after the third determining module, the apparatus further comprises:
a fourth determining module, configured to determine that the transition video is a trailer of the video to be detected when a ratio of a time length from a start time of the transition video to a start time of the video to be detected to a total time length of the video to be detected is greater than a second preset threshold and a time length from an end time of the transition video to an end time of the video to be detected is less than a third preset threshold;
a fifth determining module, configured to determine that the transition video is the title of the video to be detected when a ratio of a time length from the ending time of the transition video to the ending time of the video to be detected to a total time length of the video to be detected is greater than a fourth preset threshold and a time length from the starting time of the transition video to the starting time of the video to be detected is less than a fifth preset threshold.
Optionally, the resolution reduction module includes:
the intercepting submodule is configured to intercept a video segment with a preset time length from the video to be detected, wherein the starting time of the video segment is the starting time of the video to be detected, or the ending time of the video segment is the ending time of the video to be detected, or the starting and ending time of the video segment is the appointed starting and ending time;
and the resolution sub-module is configured to perform resolution reduction processing on the video segment with the preset duration to obtain the video segment with reduced resolution.
Optionally, the resolution reduction module includes:
the acquisition submodule is configured to acquire each video picture included in the video to be detected;
the compression submodule is configured to perform row compression and column compression on each video picture based on an interpolation algorithm of a preset down-sampling multiple to obtain a plurality of compressed video pictures;
and the combining submodule is configured to combine the plurality of compressed video pictures to obtain a video with reduced resolution.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the video detection method of the first aspect.
According to a fourth aspect of embodiments of the present disclosure, there is provided a storage medium having instructions that, when executed by a processor of an electronic device, enable the electronic device to perform the video detection method according to the first aspect.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising readable program code which, when executed by a processor of an electronic device, enables the electronic device to perform the video detection method as described in the first aspect.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
the method comprises the steps of carrying out resolution reduction processing on a video to be detected to obtain a video with reduced resolution, then carrying out pixel value statistics on each video picture included in the video with reduced resolution respectively, determining the number of pixels with the same pixel value and the proportion of the number of the pixels to the total number of the pixels of the video picture, determining the video picture with the proportion larger than a first preset threshold value as a pure-color video picture, and determining that the video to be detected contains a transition video when the video with reduced resolution contains a plurality of continuous pure-color video pictures. Before the characteristic statistics is carried out on the video to be detected, the resolution ratio of the video to be detected is reduced firstly, then the characteristic statistics is carried out on the video with the reduced resolution ratio, so that the data statistics amount is reduced, the data statistics speed is increased, whether the transition video is contained in the video to be detected or not can be detected quickly, and the detection rate is increased.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is a flow diagram illustrating a video detection method in accordance with an exemplary embodiment;
FIG. 2 is a flow diagram illustrating a method of deresolved processing in accordance with one illustrative embodiment;
FIG. 3 is a flow diagram illustrating another method of deresolved processing in accordance with one illustrative embodiment;
FIG. 4 is a block diagram illustrating a video detection device according to an exemplary embodiment;
FIG. 5 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
In the related art, the advertisement in the video is detected by using the statistical characteristics of the image so as to be able to remove the advertisement in the video, however, for the high-resolution video, the statistic is larger, resulting in a lower detection rate.
In order to solve the problem of low detection rate of transition videos in the related art, the statistical result is not affected by the resolution of the videos when the statistical characteristics of the images are used for detecting advertisements in the videos in the related art, and based on the discovery, the application provides a technical concept: before the characteristic statistics is carried out on the video to be detected, the resolution of the video to be detected is reduced, then the characteristic statistics is carried out on the video with the reduced resolution, so that the data statistics is reduced, the data statistics speed is increased, whether the transition video is contained in the video to be detected or not can be detected quickly, and the detection rate is increased.
Fig. 1 is a flow chart illustrating a video detection method according to an exemplary embodiment, as shown in fig. 1, the video detection method comprising the steps of:
in step S11, the video to be detected is subjected to resolution reduction processing, and a video with reduced resolution is obtained.
The scheme can be applied to a server, the server can be a server of a video platform and can also be a server of video processing software, the video to be detected is a video uploaded to the video platform by a user, the server can acquire the video uploaded by the user and detect the video, and before the video is detected, the resolution reduction processing is performed on the video to be detected, so that the video with the reduced resolution is obtained, and the data processing amount can be reduced. The method for performing resolution reduction processing on the video to be detected comprises various methods, including an interpolation method and resolution reduction processing on the video to be detected by using a trained resolution reduction model.
In step S12, pixel value statistics is performed on each video picture included in the video with the reduced resolution, and the number of pixels with the same pixel value and the proportion of the number of pixels to the total number of pixels in the video picture are determined.
After the video with the reduced resolution is obtained, pixel value statistics can be performed on each video picture contained in the video, each video picture is each frame of image, so that the number of pixels with the same pixel value and the proportion of the number of pixels corresponding to the pixel value to the total number of pixels of the video pictures are determined, wherein the pixels with the same pixel value are pixels with the same color, statistics needs to be performed on all the pixels during pixel value statistics, the number of the pixels is reduced in the video with the reduced resolution, but the proportion of the pixels with the same pixel value to the total number of pixels of the video pictures is unchanged, and at the moment, the pixel value statistics can be reduced, so that the data processing speed is increased, and the pixel value statistics speed is increased.
Specifically, the method for performing pixel value statistics on each video picture included in the video with reduced resolution may adopt a black pixel statistics method based on an RGB domain or a statistics method based on a color space, where when the black pixel statistics method based on the RGB domain is adopted, a plurality of pixel value thresholds need to be set to determine the number of black pixels included in each video picture, and then, the ratio of the black pixels to the entire video picture is calculated. When the statistical method based on the color space is used, the video with the reduced resolution needs to be converted into the color space, then the number of pixels of various colors contained in each video picture needs to be counted, and the proportion of the pixels of each color to the total number of pixels contained in the video picture is calculated.
In step S13, the video picture with the ratio larger than the first preset threshold is determined as the pure color video picture.
In the advertisement picture with the identifier, the proportion of the single color is higher, that is, the video picture is a pure color video picture, at this time, a first preset threshold value may be set to determine whether the video picture is the pure color video picture, wherein the first preset threshold value may be set according to an actual situation and an actual pixel value statistical method, for example, if a black pixel statistical method based on an RGB domain is adopted, when the proportion of black pixels in the entire video picture may be greater than 20%, it is determined that the video picture is the pure color video picture, that is, at this time, the first preset threshold value is 20%; if a statistical method based on a color space is used, when the proportion of the pixels of each color to the total number of the pixels included in the video picture is greater than 75%, it is determined that the video picture is a pure color video picture, that is, at this time, the first preset threshold is 75%.
In step S14, when the video with reduced resolution includes a plurality of continuous solid-color video pictures, it is determined that the video to be detected includes transition video.
When the video picture is a pure color video picture, the video picture may be an advertisement picture, at this time, it is necessary to determine whether the video to be detected includes an advertisement picture according to the previous and subsequent multi-frame video pictures, specifically, when the video with the reduced resolution includes a plurality of continuous pure color video pictures, it is determined that the video to be detected includes a transition video, that is, an advertisement video, wherein a preset threshold value of the continuous pure color video pictures may be set, and when the number of the video pictures of the continuous pure color video pictures is greater than the preset threshold value, it may be determined that the video to be detected includes the transition video, wherein the preset threshold value of the continuous pure color video pictures may be set according to an actual situation, and is not specifically limited herein.
The video detection method provided by the exemplary embodiment obtains a video with a reduced resolution by performing resolution reduction processing on a video to be detected, then performs pixel value statistics on each video picture included in the video with the reduced resolution, determines the number of pixels with the same pixel value and the proportion of the number of pixels to the total number of pixels of the video picture, determines a video picture with the proportion larger than a first preset threshold as a pure color video picture, and determines that the video to be detected includes a transition video when the video with the reduced resolution includes a plurality of continuous pure color video pictures. Before the characteristic statistics is carried out on the video to be detected, the resolution ratio of the video to be detected is reduced firstly, then the characteristic statistics is carried out on the video with the reduced resolution ratio, so that the data statistics amount is reduced, the data statistics speed is increased, whether the transition video is contained in the video to be detected or not can be detected quickly, and the detection rate is increased.
On the basis of the technical scheme, after the video to be detected is determined to contain the transition video, namely when the video to be detected contains the advertisement video, the video to be detected can be further processed, the platform identification in the transition video is removed, so that the watching experience of the user is prevented from being influenced by the advertisement identification, or the transition video is directly removed, so that the watching experience of the user is prevented from being influenced by the advertisement video, and the specific method comprises the following steps:
determining a video clip consisting of the continuous pure-color video pictures as a transition video in the video to be detected;
and when the transition video is detected to contain a preset identification, removing the preset identification from the transition video, or deleting the transition video.
The method comprises the steps of determining a video clip formed by all continuous pure-color video pictures as a transition video to be detected in a video to be detected, detecting whether a preset mark exists in the transition video, wherein the preset mark can contain advertisement marks of all video platforms, and removing the preset mark from the transition video when the transition video is detected to contain the preset mark so as to avoid the advertisement marks from influencing the watching experience of a user, or directly deleting the transition video, so that the effect of removing the advertisement marks and the advertisement of the platforms is achieved, and the video watching experience of the user is improved.
On the basis of the technical scheme, since it is time-consuming to remove the advertisement mark, and the advertisement mark of the platform are usually arranged at the head and the end of the film, it can be directly judged whether the transition video is the head or the end of the film, so as to directly remove the head or the end of the film, and accelerate the video processing efficiency, specifically, after determining the video clip formed by the continuous plurality of pure color video pictures as the transition video in the video to be detected, the method further comprises the following steps:
when the ratio of the time length from the starting time of the transition video to the starting time of the video to be detected to the total time length of the video to be detected is greater than a second preset threshold value, and the time length from the ending time of the transition video to the ending time of the video to be detected is less than a third preset threshold value, determining that the transition video is the trailer of the video to be detected;
and when the ratio of the time length from the end time of the transition video to the end time of the video to be detected to the total time length of the video to be detected is greater than a fourth preset threshold value, and the time length from the start time of the transition video to the start time of the video to be detected is less than a fifth preset threshold value, determining that the transition video is the title of the video to be detected.
The method for determining the film tail comprises the following steps: firstly, acquiring the starting time and the ending time of a transition video, the total time length of the video to be detected, the starting time and the ending time, then calculating the time length from the starting time of the transition video to the starting time of the video to be detected, for example, the starting time of the transition video is 70 minutes and 25 seconds, the starting time of the video to be detected is 0 minutes and 0 seconds, then the time length from the starting time of the transition video to the starting time of the video to be detected is 4225 seconds, then calculating the ratio of the time length from the starting time of the transition video to the starting time of the video to be detected to the total time length of the video to be detected, for example, if the total time length of the electrical measurement video is 73 minutes, namely 4380 seconds, then the ratio of the time length from the starting time of the transition video to the starting time of the video to be detected to the total time length of the video to be detected is 0.96, wherein a second preset threshold is used for judging whether the transition video is a slice tail or not, the second preset threshold is a minimum value of a ratio of a time length from the start time of the transition video to the start time of the video to be detected to a total time length of the video to be detected when the transition video is the end of the video, specifically, the second preset threshold may be 0.7, and the second preset threshold may be set according to an actual situation, which is not specifically limited herein. Then, the time length from the end time of the transition video to the end time of the video to be detected is calculated, for example, the end time of the transition video is 72 minutes and 25 seconds, and the end time of the video to be detected is 73 minutes, then, the time length from the end time of the transition video to the end time of the video to be detected is 35 seconds, the third preset threshold is used for judging whether the transition video is a trailer, the third preset threshold is the maximum value of the time length from the end time of the transition video to the end time of the video to be detected when the transition video is the trailer, specifically, the third preset threshold may be 40 seconds, and the third preset threshold may be set according to an actual situation, which is not specifically limited herein. As in the above example, 0.96 is greater than 0.7 and 35 seconds is less than 40 seconds, and at this time, the transition video can be determined as the end of the video to be detected, and the end can be directly removed.
The title determining method comprises the following steps: calculating the time length from the end time of the transition video to the end time of the video to be tested, for example, the end time of the transition video is 4 minutes 25 seconds, and the end time of the video to be tested is 73 minutes 0 seconds, then the time length from the end time of the transition video to the end time of the video to be tested is 4115 seconds, and then calculating the ratio of the time length from the end time of the transition video to the end time of the video to be tested to the total time length of the video to be tested, for example, if the total time length of the electrically tested video is 73 minutes, namely 4380 seconds, then the ratio of the time length from the end time of the transition video to the end time of the video to be tested to the total time length of the video to be tested is 0.94, wherein the fourth preset threshold is used for judging whether the transition video is a slice header, the fourth preset threshold is the minimum value of the ratio of the time length from the end time of the transition video to the end time of the video to be tested to the total time of the video to be tested when the transition video to be tested is a slice header, specifically, the fourth preset threshold may be 0.7, and the fourth preset threshold may be set according to an actual situation, and is not specifically limited herein. Then, the time length from the start time of the transition video to the start time of the video to be detected is calculated, for example, the start time of the transition video is 0 min 25 s, and the start time of the video to be detected is 0 min 0 s, then, the time length from the start time of the transition video to the start time of the video to be detected is 25 s, the fifth preset threshold is used to determine whether the transition video is a slice header, the fifth preset threshold is the maximum value of the time length from the start time of the transition video to the start time of the video to be detected when the transition video is a slice header, specifically, the fifth preset threshold may be 40 s, and the fifth preset threshold may be set according to an actual situation, which is not specifically limited herein. As in the above example, 0.94 is greater than 0.7 and 25 seconds is less than 40 seconds, and at this time, the transition video can be determined as the leader of the video to be detected, and the leader can be directly removed.
Fig. 2 is a flowchart illustrating a resolution reduction processing method according to an exemplary embodiment, as shown in fig. 2, based on the foregoing technical solution, since the video length of the video to be detected may be relatively long, at this time, if the resolution reduction processing is directly performed on the video to be detected, the data processing amount is relatively large, at this time, a part of the video segment may be cut out from the video to be detected according to the detection target to perform the resolution reduction processing, and the specific method is as follows:
in step S21, a video segment with a preset duration is captured from the video to be detected, where the start time of the video segment is the start time of the video to be detected, or the end time of the video segment is the end time of the video to be detected, or the start-stop time of the video segment is a specified start-stop time;
in step S22, the resolution of the video segment with the preset duration is reduced, so as to obtain a video segment with reduced resolution.
The method includes the steps that a video clip with preset duration can be intercepted from a video to be detected according to a detection target, wherein the preset duration can be determined according to the existing advertisement duration, the preset duration is longer than the existing maximum advertisement duration, and for example, if the existing maximum advertisement duration is 3 minutes, the preset duration can be 4 minutes. If the detected target is the leader, the start time of the intercepted video clip is the start time of the video to be detected, namely, the video clip 4 minutes before the video to be detected is intercepted, and if the detected target is the trailer, the end time of the intercepted video clip is the end time of the video to be detected, namely, the last 4 minutes video clip of the video to be detected is intercepted, or the detected target is the middle part of the video to be detected, at this moment, the video clip with the specified start-stop time in the video to be detected can be intercepted. And after the video clip with the preset duration is intercepted, the resolution reduction processing can be carried out on the video clip with the preset duration to obtain the video clip with the reduced resolution.
Fig. 3 is a flowchart illustrating another resolution reduction processing method according to an exemplary embodiment, as shown in fig. 3, on the basis of the foregoing technical solution, resolution reduction processing may be directly performed on a video to be detected, or resolution reduction processing may be performed on a video segment with a preset duration captured in the video to be detected, where the specific method is as follows:
in step S31, acquiring each video picture included in the video to be detected;
in step S32, based on an interpolation algorithm of a preset downsampling multiple, performing line compression and column compression on each video picture to obtain a plurality of compressed video pictures;
in step S33, the plurality of compressed video pictures are combined to obtain a video with a reduced resolution.
If the resolution reduction processing is directly performed on the video to be detected, each video picture included in the video to be detected is directly acquired, if the resolution reduction processing is performed on the video segment with the preset duration intercepted from the video to be detected, each video picture included in the video segment with the preset duration intercepted is acquired, then, each video picture is subjected to line compression and column compression based on an interpolation algorithm with a preset down-sampling multiple, wherein the interpolation algorithm can be bicubic interpolation or bilinear interpolation, the preset down-sampling multiple can be set according to actual conditions, for example, the preset down-sampling multiple is 10, then, the width and the height of the compressed video picture can be changed into original 0.1, for example, the size of the input video is [ H, W, 3], wherein H and W are respectively the width and the height of the video picture, and 3 is three channels. Through interpolation down-sampling operation, the size of a video picture can be changed into [0.1 xH, 0.1 xW, 3], wherein line compression and column compression are compression on the width and the height of the video picture, so that a plurality of compressed video pictures can be obtained, and then the plurality of compressed video pictures are combined to obtain a video with reduced resolution. The method reduces the resolution of the input video to be detected by an interpolation method, and then performs characteristic statistics under a small resolution, so that the detection speed can be greatly accelerated while the precision is ensured.
Fig. 4 is a block diagram illustrating a video detection apparatus according to an example embodiment. Referring to fig. 4, the apparatus includes a resolution reduction module 41, a statistics module 42, a first determination module 43, and a second determination module 44.
The resolution reducing module 41 is configured to perform resolution reduction processing on the video to be detected, so as to obtain a video with reduced resolution;
the counting module 42 is configured to perform pixel value counting on each video picture included in the video with the reduced resolution, and determine the number of pixels with the same pixel value and the proportion of the number of pixels in the total number of pixels in the video picture;
the first determining module 43 is configured to determine a video picture with a proportion greater than a first preset threshold as a pure color video picture;
the second determining module 44 is configured to determine that the video to be detected includes transition video when the reduced-resolution video includes a plurality of continuous solid-color video pictures.
Optionally, the apparatus further comprises:
a third determining module, configured to determine a video clip composed of the continuous multiple pure color video pictures as a transition video in the video to be detected;
and the removing or deleting module is configured to remove the preset identification from the transition video or delete the transition video when the transition video is detected to contain the preset identification.
Optionally, after the third determining module, the apparatus further comprises:
a fourth determining module, configured to determine that the transition video is a trailer of the video to be detected when a ratio of a time length from a start time of the transition video to a start time of the video to be detected to a total time length of the video to be detected is greater than a second preset threshold and a time length from an end time of the transition video to an end time of the video to be detected is less than a third preset threshold;
a fifth determining module, configured to determine that the transition video is the title of the video to be detected when a ratio of a time length from the ending time of the transition video to the ending time of the video to be detected to a total time length of the video to be detected is greater than a fourth preset threshold and a time length from the starting time of the transition video to the starting time of the video to be detected is less than a fifth preset threshold.
Optionally, the resolution reduction module includes:
the intercepting submodule is configured to intercept a video segment with a preset time length from the video to be detected, wherein the starting time of the video segment is the starting time of the video to be detected, or the ending time of the video segment is the ending time of the video to be detected, or the starting and ending time of the video segment is the appointed starting and ending time;
and the resolution sub-module is configured to perform resolution reduction processing on the video segment with the preset duration to obtain the video segment with reduced resolution.
Optionally, the resolution reduction module includes:
the acquisition submodule is configured to acquire each video picture included in the video to be detected;
the compression submodule is configured to perform row compression and column compression on each video picture based on an interpolation algorithm of a preset down-sampling multiple to obtain a plurality of compressed video pictures;
and the combining submodule is configured to combine the plurality of compressed video pictures to obtain a video with reduced resolution.
The video detection device provided in this exemplary embodiment obtains a video with a reduced resolution by performing resolution reduction processing on a video to be detected, then performs pixel value statistics on each video picture included in the video with the reduced resolution, determines the number of pixels with the same pixel value and the proportion of the number of pixels to the total number of pixels in the video picture, determines a video picture with a proportion larger than a first preset threshold as a pure color video picture, and determines that the video to be detected includes a transition video when the video with the reduced resolution includes a plurality of continuous pure color video pictures. Before the characteristic statistics is carried out on the video to be detected, the resolution ratio of the video to be detected is reduced firstly, then the characteristic statistics is carried out on the video with the reduced resolution ratio, so that the data statistics amount is reduced, the data statistics speed is increased, whether the transition video is contained in the video to be detected or not can be detected quickly, and the detection rate is increased.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
FIG. 5 is a block diagram illustrating an electronic device in accordance with an example embodiment. For example, the electronic device 500 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 5, electronic device 500 may include one or more of the following components: a processing component 502, a memory 504, a power component 506, a multimedia component 508, an audio component 510, an input/output (I/O) interface 512, a sensor component 514, and a communication component 516.
The processing component 502 generally controls overall operation of the electronic device 500, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 502 may include one or more processors 520 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 502 can include one or more modules that facilitate interaction between the processing component 502 and other components. For example, the processing component 502 can include a multimedia module to facilitate interaction between the multimedia component 508 and the processing component 502.
The memory 504 is configured to store various types of data to support operations at the electronic device 500. Examples of such data include instructions for any application or method operating on the electronic device 500, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 504 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 506 provides power to the various components of the electronic device 500. The power components 506 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the electronic device 500.
The multimedia component 508 includes a screen that provides an output interface between the electronic device 500 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 508 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 500 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 510 is configured to output and/or input audio signals. For example, the audio component 510 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 500 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 504 or transmitted via the communication component 516. In some embodiments, audio component 510 further includes a speaker for outputting audio signals.
The I/O interface 512 provides an interface between the processing component 502 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 514 includes one or more sensors for providing various aspects of status assessment for the electronic device 500. For example, the sensor assembly 514 may detect an open/closed state of the electronic device 500, the relative positioning of components, such as a display and keypad of the electronic device 500, the sensor assembly 514 may detect a change in the position of the electronic device 500 or a component of the electronic device 500, the presence or absence of user contact with the electronic device 500, orientation or acceleration/deceleration of the electronic device 500, and a change in the temperature of the electronic device 500. The sensor assembly 514 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 514 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 514 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 516 is configured to facilitate wired or wireless communication between the electronic device 500 and other devices. The electronic device 500 may access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 5G, or 5G), or a combination thereof. In an exemplary embodiment, the communication component 516 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 516 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 500 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described video detection method.
In an exemplary embodiment, a storage medium comprising instructions, such as the memory 504 comprising instructions, executable by the processor 520 of the electronic device 500 to perform the above-described method of personnel rights management is also provided. Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product is also provided, which comprises readable program code executable by the processor 520 of the electronic device 500 to perform the above-mentioned method of personnel rights management. Alternatively, the program code may be stored in a storage medium of the electronic device 500, which may be a non-transitory computer-readable storage medium, for example, ROM, Random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (10)

1. A method for video detection, the method comprising:
performing resolution reduction processing on a video to be detected to obtain a video with reduced resolution;
respectively carrying out pixel value statistics on each video picture included in the video with the reduced resolution, and determining the number of pixels with the same pixel value and the proportion of the number of the pixels to the total number of the pixels of the video picture;
determining the video picture with the proportion larger than a first preset threshold value as a pure color video picture;
and when the video with the reduced resolution comprises a plurality of continuous pure-color video pictures, determining that the video to be detected comprises a transition video.
2. The method of claim 1, further comprising:
determining a video clip consisting of the continuous pure-color video pictures as a transition video in the video to be detected;
and when the transition video is detected to contain a preset identification, removing the preset identification from the transition video, or deleting the transition video.
3. The method according to claim 2, further comprising, after determining the video segment composed of the consecutive plurality of pure color video pictures as a transition video in the video to be detected:
when the ratio of the time length from the starting time of the transition video to the starting time of the video to be detected to the total time length of the video to be detected is greater than a second preset threshold value, and the time length from the ending time of the transition video to the ending time of the video to be detected is less than a third preset threshold value, determining that the transition video is the trailer of the video to be detected;
and when the ratio of the time length from the end time of the transition video to the end time of the video to be detected to the total time length of the video to be detected is greater than a fourth preset threshold value, and the time length from the start time of the transition video to the start time of the video to be detected is less than a fifth preset threshold value, determining that the transition video is the title of the video to be detected.
4. The method of claim 1, wherein performing resolution reduction on the video to be detected to obtain a video with reduced resolution comprises:
intercepting a video clip with preset duration from the video to be detected, wherein the starting time of the video clip is the starting time of the video to be detected, or the ending time of the video clip is the ending time of the video to be detected, or the starting and ending time of the video clip is the appointed starting and ending time;
and performing resolution reduction processing on the video clips with the preset duration to obtain the video clips with reduced resolution.
5. The method according to claim 1 or 4, wherein performing resolution reduction processing on the video to be detected to obtain a video with reduced resolution comprises:
acquiring each video picture included in the video to be detected;
performing line compression and column compression on each video picture based on an interpolation algorithm of a preset down-sampling multiple to obtain a plurality of compressed video pictures;
and combining the plurality of compressed video pictures to obtain the video with the reduced resolution.
6. A video detection apparatus, characterized in that the apparatus comprises:
the resolution reducing module is configured to perform resolution reducing processing on the video to be detected to obtain a video with reduced resolution;
the counting module is configured to perform pixel value counting on each video picture included in the video with the reduced resolution respectively, and determine the number of pixels with the same pixel value and the proportion of the number of pixels in the total number of pixels of the video picture;
the first determining module is configured to determine the video picture with the proportion larger than a first preset threshold value as a pure color video picture;
a second determining module configured to determine that the video to be detected includes a transition video when the video with the reduced resolution includes a plurality of continuous pure color video pictures.
7. The apparatus of claim 6, further comprising:
a third determining module, configured to determine a video clip composed of the continuous multiple pure color video pictures as a transition video in the video to be detected;
and the removing or deleting module is configured to remove the preset identification from the transition video or delete the transition video when the transition video is detected to contain the preset identification.
8. The apparatus of claim 7, wherein after the third determining module, the apparatus further comprises:
a fourth determining module, configured to determine that the transition video is a trailer of the video to be detected when a ratio of a time length from a start time of the transition video to a start time of the video to be detected to a total time length of the video to be detected is greater than a second preset threshold and a time length from an end time of the transition video to an end time of the video to be detected is less than a third preset threshold;
a fifth determining module, configured to determine that the transition video is the title of the video to be detected when a ratio of a time length from the ending time of the transition video to the ending time of the video to be detected to a total time length of the video to be detected is greater than a fourth preset threshold and a time length from the starting time of the transition video to the starting time of the video to be detected is less than a fifth preset threshold.
9. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the video detection method of any of claims 1 to 5.
10. A storage medium having instructions that, when executed by a processor of an electronic device, enable the electronic device to perform the video detection method of any of claims 1 to 5.
CN202111277693.5A 2021-10-29 2021-10-29 Video detection method and device, electronic equipment and storage medium Pending CN114140389A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111277693.5A CN114140389A (en) 2021-10-29 2021-10-29 Video detection method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111277693.5A CN114140389A (en) 2021-10-29 2021-10-29 Video detection method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114140389A true CN114140389A (en) 2022-03-04

Family

ID=80391994

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111277693.5A Pending CN114140389A (en) 2021-10-29 2021-10-29 Video detection method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114140389A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116017036A (en) * 2022-12-27 2023-04-25 北京奇艺世纪科技有限公司 Audio and video analysis method and device, computer equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116017036A (en) * 2022-12-27 2023-04-25 北京奇艺世纪科技有限公司 Audio and video analysis method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN106911961B (en) Multimedia data playing method and device
CN106657780B (en) Image preview method and device
CN106534951B (en) Video segmentation method and device
CN110677734A (en) Video synthesis method and device, electronic equipment and storage medium
CN114500821B (en) Photographing method and device, terminal and storage medium
CN112188091B (en) Face information identification method and device, electronic equipment and storage medium
CN113920465A (en) Method and device for identifying film trailer, electronic equipment and storage medium
CN114025105A (en) Video processing method and device, electronic equipment and storage medium
CN114140389A (en) Video detection method and device, electronic equipment and storage medium
CN107105311B (en) Live broadcasting method and device
CN112261453A (en) Method, device and storage medium for transmitting subtitle splicing map
CN111612875A (en) Dynamic image generation method and device, electronic equipment and storage medium
CN112866612B (en) Frame insertion method, device, terminal and computer readable storage medium
CN112087570B (en) Image shooting method and device, electronic equipment and readable storage medium
CN114186154A (en) Page processing method and device, electronic equipment and storage medium
CN108833994B (en) Advertisement playing method and device
CN108769780B (en) Advertisement playing method and device
CN108874482B (en) Image processing method and device
CN112950503A (en) Training sample generation method and device and truth value image generation method and device
CN112036241A (en) Image processing method and device, electronic equipment and storage medium
CN111275649A (en) Image processing method, image processing device, electronic equipment and storage medium
CN111263190A (en) Video processing method and device, server and storage medium
CN111538447A (en) Information display method, device, equipment and storage medium
CN113315903A (en) Image acquisition method and device, electronic equipment and storage medium
CN113470571A (en) Brightness compensation method and device, electronic equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination