CN110022499A - A kind of live streaming barrage color setting method and device - Google Patents

A kind of live streaming barrage color setting method and device Download PDF

Info

Publication number
CN110022499A
CN110022499A CN201810023757.0A CN201810023757A CN110022499A CN 110022499 A CN110022499 A CN 110022499A CN 201810023757 A CN201810023757 A CN 201810023757A CN 110022499 A CN110022499 A CN 110022499A
Authority
CN
China
Prior art keywords
barrage
video frame
sub
block
pixel block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810023757.0A
Other languages
Chinese (zh)
Inventor
徐超
张文明
陈少杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 CN201810023757.0A priority Critical patent/CN110022499A/en
Publication of CN110022499A publication Critical patent/CN110022499A/en
Pending legal-status Critical Current

Links

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/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
    • H04N21/4314Generation 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 for fitting data in a restricted space on the screen, e.g. EPG data in a rectangular grid
    • 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/485End-user interface for client configuration
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a kind of live streaming barrage color setting method and devices, obtain the barrage information and barrage motion profile of target video barrage, barrage information includes barrage size and barrage content;When live video switches to current video frame from a upper video frame, target video barrage display area shared in current video frame is determined according to barrage size and barrage motion profile, wherein, current video frame is the video frame that live video is in display state in playing process;Using block of pixels corresponding with display area in current video frame as the blocks of background pixels of target video barrage;Blocks of background pixels is divided into N number of sub-pixel block, calculates the N number of barrage color value for meeting presetted pixel difference condition corresponding with N number of sub-pixel block;Target video barrage is drawn in current video frame according to barrage motion profile and N number of barrage color value, to solve the unconspicuous technical problem of display of the barrage on video.

Description

