A method for monitoring the consistency of live program first broadcast and replay content based on frame comparison
Through the method based on frame comparison, the program header and trailer are identified, video frame alignment and content consistency judgment are performed, which solves the problem of false alarms in live program monitoring in the existing technology, and realizes rapid real-time monitoring of the first broadcast and replay content of live broadcast programs. and accurate consistency judgments.
Patent Information
- Application Number
- CN202311188795.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-15
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2043-09-15
AI Technical Summary
The existing technology has the problem of false alarms in the consistency monitoring of the first broadcast and replay content of live broadcast programs. Especially when the network equipment modifies the code stream content, rapid real-time monitoring cannot be achieved.
A method based on frame comparison is adopted to identify the program title and ending through template matching, obtain the first broadcast video and update the template, compare the scene conversion frame sequence of the replay video and the first broadcast video frame by frame, and use the PSNR algorithm to judge the content consistency to ensure the accuracy of monitoring Immediacy and accuracy.
It realizes rapid real-time monitoring of the first broadcast and replay content of live broadcasts, reduces false alarms, and ensures the accuracy of content consistency judgment and rapid response capabilities.
Smart Images

Figure CN117201845B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of television live program monitoring, and in particular to a method for monitoring the consistency of the first broadcast and replay content of a live program based on frame comparison. Background Art
[0002] As an important information dissemination medium, TV stations have a wide range of influence. The accuracy and credibility of live broadcasts are the cornerstones of protecting audience rights and information security. Any tampering with the program content may lead to misunderstanding, panic or adverse social impact among the public. In the field of monitoring live TV programs, it is crucial to monitor the consistency of the program's first broadcast and replay content, especially news videos. If the content is tampered with, it may have a serious impact on social stability and public order.
[0003] There are two common monitoring solutions for content consistency monitoring of program premieres and replays. One is to encrypt the live stream data, encrypt the live signal on the server side, decrypt and verify it when the client plays it, or compare the extracted video feature code with the server side synchronously. Although this method is simple and efficient, during the stream transmission process, many network devices (such as encoding and transcoding equipment, multiplexing equipment, IP stream matrix, etc.) will modify the stream content (for example: resolution conversion, inserting PSI tables, changing audio and video PID information, etc.), which will cause the stream feature code to change, while the program content itself (audio, video) has not changed, resulting in verification failure and false alarm. The other is to verify the program video content and compare the content consistency of two video files. It does not support monitoring of live signals, and the comparison is based on scene segments rather than frame by frame, which does not meet the requirements of fast real-time monitoring and alarm.
[0004] Therefore, how to achieve instantaneous monitoring of the consistency of the first broadcast and rebroadcast content of a program is a technical problem that needs to be solved urgently in this field. Summary of the invention
[0005] In order to solve the above technical problems, this application proposes the following technical solutions:
[0006] In a first aspect, an embodiment of the present application provides a method for monitoring the consistency of the first broadcast and replay content of a live program based on frame comparison, comprising:
[0007] Obtain the video frame image to be detected according to the live channel UDP multicast video stream and store it in the message queue;
[0008] Identify the opening and ending credits of the first-run program based on template matching and record the first-run video between the opening and ending credits;
[0009] Update the title and end credits templates according to the recorded first broadcast video and extract the scene transition frame sequence of the first broadcast video;
[0010] Replay program titles are identified based on template matching, and the video frame images to be detected are stored in a message queue;
[0011] The replayed video is compared frame by frame with the scene conversion frame sequence of the first broadcast video to achieve frame alignment of the replayed and first broadcast video;
[0012] For the aligned first broadcast video and replay video, content consistency is judged frame by frame, and an alarm signal is output if there is inconsistency.
[0013] In a possible implementation, the step of acquiring the video frame image to be detected according to the live channel UDP multicast video stream and storing it in a message queue includes:
[0014] Create a UDP network connection to receive and identify data packets in real time;
[0015] Get parameter information, transcode the video according to requirements, and then split the video into video frame sequences;
[0016] The image frame is scaled and filtered, and the processed image is stored in the message queue.
[0017] In a possible implementation, the step of performing template matching based recognition of the first-run program title and the last-run program title to record the first-run video between the first-run program title and the last-run program title includes:
[0018] First, each frame image in the header message queue is matched with a set of header template images. When all header templates are configured, the header is recognized.
[0019] The recognition of the ending is also matched with a set of ending template images. When all the ending templates are matched, the ending is recognized;
[0020] When the beginning of the program is recognized, the recording of the live stream is started, and when the end of the program is recognized, the recording of the live stream is stopped to obtain the video file of the first broadcast program;
[0021] When a video frame image matches a template image, the video frame image is replaced with the template image for use in the next template matching.
[0022] In a possible implementation, the template matching is specifically:
[0023] For each frame of the live video and the template image, their difference hash codes are obtained based on the image difference hash algorithm;
[0024] Compare the difference hash codes of the live video image and the title template image frame by frame and calculate the Hamming distance, including: Where: i = 0, 1, .. n-1, x, y are both n-bit codes, Indicates exclusive OR;
[0025] When the Hamming distance is less than the set threshold, it is considered that the template image is matched;
[0026] When all template images are matched, template matching is considered to be achieved.
[0027] In a possible implementation, for each frame image of the live video and the template image, obtaining their difference hash codes based on the image difference hash algorithm includes:
[0028] Reduce each frame image to a fixed size and convert it into a grayscale image;
[0029] Calculate the difference between adjacent pixels of the grayscale image, which is the right pixel value minus the left pixel value;
[0030] When the difference is greater than or equal to 0, the corresponding binary bit is 1, otherwise it is 0;
[0031] Combine the binary bits of all pixels to get the difference hash code of the image.
[0032] In a possible implementation, updating the title and end templates according to the recorded first-broadcast video and extracting the first-broadcast video scene transition frame sequence includes:
[0033] Extract each frame of the video clip in the first time window of the first broadcast video to obtain the first broadcast video stream list A i ;
[0034] For A i All two adjacent frames in the image are compared for similarity based on the SSIM algorithm;
[0035] When the SSIM similarity value calculated between two adjacent frames is less than the set threshold, it is considered that the scene transition frame has been extracted;
[0036] The scene transition frame index and the distance between two adjacent scene transition frames constitute the first broadcast scene transition frame list A ′ i .
[0037] In a possible implementation, the i All two adjacent frames in the image are compared for similarity based on the SSIM algorithm, including:
[0038] A i Perform image preprocessing on the image frames to unify the resolution and size of the images to be compared;
[0039] Segment the image for local comparison or whole image comparison;
[0040] The SSIM values of two adjacent RGB three-channel images are calculated respectively, and the three-channel SSIM mean is used as the image comparison similarity value. The SSIM calculation formula is as follows:
[0041]
[0042] Where: μ x and μ y Represent the pixel averages of the two images x and y, respectively, and use σ x and σ y Respectively represent the pixel standard deviation of the two images x and y, with σ xy represents the pixel covariance of two images x and y, C1 and C2 are constants introduced to avoid the denominator being zero.
[0043] In a possible implementation, the replay video is compared frame by frame with the scene conversion frame sequence of the first-play video to achieve frame alignment of the replay video and the first-play video, including:
[0044] Based on the SSIM algorithm, the replay video stream list B in the message queue i and A ′ i Perform similarity comparison;
[0045] If the matching similarity value is greater than the set threshold, it is considered that the alignment frame has been found. ′ i Find two consecutive aligned frames in B, and the frame interval is the same as B i The intervals between the two corresponding alignment frames are the same, which means that frame alignment is achieved;
[0046] The latter of the two adjacent aligned frames is considered the final aligned frame, and A is deleted. i , B i The video frames preceding the alignment frames in the respective queues are used to achieve video synchronization.
[0047] In a possible implementation, the content consistency judgment is performed frame by frame for the aligned first broadcast video and the replay video, and an alarm signal is output if they are inconsistent, including:
[0048] Based on the PSNR algorithm, the aligned A i and B i Perform similarity comparison frame by frame;
[0049] When the compared PSNR value is greater than the set threshold, the image contents are considered consistent;
[0050] The dislocation comparison mechanism is used to determine the consistency of the content after dislocation comparison. Specifically, if the replay video loses a frame, B i The image frame sequence is shifted right n times and A iRealign and continue the comparison. If the first broadcast video loses a frame, B i The image frame sequence is shifted left n times and A i Realignment, where n is the number of lost frames.
[0051] In a possible implementation, the aligned A is i and B i Perform similarity comparison frame by frame, including:
[0052] Unify the resolution and size of the images to be compared;
[0053] Convert the read video RGB image into a grayscale image;
[0054] Calculate the mean square error (MSE) of the two images. MSE is a measure of the difference in pixel values at each position between the two images. The calculation formula is as follows:
[0055]
[0056] The PSNR value is calculated based on MSE, and the calculation formula is as follows:
[0057]
[0058] Among them, x i is the i-th pixel value of the original image, y i is the i-th pixel value of the image to be compared, m is the total number of image pixels, and MAX is the maximum possible value of the image pixel value.
[0059] In the embodiment of the present application, the program opening and ending are quickly identified through template matching, and the video file of the first broadcast program and the video stream of the replayed program are obtained, which greatly reduces the amount of calculation for frame-by-frame comparison; frame alignment is achieved by real-time comparison of the replayed video stream with the first broadcast video opening scene conversion frame sequence; finally, the first broadcast and replayed video images are compared frame by frame in real time, which ensures the fast and real-time nature of the comparison while taking into account a certain degree of accuracy, so that abnormalities can be discovered and alarms can be issued in the first time. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 A flowchart of a method for monitoring the consistency of the first broadcast and replay content of a live program based on frame comparison provided in an embodiment of the present application;
[0061] Figure 2 A schematic diagram of the content consistency comparison process provided in an embodiment of the present application. DETAILED DESCRIPTION
[0062] The present solution is described below in conjunction with the accompanying drawings and specific implementation methods.
[0063] Figure 1A flowchart of a method for monitoring the consistency of live program premiere and replay content based on frame comparison provided in an embodiment of the present application. Figure 1 The method for monitoring the consistency of the first broadcast and replay content of a live program based on frame comparison in this embodiment includes:
[0064] S101, obtaining a video frame image to be detected according to a live channel UDP multicast video stream and storing it in a message queue.
[0065] Create a UDP network connection, set the multicast address (such as udp: / / @237.1.1.100:1111) to receive data packets in real time, use ffprobe to obtain video information, the video transmission protocol is H.264, the resolution is 1080P, the bit rate is 8.0Mbps, and the frame rate is 25fps. Use ffmpeg to split the video stream into image frame sequences, and scale the images with a scaling ratio of 0.5. Store the processed video frame images in the message queue.
[0066] S102, identifying the opening and ending credits of the first-run program based on template matching and recording the first-run video between the opening and ending credits.
[0067] First, each frame image in the header message queue is matched with a set of header template images. When all header templates are configured, the header is recognized. The tail is also matched with a set of tail template images. When all tail templates are matched, the tail is recognized. When the header is recognized, the live stream recording is started. When the tail is recognized, the live stream recording is stopped and the first broadcast program video file is obtained. When the video frame image matches the template image, the video frame image is replaced with the template image for the next template matching.
[0068] Template matching is as follows: for each frame of the live video and the template image, their difference hash codes are obtained based on the image difference hash algorithm; the difference hash codes of the live video image and the title template image are compared frame by frame, and the Hamming distance is calculated, including: Among them: i = 0, 1, .. n-1, x, y are n-bit codes, ⊕ represents XOR; when the Hamming distance is less than the set threshold, it is considered that the template image is matched; when all template images are matched, it is considered that template matching is achieved. After template matching, video recording should be started or stopped in time. The matching process is required to be fast and accurate, which conforms to the characteristics of the difference hash algorithm. The basic principle of the algorithm is to downsample the image and then calculate the difference between pixels. The calculation process is simple and the processing speed is very fast.
[0069] For each frame image and template image of the live video, their difference hash codes are obtained based on the image difference hash algorithm, including: reducing each frame image to a fixed size and converting it into a grayscale image; calculating the difference between adjacent pixels of the grayscale image, which is the right pixel value minus the left pixel value; when the difference is greater than or equal to 0, the corresponding binary bit is 1, otherwise it is 0; and combining the binary bits of all pixels to obtain the difference hash code of the image.
[0070] In this embodiment, the TS segments of the second time window of the opening and ending of the recent news video are specifically intercepted, and the segments are split into image frame sequences of 250 frames each through ffmpeg as the opening and ending templates. i Each frame of the image in the video is matched with the title template, and the image comparison is performed based on the difference hash algorithm. The original image resolution is 1080P. After scaling by 0.5, the pixel points and information volume are still very large. First, the image to be compared is reduced to 9*8 pixels. The image is grayed out through OpenCV, and its difference hash code is calculated. An image has 8 rows, 9 pixels in each row, and the adjacent pixels in the same row are subtracted to generate 8 differences. 8 bits form a byte. If the color intensity of the previous pixel is greater than that of the second pixel, the difference is set to True (that is, 1), otherwise it is set to False (0). The adjacent pixels are subtracted step by step from the upper left to the lower right to obtain the final difference hash code dHash of the image. Then the difference hash codes of the first broadcast video image and the title template image are compared frame by frame, and their Hamming distance is calculated. The Hamming distance is the number of bits of the statistical dHash difference value. For example, the Hamming distance of dHash 0110 and 1111 is 2. Through experimental data analysis, we set the Hamming distance threshold to 5. When the Hamming distance of the compared images is less than 5, the images are considered to be consistent, that is, the match is successful. When the entire opening template matching is completed, the live video recording begins. After the news video lasts for 25 minutes, the ending template is matched and the recording ends.
[0071] S103, updating the title and ending templates according to the recorded first broadcast video and extracting the scene transition frame sequence of the first broadcast video.
[0072] Extract each frame of the video clip in the first time window of the first broadcast video to obtain the first broadcast video stream list A i ; For A i All two adjacent frames in the video are compared for similarity based on the SSIM algorithm; if the SSIM similarity value calculated between two adjacent frames is less than the set threshold, it is considered that the scene transition frame is extracted; the scene transition frame index and the distance between two adjacent scene transition frames form the first broadcast scene transition frame list A ′ i .
[0073] Similarity comparison based on the SSIM algorithm includes:
[0074] A i Perform image preprocessing on the image frames to unify the resolution and size of the images to be compared;
[0075] Segment the image for local comparison or whole image comparison;
[0076] The SSIM values of two adjacent RGB three-channel images are calculated respectively, and the three-channel SSIM mean is used as the image comparison similarity value. The SSIM calculation formula is as follows:
[0077]
[0078] Where: μ x and μ y Represent the pixel averages of the two images x and y, respectively, and use σ x and σ y Respectively represent the pixel standard deviation of the two images x and y, with σ xy Represents the pixel covariance of two images x and y. C1 and C2 are constants introduced to avoid zero denominator. The value range of SSIM is between -1 and 1. The larger the value, the higher the similarity, and the smaller the value, the lower the similarity. The scene transition frame is the image when the video screen is switched. It has obvious features and high recognition. Therefore, the SSIM algorithm is used here. SSIM can not only reflect the pixel difference between images technically, but also reflect the human eye's perception of the image. It is a comprehensive evaluation of factors such as brightness, contrast and structure.
[0079] In this embodiment, the video file is processed after the first broadcast video recording is finished. The clips of the second time window of the video file are intercepted and split into image frames to replace the original template image to ensure that the template image is always the latest. The TS clips of the first time window of the video file are intercepted and split into image frame sequences by ffmpeg to obtain the image list A. i . Below, we extract A based on the SSIM algorithm i The scene transition frames in the list are first i The images in the list are preprocessed, and important parameters are selected. The image scaling ratio is 0.2, the threshold is 0.6, and the SSIM similarity value of two adjacent frames in the list is calculated. When the value is less than 0.6, it is considered that the scene transition frame is extracted, and the frame index is a ′ i , the distance between two adjacent scene transition frames, that is, the frame interval is l i , (a i ,l i ) constitutes the scene transition frame list A ′ i Basic elements, scene transition frame list A′ i The format is [(a ′ 1,l1),(a ′ 2,l2)...,(a ′ n ,l n )].
[0080] S104, performing replay program title recognition based on template matching, and storing the video frame image to be detected into a message queue.
[0081] Read and replay the video frames of the UDP multicast stream in real time, and store the video frame images to be detected in message queue B i , match each frame of image in the message queue with the title template, and perform image comparison based on the difference hash algorithm. The calculation process is the same as step 2. When the matching of the entire title template is completed, the replay program begins.
[0082] S105, comparing the replayed video frame by frame with the scene conversion frame sequence of the first broadcast video to achieve frame alignment of the replayed and first broadcast video.
[0083] Based on the SSIM algorithm, the replay video stream list B in the message queue i and A ′ i Perform similarity comparison; if the matching similarity value is greater than the set threshold, it is considered that the alignment frame has been found. ′ i Find two consecutive aligned frames in B, and the frame interval is the same as B i The intervals between the two corresponding alignment frames are the same, which means that frame alignment is achieved; the latter frame of the two adjacent alignment frames is considered to be the final alignment frame, and A is deleted. i , B i The video frames before the alignment frames in each queue are aligned to achieve video synchronization. Frame alignment is the comparison between real-time frames and scene transition frames. Combined with the above analysis of the SSIM algorithm, the SSIM algorithm is still used for frame alignment here.
[0084] The replay program starts, and the message queue B i Each frame of the image in the ′ i The images in B are compared frame by frame. First, the resolution and size of the images are unified. i The image in the image is scaled by 0.2, the SSIM threshold is 0.8, and the SSIM similarity value of the comparison image is calculated. When the value is greater than 0.8, it is considered that the alignment frame has been found. ′ i There are two consecutive frames a ′ i and a ′ i+1Respectively with the replay video frame queue B i Frame b in j and b k The similarity value is greater than 0.8 and their frame intervals are the same, that is, kj = l i (allowing 1-2 frames difference), with a ′ i+1 and b k For the final alignment frame, delete the first broadcast video frame list A i Middle ′ i+1 Previous video frame, delete video frame list B i Medium k Previous video frame to achieve video synchronization.
[0085] S106, judging the consistency of the content of the first broadcast video and the replay video after alignment frame by frame, and outputting an alarm signal if they are inconsistent.
[0086] Based on the PSNR algorithm, the aligned A i and B i The similarity comparison is performed frame by frame. When the PSNR value of the comparison is greater than the set threshold, the image content is considered to be consistent; the dislocation comparison mechanism is used to determine the consistency of the content after dislocation comparison. Specifically, if the replay video loses a frame, B i The image frame sequence is shifted right n times and A i Realign and continue the comparison. If the first broadcast video loses a frame, B i The image frame sequence is shifted left n times and A i Realignment, where n is the number of lost frames.
[0087] The PSNR algorithm is used to align the A i and B i The similarity comparison is performed frame by frame, including: unifying the resolution and size of the image to be compared; converting the read video RGB image into a grayscale image; calculating the mean square error (MSE) value of the two images. MSE represents the measure of the difference in pixel values at each position of the two images. The calculation formula is as follows:
[0088]
[0089] The PSNR value is calculated based on MSE, and the calculation formula is as follows:
[0090]
[0091] Among them, x i is the i-th pixel value of the original image, y iis the i-th pixel value of the image to be compared, m is the total number of image pixels, and MAX is the maximum possible value of the image pixel value. The PSNR calculation method is relatively simple, suitable for fast calculation and batch processing, and the calculation is based on the mean square error MSE calculation, which is a mathematically rigorous metric. Therefore, PSNR is used for frame-by-frame comparison consistency here.
[0092] In this embodiment, for the aligned first broadcast video A i List and replay video stream B i List, each frame image in each message queue, first pre-process the image, grayscale the image through OpenCV, calculate the mean square error MSE and PSNR value between the images according to the PSNR calculation formula, the higher the PSNR value, the smaller the difference between the two pictures, the better the picture consistency, generally speaking, PSNR greater than 20dB is excellent, greater than 25dB is very good, if greater than 30dB, it can be called "no distortion", here the PSNR threshold is set to 25dB. In the real environment, frame loss caused by network fluctuations, transcoding anomalies, etc. is actually present, so the dislocation comparison mechanism is introduced. When the comparison content is inconsistent, the left and right shifts B i List n frames, reconnect with A i When the contents of the list comparison and misalignment comparison are determined to be consistent, the image comparison is considered consistent; otherwise, it is inconsistent and an alarm signal is pushed.
[0093] In the embodiments of the present application, "at least one" refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0094] The above is only a specific implementation of the present application. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. The protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for monitoring the consistency of the first broadcast and replay content of a live program based on frame comparison, characterized in that: include: Obtain the video frame image to be detected according to the live channel UDP multicast video stream and store it in the message queue; Based on template matching, the opening and ending of the first broadcast program are identified and the first broadcast video between the opening and ending is recorded, including: First, each frame image in the message queue is matched with a set of title template images. When all title templates are configured, the title is recognized; The recognition of the ending is also matched with a set of ending template images. When all the ending templates are matched, the ending is recognized; When the beginning of the program is recognized, the recording of the live stream is started, and when the end of the program is recognized, the recording of the live stream is stopped to obtain the video file of the first broadcast program; When a video frame image matches a template image, the video frame image is replaced with the template image for the next template matching; Update the title and end credits templates according to the recorded first broadcast video and extract the scene transition frame sequence of the first broadcast video; Replay program titles are identified based on template matching, and the video frame images to be detected are stored in a message queue; The replayed video is compared frame by frame with the scene conversion frame sequence of the first broadcast video to achieve frame alignment of the replayed and first broadcast video; For the aligned first broadcast video and replay video, content consistency is judged frame by frame, and an alarm signal is output if there is inconsistency.
2. The method for monitoring the consistency of the first broadcast and replay content of a live program based on frame comparison according to claim 1, characterized in that: The method of obtaining the video frame image to be detected according to the live channel UDP multicast video stream and storing it in the message queue includes: Create a UDP network connection to receive and identify data packets in real time; Get parameter information, transcode the video according to requirements, and then split the video into video frame sequences; The image frame is scaled and filtered, and the processed image is stored in the message queue.
3. The method for monitoring the consistency of the first broadcast and replay content of a live program based on frame comparison according to claim 1, characterized in that: The template matching is specifically as follows: For each frame of the live video and the template image, their difference hash codes are obtained based on the image difference hash algorithm; Compare the difference hash codes of the live video image and the title template image frame by frame, and calculate the Hamming distance, including: d(x,y)=∑x[i]⊕y[i], where: i=0,1,..n-1, x,y are both n-bit codes, ⊕ means XOR; When the Hamming distance is less than the set threshold, it is considered that the template image is matched; When all template images are matched, template matching is considered to be achieved.
4. The method for monitoring the consistency of the first broadcast and replay content of a live program based on frame comparison according to claim 3 is characterized in that: The method of obtaining the difference hash codes of each frame image and template image of the live video based on the image difference hash algorithm includes: Reduce each frame image to a fixed size and convert it into a grayscale image; Calculate the difference between adjacent pixels of the grayscale image, which is the right pixel value minus the left pixel value; When the difference is greater than or equal to 0, the corresponding binary bit is 1, otherwise it is 0; Combine the binary bits of all pixels to get the difference hash code of the image.
5. The method for monitoring the consistency of the first broadcast and replay content of a live program based on frame comparison according to claim 1, characterized in that: The method of updating the title and end templates according to the recorded first broadcast video and extracting the scene conversion frame sequence of the first broadcast video includes: Extract each frame of the video clip in the first time window of the first broadcast video to obtain the first broadcast video stream list A i ; For A i All two adjacent frames in the image are compared for similarity based on the SSIM algorithm; When the SSIM similarity value calculated between two adjacent frames is less than the set threshold, it is considered that the scene transition frame has been extracted; The scene transition frame index and the distance between two adjacent scene transition frames constitute the first broadcast scene transition frame list A ′ i .
6. The method for monitoring the consistency of the first broadcast and replay content of a live program based on frame comparison according to claim 5, characterized in that: The A i All two adjacent frames in the image are compared for similarity based on the SSIM algorithm, including: A i Perform image preprocessing on the image frames to unify the resolution and size of the images to be compared; Segment the image for local comparison or whole image comparison; Calculate the SSIM values of two adjacent RGB three-channel images respectively, and use the three-channel SSIM mean as the image comparison similarity value. The SSIM calculation formula is as follows: Where: μ x and μ y Represent the pixel averages of the two images x and y, respectively, and use σ x and σ y Respectively represent the pixel standard deviation of the two images x and y, with σ xy represents the pixel covariance of two images x and y, C1 and C2 are constants introduced to avoid the denominator being zero.
7. The method for monitoring the consistency of the first broadcast and replay content of a live program based on frame comparison according to claim 6, characterized in that: The replay video is compared frame by frame with the scene conversion frame sequence of the first play video to achieve frame alignment of the replay video, including: Based on the SSIM algorithm, the replay video stream list B in the message queue i and A ′ i Perform similarity comparison; If the matching similarity value is greater than the set threshold, it is considered that the alignment frame has been found. ′ i Find two consecutive aligned frames in B, and the frame interval is the same as B i The intervals between the two corresponding alignment frames are the same, which means that frame alignment is achieved; The latter of the two adjacent aligned frames is considered the final aligned frame, and A is deleted. i , B i The video frames preceding the alignment frames in the respective queues are used to achieve video synchronization.
8. The method for monitoring the consistency of the first broadcast and replay content of a live program based on frame comparison according to claim 7, characterized in that: The content consistency of the aligned first broadcast video and the replay video is judged frame by frame, and an alarm signal is output if they are inconsistent, including: Based on the PSNR algorithm, the aligned A i and B i Perform similarity comparison frame by frame; When the compared PSNR value is greater than the set threshold, the image contents are considered consistent; The dislocation comparison mechanism is used to determine the consistency of the content after dislocation comparison. Specifically, if the replay video loses a frame, B i The image frame sequence is shifted right n times and A i Realign and continue the comparison. If the first broadcast video loses a frame, B i The image frame sequence is shifted left n times and A i Realignment, where n is the number of lost frames.
9. The method for monitoring the consistency of the first broadcast and replay content of a live program based on frame comparison according to claim 8, characterized in that: The PSNR algorithm is used to align the A i and B i Perform similarity comparison frame by frame, including: Unify the resolution and size of the images to be compared; Convert the read video RGB image into a grayscale image; Calculate the mean square error (MSE) of the two images. MSE represents the difference between the pixel values at each position of the two images. The calculation formula is as follows: The PSNR value is calculated based on MSE, and the calculation formula is as follows: Among them, x i is the i-th pixel value of the original image, y i is the i-th pixel value of the image to be compared, m is the total number of image pixels, and MAX is the maximum possible value of the image pixel value.
