CN113891154A - Method, device, medium and computer equipment for preventing bullet screen from shielding specific target - Google Patents

Method, device, medium and computer equipment for preventing bullet screen from shielding specific target Download PDF

Info

Publication number
CN113891154A
CN113891154A CN202010632606.2A CN202010632606A CN113891154A CN 113891154 A CN113891154 A CN 113891154A CN 202010632606 A CN202010632606 A CN 202010632606A CN 113891154 A CN113891154 A CN 113891154A
Authority
CN
China
Prior art keywords
specific target
function
player
video stream
exists
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010632606.2A
Other languages
Chinese (zh)
Other versions
CN113891154B (en
Inventor
汪刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN202010632606.2A priority Critical patent/CN113891154B/en
Publication of CN113891154A publication Critical patent/CN113891154A/en
Application granted granted Critical
Publication of CN113891154B publication Critical patent/CN113891154B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • H04N21/44008Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics in the video stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/2187Live feed
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs
    • H04N21/23418Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/431Generation of visual interfaces for content selection or interaction; Content or additional data rendering
    • H04N21/4312Generation of visual interfaces for content selection or interaction; Content or additional data rendering involving specific graphical features, e.g. screen layout, special fonts or colors, blinking icons, highlights or animations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/478Supplemental services, e.g. displaying phone caller identification, shopping application
    • H04N21/4788Supplemental services, e.g. displaying phone caller identification, shopping application communicating with other users, e.g. chatting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/488Data services, e.g. news ticker
    • H04N21/4884Data services, e.g. news ticker for displaying subtitles

Abstract

The invention provides a method, a device, a medium and computer equipment for preventing a bullet screen from shielding a specific target, wherein the method comprises the following steps: if the specific target exists in the video stream, extracting the specific target and throwing out a notification message; monitoring the notification message by using a monitoring function, analyzing the player object and acquiring data of a specific target; adding the data of the specific target to a mask layer above the level to which the player belongs by utilizing a superposition function; therefore, the bullet screen information is displayed in the level of the player or in the lower layer of the level of the player, and the specific target is displayed in the upper layer of the level of the player, so that the specific target can be prevented from being shielded when the bullet screen is too much, important display information is prevented from being shielded, and the watching effect in the live broadcast process is ensured.

Description

Method, device, medium and computer equipment for preventing bullet screen from shielding specific target
Technical Field
The invention belongs to the technical field of live broadcast, and particularly relates to a method, a device, a medium and computer equipment for preventing a barrage from shielding a specific target.
Background
In a live broadcast platform, a user generally uses a bullet screen and a main broadcast to perform information interaction so as to realize interaction with the main broadcast.
In a traditional scheme, a barrage is at a level, a player is at a level, the player is used for playing a video stream and displaying live content, and the barrage is directly displayed in the level where the player is located or displayed on the upper layer of the level where the player is located. In this scheme, if the bullet screen is too many, the human face or a specific target may be blocked. Such as: the user can block the face during the speech; the anchor will block the anchor's gun while playing the game; the anchor may block the merchandise while promoting the merchandise.
It can be seen that in the live broadcast process, when the bullet screen volume is relatively large in the prior art, the bullet screen can shield important information, and the live broadcast watching effect is influenced.
Disclosure of Invention
Aiming at the problems in the prior art, the embodiment of the invention provides a method, a device, a medium and computer equipment for preventing a barrage from shielding a specific target, which are used for solving the technical problem that in the prior art, when the barrage volume information is large in the live broadcasting process, the barrage can shield important display information to influence the live broadcasting watching effect.
In a first aspect of the present invention, a method for preventing a barrage from blocking a specific target is provided, where the method is applied to a live broadcast platform, and the method includes:
acquiring a live video stream by using a player, and judging whether a specific target exists in the live video stream;
if the specific target exists in the live video stream, extracting the specific target and throwing out a notification message;
monitoring the notification message by using the monitoring function, judging whether a player object exists in the notification message, and calling a display function to display a mask bullet screen switch on a live broadcast page if the player object exists in the notification message;
when the mask bullet screen switch is determined to be in an open state, analyzing the player object to obtain data of the specific target;
adding the data of the specific target to a mask layer above the level to which the player belongs by utilizing a superposition function; wherein the content of the first and second substances,
the adding the data of the specific target to a mask layer above the level to which the player belongs by using a superposition function comprises:
creating an svGImage object corresponding to the data of the specific target by using an object creating function;
converting the svGImage object into a picture by using an image conversion function;
judging whether a carrier display layer exists or not, and if the carrier display layer exists, displaying the picture by using the carrier display layer;
loading the carrier display layer into the masking layer.
Optionally, before the acquiring the live video stream by using the player, the method further includes:
creating the monitoring function; wherein the snoop function comprises: monitoring the execution parameter, monitoring the execution object and the name of the notification message.
Optionally, the obtaining, by the player, a live video stream, and determining whether a specific target exists in the live video stream include:
reading the live video stream by using a frame reading function to obtain each frame image of the live video stream;
and judging whether the current frame image is empty or not according to the current frame image, and if the current frame image is not empty, determining that the specific target exists in the video stream.
Optionally, the extracting the specific target includes:
for each frame of image of the live video stream, identifying the image by using an identification function to obtain a Haar-like characteristic value of the image;
accelerating the Haar-like characteristic value by using an integral graph to obtain an image characteristic value;
detecting the image characteristic value by using a pre-trained cascade classifier to obtain a detection result; and the detection result is the characteristic target.
Optionally, the parsing the player object to obtain the data of the specific target includes:
analyzing the player object by using an analysis function NSData mask Data notification @ 'body _ mask'; object is the player object, and the data of the specific object is binary data userInfo @ "body _ mask" ].
Optionally, the method further includes:
and if the current frame image is determined to be empty, displaying the current frame image in the level to which the player belongs.
In a second aspect of the present invention, there is provided an apparatus for preventing a bullet screen from blocking a specific target, the apparatus comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a live video stream by using a player and judging whether a specific target exists in the live video stream;
the extracting unit is used for extracting the specific target and throwing out a notification message if the specific target is determined to exist in the live video stream;
the display unit is used for monitoring the notification message by using the monitoring function, judging whether a player object exists in the notification message, and calling a display function to display a mask barrage switch on a live broadcast page if the player object exists in the notification message;
the analysis unit is used for analyzing the player object to obtain the data of the specific target when the mask bullet screen switch is determined to be in the open state;
an adding unit, configured to add the data of the specific target to a mask layer above a level to which the player belongs by using a superposition function; wherein the content of the first and second substances,
the adding unit is specifically configured to:
creating an svGImage object corresponding to the data of the specific target by using an object creating function;
converting the svGImage object into a picture by using an image conversion function;
judging whether a carrier display layer exists or not, and if the carrier display layer exists, displaying the picture by using the carrier display layer;
loading the carrier display layer into the masking layer.
Optionally, the obtaining unit is specifically configured to:
reading the live video stream by using a frame reading function to obtain each frame image of the live video stream;
and judging whether the current frame image is empty or not according to the current frame image, and if the current frame image is not empty, determining that the specific target exists in the video stream.
In a third aspect of the invention, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the method of any one of the first aspects.
In a fourth aspect of the invention, there is provided a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of any one of the first aspect when executing the program.
The invention provides a method, a device, a medium and computer equipment for preventing a bullet screen from shielding a specific target, wherein the method comprises the following steps: acquiring a live video stream by using a player, and judging whether a specific target exists in the live video stream; if the specific target exists in the live video stream, extracting the specific target and throwing out a notification message; monitoring the notification message by using the monitoring function, judging whether a player object exists in the notification message, and calling a display function to display a mask bullet screen switch on a live broadcast page if the player object exists in the notification message; when the mask bullet screen switch is determined to be in an open state, analyzing the player object to obtain data of the specific target; adding the data of the specific target to a mask layer above the level to which the player belongs by utilizing a superposition function; wherein the adding the data of the specific target to the mask layer above the level to which the player belongs by using the superposition function comprises: creating an svGImage object corresponding to the data of the specific target by using an object creating function; converting the svGImage object into a picture by using an image conversion function; judging whether a carrier display layer exists or not, and if the carrier display layer exists, displaying the picture by using the carrier display layer; loading the carrier display layer into the masking layer; therefore, when a specific target exists in the video stream, the player can throw the notification message, the monitoring function can be used for monitoring the notification message thrown by the player at the moment, if the fact that the player object exists in the notification message is determined, the player object is analyzed to obtain data of the specific target, the data are added to a mask layer above the level to which the player belongs to display, and therefore the bullet screen information is displayed in the lower layer or the lower layer of the level to which the player belongs, and the specific target is displayed on the upper layer of the level to which the player belongs, so that the specific target can be prevented from being shielded when the bullet screen is too much, important display information is prevented from being shielded, and the watching effect in the live broadcast process is ensured.
Drawings
Fig. 1 is a schematic flow chart of a method for preventing a bullet screen from blocking a specific target according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a device for preventing a bullet screen from blocking a specific target according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a computer device for preventing a bullet screen from blocking a specific target according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a computer-readable medium structure for preventing a bullet screen from blocking a specific target according to an embodiment of the present invention.
Detailed Description
In order to solve among the prior art at live broadcast in-process when bullet screen volume information is great, the bullet screen can shelter from important show information, influences the technical problem that the live broadcast watched the effect. The invention provides a method, a device, a medium and computer equipment for preventing a bullet screen from shielding a specific target.
The technical solution of the present invention is further described in detail by the accompanying drawings and the specific embodiments.
Example one
The present embodiment provides a method for preventing a bullet screen from blocking a specific target, as shown in fig. 1, the method includes:
s110, acquiring a live video stream by using a player, and judging whether a specific target exists in the live video stream;
before a player is used for acquiring a live broadcast video stream and judging whether a specific target exists in the video stream, a monitoring function needs to be created for monitoring a notification message thrown by the player, and then the specific target is processed, so that bullet screen information does not shield the specific target any more; wherein the specific target may include: human faces and object objects (such as merchandise).
In this embodiment, a creating function is mainly used to create a listening function, where the listening function includes: monitoring execution parameters, monitoring execution objects and names of the notification messages; the creation function is as follows:
[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(onIJKMPMoviePlayerBodyMaskNotification:)
name:DYPlayerBodyMaskNotification object:nil];
the monitoring execution parameter is addObserver, and is mainly used for executing monitoring on the player and obtaining a notification message thrown by the player; the monitoring execution object is a selector, and is used for calling an onjkmpmovieperebodimassmassmasskinotification function to obtain a dyplaylayerbodimassmassmassmasskinotification of the notification message after the notification message is monitored.
As an optional embodiment, the obtaining, by using a player, a live video stream, and determining whether a specific target exists in the live video stream includes:
reading the live video stream by using a frame reading function to obtain each frame image of the live video stream;
and judging whether the current frame image is empty or not according to the current frame image, and if the current frame image is not empty, determining that a specific target exists in the video stream.
Specifically, since the live video stream is actually composed of frames of pictures, each frame of picture is continuously played to form a complete video stream. After the live video stream is acquired by the player, reading each frame image frame in the live video stream by using a frame reading function capture. For each frame, judging whether the current frame image is empty by using an empty function, if so, indicating that no specific target exists in the current frame image, and printing the current frame image by using a printing function printf for direct display. If the current frame image is not empty, the specific target exists in the current frame image, and therefore the specific target exists in the video stream.
S111, if the specific target exists in the live video stream, extracting the specific target and throwing out a notification message;
if it is determined that a specific target exists in the live video stream, in order to prevent the specific target from being blocked by the bullet screen, the specific target needs to be extracted, and meanwhile, a notification message is thrown out, wherein the notification message carries the specific target.
When extracting a specific target, the present embodiment identifies and extracts the specific target by using an identification function detectAndDisplay. Specifically, the identification function detectAndDisplay is to upload the current frame image to a pre-trained identification library cv2 to identify and extract a specific target, and the code is implemented as follows:
#include"cv2/objdetect.hpp"
#include"cv2/highgui.hpp"
#include"cv2/imgproc.hpp"
specifically, the implementation logic of the detectAndDisplay function is as follows:
aiming at each frame of image of the live video stream, identifying the image by using an identification function to obtain a Haar-like characteristic value of the image;
accelerating the Haar-like characteristic value by using an integral graph to obtain an image characteristic value;
detecting the image characteristic value by using a pre-trained cascade classifier to obtain a detection result; and extracting the characteristic target from the detection result which is the characteristic target.
S112, monitoring the notification message by using the monitoring function, judging whether a player object exists in the notification message, and calling a display function to display a mask barrage switch on a live broadcast page if the player object exists in the notification message;
when the specific target is extracted, the specific target needs to be processed. Here, after the specific target is identified, the listening function listens to a notification message, and the function for receiving the notification message is onijkmpmoviplayerbodymassmassNotification, which has a parameter, which may be notification, and is received by using the notification parameter when the notification message is received.
And after receiving the notification message, judging whether a player object exists in the notification message, and if the player object exists in the notification message, calling a display function to display a mask barrage switch on a live broadcast page.
And if the player object exists, extracting the object of the player object notification from the notification message, and calling a display function showdanmumMaskSettings to display a mask bullet screen switch on a live broadcast page. In the live broadcast process, when a user opens a mask bullet screen switch, the function of avoiding the bullet screen from shielding a specific target needs to be opened; when the user does not open the mask bullet screen switch, the function of avoiding the bullet screen to shield a specific target does not need to be opened, so that the live broadcast requirement can be flexibly adapted.
The implementation logic of calling the show function showDanmumMaskSettings to show the mask barrage switch on the live broadcast page is as follows:
call box _ callerWithCheckSelector (DYPRBLandedscapeControlInterfaceProtocol, @ selector (refreshDanmumMaskEntrance:), refreshDanmumMaskEntrance: YES) function, and show the entry of the mask bullet in the live page. Wherein, the callerWithCheckSelector is a calling method; refreshDanmumMaskEntrance is a function used to expose entries, refreshDanmuMaskEntrance is a parameter of the CallerWithCheckSelector; the dypsblandscapecontrolinterfaceprotocol is a preset protocol file.
S113, when the mask bullet screen switch is determined to be in the opening state, analyzing the player object to obtain the data of the specific target;
if the user opens the mask bullet screen switch, the mask bullet screen switch is in an open state, and at the moment, the object of the player object notification is analyzed to obtain the data of the specific object.
As an alternative embodiment, the parsing the player object to obtain the data of the specific target includes:
analyzing the player object by using an analysis function NSData mask Data not diagnosis. Wherein the data of the specific target is binary data userInfo [ @ "body _ mask" ].
And S114, adding the data of the specific target to a cover layer above the level to which the player belongs by utilizing a superposition function.
After the data of the specific target is obtained, the data of the specific target is added to a masking layer above the level to which the player belongs by using a superposition function updatewithsvgmskdata.
The mask layer is pre-constructed above the level to which the player belongs and is mainly used for displaying the specific target, so that the specific target and the bullet screen information are respectively displayed in different levels, and the bullet screen information can be prevented from shielding the specific target.
As an alternative embodiment, the adding the data of the specific target to the mask layer above the player hierarchy by using the overlay function includes:
creating an svgImage object corresponding to the data of the specific target by using an object creation function svgkage svgvgimage [ [ svgkagealloc ] initWithData ];
converting the svGImage object into a picture image by using an image conversion function UIIMage;
judging whether a carrier display layer svgLayer exists or not, and if the carrier display layer exists, displaying a picture by using the carrier display layer;
the carrier display layer is loaded into the mask layer.
Here, after the svGImage object is converted into a picture image, the picture may be processed to have a certain display effect, such as adding a blurring effect to the picture.
After the carrier display layer is loaded on the mask layer, the method further comprises the following steps: and adjusting the position of the carrier display layer based on the preset display position.
The specific code is implemented as follows:
Figure BDA0002566267290000091
when a specific target exists in the video stream, the player throws out the notification message, the notification message thrown out by the player can be monitored by using a monitoring function, if the fact that the player object exists in the notification message is determined, the player object is analyzed to obtain data of the specific target, and the data is added to a mask layer above the level to which the player belongs to be displayed, so that the bullet screen information is displayed in the lower layer or the lower layer of the level to which the player belongs, and the specific target is displayed on the upper layer of the level to which the player belongs, therefore, the specific target can be prevented from being shielded when the bullet screen is too much, important display information is prevented from being shielded, and the watching effect in the live broadcast process is ensured.
Based on the same inventive concept, the application also provides a device for preventing the bullet screen from shielding a specific target, which is detailed in the second embodiment.
Example two
The present embodiment provides an apparatus for preventing a bullet screen from blocking a specific target, as shown in fig. 2, the apparatus includes: the device comprises an acquisition unit 21, an extraction unit 22, a display unit 23, an analysis unit 24 and an addition unit 25; wherein the content of the first and second substances,
an obtaining unit 21, configured to obtain a live video stream by using a player, and determine whether a specific target exists in the video stream;
an extracting unit 22, configured to extract the specific target and throw a notification message if it is determined that the specific target exists in the video stream;
the display unit 23 is configured to monitor the notification message by using the monitoring function, determine whether a player object exists in the notification message, and if it is determined that the player object exists in the notification message, call a display function to display a mask bullet screen switch on a live broadcast page;
the analyzing unit 24 is configured to analyze the player object to obtain data of the specific target when it is determined that the mask bullet screen switch is in an on state;
an adding unit 25, configured to add the data of the specific target to a layout layer above a level to which the player belongs by using a superposition function. Wherein the content of the first and second substances,
the adding unit 25 is specifically configured to:
creating an svGImage object corresponding to the data of the specific target by using an object creating function;
converting the svGImage object into a picture by using an image conversion function;
judging whether a carrier display layer exists or not, and if the carrier display layer exists, displaying the picture by using the carrier display layer;
loading the carrier display layer into the masking layer.
Here, the apparatus further includes: a creation unit 26; before a player is used to obtain a live broadcast video stream and determine whether a specific target exists in the video stream, the creating unit 26 needs to create a monitoring function for monitoring a notification message thrown by the player, and further process the specific target so that the bullet screen information does not shield the specific target any more; wherein the specific target may include: human faces and object objects (such as merchandise).
The creating unit 26 of this embodiment mainly creates a listening function by using a creating function, where the listening function includes: monitoring execution parameters, monitoring execution objects and names of the notification messages; the creation function is as follows:
[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(onIJKMPMoviePlayerBodyMaskNotification:)
name:DYPlayerBodyMaskNotification object:nil];
the monitoring execution parameter is addObserver, and is mainly used for executing monitoring on the player and obtaining a notification message thrown by the player; the monitoring execution object is a selector, and is used for calling an onjkmpmovieperebodimassmassmasskinotification function to obtain a dyplaylayerbodimassmassmassmasskinotification of the notification message after the notification message is monitored.
As an alternative embodiment, the obtaining unit 21 is specifically configured to:
reading the live video stream by using a frame reading function to obtain each frame image of the live video stream;
and judging whether the current frame image is empty or not according to the current frame image, and if the current frame image is not empty, determining that a specific target exists in the video stream.
Specifically, since the live video stream is actually composed of frames of pictures, each frame of picture is continuously played to form a complete video stream. After the live video stream is acquired by the player, reading each frame image frame in the live video stream by using a frame reading function capture. For each frame, judging whether the current frame image is empty by using an empty function, if so, indicating that no specific target exists in the current frame image, and printing the current frame image by using a printing function printf for direct display. If the current frame image is not empty, the specific target exists in the current frame image, and therefore the specific target exists in the video stream.
If it is determined that a specific target exists in the live video stream, in order to prevent the specific target from being blocked by the bullet screen, the extracting unit 22 needs to extract the specific target, and at the same time, a notification message is thrown, where the notification message carries the specific target.
When extracting a specific object, the extracting unit 22 of this embodiment identifies and extracts the specific object by using the identifying function detectAndDisplay. Specifically, the identification function detectAndDisplay is to upload the current frame image to a pre-trained identification library cv2 to identify and extract a specific target, and the code is implemented as follows:
#include"cv2/objdetect.hpp"
#include"cv2/highgui.hpp"
#include"cv2/imgproc.hpp"
specifically, the implementation logic of the detectAndDisplay function is as follows:
aiming at each frame of image of the live video stream, identifying the image by using an identification function to obtain a Haar-like characteristic value of the image;
accelerating the Haar-like characteristic value by using an integral graph to obtain an image characteristic value;
detecting the image characteristic value by using a pre-trained cascade classifier to obtain a detection result; and extracting the characteristic target from the detection result which is the characteristic target.
When the specific target is extracted, the specific target needs to be processed. Here, after the specific target is identified, the listening function listens to a notification message, and the function for receiving the notification message is onijkmpmoviplayerbodymassmassNotification, which has a parameter, which may be notification, and is received by using the notification parameter when the notification message is received.
The display unit 24 is configured to determine whether a player object exists in the notification message after receiving the notification message, and call a display function to display the mask bullet screen switch on the live broadcast page if it is determined that the player object exists in the notification message.
If there is a player object, the presentation unit 23 extracts the player object notification from the notification message, and calls a presentation function showdanmummasksettings to present a mask bullet screen switch on the live page. In the live broadcast process, when a user opens a mask bullet screen switch, the function of avoiding the bullet screen from shielding a specific target needs to be opened; when the user does not open the mask bullet screen switch, the function of avoiding the bullet screen to shield a specific target does not need to be opened, so that the live broadcast requirement can be flexibly adapted.
The implementation logic of calling the show function showDanmumMaskSettings to show the mask barrage switch on the live broadcast page is as follows:
call box _ callerWithCheckSelector (DYPRBLandedscapeControlInterfaceProtocol, @ selector (refreshDanmumMaskEntrance:), refreshDanmumMaskEntrance: YES) function, and show the entry of the mask bullet in the live page. Wherein, the callerWithCheckSelector is a calling method; refreshDanmumMaskEntrance is a function used to expose entries, refreshDanmuMaskEntrance is a parameter of the CallerWithCheckSelector; the dypsblandscapecontrolinterfaceprotocol is a preset protocol file.
If the user opens the mask bullet screen switch, the mask bullet screen switch is in an open state, and the parsing unit 24 parses the object of the player object notification.
As an optional embodiment, the parsing unit 24 is specifically configured to:
analyzing the player object by using an analysis function NSData mask Data not diagnosis.object userinfo @ 'body _ mask'; wherein the data of the specific target is binary data userInfo [ @ "body _ mask" ].
After acquiring the data of the specific target, the overlay unit 25 is configured to add the data of the specific target to a layout layer above a level to which the player belongs by using an overlay function updatewithsvgmsdata.
The mask layer is pre-constructed above the level to which the player belongs and is mainly used for displaying the specific target, so that the specific target and the bullet screen information are respectively displayed in different levels, and the bullet screen information can be prevented from shielding the specific target.
As an alternative embodiment, the superimposing unit 25 is specifically configured to:
creating an svgImage object corresponding to the data of the specific target by using an object creation function svgkage svgvgimage [ [ svgkagealloc ] initWithData ];
converting the svGImage object into a picture image by using an image conversion function UIIMage;
judging whether a carrier display layer svgLayer exists or not, and if the carrier display layer exists, displaying a picture by using the carrier display layer;
the carrier display layer is loaded into the mask layer.
Here, after the svGImage object is converted into a picture image, the picture may be processed to have a certain display effect, such as adding a blurring effect to the picture.
After the carrier display layer is loaded on the mask layer, the method further comprises the following steps: and adjusting the position of the carrier display layer based on the preset display position.
The specific code is implemented as follows:
Figure BDA0002566267290000141
when a specific target exists in the video stream, the player throws out the notification message, the notification message thrown out by the player can be monitored by using a monitoring function, if the fact that the player object exists in the notification message is determined, the player object is analyzed to obtain data of the specific target, and the data is added to a mask layer above the level to which the player belongs to be displayed, so that the bullet screen information is displayed in the lower layer or the lower layer of the level to which the player belongs, and the specific target is displayed on the upper layer of the level to which the player belongs, therefore, the specific target can be prevented from being shielded when the bullet screen is too much, important display information is prevented from being shielded, and the watching effect in the live broadcast process is ensured.
EXAMPLE III
The present embodiment provides a computer apparatus, as shown in fig. 3, including a memory 310, a processor 320, and a computer program 311 stored in the memory 310 and executable on the processor 320, where the processor 320 executes the computer program 311 to implement the following steps:
acquiring a live video stream by using a player, and judging whether a specific target exists in the live video stream;
if the specific target exists in the live video stream, extracting the specific target and throwing out a notification message;
monitoring the notification message by using the monitoring function, judging whether a player object exists in the notification message, and calling a display function to display a mask bullet screen switch on a live broadcast page if the player object exists in the notification message;
when the mask bullet screen switch is determined to be in an open state, analyzing the player object to obtain data of the specific target;
adding the data of the specific target to a mask layer above the level to which the player belongs by utilizing a superposition function; wherein the content of the first and second substances,
the adding the data of the specific target to a mask layer above the level to which the player belongs by using a superposition function comprises:
creating an svGImage object corresponding to the data of the specific target by using an object creating function;
converting the svGImage object into a picture by using an image conversion function;
judging whether a carrier display layer exists or not, and if the carrier display layer exists, displaying the picture by using the carrier display layer;
loading the carrier display layer into the masking layer.
In particular, when the processor 320 executes the computer program 311, any one of the first embodiment can be implemented.
Since the computer device described in this embodiment is a device used for implementing the method for preventing the bullet screen from blocking the specific target in the first embodiment of the present application, based on the method described in the first embodiment of the present application, a person skilled in the art can understand a specific implementation manner of the computer device of this embodiment and various variations thereof, and therefore, a detailed description of how the server implements the method in the embodiment of the present application is not provided here. The equipment used by those skilled in the art to implement the methods in the embodiments of the present application is within the scope of the present application.
Based on the same inventive concept, the application provides a storage medium corresponding to the fourth embodiment, which is described in detail in the fourth embodiment.
Example four
The present embodiment provides a computer-readable storage medium 400, as shown in fig. 4, on which a computer program 411 is stored, which computer program 411, when being executed by a processor, realizes the steps of:
acquiring a live video stream by using a player, and judging whether a specific target exists in the live video stream;
if the specific target exists in the live video stream, extracting the specific target and throwing out a notification message;
monitoring the notification message by using the monitoring function, judging whether a player object exists in the notification message, and calling a display function to display a mask bullet screen switch on a live broadcast page if the player object exists in the notification message;
when the mask bullet screen switch is determined to be in an open state, analyzing the player object to obtain data of the specific target;
adding the data of the specific target to a mask layer above the level to which the player belongs by utilizing a superposition function; wherein the content of the first and second substances,
the adding the data of the specific target to a mask layer above the level to which the player belongs by using a superposition function comprises:
creating an svGImage object corresponding to the data of the specific target by using an object creating function;
converting the svGImage object into a picture by using an image conversion function;
judging whether a carrier display layer exists or not, and if the carrier display layer exists, displaying the picture by using the carrier display layer;
loading the carrier display layer into the masking layer.
In a specific implementation, when the computer program 411 is executed by a processor, any one of the first embodiment may be implemented.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
The above description is only exemplary of the present application and should not be taken as limiting the scope of the present application, as any modifications, equivalents, improvements, etc. made within the spirit and principle of the present application should be included in the scope of the present application.