A kind of live streaming barrage color setting method and device
Technical field
The present invention relates to network direct broadcasting field more particularly to a kind of live streaming barrage color setting method and devices.
Background technique
Currently, network direct broadcasting is to carry out net cast using internet and stream media technology.In order to increase main broadcaster and spectators Between interactivity, can with barrage effect show present and with barrage effect show spectators, main broadcaster speech.The face of barrage The user that color can initiate barrage is configured, to show the barrage effect of different colours on video.
But when playing video and barrage, when the barrage color of user setting is close with vedio color and then unknown Aobvious, therefore, display of the barrage on video is unobvious.
Summary of the invention
The embodiment of the present invention solves barrage on video by providing a kind of live streaming barrage color setting method and device The unconspicuous technical problem of display.
In a first aspect, the embodiment of the present invention provides a kind of live streaming barrage color setting method, comprising:
Obtain the barrage information and barrage motion profile of target video barrage, wherein the barrage information includes barrage ruler Very little and barrage content;
When live video switches to current video frame from a upper video frame, transported according to the barrage size and the barrage Dynamic rail mark determines target video barrage display area shared in the current video frame, wherein described to work as forward sight Frequency frame is the video frame that the live video is in display state in playing process;
Using block of pixels corresponding with the display area in the current video frame as the back of the target video barrage Scape block of pixels;
The blocks of background pixels is divided into N number of sub-pixel block, N is the integer greater than 1;
Calculate the N number of barrage color value for meeting presetted pixel difference condition corresponding with N number of sub-pixel block;
The target is drawn in the current video frame according to the barrage motion profile and N number of barrage color value Video barrage, to show the barrage content in the current video frame with N number of barrage color value.
Optionally, described to be regarded using block of pixels corresponding with the display area in the current video frame as the target The blocks of background pixels of frequency barrage, comprising:
The current video frame of the live video is carried out 1/4 to reduce, forms new video frame;
Block of pixels corresponding with the display area in the new video frame is determined as the target video barrage Blocks of background pixels.
Optionally, the current video frame by the live video carries out 1/4 diminution, forms new video frame, comprising:
The pixel data of the current video frame is divided into M 2*2 block of pixels, M is positive integer;
It takes the pixel data of single pixel block respectively to each 2*2 block of pixels in the M 2*2 block of pixels, obtains M Pixel data;
The M pixel data is synthesized, the new video frame is formed.
Optionally, before the barrage information for obtaining target video barrage and barrage motion profile, further includes:
Obtain the frame per second of the live video;
Traversal time identical with the numerical value of the frame per second of live video interval is set;
Judge whether the live video from a upper video frame switches to described work as according to the traversal time interval Preceding video frame.
Optionally, the blocks of background pixels is divided into N number of sub-pixel block, comprising:
The blocks of background pixels is divided into N number of sub-pixel block according to default value fixation, or;
The barrage character size of the barrage content is directed to from the barrage information extraction, according to the barrage size and institute The blocks of background pixels is divided into N number of sub-pixel block by the barrage character size for stating barrage content.
Optionally, described to calculate the N number of barrage color for meeting presetted pixel difference condition corresponding with N number of sub-pixel block Value, comprising:
The R component average value for calculating the n-th sub-pixel block in the blocks of background pixels, n-th described in the blocks of background pixels The B component average value of n-th sub-pixel block described in the G component average value of sub-pixel block and the blocks of background pixels, n is successively It takes 1 to N;
The G component average value and the n-th sub-pixel of R component average value, the n-th sub-pixel block based on the n-th sub-pixel block The synthesis of block B component average value is directed to the barrage average background value of the n-th sub-pixel block;
It is negated for the barrage average background value progress binary system of the n-th sub-pixel block, negates result and be set as being directed to The barrage color value of the n-th sub-pixel block.
Optionally, described to determine that the target video barrage exists according to the barrage size and the barrage motion profile Shared display area in the current video frame, comprising:
The display length and barrage height of the target video barrage are obtained from the barrage size;
Track starting point of the target video barrage in the current video frame is determined according to the barrage motion profile And final on trajectory;
Display length and barrage height based on the target video barrage, the track starting point in the current video frame And final on trajectory, target video barrage display area shared in the current video frame is calculated jointly.
Second aspect, the embodiment of the present invention provide a kind of live streaming barrage color setting device, comprising:
Barrage information acquisition unit, for obtaining the barrage information and barrage motion profile of target video barrage, wherein institute Stating barrage information includes barrage size and barrage content;
Display area determination unit, for when live video switches to current video frame from a upper video frame, according to institute It states barrage size and the barrage motion profile is determined that the target video barrage is shared in the current video frame and shown Show region, wherein the current video frame is the video frame that the live video is in display state in playing process;
Background determination unit is used for block of pixels corresponding with the display area in the current video frame as described in The blocks of background pixels of target video barrage;
Pixel cutting unit, for the blocks of background pixels to be divided into N number of sub-pixel block, N is the integer greater than 1;
Barrage color computing unit, for calculating the N that meets presetted pixel difference condition corresponding with the N number of sub-pixel block A barrage color value;
Barrage drawing unit, for working as forward sight described according to the barrage motion profile and N number of barrage color value The target video barrage is drawn in frequency frame, to show institute in the current video frame with N number of barrage color value State barrage content.
Optionally, the background determination unit, comprising:
Subelement is reduced, is reduced for the current video frame of the live video to be carried out 1/4, forms new video frame;
Determine subelement, it is described for block of pixels corresponding with the display area in the new video frame to be determined as The blocks of background pixels of target video barrage.
Optionally, the diminution subelement, is specifically used for:
The pixel data of the current video frame is divided into M 2*2 block of pixels, M is positive integer;
It takes the pixel data of single pixel block respectively to each 2*2 block of pixels in the M 2*2 block of pixels, obtains M Pixel data;
The M pixel data is synthesized, the new video frame is formed.
Optionally, in described device further include:
Frame per second acquiring unit, for obtaining the frame per second of the live video;
Traversal time setting unit, for being arranged between the identical traversal time of the numerical value of the frame per second of the live video Every;
Switching judging unit, is used to judge according to the traversal time interval whether the live video to regard from described upper one Frequency frame switches to the current video frame.
Optionally, the pixel cutting unit, comprising:
Fixed segmentation subelement, for the blocks of background pixels to be divided into N number of sub-pixel block according to default value fixation, Or;
With sized divisions subelement, for being directed to the barrage character ruler of the barrage content from the barrage information extraction It is very little, according to the barrage character size of the barrage size and the barrage content, the blocks of background pixels is divided into N number of sub- picture Plain block.
Optionally, the barrage color computing unit, comprising:
Color is averaged subelement, described for calculating the R component average value of the n-th sub-pixel block in the blocks of background pixels N-th sub-pixel block described in the G component average value of n-th sub-pixel block described in blocks of background pixels and the blocks of background pixels B component average value, n successively takes 1 to N;
Color synthesizing subunit, G points for R component average value, the n-th sub-pixel block based on the n-th sub-pixel block It measures average value and the synthesis of the n-th sub-pixel block B component average value is directed to the barrage average background value of the n-th sub-pixel block;
It is negated for the barrage average background value progress binary system of the n-th sub-pixel block, negates result and be set as being directed to The barrage color value of the n-th sub-pixel block.
Optionally, the display area determination unit, comprising:
Size obtains subelement, for obtaining the display length and bullet of the target video barrage from the barrage size Curtain height;
Track initial determines subelement, for determining the target video barrage described according to the barrage motion profile Track starting point and final on trajectory in current video frame;
Display area computation subunit, for based on the target video barrage display length and barrage height, in institute Track starting point and the final on trajectory in current video frame are stated, calculates the target video barrage jointly in the current video frame In shared display area.
The third aspect, the embodiment of the invention provides a kind of computer readable storage mediums, are stored thereon with computer journey Sequence realizes step described in any embodiment in first aspect when the program is executed by processor.
Fourth aspect the embodiment of the invention provides a kind of computer equipment, including memory, processor and is stored in On reservoir and the computer program that can run on a processor, the processor is realized in first aspect when executing described program appoints Step described in one embodiment.
The one or more technical solutions provided in the embodiment of the present invention, have at least the following technical effects or advantages:
Due to using block of pixels corresponding with display area in current video frame as the blocks of background pixels of target video barrage Later, blocks of background pixels is also divided into N number of sub-pixel block, calculating is corresponding with N number of sub-pixel block to meet presetted pixel difference item N number of barrage color value of part;Target video bullet is drawn in current video frame according to barrage motion profile and N number of barrage color value Curtain, to show barrage content in current video frame with N number of barrage color value.It therefore, can not only be to following video frame Switching and change the barrage color of target video barrage, even if each section of a barrage content exists in current video frame Color on current video frame may be different, show barrage content in each section color also be presently in video frame The color of the sub-pixel block of corresponding position presents a contrast, so, not only remaining and be presently in video frame has enough face Color difference is different, barrage color also in blocks of background pixels where in sub-pixel block between contrast it is bigger, thus target video barrage It can more obviously present, and then improve display effect of the barrage on video.
Detailed description of the invention
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, drawings in the following description are some embodiments of the invention, for this For the those of ordinary skill of field, without creative efforts, it can also be obtained according to these attached drawings others Attached drawing.
Fig. 1 is the flow chart of live streaming barrage color setting method provided in an embodiment of the present invention;
Fig. 2 is the Program modual graph of live streaming barrage color setting method provided in an embodiment of the present invention;
Fig. 3 is the structural schematic diagram of computer readable storage medium provided in an embodiment of the present invention;
Fig. 4 is the structural schematic diagram of computer equipment provided in an embodiment of the present invention.
Specific embodiment
The embodiment of the present invention solves the prior art and is hit by a bullet by providing a kind of live streaming barrage color setting method and device The unstable technical problem of display effect of the curtain effect on video.
In order to solve the above-mentioned technical problem, technical solution provided in an embodiment of the present invention, general thought are as follows:
Due to using block of pixels corresponding with display area in current video frame as the blocks of background pixels of target video barrage Later, blocks of background pixels is divided into N number of sub-pixel block, calculating is corresponding with N number of sub-pixel block to meet presetted pixel difference condition N number of barrage color value;Target video bullet is drawn in current video frame according to barrage motion profile and N number of barrage color value Curtain, to show barrage content in current video frame with N number of barrage color value.
Through the above technical solutions, the barrage face of target video barrage can not only be changed to the switching for following video frame Color shows that color of the color of each section in barrage content also with the sub-pixel block for being presently in corresponding position in video frame is formed Contrast, so, not only remaining and be presently in video frame has enough color differences, anti-between barrage color and background Difference is bigger, so that target video barrage is more obviously presented, improves display effect of the barrage on video.
In order to better understand the above technical scheme, in conjunction with appended figures and specific embodiments to upper Technical solution is stated to be described in detail.
A kind of live streaming barrage color setting method provided in an embodiment of the present invention is applied to Web, wireless client.For For wireless client, it can be applied to the wireless client of iOS system, also can be applied to the wireless visitor of android system Family end.For example, the network direct broadcasting client of iOS system or android system.
Refering to what is shown in Fig. 1, live streaming barrage color setting method provided in an embodiment of the present invention, includes the following steps:
Firstly, executing step S101: obtaining the barrage information and barrage motion profile of target video barrage, wherein described Barrage information includes barrage size and barrage content.
In the specific implementation process, the barrage information of target video barrage is obtained from barrage server by network module. The barrage motion profile of target video barrage is to be laid out to be arranged according to current barrage, is specifically configured to the bullet of other video barrages The barrage motion profile that curtain motion profile is not overlapped.
It should be noted that the target video barrage in the present embodiment can be present special efficacy barrage, or speech Barrage.
After step slol, it then executes step S102: switching to current video from a upper video frame in live video When frame, determine the target video barrage in the current video frame according to the barrage size and the barrage motion profile In shared display area, wherein the current video frame be the live video in playing process in display state Video frame.
In one embodiment, S102 includes the following steps that S1021~S10213 determines display area:
Step S1021: the display length and barrage height of target video barrage are obtained from barrage size.
Step S1022: according to barrage motion profile determine track starting point of the target video barrage in current video frame and Final on trajectory.
It should be noted that step S1021 and S1022 can be the step of independently executing, or successively successively It executes.
After step S1021 and step S1022 have been performed both by, step S1023 is executed: aobvious based on target video barrage Show length and barrage height, the track starting point in current video frame and final on trajectory, calculates target video barrage jointly and exist Shared display area in current video frame.
In one embodiment, since there is setting barrage motion profile in front, target video is determined according to barrage motion profile Coordinate information of the barrage in current video frame;Will be centered on coordinate information, the display length and barrage of target video barrage Height is that the region on boundary is determined as target video barrage display area shared in current video.
In one embodiment, current video frame is switched to from a upper video frame in order to accurately determining, is executing step S101 Before further include following steps: obtaining the frame per second of live video;When traversal identical with the numerical value of the frame per second of live video is set Between be spaced;Judge whether live video from a upper video frame switches to current video frame according to traversal time interval.
Determine that live video plays the time interval of each frame by frame per second, then traversal time interval is specially every to play The time interval of one frame is looped through, to keep the switching of video frame and calculate the barrage color of target video barrage It is synchronous, after the switching of each video frame, the barrage of each target video barrage is recalculated according to the video frame after switching Color, to keep video frame synchronous with the calculating of barrage color, and then barrage color follows the switching of video frame and dynamically changes To having enough colour contrasts with shown video frame, to persistently highlight in barrage.
After step s 102, then, step S103 is executed: will be corresponding with the display area in the current video frame Blocks of background pixels of the block of pixels as the target video barrage.
In one embodiment, S103 specifically comprises the following steps that S1031~S1032 determines blocks of background pixels:
Firstly, executing step S1031: the current video frame of live video being carried out 1/4 and is reduced, new video frame is formed.
Specifically, the pixel data of current video frame is divided into M 2*2 block of pixels, M is positive integer.It is divided into 2*2 block of pixels is specially long 2 pixels, the block of pixels of high 2 pixels.To each 2*2 block of pixels in M 2*2 block of pixels point The single pixel data of block of pixels are not taken, obtain M pixel data;M pixel data is synthesized, new video is formed Frame.
Top left corner pixel data can be taken simultaneously to each 2*2 block of pixels in M 2*2 block of pixels, or take a left side simultaneously Inferior horn pixel data perhaps takes upper right corner pixel data simultaneously or takes lower right corner pixel data simultaneously.The new video of composition The unit pixel height of frame is the 1/2 of the unit pixel height of original video frame (current video frame), the unit picture of new video frame Plain length is the 1/2 of the unit pixel length of original video frame, so that new video frame is compared with the data volume of current video frame, newly The data volume of video frame is reduced to the 1/4 of the data volume of current video frame, so that data calculation amount is reduced, so that calculating barrage Pixel color becomes smaller.
Step S1032, block of pixels corresponding with display area in new video frame is determined as to the back of target video barrage Scape block of pixels.
After step s 103, it then executes step S104: the blocks of background pixels being divided into N number of sub-pixel block, N is Integer greater than 1.
Specifically, if the blocks of background pixels is to extend in the horizontal direction, by the blocks of background pixels in level side To N number of sub-pixel block is divided into, if the blocks of background pixels is to extend in vertical direction, by the blocks of background pixels perpendicular Histogram is to being divided into N number of sub-pixel block.
Specifically, be either divided into N number of sub-pixel block in the horizontal direction or in vertical direction, step S104 can be with It uses embodiment one: the blocks of background pixels is divided into N number of sub-pixel block according to default value fixation.
Specifically, barrage content how many character no matter obtained, default value can be only one kind, for example, can To be set as one of 5-10 numerical value, for example, default value is 5, barrage content how many character no matter obtained, general The blocks of background pixels is divided into 5 sub- block of pixels, and for another example, default value 10 has in the barrage no matter got more Few character, is divided into 10 sub- block of pixels for the blocks of background pixels.Specifically, default value may be default value One in group, for example, default value group can be by the first default value, the second default value, third default value etc. group At, corresponding to the first barrage length range is the first default value, and corresponding to the second barrage length range is the second default value, It is third default value corresponding to third barrage length range, and so on ....Second barrage length range is in the first barrage After length range, third barrage length range is after the second barrage length.For example, the first barrage length range be (0, A1], the second barrage length range be (a1, a2], third barrage length range be (a2, a3], wherein a1 is less than a2, and a2 is less than A3, and so on ....First default value is less than third default value less than the second default value, the second default value.From And the number for making blocks of background pixels be divided into sub-pixel block is more suitable, is unlikely to also to be unlikely to very little too much.
Specifically, be either divided into N number of sub-pixel block in the horizontal direction or in vertical direction, step S103 can be with It uses embodiment two: the barrage character size of the barrage content is directed to from the barrage information extraction, according to the barrage The blocks of background pixels is divided into N number of sub-pixel block by the barrage character size of size and the barrage content.
Barrage character size can be the overall dimensions of barrage character length or barrage character.
It specifically, can be by the length dimension of blocks of background pixels for barrage character size is barrage character length Divided by barrage character length, obtain needing for the blocks of background pixels to be split the block of pixels number N for sub-pixel block, according to Block of pixels number N is split as N number of sub-pixel block blocks of background pixels.For example, the length dimension of blocks of background pixels is 500 Pixel, barrage character length are 50 pixels, then 500/50=10, then blocks of background pixels are divided into 10 sub-pixels Block.It should be noted that barrage character length is the length of rectangular area shared by single barrage character in barrage content.Pass through this Kind embodiment, enables to barrage color to have certain gradual change on current video frame, between barrage character and place background Colour contrast compare barrage solid colour when colour contrast it is bigger.
Specifically, barrage character size be barrage character overall dimensions for, can be by the entirety of blocks of background pixels Size obtains needing to be split the blocks of background pixels as the block of pixels of sub-pixel block divided by the overall dimensions of barrage character Number N is split as N number of sub-pixel block blocks of background pixels according to block of pixels number N.For example, the entirety of blocks of background pixels Having a size of 500*30 pixel, the overall dimensions of barrage character are 50*30 pixel, then (500*30)/(50*30)=10 It is a, then blocks of background pixels is divided into 10 sub- block of pixels.In the present embodiment mode, the overall dimensions of barrage character are single The area size of rectangular area shared by barrage character, by this embodiment, enabling to barrage color is according to barrage The color of sub-pixel block is configured where the single character of content, so that barrage color gradient is finer, further Increase the colour contrast between barrage character and place background.
After step s 104, then execute step S105: calculating is corresponding with N number of sub-pixel block to meet presetted pixel N number of barrage color value of difference condition.
Specifically, be the relationship that negates between the color value and barrage color value of sub-pixel block, can also be with the face of sub-pixel block It is greater than pre-set color discrepancy threshold between color value and barrage color value.
In order to calculate the N number of barrage color value for meeting presetted pixel difference condition corresponding with N number of sub-pixel block, one In embodiment, the barrage color value of each sub-pixel block is the color average of the corresponding sub-pixel block in N number of sub-pixel block Negate as a result, being realized especially by the mode of being implemented as follows:
Firstly, executing step S1051: calculating the R component average value of the n-th sub-pixel block in the blocks of background pixels, n is successively It takes 1 to N.
Specifically, R component value is extracted to each pixel of the n-th sub-pixel block in blocks of background pixels, then, will mentions Each R component value of the n-th sub-pixel block taken carries out read group total, to calculate the R component value summation of the n-th sub-pixel block, by n-th The R component value summation of sub-pixel block is total divided by the pixel of the n-th sub-pixel block, to obtain the original R component of the n-th sub-pixel block Average value, if the original R component average value of calculated n-th sub-pixel block is greater than 255, the R component of the n-th sub-pixel block is flat Mean value takes 255;If the calculated original R component average value of n-th sub-pixel block is flat less than the R component of 0, n-th sub-pixel block Mean value takes 0;Otherwise the R component average value of the n-th sub-pixel block directly selects its original R component average value.
Step S1052: the G component average value of all pixels point of the n-th sub-pixel block in blocks of background pixels is calculated.
Specifically, G component value is extracted to all pixels point of the n-th sub-pixel block in blocks of background pixels, then, will mentioned Each G component value of the n-th sub-pixel block taken carries out read group total, to calculate the G component value summation of the n-th sub-pixel block, by n-th The G component value summation of sub-pixel block is total divided by the pixel of the n-th sub-pixel block, to obtain the original R component of the n-th sub-pixel block Average value, if the original G component average value of calculated n-th sub-pixel block is greater than 255, the G component of the n-th sub-pixel block is flat Mean value takes 255;If the original R component average value of calculated n-th sub-pixel block is less than the G component of 0, n-th sub-pixel block Average value takes 0;Otherwise the G component average value of the n-th sub-pixel block directly selects as its original G component average value.
Step S1053: the B component average value of all pixels point of the n-th sub-pixel block in blocks of background pixels is calculated.
B component value is extracted to all pixels point of the n-th sub-pixel block in blocks of background pixels, then, by the n-th son of extraction Each B component value of block of pixels carries out read group total, to calculate the B component value summation of the n-th sub-pixel block, by the n-th sub-pixel block B component value summation obtained divided by the pixel sum of the n-th sub-pixel block, it is average with the original R component for obtaining the n-th sub-pixel block Value, if the original B component average value of calculated n-th sub-pixel block is greater than 255, the B component average value of the n-th sub-pixel block Take 255;If the original B component average value of calculated n-th sub-pixel block is average less than the B component of 0, n-th sub-pixel block Value takes 0;Otherwise, the B component average value of the n-th sub-pixel block is selected as its original B component average value.
It should be noted that rgb color mode is a kind of color standard of industry, it is by red (R), green (G), indigo plant (B) variation of three Color Channels and their mutual superpositions are to obtain miscellaneous color, in the present embodiment Mentioned R, G, B is the color for representing three channels of red, green, blue.In addition, it should also be noted that, step S1051~ S1053 can be that can also divide the successive execution of random order the step of independently executing.
After step S1051~S1053 is performed both by completion, step S1054: the R based on the n-th sub-pixel block is executed Component average value, the G component average value of the n-th sub-pixel block and the synthesis of the n-th sub-pixel block B component average value are for n-th son The barrage average background value of block of pixels.
After step S1054, step S1055 is executed: carrying out for the barrage average background value of the n-th sub-pixel block Binary system negates, and negates result and is set as being directed to the barrage color value of the n-th sub-pixel block.
It should be noted that passing through step S1051~step for the 1st in blocks of background pixels to n-th sub-pixel block Rapid S1055 obtains respective barrage average background value, so that the barrage background for obtaining each sub-pixel block in blocks of background pixels is flat Mean value.
For example, white carries out binary system to negate is black, red carry out binary system and negate be it is light blue, by a large amount of It is demonstrated experimentally that blocks of background pixels is divided into multiple sub-pixel blocks so that the color of barrage and place background reflectance are bigger, keep away Exempted from entire blocks of background pixels carry out calculate barrage color when, the color change of entire blocks of background pixels is too big, calculated bullet Curtain color and the partial region contrast in blocks of background pixels are smaller, show unconspicuous defect without barrage.
After step S105, step S106 is then executed: according to the barrage motion profile and N number of barrage color Value draws the target video barrage in the current video frame, thus with N number of barrage in the current video frame Color value shows the barrage content.
Specifically, in conjunction with the embodiment one of step S104, step S106 specifically: in current video frame, according to institute N-th of barrage color value in barrage motion profile and N number of barrage color value is stated, is drawn in the current video frame Make the n-th partial content of the barrage content, n successively takes 1 to N.
Specifically, according to first barrage color value in the barrage motion profile and N number of barrage color value, Carry out drawing first part's content of the barrage content in the current video frame;Then, rail is moved according to the barrage Second barrage color value in mark and N number of barrage color value, carries out drawing the barrage in the current video frame The second part of content successively carries out, until according in the barrage motion profile and N number of barrage color value N number of barrage color value carries out the N section content for drawing the barrage content in the current video frame.
Specifically, in conjunction with the embodiment two of step S104, step S106 specifically: in current video frame, according to institute N-th of barrage color value in barrage motion profile and N number of barrage color value is stated, is drawn in the current video frame Make n-th of barrage character of the barrage content, n successively takes 1 to N.To the color of each barrage character in barrage content It is opposite that be between the color value of rectangular area shared by the barrage character be, therefore, color between barrage and place background Contrast is bigger.
Based on the same inventive concept, the embodiment of the invention provides a kind of live streaming barrage colors, and device is arranged, with reference to Fig. 2 institute Show, live streaming barrage color setting device provided in this embodiment includes:
Barrage information acquisition unit 201, for obtaining the barrage information and barrage motion profile of target video barrage, In, the barrage information includes barrage size and barrage content;
Display area determination unit 202, for when live video switches to current video frame from a upper video frame, according to The barrage size and the barrage motion profile determine that the target video barrage is shared in the current video frame Display area, wherein the current video frame is the video frame that the live video is in display state in playing process;
Background determination unit 203, for using block of pixels corresponding with the display area in the current video frame as The blocks of background pixels of the target video barrage;
Pixel cutting unit 204, for the blocks of background pixels to be divided into N number of sub-pixel block, N is the integer greater than 1;
Barrage color computing unit 205 corresponding with N number of sub-pixel block meets presetted pixel difference condition for calculating N number of barrage color value;
Barrage drawing unit 206 is used for according to the barrage motion profile and N number of barrage color value described current The target video barrage is drawn in video frame, to show in the current video frame with N number of barrage color value The barrage content.
Optionally, the background determination unit 203, comprising:
Subelement is reduced, is reduced for the current video frame of the live video to be carried out 1/4, forms new video frame;
Determine subelement, it is described for block of pixels corresponding with the display area in the new video frame to be determined as The blocks of background pixels of target video barrage.
Optionally, the diminution subelement, is specifically used for:
The pixel data of the current video frame is divided into M 2*2 block of pixels, M is positive integer;
It takes the pixel data of single pixel block respectively to each 2*2 block of pixels in the M 2*2 block of pixels, obtains M Pixel data;
The M pixel data is synthesized, the new video frame is formed.
Optionally, in described device further include:
Frame per second acquiring unit, for obtaining the frame per second of the live video;
Traversal time setting unit, for being arranged between the identical traversal time of the numerical value of the frame per second of the live video Every;
Switching judging unit, is used to judge according to the traversal time interval whether the live video to regard from described upper one Frequency frame switches to the current video frame.
Optionally, the pixel cutting unit 204, comprising:
Fixed segmentation subelement, for the blocks of background pixels to be divided into N number of sub-pixel block according to default value fixation, Or;
With sized divisions subelement, for being directed to the barrage character ruler of the barrage content from the barrage information extraction It is very little, according to the barrage character size of the barrage size and the barrage content, the blocks of background pixels is divided into N number of sub- picture Plain block.
Optionally, the barrage color computing unit 205, comprising:
Color is averaged subelement, described for calculating the R component average value of the n-th sub-pixel block in the blocks of background pixels N-th sub-pixel block described in the G component average value of n-th sub-pixel block described in blocks of background pixels and the blocks of background pixels B component average value, n successively takes 1 to N;
Color synthesizing subunit, G points for R component average value, the n-th sub-pixel block based on the n-th sub-pixel block It measures average value and the synthesis of the n-th sub-pixel block B component average value is directed to the barrage average background value of the n-th sub-pixel block;
It is negated for the barrage average background value progress binary system of the n-th sub-pixel block, negates result and be set as being directed to The barrage color value of the n-th sub-pixel block.
Optionally, the display area determination unit 202, comprising:
Size obtains subelement, for obtaining the display length and bullet of the target video barrage from the barrage size Curtain height;
Track initial determines subelement, for determining the target video barrage described according to the barrage motion profile Track starting point and final on trajectory in current video frame;
Display area computation subunit, for based on the target video barrage display length and barrage height, in institute Track starting point and the final on trajectory in current video frame are stated, calculates the target video barrage jointly in the current video frame In shared display area.
Based on the same inventive concept, the embodiment of the invention provides a kind of computer readable storage mediums 301, with reference to Fig. 3 It is shown, it is stored thereon with computer program 302, which realizes aforementioned live streaming barrage color setting when being executed by processor Step in any of method embodiment.
Based on the same inventive concept, the embodiment of the invention provides a kind of computer equipments 400, refering to what is shown in Fig. 4, including Memory 410, processor 430 and it is stored in the computer program 420 that can be run on memory 410 and on processor 430, institute State the step realized in any of aforementioned live streaming barrage color setting method embodiment when processor 430 executes described program 420 Suddenly.
Since above-mentioned introduced device, storage medium and computer equipment are to implement aforementioned live streaming in the embodiment of the present invention Barrage color setting method is used, so based on live streaming barrage color setting method described in the embodiment of the present invention, this Those skilled in the art can understand the specific embodiment and its various change of device, storage medium and computer equipment Form, so how to realize the live streaming barrage face in the embodiment of the present invention for device, storage medium and computer equipment at this Color setting method is no longer discussed in detail.As long as those skilled in the art implement the live streaming barrage color in the embodiment of the present invention Device, storage medium used by setting method and computer equipment belong to the range of the invention to be protected.
The present invention through the foregoing embodiment in technical solution, at least have the following technical effects or advantages:
Due to using block of pixels corresponding with display area in current video frame as the blocks of background pixels of target video barrage Later, blocks of background pixels is also divided into N number of sub-pixel block, calculating is corresponding with N number of sub-pixel block to meet presetted pixel difference item N number of barrage color value of part;Target video bullet is drawn in current video frame according to barrage motion profile and N number of barrage color value Curtain, to show barrage content in current video frame with N number of barrage color value.It therefore, can not only be to following video frame Switching and change the barrage color of target video barrage, even if showing each section in barrage content in current video frame Color of the color also with the sub-pixel block for being presently in corresponding position in video frame presents a contrast, so, not only remain with Being presently in video frame has enough color differences, barrage color also in blocks of background pixels where in sub-pixel block between it is anti- Difference is bigger, so that target video barrage can be more obviously presented, and then improves display effect of the barrage on video.
It should be understood by those skilled in the art that, the embodiment of the present invention can provide as method, system or computer program Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the present invention Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the present invention, which can be used in one or more, The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces The form of product.
The present invention be referring to according to the method for the embodiment of the present invention, the process of equipment (system) and computer program product Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates, Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one The step of function of being specified in a box or multiple boxes.
Although preferred embodiments of the present invention have been described, it is created once a person skilled in the art knows basic Property concept, then additional changes and modifications may be made to these embodiments.So it includes excellent that the following claims are intended to be interpreted as It selects embodiment and falls into all change and modification of the scope of the invention.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art Mind and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to include these modifications and variations.

