Multi-channel video content real-time comparison method and device, equipment and storage medium
By comparing the lens frames and intermediate content frames in the video frame sequence in real time, the problem of low accuracy and poor timeliness of multi-channel video content detection is solved, and real-time consistency detection of video content is achieved, which is suitable for fast-changing TV program content. .
Patent Information
- Application Number
- CN202310441706.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-23
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2043-04-23
AI Technical Summary
Multi-channel video content detection in the existing technology has low accuracy and poor timeliness, making it difficult to achieve adaptability and real-time performance. Moreover, the content of radio and television programs changes rapidly, making it impossible to perform real-time comparison through advance learning.
Use content frames that can represent the content of the lens, obtain the video frame sequence through real-time synchronization, extract the lens frames and intermediate content frames, and use difference rate calculation and cache comparison to determine the consistency of the video content, avoiding dependence on machine learning models, and achieving Real-time comparison of video content.
It improves the accuracy and efficiency of multi-channel video content detection, reduces implementation costs, realizes real-time consistency detection of video content, has strong adaptability, and is suitable for rapidly changing TV program content.
Smart Images

Figure CN117278776B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of video processing technology, and in particular to a multi-channel video content real-time comparison method and device, equipment and storage medium. Background Art
[0002] In the related art, the consistency detection of video content in multiple channels generally adopts machine learning models based on artificial intelligence to detect, that is, by annotating the video sample library and training it, it is further determined whether two or more video signals are the same video signal. However, the machine learning model relies heavily on the sample library and human experience and understanding of the information application space, and it is difficult to achieve the adaptability and real-time performance of video content comparison. Therefore, the consistency detection accuracy of video content in multiple channels is low, and the training cost is high, wasting computing resources. In addition, the video content of radio and television programs cannot be obtained in advance before broadcasting, and the content of television programs changes every day, so it is impossible to perform real-time comparison by learning in advance. Summary of the invention
[0003] The embodiments of the present invention provide a multi-channel video content real-time comparison method and apparatus, equipment and storage medium to at least solve the technical problems of low accuracy and poor timeliness when detecting multi-channel video content in the related art.
[0004] According to one aspect of an embodiment of the present invention, a multi-channel video content comparison method is provided, comprising: synchronously acquiring an original video frame sequence transmitted from a source channel and a comparison video frame sequence transmitted from a target channel in real time; extracting content frames of the original video frame sequence to obtain a source channel content frame sequence; extracting content frames of the comparison video frame sequence to obtain a target channel content frame sequence, and sequentially placing each content frame of the source channel content frame sequence before the current moment into a cache of a server according to time periods; wherein a content frame is a frame representing a lens content, and comprises a first frame, a last frame, and N intermediate content frames, where N is a natural number, and the intermediate content frame is obtained by calculating a difference rate between all subframes of a lens except the first and last two frames and the previous content frame, and the difference rate is greater than a first preset threshold; the content frame comprises a lens frame, and the lens frame comprises the first frame and the last frame; sequentially comparing the first content frame in the target channel content frame sequence with each content frame of the source channel content frame sequence in the cache, and determining Whether there is a content frame matching the first content frame in the source channel content frame sequence, if yes, the first content frame is recorded as the first matching frame, and the matching frame is a content frame in the target channel content frame sequence, and the difference rate with a certain frame in the source channel content frame sequence is less than or equal to a second preset threshold; if not, then continue to compare the next content frame of the target channel content frame sequence with each content frame of the source channel content frame sequence in the cache in sequence until the first matching frame is found; and so on, to obtain a plurality of matching frames; determine whether the plurality of matching frames are content frames with continuous sequence numbers in the target channel content frame sequence, and whether the sequence numbers of the content frames of the source channel content frame sequence matching the plurality of matching frames are continuous in the source channel content frame sequence; if they are continuous, determine whether the durations corresponding to the plurality of matching frames with continuous sequence numbers meet a preset duration condition; when the durations corresponding to the plurality of matching frames with continuous sequence numbers meet the preset duration condition, determine that the video contents of the source channel and the target channel are consistent.
[0005] According to another aspect of an embodiment of the present invention, a multi-channel video content comparison device is also provided, comprising: an acquisition unit, which synchronously acquires in real time an original video frame sequence transmitted from a source channel and a comparison video frame sequence transmitted from a target channel; an extraction unit, which is used to extract content frames of the original video frame sequence to obtain a source channel content frame sequence; extract content frames of the comparison video frame sequence to obtain a target channel content frame sequence, and sequentially put each content frame of the source channel content frame sequence before the current moment into a cache of a server according to time periods; wherein a content frame is a frame representing a lens content, and comprises a first frame, a last frame, and N intermediate content frames, where N is a natural number, and the intermediate content frame is obtained by calculating a difference rate between all subframes of a lens except the first and last two frames and the previous content frame, and the difference rate is greater than a first preset threshold; the content frame comprises a lens frame, and the lens frame comprises the first frame and the last frame; a comparison unit, which is used to sequentially compare the first content frame in the target channel content frame sequence with each content frame of the source channel content frame sequence in the cache; A comparison is performed to determine whether there is a content frame matching the first content frame in the source channel content frame sequence. If yes, the first content frame is recorded as the first matching frame, and the matching frame is a content frame in the target channel content frame sequence, and the difference rate with a certain frame in the source channel content frame sequence is less than a second preset threshold value; if not, the next content frame of the target channel content frame sequence is continuously compared with each content frame of the source channel content frame sequence in the cache in sequence until the first matching frame is found; and so on, a plurality of matching frames are obtained; a judging unit is used to judge whether the plurality of matching frames are content frames with continuous sequence numbers in the target channel content frame sequence, and whether the sequence numbers of the content frames of the source channel content frame sequence matching the plurality of matching frames are continuous in the source channel content frame sequence; if they are continuous, it is judged whether the duration corresponding to the plurality of matching frames with continuous sequence numbers meets the preset duration condition; when the duration corresponding to the plurality of matching frames with continuous sequence numbers meets the preset duration condition, it is determined that the video contents of the source channel and the target channel are consistent.
[0006] According to another aspect of an embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the multi-channel video content comparison method through the computer program.
[0007] According to another aspect of the embodiments of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the multi-channel video content comparison method when running.
[0008] In an embodiment of the present invention, by adopting content frames that can represent the content of the shot, it is possible to determine that the video contents of the source channel and the target channel are consistent without comparing all the frames of the source channel and the target channel, and there is no need to build a machine learning model for video content comparison, thereby getting rid of the dependence on the sample library, achieving the adaptability and real-time nature of the detection process, reducing the implementation cost, improving the accuracy of multi-channel video content detection, and improving the efficiency of multi-channel video content detection, thereby solving the technical problems of low accuracy and poor timeliness in detecting multi-channel video content in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0010] Figure 1 is a schematic diagram of an application environment of an optional multi-channel video content real-time comparison method according to an embodiment of the present invention;
[0011] Figure 2 is a schematic diagram of an application environment of another optional multi-channel video content real-time comparison method according to an embodiment of the present invention;
[0012] Figure 3 is a schematic diagram of an optional process of comparing multi-channel video contents in real time with each other according to an embodiment of the present invention;
[0013] Figure 4 is a schematic diagram of granular processing of a video frame sequence of a multi-channel video according to an embodiment of the present invention;
[0014] Figure 5 is a schematic diagram showing content frames in a video frame sequence of another optional multi-channel video according to an embodiment of the present invention;
[0015] Figure 6 is a flow chart of another optional multi-channel video content real-time comparison method according to an embodiment of the present invention;
[0016] Figure 7 is a schematic diagram of shot comparison according to an optional multi-channel video content comparison method according to an embodiment of the present invention;
[0017] Figure 8 is a schematic diagram of shot comparison according to another optional multi-channel video content comparison method according to an embodiment of the present invention;
[0018] Fig. 9 is a schematic structural diagram of an optional multi-channel video content real-time comparison device according to an embodiment of the present invention;
[0019] Fig.10 It is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0020] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0021] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0022] According to one aspect of an embodiment of the present invention, a multi-channel video content comparison method is provided. As an optional implementation, the multi-channel video content comparison method can be but is not limited to being applied to: Figure 1 In the application environment shown. The application environment includes: a terminal device 102 for human-computer interaction with a user, a network 104, and a server 106. A user 108 can perform human-computer interaction with the terminal device 102, and a multi-channel video content comparison application is running in the terminal device 102. The above-mentioned terminal device 102 includes a human-computer interaction screen 1022, a processor 1024 and a memory 1026. The human-computer interaction screen 1022 is used to display a video frame sequence; the processor 1024 is used to obtain an original video frame sequence of a source channel and a comparison video frame sequence of a target channel. The memory 1026 is used to store the above-mentioned original video frame sequence of the source channel and the comparison video frame sequence of the target channel.
[0023] In addition, the server 106 includes a database 1062 and a processing engine 1064. The database 1062 is used to store the original video frame sequence of the source channel and the compared video frame sequence of the target channel. The processing engine 1064 is used to: synchronously acquire the original video frame sequence transmitted from the source channel and the comparison video frame sequence transmitted from the target channel in real time; extract the content frame of the original video frame sequence to obtain the source channel content frame sequence; extract the content frame of the comparison video frame sequence to obtain the target channel content frame sequence, and sequentially put the content frames of the source channel content frame sequence before the current moment into the cache of the server according to the time period; wherein the content frame is a frame representing the content of the lens, including the first frame, the last frame, and N intermediate content frames, N is a natural number, and the intermediate content frame is obtained by calculating the difference rate between all sub-frames of a lens except the first and last two frames and the previous content frame, and when the difference rate is greater than a first preset threshold; the content frame includes the lens frame, and the lens frame includes the first frame and the last frame; the first content frame in the target channel content frame sequence is sequentially compared with each content frame of the source channel content frame sequence in the cache, and the content frame of the source channel content frame sequence is determined. Whether there is a content frame that matches the first content frame, if so, the first content frame is recorded as the first matching frame, and the matching frame is a content frame in the target channel content frame sequence, and the difference rate with a certain frame in the source channel content frame sequence is less than or equal to a second preset threshold; if not, then continue to compare the next content frame of the target channel content frame sequence with each content frame of the source channel content frame sequence in the cache in sequence until the first matching frame is found; and so on, to obtain a number of matching frames; determine whether the several matching frames are content frames with continuous sequence numbers in the target channel content frame sequence, and whether the sequence numbers of the content frames of the source channel content frame sequence that match the several matching frames are continuous in the source channel content frame sequence; if they are all continuous, determine whether the duration corresponding to the several matching frames with continuous sequence numbers meets the preset duration condition; when the duration corresponding to the several matching frames with continuous sequence numbers meets the preset duration condition, it is determined that the video contents of the source channel and the target channel are consistent.
[0024] In one or more embodiments, the multi-channel video content comparison method of the present application can be applied to Figure 2 In the application environment shown. Figure 2 As shown, human-computer interaction can be performed between user 202 and user device 204. User device 204 includes memory 206 and processor 208. In this embodiment, user device 204 can refer to but not be limited to executing the operations executed by the above terminal device 102 to determine that the video contents of the source channel and the target channel are consistent.
[0025] Optionally, the terminal device 102 and the user device 204 include but are not limited to mobile phones, tablet computers, laptop computers, PCs, vehicle-mounted electronic devices, wearable devices and other terminals, and the network 104 may include but is not limited to wireless networks or wired networks. Among them, the wireless network includes: WIFI and other networks that realize wireless communication. The wired network may include but is not limited to: wide area network, metropolitan area network, local area network. The server 106 may include but is not limited to any hardware device that can perform computing. The server may be a single server, or a server cluster composed of multiple servers, or a cloud server. The above is only an example, and no limitation is made to this in this embodiment.
[0026] In the related technology, when checking the consistency of video content in multiple channels, a machine learning model is used to compare the video content in multiple channels. First, the machine learning model has a dependency on the sample library. The establishment and labeling of the sample library requires a large number of people and is prone to data drift problems, which will cause a large number of videos to be unable to be effectively processed. Many common video platforms usually rely on a large number of people to label and review videos in machine learning models.
[0027] Secondly, the cost of machine learning is high and the efficiency is low. Whether it is the number of layers of the neural network or the size of the sample library, it relies on human experience and understanding of the information application space to continuously try to adjust the parameters on the known data set, so it is impossible to achieve adaptive detection of video content in a production environment. For example, the GPT-3 model requires about 5,000 devices to run for one month to train once, consuming 190,000 degrees of electricity, and the training effect cannot meet user needs to a certain extent.
[0028] Thirdly, the video content of radio and television programs cannot be acquired in advance before they are broadcast, and the content of television programs changes every day, so real-time comparison cannot be performed through advance learning.
[0029] In order to solve the above technical problems, as an optional implementation method, Figure 3 As shown, an embodiment of the present invention provides a multi-channel video content comparison method, comprising the following steps:
[0030] S302, synchronously acquiring in real time an original video frame sequence transmitted from a source channel and a comparison video frame sequence transmitted from a target channel.
[0031] Specifically, the target channel referred to in this application is a channel that broadcasts the video played by the source channel. In an exemplary scenario, the source channel is a certain channel, and the target channel is various local TV stations. At 7 o'clock every day, a certain channel broadcasts a news program, and various local TV stations broadcast it. Due to the high cost of advertising during prime time, some local TV stations may delay switching in or switch out in advance. The content consistency comparison method provided in the embodiment of the present application can detect in real time whether each local TV station broadcasts news programs on time, perform consistency detection on the video playback content, and judge the switching in and out of each local TV station in real time, with accuracy to milliseconds.
[0032] In one or more embodiments, after the above-mentioned real-time synchronous acquisition of the original video frame sequence transmitted from the source channel and the comparison video frame sequence transmitted from the target channel, it also includes: respectively determining a shot set corresponding to the comparison video frame sequence of the target channel, and a shot set corresponding to the original video frame sequence of the source channel, wherein the frame sequence corresponding to each shot in the shot set is a group of frame sequences with continuous content.
[0033] Specifically, the lens of the present application includes continuous image segments captured by a camera from the time it is turned on to the time it is turned off, and is the basic unit of video composition.
[0034] S304, extracting content frames of the original video frame sequence to obtain a source channel content frame sequence; extracting and comparing content frames of the video frame sequence to obtain a target channel content frame sequence, and sequentially placing each content frame of the source channel content frame sequence before the current moment into the server cache according to time periods; wherein the content frame is a frame representing the lens content, including a first frame, a last frame, and N intermediate content frames, N is a natural number, and the intermediate content frame is obtained by calculating the difference rate between all sub-frames of a lens except the first and last two frames and the previous content frame, and when the difference rate is greater than a first preset threshold; the content frame includes the lens frame, and the lens frame includes the first frame and the last frame.
[0035] In one embodiment, determining the content frame corresponding to each shot in a shot set includes: for each shot in the shot set, taking the first and last two frames of images of each shot as the content frames of each shot; calculating the difference rate between all subframes except the first frame and the last frame in each shot and the previous content frame; when the obtained difference rate is greater than a first preset threshold, taking the subframe as an intermediate content frame; and composing the content frame of each shot with the first frame, the last frame and the intermediate content frames.
[0036] The difference calculation between a subframe in a shot and a previous content frame is performed, and when the difference rate obtained is greater than a first preset threshold, the subframe is used as an intermediate content frame, including: determining a first characteristic matrix of the current subframe and a modulus of the first characteristic matrix; determining a second characteristic matrix and a modulus of the second characteristic matrix of a content frame previous to the current subframe; when the modulus of the first characteristic matrix is greater than a third preset threshold, determining the difference rate between the first characteristic matrix and the second characteristic matrix based on a preset difference rate calculation formula; when the difference rate is greater than the first preset threshold, determining the current subframe as an intermediate content frame. The specific difference rate threshold can be set according to actual conditions.
[0037] In an optional embodiment, the difference rate may be calculated based on the Uniform LBP feature of the image, or the difference rate may be calculated using other methods in the prior art, which is not specifically limited in this application.
[0038] Optionally, based on formula (1), each neighborhood of each pixel point in the previous content frame and the currently calculated subframe is obtained: and The characteristic value of .
[0039]
[0040] Among them, c is the center pixel, i is the feature point in the neighborhood, and pixel is the pixel value.
[0041] Based on the neighborhood feature values, the LBP features of the preset number of bits corresponding to the previous content frame and the currently calculated subframe are obtained, and then the Uniform LBP features are obtained; the Uniform LBP features corresponding to all pixels in the YUV components of the previous content frame and the currently calculated subframe are calculated to obtain the first feature matrix and the second feature matrix under the YUV component.
[0042] In one or more embodiments, determining a first modulus value corresponding to the first characteristic matrix and a second modulus value corresponding to the second characteristic matrix includes:
[0043] Determine the first modulus value and the second modulus value respectively by formula (2);
[0044]
[0045] Among them, i is the YUV component, w i and h i is the width and height of the component, (m,,n) is the horizontal and vertical coordinates of the pixel point, m and n are both non-negative integers, UniLBP v (m,n) is the eigenvalue of the pixel coordinate point (m,,n) in the v dimension, bins∈[0.15].
[0046] In one or more embodiments, determining the feature difference value corresponding to the previous content frame and the currently calculated sub-frame under the YUV components includes:
[0047] Determining, respectively through formula (3), the feature difference value corresponding to each pixel point with the same coordinate position in the previous content frame and the currently calculated sub-frame under the YUV components;
[0048]
[0049] where v ∈ bin s, m < wi, n < hi and both m and n are non-negative integers; diffLBP v (m, n) is the feature difference value corresponding to the pixel point at the coordinate point (m, n) in the previous content frame and the currently calculated sub-frame under the YUV components;
[0050] Determining the feature difference value diff(f p , f q ) corresponding to the previous content frame and the currently calculated sub-frame under the YUV components according to formula (4);
[0051]
[0052] where f p , f q represent the previous content frame and the currently calculated sub-frame respectively.
[0053] In one or more embodiments, determining the difference rate between the previous content frame and the currently calculated sub-frame based on the first modulus value, the second modulus value and the feature difference value includes:
[0054] Determining the difference rate dis(f p , f q ) between the previous content frame and the currently calculated sub-frame according to formula (5);
[0055]
[0056] where modULBPM(f p ), modULBPM(f q ) are both not zero.
[0057] In the embodiments of the present application, during the process of obtaining the content frame, first extract the image features of each frame image in the video frame sequence, and count the number of image features of each frame image. Among them, the number of image features extracted in the embodiments of the present application can be the number of non-zero features in the feature matrix, or the number of non-zero vectors in the set of feature vectors of the image, or the modulus of the feature vector, or the modulus of the feature matrix.
[0058] Further, determine whether the number of image features of the subframe is less than a preset minimum feature number threshold; when the number of image features of the subframe is less than the minimum feature number threshold, determine that the subframe is not a content frame. Among them, the specific value of the minimum feature number threshold can be set according to actual conditions, and the embodiments of the present application are not limited. When the number of image features is small, it may be a solid color frame. This type of image has no features and cannot express the video content. By filtering images with a small number of features, the extracted content frame can clearly express the content of the video.
[0059] In one embodiment, a feature matrix of the image may be extracted, such as a matrix composed of Uniform LBP features, or a histogram feature matrix, a hog feature matrix, a sift feature matrix, etc., which is not limited in the embodiment of the present application. Then, the modulus of the feature matrix is calculated, and when the modulus of the feature matrix is less than a third preset threshold, it is determined that the current subframe is not a content frame.
[0060] When the number of image features of a subframe is greater than or equal to a preset minimum feature number threshold (the third preset threshold), the difference rate is calculated for all subframes except the first and last two frames and their previous content frame. When the difference rate is greater than the above-mentioned first preset threshold, the currently calculated subframe is used as a new content frame to obtain a content frame sequence for each shot.
[0061] If the difference rate between all subframes and their previous content frames is less than or equal to the first preset threshold, then all subframes are not content frames, and only the first and last two frames of the shot are extracted as content frames. For example, in a surveillance video at night, the scene in a video frame sequence that may be extracted does not change, and only the first and last two frames of the shot are taken as the content frame sequence of the shot.
[0062] like Figure 4 As shown in the figure, the video content is composed of a continuous frame sequence. According to the continuity of the video content, the continuous frame sequence can be divided into multiple groups, and each group of continuous frame sequences is a shot. By analyzing the differences in the content of the video shot, a small number of frames are selected from the continuous frame sequence to represent the content of the shot. These frames are content frames. The content frame includes at least the first and last two frames of the shot (shot frames), so the number of content frames of a shot is at least 2.
[0063] like Figure 5As shown, the first frame is the first content frame, and then the difference rate between the second, third, ... and the first frame is calculated until it is greater than the preset threshold. If the difference rate between the second and third frames and the first frame is less than the preset threshold, and the fourth frame is greater than the preset threshold, then the fourth frame is the second content frame. Then the difference rate between the fifth, sixth, ... and the fourth frame is calculated until it is greater than the preset threshold. If the difference rate between the fifth, sixth, and seventh frames and the first frame is less than the preset threshold, and the eighth frame is greater than the preset threshold, then the eighth frame is the third content frame. And so on, calculate the content frames in all subframes between the first frame and the last frame. The last frame is directly selected as the last content frame without calculating the difference rate between it and the previous content frame.
[0064] For example, in a surveillance video, there are few people and cars at night, and the video screen changes very little, so there will be few content frames. For example, only a few content frames are extracted in 10 hours. During the day, there are many people and cars, and people and objects in the video screen change frequently. The content frames calculated according to the above method will be much more than at night. Therefore, compared with the key frame, the content frame ensures that all content information of the lens video is not lost, because the key frame may lose part of the lens content. Compared with the solution that calculates and considers every frame of the video, the selection of the content frame only selects part of the video image frame, which greatly reduces the amount of image calculation without losing the content.
[0065] Here, it is assumed that the server's cache only stores a 30-second continuous video frame sequence. For example, if the current time is 19:030, then each content frame of the source channel content frame sequence from 19:00 to 19:029 is stored in the server's cache; for example, if the current time is 19:040, then each content frame of the source channel content frame sequence from 19:10 to 19:039 is stored in the server's cache.
[0066] S306, the first content frame in the target channel content frame sequence is compared with each content frame in the source channel content frame sequence in the cache in turn, and it is determined whether there is a content frame in the source channel content frame sequence that matches the first content frame. If so, the first content frame is recorded as the first matching frame, and the matching frame is a content frame in the target channel content frame sequence, and the difference rate between the matching frame and a certain frame in the source channel content frame sequence is less than or equal to a preset threshold; if not, the next content frame in the target channel content frame sequence is continuously compared with each content frame in the source channel content frame sequence in turn until the first matching frame is found; and so on, a plurality of matching frames are obtained.
[0067] Specifically, after the video of the target channel is connected to the server, the first content frame V1 in the target channel content frame sequence is compared with each content frame of the source channel content frame sequence in the cache in turn to determine whether there is a content frame in the source channel content frame sequence whose difference rate with the first content frame is less than or equal to a second preset threshold. If so, the first content frame V1 is recorded as the first matching frame P1 (when there are multiple first matching frames, the content frame with the smallest difference rate with the target image feature is taken as the first matching frame). If not, the next content frame of the target channel content frame sequence continues to be compared with each content frame of the source channel content frame sequence in the cache frame by frame until the first matching frame P1 is found; and so on, a number of matching frames are obtained.
[0068] In one or more embodiments, a first difference ratio between a shot frame of an original video frame sequence and a shot frame of a comparison video frame sequence is calculated according to a preset image difference function. When the first difference ratio is less than or equal to a preset difference ratio, it is determined that the shot frame of the original video frame sequence matches the shot frame of the comparison video frame sequence.
[0069] A second difference rate between the middle content frame of the original video frame sequence and the middle content frame of the comparison video frame sequence is calculated according to a preset difference function, and when the second difference rate is less than or equal to the preset difference rate, it is determined that the middle content frame of the original video frame sequence matches the middle content frame of the comparison video frame sequence.
[0070] Specifically, the preset difference rate function here includes but is not limited to the image feature difference rate Dis function, the image histogram distance function, the image similarity calculation function based on feature points, etc. If the frame difference rate of two frames of image to be compared is less than or equal to the preset difference rate, the two frames of image to be compared can be considered to be the same frame image, and the standard for judging whether the two frames of image match can be adjusted according to the change of the preset difference rate.
[0071] S308, determining whether the plurality of matching frames are content frames with continuous serial numbers in the target channel content frame sequence, and whether the serial numbers of the content frames of the source channel content frame sequence that match the plurality of matching frames are continuous in the source channel content frame sequence; if they are continuous, determining whether the duration corresponding to the plurality of matching frames with continuous serial numbers meets a preset duration condition; when the duration corresponding to the plurality of matching frames with continuous serial numbers meets the preset duration condition, determining that the video contents of the source channel and the target channel are consistent.
[0072] In one embodiment, it is assumed that the obtained matching frames are {P1, P2, P3}, and the content frames of the source channel content frame sequence matching the matching frames {P1, P2, P3} are {Q1, Q2, Q3}, and the sequence numbers of {Q1, Q2, Q3} are continuous in the source channel content frame sequence. This indicates that the video contents of the source channel and the target channel start to coincide, and the sequence number of the target video content frame P1 with the coincident start can be determined. According to the time information corresponding to the target video content frame P1 with the coincident start, the time information of the target channel switching into the video to be broadcasted can be accurately obtained.
[0073] When it is determined that the serial numbers of several matching frames are continuous, and the serial numbers of the corresponding content frame sequences in the source channel are also continuous, it can be said that the video content has begun to match. In order to accurately confirm whether all the video content matches, it is also necessary to determine whether the duration corresponding to several matching frames with continuous serial numbers meets the preset duration condition; when the duration corresponding to several matching frames with continuous serial numbers meets the preset duration condition, it is determined that the video content of the source channel and the target channel are consistent.
[0074] In one embodiment, determining whether the duration corresponding to a number of matching frames with consecutive serial numbers is greater than or equal to a first preset duration includes: before the current moment, when the number of shots corresponding to the number of matching frames with consecutive serial numbers is greater than or equal to a first preset number threshold, determining that the duration corresponding to the number of matching frames with consecutive serial numbers meets the preset duration condition.
[0075] Optionally, when several matching frames with consecutive serial numbers are located in multiple shots, it can be determined whether the number of consecutive matching shots is greater than or equal to a first preset number threshold. The consecutive matching shots are shots corresponding to several matching frames with consecutive serial numbers. When the number of consecutive matching shots is greater than or equal to the first preset number threshold, it means that multiple shots are matched, so there is no need to calculate the corresponding duration. The first preset number threshold can be set according to actual conditions, and the embodiment of the present application does not limit it.
[0076] In one embodiment, if a plurality of matching frames with consecutive serial numbers are located in only one shot, such as a one-shot shooting method, it is also possible to determine whether the duration corresponding to the plurality of matching frames with consecutive serial numbers in the shot is greater than or equal to a first preset duration. When the time difference between the current moment and the time corresponding to the first matching frame in the plurality of matching frames with consecutive serial numbers is greater than or equal to the first preset duration, it is determined that the plurality of matching frames with consecutive serial numbers meet the preset duration condition. If the plurality of matching frames with consecutive serial numbers are located in multiple shots, it is also possible to determine whether the duration corresponding to the plurality of matching frames with consecutive serial numbers in the shot is greater than or equal to the first preset duration.
[0077] Specifically, it is assumed that the first preset number threshold set here is 10, and the first preset duration is 30 seconds; before the current moment, when the number of shots corresponding to several matching frames with consecutive sequence numbers in the target channel content frame sequence is greater than or equal to 10, it is determined that the video contents of the source channel and the target channel at the current moment are consistent; or before the current moment, when the duration corresponding to several matching frames with consecutive sequence numbers in the target channel content frame sequence is greater than or equal to 30 seconds, it is determined that the video contents of the source channel and the target channel at the current moment are consistent.
[0078] Through the method of the present application, it is possible to accurately detect whether the video contents of multiple channels are consistent and when they start to become consistent. In the live broadcast scenario of TV programs, the video content and cut-in time of the source channel broadcast by other target channels can be accurately identified.
[0079] In an exemplary scenario, after obtaining the cut-in time of other target channels, it is also necessary to determine the cut-out time of the target channel. When a TV program is broadcast live, some TV stations cut out the program in advance in order to play more advertisements, which violates relevant regulations. Therefore, after detecting that the video playback content is consistent, the method of the present application can also detect when the inconsistency begins.
[0080] In one or more embodiments, the multi-channel video content comparison method further includes: when a number of matching frames are content frames with non-continuous sequence numbers in the target channel content frame sequence, and / or when the content frames of the source channel content frame sequence that match the number of matching frames are content frames with non-continuous sequence numbers in the source channel content frame sequence, determining that the video contents of the source channel and the target channel are inconsistent.
[0081] Specifically, for example, if a number of matching frames are {P1, P3, P4}, it is determined that the video contents of the source channel and the target channel are inconsistent; for another example, if a number of matching frames are {P1, P2, P3}, and the content frames of the source channel content frame sequence that match the number of matching frames {P1, P2, P3} are {Q1, Q3, Q2}, it is determined that the video contents of the source channel and the target channel are inconsistent.
[0082] In one or more embodiments, determining at the current moment that the video contents of the source channel and the target channel are inconsistent includes: from the first moment to the current moment, when the number of consecutive unmatched shots is greater than or equal to a second preset number threshold, determining that the video contents of the source channel and the target channel at the current moment are inconsistent; the consecutive unmatched shots include: a number of matching frames with non-continuous sequence numbers in the target channel content frame sequence, or shots corresponding to content frames of a source channel content frame sequence that match a number of matching frames when the sequence numbers in the source channel content frame sequence are non-continuous; the first moment is a moment that has been determined to be consistent in content comparison before the current moment.
[0083] Alternatively, from the first moment to the current moment, when the duration of continuous mismatch of content frames is greater than or equal to a second preset duration, it is determined that the video contents of the source channel and the target channel at the current moment are inconsistent; the duration of continuous mismatch of content frames includes: a number of matching frames with non-continuous sequence numbers in the target channel content frame sequence, or a duration corresponding to the non-continuous sequence numbers of each content frame in the source channel content frame sequence that matches a number of matching frames in the source channel content frame sequence.
[0084] Specifically, in the embodiment of the present application, for example, at the first moment 19:30 is the moment that has been determined to be consistent with the content comparison, the second preset number threshold is 5, and the second preset duration is 6 seconds. From then until the current moment, if the number of consecutive mismatched shots is greater than or equal to 5, or when the content frame is continuously mismatched for a duration greater than or equal to 6 seconds, it is determined that the video content of the source channel and the target channel is inconsistent at the current moment, and the content frame number of the target channel that starts to be inconsistent can be determined. According to the time information corresponding to the content frame number of the target channel that starts to be inconsistent, the time information of the target channel cutting out the video to be broadcast is obtained.
[0085] According to the video content consistency comparison method provided by the present application, by adopting content frames that can represent the content of the shot, it is possible to determine that the video content of the source channel and the target channel are consistent without comparing all frames of the source channel and the target channel, and there is no need to build a machine learning model for video content comparison. This not only improves the accuracy of multi-channel video content detection, but also improves the efficiency of multi-channel video content detection, thereby solving the technical problems of low accuracy and poor timeliness in detecting multi-channel video content in related technologies.
[0086] In an application embodiment of the present application, the multi-channel video content consistency real-time detection technology does not use the traditional frame-by-frame comparison method, but determines the consistency of the video content by comparing the lens frame and the intermediate content frame. Figure 6 As shown, the multi-channel video content consistency comparison process includes the following steps:
[0087] Step 1: Perform shot detection on the frame sequences of the source channel and the target channel respectively, find the shot frames and the intermediate content frames, and perform the following operations on the frame sequences of the source channel and the target channel at the same time:
[0088] a) Determine whether the current frame of the source channel is a shot frame or an intermediate content frame, and if so, put it into the cache of the server.
[0089] b) Determine whether the current frame of the target channel is a shot frame or an intermediate content frame. If not, re-execute step 1.
[0090] Step 2: If it is determined that the target channel and the source channel play the same content at the current moment, go to step 5; otherwise, go to step 3.
[0091] Step 3: Calculate the difference between the current shot frame and intermediate content frame of the target channel and the shot frame and intermediate content frame in the source channel cache according to the difference function, and find the matching shot frame or intermediate content frame according to the difference.
[0092] Step 4: Determine the lens matching status of the source channel and the target channel. The determination conditions include:
[0093] 1) Match the source and target channel’s shot frames;
[0094] 2) Matching the middle content frames of the source and target channels;
[0095] 3) the plurality of matching frames have content frames with consecutive sequence numbers in the target channel content frame sequence, and the content frames of the source channel content frame sequence that match the plurality of matching frames have consecutive sequence numbers in the source channel content frame sequence;
[0096] 4) Satisfy one of the conditions a) and b):
[0097] a) The number of consecutive matching shots corresponding to a number of matching frames is not less than MatchShotCount (preset threshold);
[0098] b) The continuous matching duration corresponding to a number of matching frames is not less than MatchSecs (preset threshold, in seconds);
[0099] When the above four conditions are met at the same time, the video content of the source channel and the target channel are consistent, otherwise the video content of the source channel and the target channel are inconsistent.
[0100] Step 5: Determine that the current target channel video playback content is consistent with the source channel, so determine whether the source channel and the target video content are consistent at the subsequent moments of the current moment based on the timing. Just calculate whether the target video lens frame or intermediate content frame matches the corresponding lens frame or content frame of the source video in the cache. If they match, the source channel and the target channel content are still consistent, otherwise if one of the following conditions is met:
[0101] a) The number of consecutive mismatched shots between the source channel and the target channel exceeds MissShotCount (preset threshold);
[0102] b) The content frames of the source channel and the target channel do not match for a continuous period exceeding MissSecs (preset threshold, in seconds);
[0103] It is determined that the source and target video contents are no longer consistent.
[0104] like Figure 7As shown, in the source shot sequence (the shot sequence corresponding to the source channel), shot 1 matches the content frame corresponding to the current shot of the target shot sequence (the shot sequence corresponding to the target channel), but the timing is inconsistent, determining that the content of shot 1 and the current shot are inconsistent.
[0105] like Figure 8 As shown, in the source shot sequence (the shot sequence corresponding to the source channel), shot 1 matches the content frame corresponding to the current shot of the target shot sequence (the shot sequence corresponding to the target channel), and the timing is also consistent, which determines that the content of shot 1 is consistent with the current shot.
[0106] The embodiments of the present invention also have the following beneficial effects:
[0107] 1. The embodiment of the present invention uses the Uniform LBP feature as the basic feature for image description. This feature is more sensitive to image texture changes than other features, and is similar to other features in terms of stability to movement changes. A graph model is used in the construction of the difference degree, which can reduce abnormal disturbances while highlighting the differences between different images.
[0108] 2. The embodiment of the present invention analyzes the pixel domain features based on the dynamic division of the image area, uses a sliding window to scan and analyze the feature space of the previous and next frames, calculates the regional feature changes of the previous and next frames, finds the mutation point of the video content change, determines the lens boundary, and realizes sample-free autonomous learning, which improves the speed, efficiency, accuracy and other performance indicators of massive media video lens content frame processing by an order of magnitude. The lens and content frame extraction computing power exceeds 160,000 frames / second, and the calculation process uses a CPU core with a main frequency of 3.0GHz, with an accuracy rate of more than 95%.
[0109] 3. Two servers can support real-time content comparison of 100 broadcast streams and live streams, with a response time of seconds, and both the capacity and energy consumption have reached the international advanced level. The switching-in and switching-out information of the video content of the source channel of each target channel can be monitored in real time in the background.
[0110] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0111] According to another aspect of the embodiments of the present invention, a multi-channel video content comparison device for implementing the multi-channel video content comparison method is also provided. Fig. 9As shown, the device comprises:
[0112] An acquisition unit 902 acquires in real time and synchronously an original video frame sequence transmitted from a source channel and a comparison video frame sequence transmitted from a target channel;
[0113] The extraction unit 904 is used to extract the content frames of the original video frame sequence to obtain the source channel content frame sequence; extract and compare the content frames of the original video frame sequence to obtain the target channel content frame sequence, and sequentially put the content frames of the source channel content frame sequence before the current moment into the cache of the server according to the time period; wherein the content frame is a frame representing the content of the lens, including the first frame, the last frame, and N middle content frames, N is a natural number, and the middle content frame is obtained by calculating the difference rate between all sub-frames of a lens except the first and last two frames and the previous content frame, and when the difference rate is greater than a first preset threshold; the content frame includes the lens frame, and the lens frame includes the first frame and the last frame;
[0114] The comparison unit 906 is used to compare the first content frame in the target channel content frame sequence with each content frame in the source channel content frame sequence in the cache in turn, and determine whether there is a content frame in the source channel content frame sequence that matches the first content frame. If yes, the first content frame is recorded as the first matching frame, and the matching frame is a content frame in the target channel content frame sequence whose difference rate with a certain frame in the source channel content frame sequence is less than a second preset threshold; if no, continue to compare the next content frame in the target channel content frame sequence with each content frame in the source channel content frame sequence in the cache in turn until the first matching frame is found; and so on, to obtain a plurality of matching frames;
[0115] The judgment unit 908 is used to judge whether the several matching frames are content frames with continuous serial numbers in the target channel content frame sequence, and whether the serial numbers of the content frames of the source channel content frame sequence matching the several matching frames are continuous in the source channel content frame sequence; if they are continuous, judge whether the duration corresponding to the several matching frames with continuous serial numbers meets the preset duration condition; when the duration corresponding to the several matching frames with continuous serial numbers meets the preset duration condition, it is determined that the video contents of the source channel and the target channel are consistent.
[0116] In an embodiment of the present invention, by adopting content frames that can represent the content of the shot, it is possible to determine that the video contents of the source channel and the target channel are consistent without comparing all frames of the source channel and the target channel, and there is no need to build a machine learning model for video content comparison, which not only improves the accuracy of multi-channel video content detection, but also improves the efficiency of multi-channel video content detection, thereby solving the technical problems of low accuracy and poor timeliness in detecting multi-channel video content in related technologies.
[0117] According to another aspect of the embodiments of the present invention, there is also provided an electronic device for implementing the above-mentioned multi-channel video content comparison method. The electronic device may be Fig.10 The terminal device or server shown in the figure. This embodiment is described by taking the electronic device as a terminal as an example. Fig.10 As shown, the electronic device includes a memory 1002 and a processor 1004. The memory 1002 stores a computer program, and the processor 1004 is configured to execute the steps in any of the above method embodiments through the computer program.
[0118] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.
[0119] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0120] S1, real-time synchronous acquisition of the original video frame sequence transmitted by the source channel and the comparison video frame sequence transmitted by the target channel;
[0121] S2, extracting content frames of the original video frame sequence to obtain a source channel content frame sequence; extracting and comparing content frames of the video frame sequence to obtain a target channel content frame sequence, and sequentially placing each content frame of the source channel content frame sequence before the current moment into the cache of the server according to time periods; wherein the content frame is a frame representing the content of a shot, including a first frame, a last frame, and N intermediate content frames, N being a natural number, and the intermediate content frame is obtained by calculating the difference rate between all sub-frames of a shot except the first and last two frames and the previous content frame, and when the difference rate is greater than a first preset threshold; the content frame includes the shot frame, and the shot frame includes the first frame and the last frame;
[0122] S3, sequentially comparing the first content frame in the target channel content frame sequence with each content frame in the source channel content frame sequence in the cache, and determining whether there is a content frame in the source channel content frame sequence that matches the first content frame. If yes, the first content frame is recorded as the first matching frame, and the matching frame is a content frame in the target channel content frame sequence whose difference rate with a certain frame in the source channel content frame sequence is less than or equal to a second preset threshold. If no, then continuing to sequentially compare the next content frame in the target channel content frame sequence with each content frame in the source channel content frame sequence in the cache, until the first matching frame is found; and so on, obtaining a plurality of matching frames.
[0123] S4, determine whether the plurality of matching frames are content frames with continuous serial numbers in the target channel content frame sequence, and whether the serial numbers of the content frames of the source channel content frame sequence matching the plurality of matching frames are continuous in the source channel content frame sequence; if they are continuous, determine whether the duration corresponding to the plurality of matching frames with continuous serial numbers meets a preset duration condition; when the duration corresponding to the plurality of matching frames with continuous serial numbers meets the preset duration condition, determine that the video contents of the source channel and the target channel are consistent.
[0124] Alternatively, a person skilled in the art may understand that: Fig.10 The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (MID), a PAD, and other terminal devices. Fig.10 The electronic device and the electronic equipment described above are not limited in structure. Fig.10 More or fewer components (such as network interfaces, etc.) as shown in, or with Fig.10 Different configurations are shown.
[0125] Among them, the memory 1002 can be used to store software programs and modules, such as the program instructions / modules corresponding to the multi-channel video content comparison method and device in the embodiment of the present invention. The processor 1004 executes various functional applications and data processing by running the software programs and modules stored in the memory 1002, that is, to implement the above-mentioned multi-channel video content comparison method. The memory 1002 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1002 may further include a memory remotely arranged relative to the processor 1004, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 1002 can be specifically, but not limited to, used to store information such as lens frames and content frames. As an example, such as Fig.10 As shown, the memory 1002 may include but is not limited to the segmentation unit 1702, the acquisition unit 1704 and the first determination unit 1706 in the multi-channel video content comparison device. In addition, it may also include but is not limited to other module units in the multi-channel video content comparison device, which will not be repeated in this example.
[0126] Optionally, the transmission device 1006 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wired network and a wireless network. In one example, the transmission device 1006 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 1006 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0127] In addition, the electronic device further includes: a display 1008 for displaying the processing result of the bill subtask; and a connection bus 1010 for connecting the various module components in the electronic device.
[0128] According to one aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above-mentioned multi-channel video content comparison method, wherein the computer program is configured to perform the steps of any one of the above-mentioned method embodiments when running.
[0129] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0130] S1, real-time synchronous acquisition of the original video frame sequence transmitted by the source channel and the comparison video frame sequence transmitted by the target channel;
[0131] S2, extracting the content frames of the original video frame sequence to obtain the source channel content frame sequence; extracting the content frames of the comparison video frame sequence to obtain the target channel content frame sequence, and sequentially placing the content frames of the source channel content frame sequence before the current moment into the cache of the server according to time periods; wherein the content frame is a frame representing the content of a shot, including a first frame, a last frame, and N intermediate content frames, N is a natural number, and the intermediate content frame is obtained by calculating the difference rate between all subframes of a shot except the first and last two frames and the previous content frame, and when the difference rate is greater than a first preset threshold; the content frame includes the shot frame, and the shot frame includes the first frame and the last frame;
[0132] S3, sequentially comparing the first content frame in the target channel content frame sequence with each content frame in the source channel content frame sequence in the cache, and determining whether there is a content frame in the source channel content frame sequence that matches the first content frame; if so, the first content frame is recorded as the first matching frame, and the matching frame is a content frame in the target channel content frame sequence whose difference rate with a certain frame in the source channel content frame sequence is less than or equal to a second preset threshold; if not, then continuing to sequentially compare the next content frame in the target channel content frame sequence with each content frame in the source channel content frame sequence in the cache, until the first matching frame is found; and so on, obtaining a plurality of matching frames;
[0133] S4, determining whether the plurality of matching frames are content frames with continuous serial numbers in the target channel content frame sequence, and whether the serial numbers of the content frames of the source channel content frame sequence matching the plurality of matching frames are continuous in the source channel content frame sequence; if they are continuous, determining whether the durations corresponding to the plurality of matching frames with continuous serial numbers meet a preset duration condition; when the durations corresponding to the plurality of matching frames with continuous serial numbers meet the preset duration condition, determining that the video contents of the source channel and the target channel are consistent.
[0134] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0135] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0136] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention.
[0137] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0138] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0139] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0140] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0141] The above are only preferred embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A multi-channel video content real-time comparison method, characterized in that: include: Real-time synchronous acquisition of the original video frame sequence transmitted from the source channel and the comparison video frame sequence transmitted from the target channel; Extract the content frames of the original video frame sequence to obtain the source channel content frame sequence; extract the content frames of the comparison video frame sequence to obtain the target channel content frame sequence, and put the content frames of the source channel content frame sequence before the current moment into the cache of the server in sequence according to time periods; wherein the content frame is a frame representing the content of the lens, including the first frame, the last frame, and N intermediate content frames, N is a natural number, and the intermediate content frame is obtained by calculating the difference rate between all sub-frames of a lens except the first and last two frames and the previous content frame, and the difference rate is greater than a first preset threshold; the content frame includes the lens frame, and the lens frame includes the first frame and the last frame; Compare the first content frame in the target channel content frame sequence with each content frame in the source channel content frame sequence in the cache in turn, and determine whether there is a content frame in the source channel content frame sequence that matches the first content frame. If yes, the first content frame is recorded as the first matching frame, and the matching frame is a content frame in the target channel content frame sequence whose difference rate with a certain frame in the source channel content frame sequence is less than or equal to a second preset threshold. If no, continue to compare the next content frame in the target channel content frame sequence with each content frame in the source channel content frame sequence in the cache in turn until the first matching frame is found. And so on, to obtain a plurality of matching frames. Determine whether the plurality of matching frames are content frames with continuous serial numbers in the target channel content frame sequence, and whether the serial numbers of the content frames of the source channel content frame sequence matching the plurality of matching frames are continuous in the source channel content frame sequence; if they are continuous, determine whether the durations corresponding to the plurality of matching frames with continuous serial numbers meet a preset duration condition; when the durations corresponding to the plurality of matching frames with continuous serial numbers meet the preset duration condition, determine that the video contents of the source channel and the target channel are consistent.
2. The method according to claim 1, characterized in that After the real-time synchronous acquisition of the original video frame sequence transmitted from the source channel and the comparison video frame sequence transmitted from the target channel, the method further includes: The shot set corresponding to the comparison video frame sequence of the target channel and the shot set corresponding to the original video frame sequence of the source channel are determined respectively, and the frame sequence corresponding to each shot in the shot set is a group of frame sequences with continuous content.
3. The method according to claim 2, characterized in that Determining whether the durations corresponding to the plurality of matching frames with consecutive serial numbers meet a preset duration condition includes: Before the current moment, when the number of shots corresponding to the plurality of matching frames with consecutive serial numbers is greater than or equal to a first preset number threshold, determining that the duration corresponding to the plurality of matching frames with consecutive serial numbers meets a preset duration condition; or, When the time difference between the current moment and the time corresponding to the first matching frame among the plurality of matching frames with consecutive serial numbers is greater than or equal to the first preset duration, it is determined that the duration corresponding to the plurality of matching frames with consecutive serial numbers meets the preset duration condition.
4. The method according to claim 1, characterized in that The method further comprises: When the sequence numbers of the several matching frames in the target channel content frame sequence are non-continuous content frames, and / or the sequence numbers of the content frames in the source channel content frame sequence that match the several matching frames are non-continuous in the source channel content frame sequence, it is determined that the video contents of the source channel and the target channel are inconsistent.
5. The method according to claim 4, characterized in that Determine at the current moment that the video content of the source channel and the target channel are inconsistent, including: From the first moment to the current moment, when the number of consecutive unmatched shots is greater than or equal to a second preset number threshold, it is determined that the video contents of the source channel and the target channel at the current moment are inconsistent; the consecutive unmatched shots include: the plurality of matching frames whose serial numbers are non-continuous in the target channel content frame sequence, or the shots corresponding to the content frames of the source channel content frame sequence that match the plurality of matching frames when the serial numbers in the source channel content frame sequence are non-continuous; the first moment is a moment that has been determined to be consistent with the content comparison before the current moment; or, From the first moment to the current moment, when the duration of continuous mismatch of content frames is greater than or equal to a second preset duration, it is determined that the video contents of the source channel and the target channel at the current moment are inconsistent; the duration of continuous mismatch of content frames includes: the several matching frames whose sequence numbers are non-continuous in the target channel content frame sequence, or the duration corresponding to the content frames of the source channel content frame sequence that match the several matching frames when the sequence numbers in the source channel content frame sequence are non-continuous.
6. The method according to claim 2, characterized in that Determining a content frame corresponding to each shot in the shot set includes: For each shot in the shot set, the first and last two frames of images of each shot are used as content frames of each shot; Calculate the difference rate between all sub-frames except the first frame and the last frame in each shot and their previous content frame; When the obtained difference rate is greater than a first preset threshold, the subframe is used as the middle content frame: The first frame, the last frame and the middle content frames are combined to form content frames of each shot.
7. The method according to claim 6, characterized in that Calculating the difference between a subframe in a shot and a previous content frame, and when the obtained difference rate is greater than a first preset threshold, using the subframe as the intermediate content frame, comprises: Determine a first characteristic matrix of a current subframe and a modulus of the first characteristic matrix; Determine a second characteristic matrix of a content frame previous to a current subframe and a modulus of the second characteristic matrix; When the modulus of the first feature matrix is greater than a third preset threshold, determining a difference rate between the first feature matrix and the second feature matrix based on a preset difference rate calculation formula; When the difference rate is greater than the first preset threshold, the current subframe is determined to be the middle content frame.
8. The method according to claim 1, characterized in that Before determining that the video contents of the source channel and the target channel are consistent, the method further includes: Calculating a first difference rate between the shot frames of the original video frame sequence and the shot frames of the comparison video frame sequence according to a preset image difference function, and determining that the shot frames of the original video frame sequence match the shot frames of the comparison video frame sequence when the first difference rate is less than or equal to a preset difference rate; A second difference rate between the middle content frame of the original video frame sequence and the middle content frame of the comparison video frame sequence is calculated according to the preset image difference function, and when the second difference rate is less than or equal to the preset difference rate, it is determined that the middle content frame of the original video frame sequence matches the middle content frame of the comparison video frame sequence.
9. A multi-channel video content real-time comparison device, characterized in that: include: An acquisition unit, which synchronously acquires the original video frame sequence transmitted from the source channel and the comparison video frame sequence transmitted from the target channel in real time; The extraction unit is used to extract the content frames of the original video frame sequence to obtain the source channel content frame sequence; extract the content frames of the comparison video frame sequence to obtain the target channel content frame sequence, and put the content frames of the source channel content frame sequence before the current moment into the cache of the server in sequence according to the time period; wherein the content frame is a frame representing the content of the lens, including the first frame, the last frame, and N intermediate content frames, N is a natural number, and the intermediate content frame is obtained by calculating the difference rate between all sub-frames of a lens except the first and last two frames and the previous content frame, and the difference rate is greater than a first preset threshold; the content frame includes the lens frame, and the lens frame includes the first frame and the last frame; a comparing unit, configured to compare the first content frame in the target channel content frame sequence with each content frame in the source channel content frame sequence in the cache in sequence, and determine whether there is a content frame in the source channel content frame sequence that matches the first content frame; if yes, the first content frame is recorded as a first matching frame, and the matching frame is a content frame in the target channel content frame sequence, and the difference rate between the content frame in the source channel content frame sequence and a certain frame in the source channel content frame sequence is less than a second preset threshold; if no, continue to compare the next content frame in the target channel content frame sequence with each content frame in the source channel content frame sequence in sequence, until the first matching frame is found; and so on, to obtain a plurality of matching frames; The judging unit is used to judge whether the plurality of matching frames are content frames with continuous serial numbers in the target channel content frame sequence, and whether the serial numbers of the content frames of the source channel content frame sequence matching the plurality of matching frames are continuous in the source channel content frame sequence; if they are continuous, judging whether the durations corresponding to the plurality of matching frames with continuous serial numbers meet a preset duration condition; when the durations corresponding to the plurality of matching frames with continuous serial numbers meet the preset duration condition, determining that the video contents of the source channel and the target channel are consistent.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 8 through the computer program.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 8 when executed.
Citation Information
Patent Citations
Mistakenly-played video detection method and device
CN104079924A
Video processing method and device, storage medium and electronic device
CN111246178A
Video processing method and device, storage medium and electronic equipment
CN111950653A
Content identification using fingerprint matching
US20130054645A1
Systems and methods for encoding video using higher rate video sequences
US20140003523A1