Claims (10)

1. A method for preventing a barrage from shielding a specific target is applied to a live platform, and comprises the following steps:
acquiring a live video stream by using a player, and judging whether a specific target exists in the live video stream;
if the specific target exists in the live video stream, extracting the specific target and throwing out a notification message;
monitoring the notification message by using the monitoring function, judging whether a player object exists in the notification message, and calling a display function to display a mask bullet screen switch on a live broadcast page if the player object exists in the notification message;
when the mask bullet screen switch is determined to be in an open state, analyzing the player object to obtain data of the specific target;
adding the data of the specific target to a mask layer above the level to which the player belongs by utilizing a superposition function; wherein the content of the first and second substances,
the adding the data of the specific target to a mask layer above the level to which the player belongs by using a superposition function comprises:
creating an svGImage object corresponding to the data of the specific target by using an object creating function;
converting the svGImage object into a picture by using an image conversion function;
judging whether a carrier display layer exists or not, and if the carrier display layer exists, displaying the picture by using the carrier display layer;
loading the carrier display layer into the masking layer.
2. The method of claim 1, wherein prior to obtaining the live video stream with the player, further comprising:
creating the monitoring function; wherein the snoop function comprises: monitoring the execution parameter, monitoring the execution object and the name of the notification message.
3. The method of claim 1, wherein the obtaining a live video stream with a player and determining whether a specific target exists in the live video stream comprises:
reading the live video stream by using a frame reading function to obtain each frame image of the live video stream;
and judging whether the current frame image is empty or not according to the current frame image, and if the current frame image is not empty, determining that the specific target exists in the video stream.
4. The method of claim 1, wherein said extracting the specific target comprises:
for each frame of image of the live video stream, identifying the image by using an identification function to obtain a Haar-like characteristic value of the image;
accelerating the Haar-like characteristic value by using an integral graph to obtain an image characteristic value;
detecting the image characteristic value by using a pre-trained cascade classifier to obtain a detection result; and the detection result is the characteristic target.
5. The method of claim 1, wherein the parsing the player object to obtain the target-specific data comprises:
analyzing the player object by using an analysis function NSData mask Data notification. Object is the player object, and the data of the specific object is binary data userInfo @ "body _ mask" ].
6. The method of claim 4, wherein the method further comprises:
and if the current frame image is determined to be empty, displaying the current frame image in the level to which the player belongs.
7. An apparatus for preventing a bullet screen from blocking a specific target, the apparatus comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a live video stream by using a player and judging whether a specific target exists in the live video stream;
the extracting unit is used for extracting the specific target and throwing out a notification message if the specific target is determined to exist in the live video stream;
the display unit is used for monitoring the notification message by using the monitoring function, judging whether a player object exists in the notification message, and calling a display function to display a mask barrage switch on a live broadcast page if the player object exists in the notification message;
the analysis unit is used for analyzing the player object to obtain the data of the specific target when the mask bullet screen switch is determined to be in the open state;
an adding unit, configured to add the data of the specific target to a mask layer above a level to which the player belongs by using a superposition function; wherein the content of the first and second substances,
the adding unit is specifically configured to:
creating an svGImage object corresponding to the data of the specific target by using an object creating function;
converting the svGImage object into a picture by using an image conversion function;
judging whether a carrier display layer exists or not, and if the carrier display layer exists, displaying the picture by using the carrier display layer;
loading the carrier display layer into the masking layer.
8. The apparatus of claim 7, wherein the obtaining unit is specifically configured to:
reading the live video stream by using a frame reading function to obtain each frame image of the live video stream;
and judging whether the current frame image is empty or not according to the current frame image, and if the current frame image is not empty, determining that the specific target exists in the video stream.
9. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the method of any one of claims 1 to 6.
10. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of any of claims 1 to 6 when executing the program.
CN202010632606.2A 2020-07-02 2020-07-02 Method, device, medium and computer equipment for preventing bullet screen from shielding specific target Active CN113891154B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010632606.2A CN113891154B (en) 2020-07-02 2020-07-02 Method, device, medium and computer equipment for preventing bullet screen from shielding specific target

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010632606.2A CN113891154B (en) 2020-07-02 2020-07-02 Method, device, medium and computer equipment for preventing bullet screen from shielding specific target