Claims (10)

1. a kind of live streaming barrage color setting method characterized by comprising
Obtain target video barrage barrage information and barrage motion profile, wherein the barrage information include barrage size and Barrage content;
When live video switches to current video frame from a upper video frame, rail is moved according to the barrage size and the barrage Mark determines target video barrage display area shared in the current video frame, wherein the current video frame The video frame of display state is in playing process for the live video;
Using block of pixels corresponding with the display area in the current video frame as the background picture of the target video barrage Plain block;
The blocks of background pixels is divided into N number of sub-pixel block, N is the integer greater than 1;
Calculate the N number of barrage color value for meeting presetted pixel difference condition corresponding with N number of sub-pixel block;
The target video is drawn in the current video frame according to the barrage motion profile and N number of barrage color value Barrage, to show the barrage content in the current video frame with N number of barrage color value.
2. as described in claim 1 live streaming barrage color setting method, which is characterized in that it is described will be in the current video frame Blocks of background pixels of the block of pixels corresponding with the display area as the target video barrage, comprising:
The current video frame of the live video is carried out 1/4 to reduce, forms new video frame;
Block of pixels corresponding with the display area in the new video frame is determined as to the background of the target video barrage Block of pixels.
3. live streaming barrage color setting method as claimed in claim 2, which is characterized in that the working as the live video Preceding video frame carries out 1/4 and reduces, and forms new video frame, comprising:
The pixel data of the current video frame is divided into M 2*2 block of pixels, M is positive integer;
It takes the pixel data of single pixel block respectively to each 2*2 block of pixels in the M 2*2 block of pixels, obtains M pixel Data;
The M pixel data is synthesized, the new video frame is formed.
4. such as live streaming barrage color setting method as claimed in any one of claims 1-3, which is characterized in that in the acquisition target Before the barrage information and barrage motion profile of video barrage, further includes:
Obtain the frame per second of the live video;
Traversal time identical with the numerical value of the frame per second of live video interval is set;
Judge whether the live video switches to from a upper video frame according to the traversal time interval and described works as forward sight Frequency frame.
5. such as live streaming barrage color setting method as claimed in any one of claims 1-3, which is characterized in that by the background pixel Block is divided into N number of sub-pixel block, comprising:
The blocks of background pixels is divided into N number of sub-pixel block according to default value fixation, or;
The barrage character size of the barrage content is directed to from the barrage information extraction, according to the barrage size and the bullet The barrage character size of curtain content, is divided into N number of sub-pixel block for the blocks of background pixels.
6. live streaming barrage color setting method as described in claim 1, which is characterized in that the calculating and N number of sub- picture The corresponding N number of barrage color value for meeting presetted pixel difference condition of plain block, comprising:
The R component average value for calculating the n-th sub-pixel block in the blocks of background pixels, the n-th sub- picture described in the blocks of background pixels The B component average value of n-th sub-pixel block described in the G component average value of plain block and the blocks of background pixels, n successively take 1 to N;
The G component average value and the n-th sub-pixel block B of R component average value, the n-th sub-pixel block based on the n-th sub-pixel block point Measure the barrage average background value that average value synthesis is directed to the n-th sub-pixel block;
It is negated for the barrage average background value progress binary system of the n-th sub-pixel block, negates result and be set as described The barrage color value of n-th sub-pixel block.
7. live streaming barrage color setting method as described in claim 1, which is characterized in that it is described according to the barrage size and The barrage motion profile determines target video barrage display area shared in the current video frame, comprising:
The display length and barrage height of the target video barrage are obtained from the barrage size;
Track starting point and rail of the target video barrage in the current video frame are determined according to the barrage motion profile Mark terminal;
Display length and barrage height based on the target video barrage, the track starting point in the current video frame and rail Mark terminal calculates target video barrage display area shared in the current video frame jointly.
8. device is arranged in a kind of live streaming barrage color characterized by comprising
Barrage information acquisition unit, for obtaining the barrage information and barrage motion profile of target video barrage, wherein the bullet Curtain information includes barrage size and barrage content;
Display area determination unit, for when live video switches to current video frame from a upper video frame, according to the bullet Curtain size and the barrage motion profile determine target video barrage viewing area shared in the current video frame Domain, wherein the current video frame is the video frame that the live video is in display state in playing process;
Background determination unit, for using block of pixels corresponding with the display area in the current video frame as the target The blocks of background pixels of video barrage;
Pixel cutting unit, for the blocks of background pixels to be divided into N number of sub-pixel block, N is the integer greater than 1;
Barrage color computing unit, for calculating the N number of bullet for meeting presetted pixel difference condition corresponding with N number of sub-pixel block Curtain color value;
Barrage drawing unit is used for according to the barrage motion profile and N number of barrage color value in the current video frame It is middle to draw the target video barrage, to show the bullet in the current video frame with N number of barrage color value Curtain content.
9. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is held by processor Step of any of claims 1-7 is realized when row.
10. a kind of computer equipment including memory, processor and stores the meter that can be run on a memory and on a processor Calculation machine program, which is characterized in that the processor realizes step of any of claims 1-7 when executing described program Suddenly.
CN201810023757.0A 2018-01-10 2018-01-10 A kind of live streaming barrage color setting method and device Pending CN110022499A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810023757.0A CN110022499A (en) 2018-01-10 2018-01-10 A kind of live streaming barrage color setting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810023757.0A CN110022499A (en) 2018-01-10 2018-01-10 A kind of live streaming barrage color setting method and device

