Video detection method and device, electronic equipment and storage medium
By downscaling and pixel value statistics of high-resolution videos, advertisements can be quickly detected and removed, solving the problem of low detection rate for high-resolution videos and improving user experience.
Patent Information
- Application Number
- CN202111277693.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-29
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2041-10-29
AI Technical Summary
In existing technologies, the ad detection rate for high-resolution videos is relatively low, resulting in a poor viewing experience for users.
By reducing the resolution of the video to be tested, the pixel values of the video frames are counted after the resolution is reduced to identify solid color video frames. The presence of transition videos is then determined based on multiple consecutive solid color video frames, and the advertising logos are further removed.
It improves the speed of video detection, reduces the amount of data processing, and enhances the user viewing experience.
Smart Images

Figure CN114140389B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the video processing technology, and particularly relates to a video detection method and device, electronic equipment and storage medium. BACKGROUND
[0002] In the information interconnection era, video content is also shared, that is, a video will be shared by the creator on multiple platforms, however, some platforms will add advertisements to the exported video, which affects the video quality and user viewing experience.
[0003] In the related art, the statistical characteristics of the image are used to detect the advertisements in the video, so as to remove the advertisements in the video, however, for high-resolution videos, the statistical quantity is large, which leads to a low detection rate. SUMMARY
[0004] The present disclosure provides a video detection method, device, electronic equipment and storage medium to at least solve the problem of low detection rate in the related art. The technical solutions of the present disclosure are as follows:
[0005] According to a first aspect of the embodiments of the present disclosure, a video detection method is provided, comprising:
[0006] performing resolution reduction processing on a to-be-detected video to obtain a video with reduced resolution;
[0007] respectively performing pixel value statistics on each video frame included in the video with reduced resolution to determine the number of pixel points with the same pixel value and the proportion of the number of pixel points in the total number of pixel points of the video frame;
[0008] determining a video frame with a proportion greater than a first preset threshold as a pure color video frame;
[0009] when the video with reduced resolution contains a plurality of continuous pure color video frames, determining that the to-be-detected video contains a transition video.
[0010] Optionally, the method further comprises:
[0011] determining a video segment composed of the plurality of continuous pure color video frames as the transition video in the to-be-detected video;
[0012] when it is detected that the transition video contains a preset identifier, removing the preset identifier from the transition video, or deleting the transition video.
[0013] Optionally, after determining the video segment composed of the plurality of continuous pure color video frames as the transition video in the to-be-detected video, the method further comprises:
[0014] when the ratio of the time length from the start time of the transition video to the start time of the to-be-detected video to the total time length of the to-be-detected video is greater than a second preset threshold, and the time length from the end time of the transition video to the end time of the to-be-detected video is less than a third preset threshold, the transition video is determined to be a trailer of the to-be-detected video;
[0015] when the ratio of the time length from the end time of the transition video to the end time of the to-be-detected video to the total time length of the to-be-detected video is greater than a fourth preset threshold, and the time length from the start time of the transition video to the start time of the to-be-detected video is less than a fifth preset threshold, the transition video is determined to be a trailer of the to-be-detected video.
[0016] Optionally, the to-be-detected video is subjected to resolution reduction processing to obtain a video with reduced resolution.
[0017] A video segment with a preset time length is intercepted from the to-be-detected video, and a start time of the video segment is a start time of the to-be-detected video, or an end time of the video segment is an end time of the to-be-detected video, or start and end times of the video segment are specified start and end times.
[0018] The video segment with the preset time length is subjected to resolution reduction processing to obtain a video segment with reduced resolution.
[0019] Optionally, the to-be-detected video is subjected to resolution reduction processing to obtain a video with reduced resolution.
[0020] Each video frame included in the to-be-detected video is obtained.
[0021] Each video frame is subjected to row compression and column compression based on an interpolation algorithm of a preset downsampling multiple to obtain a plurality of compressed video frames.
[0022] The plurality of compressed video frames are combined to obtain a video with reduced resolution.
[0023] According to a second aspect of the embodiments of the present disclosure, a video detection device is provided, which includes:
[0024] A resolution reduction module is configured to subject a to-be-detected video to resolution reduction processing to obtain a video with reduced resolution.
[0025] A statistics module is configured to respectively perform pixel value statistics on each video frame included in the video with reduced resolution, to determine a number of pixel points with the same pixel value and a proportion of the number of pixel points in a total number of pixel points of the video frame.
[0026] The first determining module is configured to determine a video picture with a proportion greater than a first preset threshold as a pure color video picture.
[0027] The second determining module is configured to determine that the video to be detected contains a transition video when the video with reduced resolution contains continuous multiple pure color video pictures.
[0028] Optionally, the device further comprises:
[0029] The third determining module is configured to determine a video segment composed of the continuous multiple pure color video pictures as the transition video in the video to be detected.
[0030] The removing or deleting module is configured to remove a preset identifier from the transition video or delete the transition video when it is detected that the transition video contains the preset identifier.
[0031] Optionally, after the third determining module, the device further comprises:
[0032] The fourth determining module is configured to determine that the transition video is an end of a film 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.
[0033] The fifth determining module is configured to determine that the transition video is a start of a film when a ratio of a time length from an end time of the transition video to an end 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 a start time of the transition video to a start time of the video to be detected is less than a fifth preset threshold.
[0034] Optionally, the resolution reducing module comprises:
[0035] The intercepting submodule is configured to intercept a video segment with a preset time length from the video to be detected, a start time of the video segment being a start time of the video to be detected, or an end time of the video segment being an end time of the video to be detected, or start and end times of the video segment being specified start and end times.
[0036] The resolution reducing submodule is configured to perform resolution reduction processing on the video segment with the preset time length to obtain a video segment with reduced resolution.
[0037] Optionally, the resolution reducing module comprises:
[0038] An acquisition sub-module is configured to acquire each video frame included in the to-be-detected video.
[0039] A compression sub-module is configured to perform row compression and column compression on each video frame based on an interpolation algorithm of a preset down-sampling multiple, to obtain multiple compressed video frames.
[0040] A combination sub-module is configured to combine the multiple compressed video frames to obtain a video with reduced resolution.
[0041] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising:
[0042] a processor;
[0043] a memory for storing instructions executable by the processor;
[0044] The processor is configured to execute the instructions to implement the video detection method according to the first aspect.
[0045] According to a fourth aspect of an embodiment of the present disclosure, a storage medium is provided, when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the video detection method according to the first aspect.
[0046] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, the computer program product comprises readable program codes, when the readable program codes are executed by a processor of an electronic device, the electronic device is enabled to perform the video detection method according to the first aspect.
[0047] The technical solutions provided by the embodiments of the present disclosure at least bring the following beneficial effects:
[0048] The present disclosure reduces the resolution of the to-be-detected video to obtain a video with reduced resolution, then respectively performs pixel value statistics on each video frame included in the video with reduced resolution, determines the number of pixel points with the same pixel value and the proportion of the number of pixel points in the total number of pixel points of the video frame, and determines the video frame with a proportion greater than a first preset threshold as a pure color video frame. When the video with reduced resolution contains continuous multiple pure color video frames, it is determined that the to-be-detected video contains a transition video. By reducing the resolution of the to-be-detected video before performing characteristic statistics on the to-be-detected video, and then performing characteristic statistics on the video with reduced resolution, the amount of data statistics is reduced, so as to improve the speed of data statistics, so that whether the to-be-detected video contains a transition video can be quickly detected, and the detection rate is improved.
[0049] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS
[0050] The accompanying drawings, which are incorporated herein and constitute part of the specification, illustrate implementations of the present disclosure and, together with the description, further serve to explain the principles of the present disclosure and, do not limit the present disclosure in any inappropriable way.
[0051] Figure 1 is a flow chart of a video detection method according to an exemplary embodiment;
[0052] Figure 2 is a flow chart of a resolution reduction method according to an exemplary embodiment;
[0053] Figure 3 is a flow chart of another resolution reduction method according to an exemplary embodiment;
[0054] Figure 4 is a block diagram of a video detection apparatus according to an exemplary embodiment;
[0055] Figure 5 is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0056] In order to make the ordinary person skilled in the art better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be described clearly and completely below with reference to the drawings.
[0057] It should be noted that the terms "first", "second", and the like in the specification and claims of the present disclosure and the above-described drawings are used to distinguish similar objects, and do not necessarily have to describe a specific order or a chronological sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The implementation described in the following exemplary embodiments does not represent all implementations consistent with the present disclosure. Rather, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0058] In the related art, the statistical characteristics of images are used to detect advertisements in videos, so as to be able to remove advertisements in videos. However, for high-resolution videos, the statistical amount is large, resulting in a low detection rate.
[0059] To solve the problem of low transition video detection rate in the related art, it is found that when the statistical characteristics of images are used to detect advertisements in a video in the related art, the statistical results are not affected by the video resolution. Based on this finding, the present application provides a technical concept: before performing characteristic statistics on the to-be-detected video, the resolution of the to-be-detected video is first reduced, and then characteristic statistics are performed on the video with reduced resolution, so as to reduce the amount of data statistics, so as to improve the data statistics speed, so as to quickly detect whether the to-be-detected video contains a transition video, and improve the detection rate.
[0060] Figure 1 is a flowchart of a video detection method according to an exemplary embodiment, as shown in Figure 1 The video detection method includes the following steps:
[0061] In step S11, the to-be-detected video is subjected to resolution reduction processing to obtain a video with reduced resolution.
[0062] The scheme can be applied to a server, which can be a server of a video platform or a server of video processing software. The to-be-detected video is a video uploaded by a user to the video platform. The server can obtain the video uploaded by the user and detect the video. Before detecting the video, the to-be-detected video is subjected to resolution reduction processing to obtain a video with reduced resolution, so as to reduce the amount of data processing. There are various methods for performing resolution reduction processing on the to-be-detected video, including interpolation method and using a trained resolution reduction model to perform resolution reduction processing on the to-be-detected video.
[0063] In step S12, pixel value statistics are performed on each video frame included in the video with reduced resolution to determine the number of pixel points with the same pixel value and the proportion of the number of pixel points with the same pixel value in the total number of pixel points of the video frame.
[0064] After obtaining the video with reduced resolution, pixel value statistics are performed on each video frame included in the video with reduced resolution, i.e., each image, to determine the number of pixel points with the same pixel value and the proportion of the number of pixel points corresponding to the pixel value in the total number of pixel points of the video frame. The pixel points with the same pixel value are pixel points with the same color. When performing pixel value statistics, all pixel points need to be counted. The number of pixel points is reduced in the video with reduced resolution, but the proportion of pixel points with the same pixel value in the total number of pixel points of the video frame remains unchanged. At this time, the amount of pixel value statistics can be reduced, so as to improve the data processing speed and the pixel value statistics speed.
[0065] Specifically, the method for performing pixel value statistics on each video frame included in the resolution-reduced video can adopt an RGB domain-based black pixel statistics method or a color space-based statistics method. When the RGB domain-based black pixel statistics method is adopted, a plurality of pixel value thresholds are set to determine the number of black pixels included in each video frame, and then the proportion of black pixels in the entire video frame is calculated. When the color space-based statistics method is adopted, the resolution-reduced video is first converted to a color space, and then the number of pixels of each color included in each video frame is counted, and the proportion of pixels of each color in the total number of pixels included in the video frame is calculated. At this time, the resolution-reduced video is used when processing the color space conversion, and the calculation cost of the non-linear color space can be reduced in the low-resolution space.
[0066] In step S13, the video frame whose proportion is greater than the first preset threshold is determined as a pure color video frame.
[0067] In the marked advertisement frame, the proportion of a single color is relatively high, i.e., the video frame is a pure color video frame. At this time, a first preset threshold can be set to determine whether the video frame is a pure color video frame. The first preset threshold can be set according to actual conditions and the actual pixel value statistics method adopted. For example, if the RGB domain-based black pixel statistics method is adopted, the proportion of black pixels in the entire video frame can be greater than 20% to determine that the video frame is a pure color video frame. At this time, the first preset threshold is 20%. If the color space-based statistics method is used, when the proportion of pixels of each color in the total number of pixels included in the video frame is greater than 75%, it can be determined that the video frame is a pure color video frame. At this time, the first preset threshold is 75%.
[0068] In step S14, when the resolution-reduced video includes a plurality of continuous pure color video frames, it is determined that the video to be detected includes a transition video.
[0069] When the video frame is a pure color video frame, the video frame can be an advertisement frame. At this time, whether the video to be detected includes an advertisement frame needs to be determined according to a plurality of frames of video frames before and after. Specifically, when the resolution-reduced video includes a plurality of continuous pure color video frames, it is determined that the video to be detected includes a transition video, i.e., an advertisement video. A preset threshold of continuous pure color video frames can be set. When the number of video frames of continuous pure color video frames is greater than the preset threshold, it can be determined that the video to be detected includes a transition video. The preset threshold of continuous pure color video frames can be set according to actual conditions, which is not limited here.
[0070] The video detection method provided by the example embodiment determines whether the to-be-detected video contains a transition video by performing resolution reduction on the to-be-detected video to obtain a video with reduced resolution, performing pixel value statistics on each video frame included in the video with reduced resolution, determining the number of pixel points with the same pixel value and the proportion of the number of pixel points in the total number of pixel points of the video frame, and determining a video frame with a proportion greater than a first preset threshold as a pure color video frame. When the video with reduced resolution contains a plurality of continuous pure color video frames, it is determined that the to-be-detected video contains a transition video. The resolution of the to-be-detected video is reduced before performing characteristic statistics on the to-be-detected video, and then characteristic statistics are performed on the video with reduced resolution, so as to reduce the amount of data statistics and improve the speed of data statistics, thereby quickly detecting whether the to-be-detected video contains a transition video and improving the detection rate.
[0071] On the basis of the above technical solution, when it is determined that the to-be-detected video contains a transition video, that is, the to-be-detected video contains an advertisement video, the to-be-detected video can be further processed to remove the platform logo in the transition video, so as to avoid the influence of the advertisement logo on the user's viewing experience, or the transition video is directly removed to avoid the influence of the advertisement video on the user's viewing experience. The specific method is as follows:
[0072] The video segment composed of the plurality of continuous pure color video frames is determined as the transition video in the to-be-detected video.
[0073] When it is detected that the transition video contains a preset logo, the preset logo is removed from the transition video, or the transition video is deleted.
[0074] In the above technical solution, the video segment composed of all continuous pure color video frames can be determined as the transition video in the to-be-detected video, and then it is detected whether the transition video contains a preset logo. The preset logo can contain the advertisement logo of all video platforms. When it is detected that the transition video contains the preset logo, the preset logo can be removed from the transition video to avoid the influence of the advertisement logo on the user's viewing experience, or the transition video is directly deleted, so as to remove the platform advertisement logo and the advertisement effect and improve the user's video viewing experience.
[0075] On the basis of the above technical solution, since removing the advertisement logo is time-consuming, and the platform advertisement and the advertisement logo are usually arranged at the beginning and the end of a video, it can be directly judged whether the transition video is the beginning or the end of a video, so as to directly remove the beginning or the end of a video to speed up the video processing efficiency. Specifically, after the video segment composed of the plurality of continuous pure color video frames is determined as the transition video in the to-be-detected video, the following method is further included:
[0076] when the ratio of the time length from the start time of the transition video to the start time of the to-be-tested video to the total time length of the to-be-tested video is greater than a second preset threshold value, and the time length from the end time of the transition video to the end time of the to-be-tested video is less than a third preset threshold value, the transition video is determined to be an end of the to-be-tested video;
[0077] when the ratio of the time length from the end time of the transition video to the end time of the to-be-tested video to the total time length of the to-be-tested video 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 to-be-tested video is less than a fifth preset threshold value, the transition video is determined to be a start of the to-be-tested video.
[0078] wherein, the method for determining the end of the video is: first, obtaining the start time and the end time of the transition video, and the total time length, the start time and the end time of the to-be-tested video, then calculating the time length from the start time of the transition video to the start time of the to-be-tested video, for example, the start time of the transition video is 70 minutes and 25 seconds, and the start time of the to-be-tested video is 0 minute and 0 second, then the time length from the start time of the transition video to the start time of the to-be-tested video is 4225 seconds, then calculating the ratio of the time length from the start time of the transition video to the start time of the to-be-tested video to the total time length of the to-be-tested video, for example, if the total time length of the to-be-tested video is 73 minutes, that is, 4380 seconds, then the ratio of the time length from the start time of the transition video to the start time of the to-be-tested video to the total time length of the to-be-tested video is 0.96, wherein the second preset threshold value is used to determine whether the transition video is the end of the video, and the second preset threshold value is the minimum value of the ratio of the time length from the start time of the transition video to the start time of the to-be-tested video to the total time length of the to-be-tested video when the transition video is the end of the video, specifically, the second preset threshold value can be 0.7, and the second preset threshold value can be set according to actual conditions, which is not specifically limited herein. Then, the time length from the end time of the transition video to the end time of the to-be-tested video is calculated, for example, the end time of the transition video is 72 minutes and 25 seconds, and the end time of the to-be-tested video is 73 minutes, then the time length from the end time of the transition video to the end time of the to-be-tested video is 35 seconds, the third preset threshold value is used to determine whether the transition video is the end of the video, and the third preset threshold value is the maximum value of the time length from the end time of the transition video to the end time of the to-be-tested video when the transition video is the end of the video, specifically, the third preset threshold value can be 40 seconds, and the third preset threshold value can be set according to actual conditions, 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, at this time, the transition video can be determined to be the end of the to-be-tested video, and the end of the video can be directly removed.
[0079] The determination method of the clip head is as follows: the time length from the end time of the transition video to the end time of the to-be-tested video is calculated, for example, the end time of the transition video is 4 minutes and 25 seconds, and the end time of the to-be-tested video is 73 minutes and 0 seconds, so the time length from the end time of the transition video to the end time of the to-be-tested video is 4115 seconds, and then the ratio of the time length from the end time of the transition video to the end time of the to-be-tested video to the total time length of the to-be-tested video is calculated, for example, if the total time length of the to-be-tested video is 73 minutes, that is, 4380 seconds, the ratio of the time length from the end time of the transition video to the end time of the to-be-tested video to the total time length of the to-be-tested video is 0.94, wherein the fourth preset threshold is used to determine whether the transition video is a clip head, and 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 to-be-tested video to the total time length of the to-be-tested video when the transition video is a clip head, specifically, the fourth preset threshold can be 0.7, and the fourth preset threshold can be set according to actual conditions, which is not limited here. Then, the time length from the start time of the transition video to the start time of the to-be-tested video is calculated, for example, the start time of the transition video is 0 minutes and 25 seconds, and the start time of the to-be-tested video is 0 minutes and 0 seconds, so the time length from the start time of the transition video to the start time of the to-be-tested video is 25 seconds, the fifth preset threshold is used to determine whether the transition video is a clip head, and 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 to-be-tested video when the transition video is a clip head, specifically, the fifth preset threshold can be 40 seconds, and the fifth preset threshold can be set according to actual conditions, which is not limited here. As in the above example, 0.94 is greater than 0.7 and 25 seconds is less than 40 seconds, at this time, the transition video can be determined as the clip head of the to-be-tested video, and the clip head can be directly removed.
[0080] Figure 2 is a flow chart of a resolution reduction processing method according to an exemplary embodiment, as shown in Figure 2 On the basis of the above technical solution, since the video length of the to-be-tested video can be relatively long, at this time, if the resolution of the to-be-tested video is directly reduced, the data processing amount will be large, at this time, a part of the video segment can be cut from the to-be-tested video for resolution reduction processing according to the detection target, and the specific method is as follows:
[0081] In step S21, a video segment with a preset time length is cut from the to-be-tested video, the start time of the video segment is the start time of the to-be-tested video, or the end time of the video segment is the end time of the to-be-tested video, or the start and end times of the video segment are specified start and end times;
[0082] In step S22, the video segment with the preset time length is subjected to resolution reduction processing to obtain a video segment with reduced resolution.
[0083] The preset time length can be determined according to an existing advertisement time length, and the preset time length is greater than the existing maximum advertisement time length. For example, if the existing maximum advertisement time length is 3 minutes, the preset time length can be 4 minutes. If the detection target is a film head, the starting time of the video segment to be intercepted is the starting time of the video to be detected, that is, a video segment of 4 minutes before the video to be detected is intercepted. If the detection target is a film tail, the ending time of the video segment to be intercepted is the ending time of the video to be detected, that is, a video segment of 4 minutes after the video to be detected is intercepted. Alternatively, the detection target is the middle part of the video to be detected, and at this time, a video segment with a specified starting and ending time in the video to be detected can be intercepted. After the video segment with the preset time length is intercepted, the video segment with the preset time length is subjected to the resolution reduction processing to obtain a video segment with reduced resolution.
[0084] Figure 3 is a flow chart of another resolution reduction processing method according to an exemplary embodiment. As shown in Figure 3 On the basis of the above technical solution, the video to be detected can be directly subjected to the resolution reduction processing, or the video segment with the preset time length intercepted from the video to be detected can be subjected to the resolution reduction processing. The specific method is as follows:
[0085] In step S31, each video picture included in the video to be detected is obtained.
[0086] In step S32, each video picture is subjected to row compression and column compression based on an interpolation algorithm of a preset downsampling multiple, to obtain a plurality of compressed video pictures.
[0087] In step S33, the plurality of compressed video pictures are combined to obtain a video with reduced resolution.
[0088] If the resolution of the to-be-detected video is directly reduced, each video frame included in the to-be-detected video is directly obtained, if the resolution of the video segment of the preset time length intercepted from the to-be-detected video is reduced, each video frame included in the video segment of the preset time length intercepted is obtained, then, based on an interpolation algorithm of a preset downsampling multiple, each video frame is compressed in a row and in a column, wherein the interpolation algorithm can be bicubic interpolation or bilinear interpolation, and the preset downsampling multiple can be set according to actual conditions, for example, if the preset downsampling multiple is 10, the width and the height of the compressed video frame are both 0.1 of the original, for example, the size of the input video is [H, W, 3], wherein H and W are the width and the height of the video frame respectively, and 3 is three channels. Through the interpolation downsampling operation, the size of the video frame is changed to [0.1xH, 0.1xW, 3], the row compression and the column compression are compression of the width and the height of the video frame, and a plurality of compressed video frames are obtained, then, the plurality of compressed video frames are combined to obtain a video with reduced resolution. By using the interpolation method to reduce the resolution of the input to-be-detected video, and then performing feature statistics under a small resolution, the detection speed can be greatly accelerated while the accuracy is ensured.
[0089] Figure 4 is a block diagram of a video detection device according to an exemplary embodiment. Referring to Figure 4 The device includes a resolution reduction module 41, a statistics module 42, a first determination module 43, and a second determination module 44.
[0090] The resolution reduction module 41 is configured to reduce the resolution of a to-be-detected video to obtain a video with reduced resolution.
[0091] The statistics module 42 is configured to respectively perform pixel value statistics on each video frame included in the video with reduced resolution, determine the number of pixel points with the same pixel value and the proportion of the number of pixel points in the total number of pixel points of the video frame.
[0092] The first determination module 43 is configured to determine a video frame with a proportion greater than a first preset threshold as a pure color video frame.
[0093] The second determination module 44 is configured to determine that the to-be-detected video contains a transition video when the video with reduced resolution contains a plurality of continuous pure color video frames.
[0094] Optionally, the device further includes:
[0095] A third determination module configured to determine a video segment composed of the plurality of continuous pure color video frames as a transition video in the to-be-detected video.
[0096] The removing or deleting module is configured to remove the preset identifier from the transition video, or delete the transition video, when it is detected that the transition video contains the preset identifier.
[0097] Optionally, after the third determining module, the apparatus further comprises:
[0098] The fourth determining module is configured to determine that the transition video is a trailer of the to-be-detected video, when a ratio of a time length from a start time of the transition video to a start time of the to-be-detected video to a total time length of the to-be-detected video 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 to-be-detected video is less than a third preset threshold.
[0099] The fifth determining module is configured to determine that the transition video is a head of the to-be-detected video, when a ratio of a time length from an end time of the transition video to an end time of the to-be-detected video to a total time length of the to-be-detected video is greater than a fourth preset threshold, and a time length from a start time of the transition video to a start time of the to-be-detected video is less than a fifth preset threshold.
[0100] Optionally, the resolution reducing module comprises:
[0101] The intercepting sub-module is configured to intercept a video segment of a preset time length from the to-be-detected video, a start time of the video segment being a start time of the to-be-detected video, or an end time of the video segment being an end time of the to-be-detected video, or start and end times of the video segment being specified start and end times.
[0102] The resolution reducing sub-module is configured to perform resolution reduction processing on the video segment of the preset time length to obtain a video of reduced resolution.
[0103] Optionally, the resolution reducing module comprises:
[0104] The acquisition sub-module is configured to acquire each video frame included in the to-be-detected video.
[0105] The compression sub-module is configured to perform row compression and column compression on each video frame based on an interpolation algorithm of a preset downsampling multiple to obtain a plurality of compressed video frames.
[0106] The combination sub-module is configured to combine the plurality of compressed video frames to obtain a video of reduced resolution.
[0107] The video detection device provided by the example embodiment can determine whether the to-be-detected video contains a transition video by the following steps: performing resolution reduction processing on the to-be-detected video to obtain a video with reduced resolution, then performing pixel value statistics on each video frame included in the video with reduced resolution, determining the number of pixel points with the same pixel value and the proportion of the number of pixel points in the total number of pixel points of the video frame, and determining the video frame with the proportion greater than a first preset threshold as a solid color video frame. When the video with reduced resolution contains continuous multiple solid color video frames, it is determined that the to-be-detected video contains a transition video. By reducing the resolution of the to-be-detected video before performing characteristic statistics on the to-be-detected video, and then performing characteristic statistics on the video with reduced resolution, the amount of data statistics is reduced, so that the data statistics speed is improved, so that the to-be-detected video can be quickly detected to determine whether it contains a transition video, and the detection rate is improved.
[0108] As to the device in the above embodiments, the specific manner in which each module performs operations has been described in detail in the embodiments of the method, and will not be described in detail here.
[0109] Figure 5 is a block diagram of an electronic device according to an example embodiment. For example, the electronic device 500 can be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, and the like.
[0110] Referring to Figure 5 , the electronic device 500 can include one or more of the following components: a processing component 502, a memory 504, a power supply 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.
[0111] The processing component 502 usually controls overall operations of the electronic device 500, such as operations associated with display, phone call, data communication, camera operation, and recording operation. The processing component 502 can include one or more processors 520 to execute instructions to complete all or part of the steps of the methods described above. In addition, the processing component 502 can include one or more modules to facilitate the interaction between the processing component 502 and other components. For example, the processing component 502 can include a multimedia module to facilitate the interaction between the multimedia component 508 and the processing component 502.
[0112] The memory 504 is configured to store various types of data to support the operation of 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, etc. The memory 504 can be implemented by any type of volatile or nonvolatile memory, or a combination thereof, 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 disc, or optical disc.
[0113] The power supply component 506 supplies power for various components of the electronic device 500. The power supply component 506 can include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 500.
[0114] The multimedia component 508 includes a screen providing an output interface between the electronic device 500 and a user. In some embodiments, the screen can include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can 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 a touch, a slide, and a gesture on the touch panel. The touch sensor can not only sense a boundary of a touching or a sliding action, but also detect duration and pressure related to the touching or sliding action. In some embodiments, the multimedia component 508 includes a front camera and / or a back camera. The front camera and / or the back camera can receive external multimedia data when the electronic device 500 is in an operation mode, such as a photographing mode or a video mode. Each of the front camera and the back camera can be a fixed optical lens system or have a focal length and optical zoom capability.
[0115] The audio component 510 is configured to output and / or input an audio signal. For example, the audio component 510 includes a microphone (MIC) configured to receive an external audio signal when the electronic device 500 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal can be further stored in the memory 504 or transmitted via the communication component 516. In some embodiments, the audio component 510 also includes a speaker for outputting an audio signal.
[0116] The I / O interface 512 provides an interface between the processing component 502 and peripheral interface modules, which can be a keypad, a click wheel, buttons, etc. The buttons can include, but are not limited to, a home button, a volume button, a start button, and a lock button.
[0117] The sensor component 514 includes one or more sensors for providing status assessments for various aspects of the electronic device 500. For example, the sensor component 514 can detect an open / closed position of the electronic device 500, relative positioning of components of the electronic device 500, such as a display and a keypad of the electronic device 500, a change in position of the electronic device 500 or a component of the electronic device 500, presence or absence of user contact with the electronic device 500, orientation or acceleration / deceleration of the electronic device 500, and temperature changes of the electronic device 500. The sensor component 514 can include a proximity sensor configured to detect presence of a nearby object without any physical contact. The sensor component 514 can also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 514 can further include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0118] The communication component 516 is configured to facilitate wired or wireless communication between the electronic device 500 and other devices. The electronic device 500 can access a wireless network based on a communication standard, such as WiFi, a cellular network standard (such as 2G, 3G, 5G, or 5G), or a combination thereof. In an example embodiment, the communication component 516 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In an example embodiment, the communication component 516 can further include a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) techniques, infrared data association (IrDA) techniques, ultra-wideband (UWB) techniques, Bluetooth (BT) techniques, and other techniques.
[0119] In an example embodiment, the electronic device 500 can be implemented with 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 elements to perform the above-described video detection method.
[0120] In an example embodiment, a storage medium including instructions, such as the memory 504 including instructions, is also provided. The instructions can be executable by the processor 520 of the electronic device 500 to implement the above-described personnel authority management method. Alternatively, the storage medium can be a non-transitory computer-readable storage medium, such as a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disc, and an optical data storage device, and the like.
[0121] In the example embodiment, a computer program product is also provided, which includes readable program codes executable by the processor 520 of the electronic device 500 to complete the above-mentioned personnel authority management method. Optionally, the program codes can be stored in a storage medium of the electronic device 500, which can be a non-transitory computer readable storage medium, for example, the non-transitory computer readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0122] Other embodiments of the present disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the features disclosed herein. It is intended that the present disclosure cover any and all variations of the present disclosure that come within the scope of the following claims and their equivalents. It is intended that the specification and examples be considered exemplary only, with the true scope and spirit of the present disclosure being indicated by the following claims.
[0123] It should be understood that the application is not limited to the precise construction that has been described above and shown in the accompanying drawings, and that various modifications and changes can be made by those skilled in the art without departing from the scope of the application. The scope of the application is limited only by the appended claims.
Claims
1. A video detection method, characterized by, The method comprises: performing resolution reduction processing on a to-be-detected video to obtain a video with reduced resolution; performing pixel value statistics on each video frame included in the video with reduced resolution respectively to determine the number of pixel points with the same pixel value and the proportion of the number of pixel points in the total number of pixel points of the video frame; determining a video frame with a proportion greater than a first preset threshold as a pure color video frame; when the video with reduced resolution contains a plurality of continuous pure color video frames, determining that the to-be-detected video contains a transition video; The method further comprises: determining a video segment composed of the plurality of continuous pure color video frames as the transition video in the to-be-detected video; when the ratio of the time length from the start time of the transition video to the start time of the to-be-detected video to the total time length of the to-be-detected video is greater than a second preset threshold, and the time length from the end time of the transition video to the end time of the to-be-detected video is less than a third preset threshold, determining that the transition video is an end of the to-be-detected video; when the ratio of the time length from the end time of the transition video to the end time of the to-be-detected video to the total time length of the to-be-detected video is greater than a fourth preset threshold, and the time length from the start time of the transition video to the start time of the to-be-detected video is less than a fifth preset threshold, determining that the transition video is a beginning of the to-be-detected video.
2. The method of claim 1, wherein, The method further comprises: when it is detected that the transition video contains a preset identifier, removing the preset identifier from the transition video, or, when it is detected that the transition video contains a preset identifier, deleting the transition video.
3. The method of claim 1, wherein, performing resolution reduction processing on a to-be-detected video to obtain a video with reduced resolution, comprising: extracting a video segment with a preset time length from the to-be-detected video, the start time of the video segment being the start time of the to-be-detected video, or the end time of the video segment being the end time of the to-be-detected video, or the start and end times of the video segment being specified start and end times; performing resolution reduction processing on the video segment with a preset time length to obtain a video segment with reduced resolution.
4. The method according to claim 1 or 3, characterized in that, performing resolution reduction processing on a to-be-detected video to obtain a video with reduced resolution, comprising: obtaining each video frame included in the to-be-detected video; performing row compression and column compression on each video frame based on an interpolation algorithm with a preset downsampling multiple to obtain a plurality of compressed video frames; combining the plurality of compressed video frames to obtain a video with reduced resolution.
5. A video detection apparatus characterized by comprising: The device comprises: a resolution reduction module configured to perform resolution reduction processing on a to-be-detected video to obtain a video with reduced resolution; a statistics module configured to perform pixel value statistics on each video frame included in the video with reduced resolution respectively to determine the number of pixel points with the same pixel value and the proportion of the number of pixel points in the total number of pixel points of the video frame; a first determination module configured to determine a video frame with a proportion greater than a first preset threshold as a pure color video frame; The second determining module is configured to determine that the to-be-detected video contains a transition video when the video with the reduced resolution contains a plurality of continuous pure color video pictures. The device further comprises: The third determining module is configured to determine a video segment composed of the plurality of continuous pure color video pictures as the transition video in the to-be-detected video. The fourth determining module is configured to determine that the transition video is an end of the to-be-detected video when a ratio of a time length from a start time of the transition video to a start time of the to-be-detected video to a total time length of the to-be-detected video is greater than a second preset threshold value, and a time length from an end time of the transition video to an end time of the to-be-detected video is less than a third preset threshold value. The fifth determining module is configured to determine that the transition video is a start of the to-be-detected video when a ratio of a time length from an end time of the transition video to an end time of the to-be-detected video to the total time length of the to-be-detected video is greater than a fourth preset threshold value, and a time length from a start time of the transition video to a start time of the to-be-detected video is less than a fifth preset threshold value.
6. The apparatus of claim 5, wherein, The device further comprises: The removing or deleting module is configured to remove the preset identifier from the transition video when it is detected that the transition video contains the preset identifier, or delete the transition video when it is detected that the transition video contains the preset identifier.
7. The apparatus of claim 5, wherein, The resolution reducing module comprises: The intercepting submodule is configured to intercept a video segment with a preset time length from the to-be-detected video, a start time of the video segment being a start time of the to-be-detected video, or an end time of the video segment being an end time of the to-be-detected video, or the start time and the end time of the video segment being specified start and end times; The resolution reducing module comprises:
8. The apparatus of claim 5 or 7, wherein, The acquiring submodule is configured to acquire each video picture included in the to-be-detected video; The compression submodule is configured to perform row compression and column compression on each video picture based on an interpolation algorithm with a preset downsampling multiple, to obtain a plurality of compressed video pictures; The combination submodule is configured to combine the plurality of compressed video pictures to obtain the video with the reduced resolution. comprise:
9. An electronic device, comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the video detection method according to any one of claims 1 to 4.
10. A storage medium, when instructions in the storage medium are executed by a processor of an electronic device, enabling the electronic device to perform the video detection method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Blurred screen detection method, electronic device and readable storage medium
CN110166765A
Monochrome screen detection method and device in video file
CN111951244A
Video advertisement identification method and device, storage medium and equipment
CN112291616A
Chip tail identification method and device, electronic equipment and storage medium
CN113920465A