Publications (2)

Publication Number Publication Date
CN113891154A true CN113891154A (en) 2022-01-04
CN113891154B CN113891154B (en) 2023-09-26

Family

ID=79012534

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010632606.2A Active CN113891154B (en) 2020-07-02 2020-07-02 Method, device, medium and computer equipment for preventing bullet screen from shielding specific target

Country Status (1)

Country Link
CN (1) CN113891154B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105338410A (en) * 2014-07-07 2016-02-17 乐视网信息技术(北京)股份有限公司 Method and device for displaying barrage of video
CN105930543A (en) * 2016-06-28 2016-09-07 武汉斗鱼网络科技有限公司 Control method and device based on webpage bullet screen level
CN108881995A (en) * 2018-07-17 2018-11-23 上海哔哩哔哩科技有限公司 Video barrage masking-out method for drafting, barrage playback method, device and medium
CN109309861A (en) * 2018-10-30 2019-02-05 广州虎牙科技有限公司 A kind of media processing method, device, terminal device and storage medium
CN109618213A (en) * 2018-12-17 2019-04-12 华中科技大学 A method of preventing barrage shelter target object
CN109688457A (en) * 2018-12-28 2019-04-26 武汉斗鱼网络科技有限公司 A kind of anti-occlusion method of video, device, electronic equipment and medium
CN109862380A (en) * 2019-01-10 2019-06-07 北京达佳互联信息技术有限公司 Video data handling procedure, device and server, electronic equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105338410A (en) * 2014-07-07 2016-02-17 乐视网信息技术(北京)股份有限公司 Method and device for displaying barrage of video
CN105930543A (en) * 2016-06-28 2016-09-07 武汉斗鱼网络科技有限公司 Control method and device based on webpage bullet screen level
CN108881995A (en) * 2018-07-17 2018-11-23 上海哔哩哔哩科技有限公司 Video barrage masking-out method for drafting, barrage playback method, device and medium
CN109309861A (en) * 2018-10-30 2019-02-05 广州虎牙科技有限公司 A kind of media processing method, device, terminal device and storage medium
CN109618213A (en) * 2018-12-17 2019-04-12 华中科技大学 A method of preventing barrage shelter target object
CN109688457A (en) * 2018-12-28 2019-04-26 武汉斗鱼网络科技有限公司 A kind of anti-occlusion method of video, device, electronic equipment and medium
CN109862380A (en) * 2019-01-10 2019-06-07 北京达佳互联信息技术有限公司 Video data handling procedure, device and server, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN113891154B (en) 2023-09-26