Publications (1)

Publication Number Publication Date
CN110022499A true CN110022499A (en) 2019-07-16

Family

ID=67188114

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810023757.0A Pending CN110022499A (en) 2018-01-10 2018-01-10 A kind of live streaming barrage color setting method and device

Country Status (1)

Country Link
CN (1) CN110022499A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111596834A (en) * 2019-09-06 2020-08-28 吴春光 Video playing APP control platform
CN111899192A (en) * 2020-07-23 2020-11-06 北京字节跳动网络技术有限公司 Interaction method, interaction device, electronic equipment and computer-readable storage medium
CN115550714A (en) * 2021-06-30 2022-12-30 花瓣云科技有限公司 Subtitle display method and related equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104575553A (en) * 2014-12-19 2015-04-29 百度时代网络技术(北京)有限公司 Method and device for generating barrage overlaid on playing object
CN105812888A (en) * 2016-03-31 2016-07-27 北京奇艺世纪科技有限公司 Character display method and device
US20160366463A1 (en) * 2014-02-26 2016-12-15 Tencent Technology (Shenzhen) Company Limited Information pushing method, terminal and server
CN106293369A (en) * 2015-05-26 2017-01-04 北京智谷睿拓技术服务有限公司 Exchange method based on barrage, interactive device and subscriber equipment
CN106792100A (en) * 2016-12-30 2017-05-31 北京奇艺世纪科技有限公司 A kind of video barrage display methods and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160366463A1 (en) * 2014-02-26 2016-12-15 Tencent Technology (Shenzhen) Company Limited Information pushing method, terminal and server
CN104575553A (en) * 2014-12-19 2015-04-29 百度时代网络技术(北京)有限公司 Method and device for generating barrage overlaid on playing object
CN106293369A (en) * 2015-05-26 2017-01-04 北京智谷睿拓技术服务有限公司 Exchange method based on barrage, interactive device and subscriber equipment
CN105812888A (en) * 2016-03-31 2016-07-27 北京奇艺世纪科技有限公司 Character display method and device
CN106792100A (en) * 2016-12-30 2017-05-31 北京奇艺世纪科技有限公司 A kind of video barrage display methods and device

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111596834A (en) * 2019-09-06 2020-08-28 吴春光 Video playing APP control platform
CN111596834B (en) * 2019-09-06 2020-12-15 深圳新为云动教育科技有限公司 Video playing APP control system
CN111899192A (en) * 2020-07-23 2020-11-06 北京字节跳动网络技术有限公司 Interaction method, interaction device, electronic equipment and computer-readable storage medium
CN111899192B (en) * 2020-07-23 2022-02-01 北京字节跳动网络技术有限公司 Interaction method, interaction device, electronic equipment and computer-readable storage medium
US11842425B2 (en) 2020-07-23 2023-12-12 Beijing Bytedance Network Technology Co., Ltd. Interaction method and apparatus, and electronic device and computer-readable storage medium
CN115550714A (en) * 2021-06-30 2022-12-30 花瓣云科技有限公司 Subtitle display method and related equipment
WO2023273729A1 (en) * 2021-06-30 2023-01-05 花瓣云科技有限公司 Subtitle display method and related device