Similar Documents

Publication Publication Date Title
US9124856B2 (en) Method and system for video event detection for contextual annotation and synchronization
CN109089154B (en) Video extraction method, device, equipment and medium
CN108427633B (en) Display interface processing method and device
CN109726312B (en) Regular expression detection method, device, equipment and storage medium
CN109045702B (en) Plug-in detection method, system, device, computing equipment and medium
CN112753225A (en) Video processing for embedded information card location and content extraction
US10417527B2 (en) Identifying an object within content
CN103312770B (en) Method for auditing resources of cloud platform
CN108777806B (en) User identity recognition method, device and storage medium
US20150104149A1 (en) Video summary apparatus and method
CN111241872B (en) Video image shielding method and device
CN110784755A (en) Bullet screen information display method and device, terminal and storage medium
US20200218903A1 (en) CCTV video smart surveillance system and method thereof
CN111586432B (en) Method and device for determining air-broadcast live broadcast room, server and storage medium
CN107333101B (en) Court trial personnel behavior patrol method and system based on court announcements
CN112827172A (en) Shooting method, shooting device, electronic equipment and storage medium
CN112419639A (en) Video information acquisition method and device
CN113891154A (en) Method, device, medium and computer equipment for preventing bullet screen from shielding specific target
CN107135421A (en) Video features detection method and device
CN106792227A (en) A kind of live middle interactive method and device
CN113515670B (en) Film and television resource state identification method, equipment and storage medium
CN114143429B (en) Image shooting method, device, electronic equipment and computer readable storage medium
CN110856033B (en) Object display method, device, terminal and storage medium
CN108882051B (en) Method and device for acquiring plug-in subtitle
CN112861612A (en) Method and device for shooting image, electronic equipment and storage medium

Legal Events

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