Similar Documents

Publication Publication Date Title
KR101183863B1 (en) Creating a depth map
KR101650702B1 (en) Creation of depth maps from images
CN110022499A (en) A kind of live streaming barrage color setting method and device
CN101393649A (en) Apparatus and method for rendering multi-viewpoint images
CN108513131B (en) Free viewpoint video depth map region-of-interest coding method
CN109218798A (en) A kind of live streaming barrage color setting method and device
CN103841401B (en) For revising the apparatus and method of the depth map of 3-D view
JP2015156607A (en) Image processing method, image processing apparatus, and electronic device
CN104735521B (en) A kind of roll titles detection method and device
CN107801093B (en) Video rendering method and device, computer equipment and readable storage medium
KR20100109069A (en) Device for generating visual attention map and method thereof
CN105704398A (en) Video processing method
Schmeing et al. Time-consistency of disocclusion filling algorithms in depth image based rendering
CN109600605A (en) Detection method, electronic equipment and the computer program product of 4K ultra high-definition video
CN103581652A (en) Multi-view stereoscopic video data processing method and device
KR20070086283A (en) Rendering images based on image segmentation
CN106447761B (en) A kind of Shading Rendering method
CN105141940A (en) 3D video coding method based on regional division
CN104282013B (en) A kind of image processing method and device for foreground target detection
CN106231397B (en) Main broadcaster's class interaction platform main broadcaster end method for changing scenes and its device, Zhu Boduan
CN106454509B (en) A kind of detection method and device of advertising image
CN107833227A (en) A kind of method for drafting and its system of circular clipping region
CN106296593A (en) Image recovery method and device
CN102572297B (en) Efficient high-quality video special effect rendering method
CN103514593B (en) Image processing method and device

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190716