CN107734353B - Method and device for recording barrage video, readable storage medium and equipment - Google Patents

Method and device for recording barrage video, readable storage medium and equipment Download PDF

Info

Publication number
CN107734353B
CN107734353B CN201710930602.0A CN201710930602A CN107734353B CN 107734353 B CN107734353 B CN 107734353B CN 201710930602 A CN201710930602 A CN 201710930602A CN 107734353 B CN107734353 B CN 107734353B
Authority
CN
China
Prior art keywords
bullet screen
video
capture class
recording
class
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.)
Active
Application number
CN201710930602.0A
Other languages
Chinese (zh)
Other versions
CN107734353A (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 CN201710930602.0A priority Critical patent/CN107734353B/en
Publication of CN107734353A publication Critical patent/CN107734353A/en
Application granted granted Critical
Publication of CN107734353B publication Critical patent/CN107734353B/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/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/231Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion
    • 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/237Communication with additional data server
    • 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/433Content storage operation, e.g. storage operation in response to a pause request, caching operations
    • H04N21/4334Recording operations
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • General Engineering & Computer Science (AREA)
  • Television Signal Processing For Recording (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention relates to the technical field of video processing, in particular to a method, a device, a readable storage medium and equipment for recording a barrage video, wherein the method comprises the following steps: establishing connection with a bullet screen server; initializing a live broadcast encoder; creating a video capture class for recording video content in the bullet screen video; inheriting the customized capture class in the live broadcast encoder, and creating a bullet screen capture class for recording bullet screen content in the bullet screen video; and recording the bullet screen video based on the video capture class and the bullet screen capture class to obtain a bullet screen video recording file containing the video content and the bullet screen content. The method and the device solve the problem that the video content and the bullet screen content cannot be recorded in one file in the prior art, and realize mixed recording of the video content and the bullet screen content.

Description

Method and device for recording barrage video, readable storage medium and equipment
Technical Field
The present invention relates to the field of video processing technologies, and in particular, to a method, an apparatus, a readable storage medium, and a device for recording a bullet screen video.
Background
When watching the video content of the live platform, the viewer sometimes needs to record the video. However, for the live platform, there is a very important part in the video, namely the bullet screen. In the prior art, when a video is recorded, a bullet screen cannot be directly recorded into a video file, but the video and the bullet screen are respectively recorded, that is, the video and the bullet screen are respectively recorded into the video file and the bullet screen file.
Disclosure of Invention
In view of the above, the present invention has been made to provide a method, apparatus, readable storage medium and device for recording a bullet screen video that overcome or at least partially solve the above-mentioned problems.
The embodiment of the invention provides a method for recording a barrage video, which is applied to a client and comprises the following steps:
establishing connection with a bullet screen server;
initializing a live broadcast encoder;
creating a video capture class for recording video content in the bullet screen video;
inheriting the customized capture class in the live broadcast encoder, and creating a bullet screen capture class for recording bullet screen content in the bullet screen video;
and recording the bullet screen video based on the video capture class and the bullet screen capture class to obtain a bullet screen video recording file containing the video content and the bullet screen content.
Preferably, the initializing the live encoder includes:
creating a live interface;
initializing video coding parameters based on the coding parameter information of the barrage video;
initializing the live broadcast interface based on the initialized video coding parameters.
Preferably, after the creating a video capture class for recording the video content in the bullet screen video, the method further includes:
closing the playing sound of the video capturing class;
closing the live broadcast encoder to acquire system sound cards and microphone sounds;
calling a setting callback function of the live broadcast encoder, and registering an audio buffering callback function in the live broadcast encoder;
and transmitting the audio data of the barrage video into an audio encoder of the live broadcast encoder based on the audio buffering callback function.
Preferably, the inheriting the customized capture class in the live encoder and creating a bullet screen capture class for recording bullet screen content in the bullet screen video includes:
filling a customized capturing parameter structure of the customized capturing class according to the size of the bullet screen image corresponding to the bullet screen video;
drawing the bullet screen image in the customized capture class;
and creating a bullet screen drawing method in the customized capture class to obtain the bullet screen capture class.
Preferably, the method for creating a barrage drawing includes:
after receiving a bullet screen from the bullet screen video, creating a bullet screen object corresponding to the bullet screen, and storing the bullet screen object into a bullet screen list;
and drawing the bullet screen according to the transverse coordinate value and the longitudinal coordinate value of each bullet screen object in the bullet screen list.
Preferably, the creating of the bullet screen object corresponding to the bullet screen includes:
acquiring the width and the height of the bullet screen;
obtaining the moving speed of the bullet screen based on the width of the bullet screen;
determining the longitudinal position of the bullet screen;
and creating the bullet screen object according to the width, the height, the moving speed and the longitudinal position of the bullet screen.
The embodiment of the invention also provides a device for recording the barrage video, which comprises:
the connection module is used for establishing connection with the bullet screen server;
the initialization module is used for initializing the live broadcast encoder;
the first creating module is used for creating a video capturing class for recording the video content in the bullet screen video;
the second creating module is used for inheriting the customized capturing class in the live broadcast encoder and creating a bullet screen capturing class for recording bullet screen contents in the bullet screen video;
and the recording module is used for recording the bullet screen video based on the video capture class and the bullet screen capture class to obtain a bullet screen video recording file containing the video content and the bullet screen content.
Preferably, the initialization module includes:
the creation unit is used for creating a live broadcast interface;
the first initialization unit is used for initializing video coding parameters based on the coding parameter information of the barrage video;
and the second initialization unit is used for initializing the live broadcast interface based on the initialized video coding parameters.
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the following steps:
establishing connection with a bullet screen server;
initializing a live broadcast encoder;
creating a video capture class for recording video content in the bullet screen video;
inheriting the customized capture class in the live broadcast encoder, and creating a bullet screen capture class for recording bullet screen content in the bullet screen video;
and recording the bullet screen video based on the video capture class and the bullet screen capture class to obtain a bullet screen video recording file containing the video content and the bullet screen content.
The embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and when the processor executes the computer program, the following steps are implemented:
establishing connection with a bullet screen server;
initializing a live broadcast encoder;
creating a video capture class for recording video content in the bullet screen video;
inheriting the customized capture class in the live broadcast encoder, and creating a bullet screen capture class for recording bullet screen content in the bullet screen video;
and recording the bullet screen video based on the video capture class and the bullet screen capture class to obtain a bullet screen video recording file containing the video content and the bullet screen content.
One or more technical solutions in the embodiments of the present invention have at least the following technical effects or advantages:
this application is at first to be connected with barrage server establishment, initialize the live encoder after that, then establish the video capture class that is arranged in recording the video content in the barrage video, inherit the customization capture class in the live encoder again, establish the barrage capture class that is arranged in recording the barrage content in the barrage video, at last based on video capture class and barrage capture class, record the barrage video, the barrage video that contains video content and barrage content is recorded the file, the problem that prior art can't record video content and barrage content to a file has been solved, the mixed of video content and barrage content is recorded.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 shows a flowchart of a method of recording a bullet screen video in an embodiment of the invention;
fig. 2 is a block diagram showing an apparatus for recording a bullet screen video in the embodiment of the present invention;
fig. 3 shows a physical structure diagram of a computer device in the embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
The embodiment of the application provides a method for recording a barrage video, which is applied to a client side where a user needs to record a video, and as shown in fig. 1, the method includes:
step 101: and establishing connection with the bullet screen server.
Step 102: the live encoder is initialized.
Step 103: and creating a video capture class for recording the video content in the bullet screen video.
Step 104: inheriting the customized capture class in the live broadcast encoder, and creating a bullet screen capture class for recording bullet screen contents in the bullet screen video.
Step 105: and recording the bullet screen video based on the video capture class and the bullet screen capture class to obtain a bullet screen video recording file containing the video content and the bullet screen content.
Specifically, for step 101, in order to record a bullet screen, first, a connection to a bullet screen server is required, and the application logs in to the bullet screen server by calling L oginAsUserNick function, so as to establish a connection relationship between a recording program and the bullet screen server.
Further, in the present application, for both the video capture class and the barrage capture class, both classes are from the framework of a live encoder (L iveEncoder), so that before recording the barrage video, it is first necessary to initialize L iveEncoder, and in a preferred embodiment, the live encoder includes:
s11: a live interface is created.
S12: and initializing video coding parameters based on the coding parameter information of the barrage video.
S13: initializing the live broadcast interface based on the initialized video coding parameters.
In the specific implementation process, firstly, a live interface (Ilive interface) is created by calling a Create L iveInstance function of L iveEncoders, then, as files need to be recorded, encoding parameter information of the files to be recorded needs to be set, so in the application, encoding parameter information of a barrage video is acquired, for example, the acquired encoding parameter information includes that the video resolution is 1280 × 720, the code rate is 3000kb, and the frame rate is 25fps, then, video encoding parameters are initialized based on the encoding parameter information, that is, the encoding parameter information is set to fields related to VideoEncodeSetting, so that the initialization work of the video encoding parameters is completed, then, after the initialization of the video encoding parameters is completed, the initialization of the live interface is executed, specifically, a get _ Encoder method of the Ilive interface is called, a live encoding interface (I L Encoder interface) is transmitted, and the live encoding parameters are acquired by calling the Video _ EncodeSettie method of the I L iveEncoder, so that the live encoding parameters are acquired.
Further, after the initialization of the live encoder is completed, for step 103, an open _ media _ capture method of the I L iveEncoder interface may be called, and a video stream address of the barrage video is introduced into the method as a parameter, so as to realize playing of the video content in the barrage video.
To solve the above problem, in the present application, after creating a video capture class for recording video content in the bullet screen video, the method further includes:
s21: and closing the playing sound of the video capturing class.
S22: and closing the live broadcast encoder to acquire the system sound card and the microphone sound.
S23: and calling a setting callback function of the live broadcast encoder, and registering an audio buffering callback function in the live broadcast encoder.
S24: and transmitting the audio data of the barrage video into an audio encoder of the live broadcast encoder based on the audio buffering callback function.
Specifically, for S21, the set _ media _ sound _ volume interface calling the I L iveEncoder interface sets the video capture class (mediaCapture) to mute so that the sound of the video content of the barrage video does not conflict with the sound of the player during normal play, for S22, the disable Audio Capture method calling the I L iveEncoder interface masks off the capture of L iveEncode on the system sound card and the microphone sound so that the recorded file is prevented from being doped with sounds other than the video content, further, since S22 masks the capture of the system sound card and the microphone so that the data source during audio encoding is cut off, but the sound of the video content needs to be recorded during recording, S23 is executed, the OneAudio Audio function is registered into the OneAudio recorder function by calling the SetCallbackationfunctions of Segment, the OneAudio function is further registered into the Audio recorder function registry function L, and the playback call back is carried out through the Audio recorder callback function which calls the AudioCallbacknowledger function into the audio recorder.
Further to step 104, in a preferred embodiment, step 104 includes:
s31: and filling a customized capturing parameter structure of the customized capturing class according to the size of the bullet screen image corresponding to the bullet screen video.
S32: drawing the bullet screen image in the customized capture class.
S33: and creating a bullet screen drawing method in the customized capture class to obtain the bullet screen capture class.
Specifically, since there is no barrage capture class in L iveEncoder, but L iveEncoder provides a custom capture (customclosure) interface for upper-layer development and extension, in the present application, the custom capture (BulletCapture) interface is inherited to the customclosure creation barrage capture class (bulletencapture), wherein the bulletencapture can be created by calling opencustomclosure of the I L iveEncoder interface, and further, a specific process of creating bulletencapture is as follows:
firstly, S31 is executed, that is, the getcapturepaams method is implemented, specifically, the size of the barrage image can be obtained according to the video resolution in the coding parameter information of the barrage video, for example, 1280 × 720, and further, the customcpapturepaam structure in the getcapturepaams method is executed, during filling, the width field is set to 1280, the height field is set to 720, and the pixel format is set to CF _ ARGB32 (RGB format with alpha channel), thereby completing filling of the customized capture class.
The size of a bullet screen image of a BulletCapture is known through S31 and L iveEncoder, and further S32 is executed, namely a Read method is realized.
Further, executing S33, the bullet screen drawing method of the present application specifically includes the following steps:
s41: and after receiving the bullet screen from the bullet screen video, creating a bullet screen object corresponding to the bullet screen, and storing the bullet screen object in a bullet screen list.
S42: and drawing the bullet screen according to the transverse coordinate value and the longitudinal coordinate value of each bullet screen object in the bullet screen list.
In the specific implementation process, the structure Bullet is used for representing a Bullet screen, a text field in the structure represents the text content of the Bullet screen, an x field represents the x coordinate of the left vertex of the Bullet screen, a Y field represents the Y coordinate of the left vertex of the Bullet screen, a time field represents the last drawing time of the Bullet screen, a width field represents the width of the Bullet screen, a height field represents the height of the Bullet screen, a speed field represents the moving speed of the field, an entry field represents the information of the line of the Bullet screen, an entry field is also a pointer of the BulletEntry structure, and the BulletEntry is used for determining the Y-value coordinate of a new Bullet screen. The Y field in the structure represents the Y value coordinate of the Entry, and the currentfill field is a pointer to the fill structure, which records a Bullet screen closest to the right of the player.
Further, in the process of implementing S33, first, S41 is executed, a Bullet screen object (Bullet object) is created and saved in the Bullet screen list (m _ bullets), specifically, when a new Bullet screen is received, the application creates a Bullet screen object to describe the Bullet screen, and for the creation of the Bullet screen object, the method includes:
s51: and acquiring the width and the height of the bullet screen.
S52: and obtaining the moving speed of the bullet screen based on the width of the bullet screen.
S53: and determining the longitudinal position of the bullet screen.
S54: and creating the bullet screen object according to the width, the height, the moving speed and the longitudinal position of the bullet screen.
In the specific implementation process, the width and the height of the Bullet screen are obtained by a MeasureString method in Gdiplus of the system, and are filled into the width and height fields of the Bullet structure. After obtaining the width value of the bullet screen, the moving speed of the bullet screen can be calculated, for example, when the moving time of the bullet screen is 10s, the moving speed is the sum of the width of the bullet screen image and the width of the bullet screen divided by 10s, so the speed field value is (1280+ width)/10, and according to the above formula, the moving speed is larger for the longer field of the bullet screen, and the moving speed is smaller for the shorter field of the bullet screen. In addition, in this application, the longitudinal position of the newly added bullet screen needs to be determined, that is, the Y value coordinate, where the Y value coordinate is the row in which the newly added bullet screen moves, and the determination algorithm of the Y value coordinate in this application is as follows: and searching a BulletEntry from the m _ BulletEntry list based on the algorithm criterion, and determining the Y-value coordinate of the newly added bullet screen, namely the longitudinal coordinate value of the bullet screen object by using the Y field of the BulletEntry.
After S41 is completed, S42 is executed, and in a specific implementation process, for the drawing of the bullet screen, firstly determining elapsed time, specifically, calling a gettimecount function of the system, obtaining a current system time t, and then obtaining an elapsed time from a last drawing bullet screen by using (t-bullet- > time)/1000, where bullet- > time is a system time when the bullet screen was drawn last time; then, calculating a new X coordinate position, specifically, after acquiring elapsed time, calculating a moving distance of the bullet screen in the period of time, calculating the moving distance by using S ═ bulb- > speed ═ elapsedTime, and then recalculating the X coordinate of the bullet screen by using the bulb- > X ═ bulb- > X-S, that is, the transverse coordinate value of the bullet screen object; and finally, drawing each bullet screen according to the transverse coordinate value and the longitudinal coordinate value of each bullet in the m _ bullet list by using the DrawString method of Gdiplus.
It should be noted that, in the present application, when the width of the x field added to the bullet screen in the bullet structure is less than 0, it indicates that the bullet screen has jumped out of the screen, so that the bullet screen is removed.
For step 105, based on the created video capture class and the created bullet screen capture class, a StartRecord method of an I L iveEncoder interface is called to record the bullet screen video, and finally, a bullet screen video recording file containing the video content and the bullet screen content is obtained.
Based on the same inventive concept, an embodiment of the present invention further provides a device for recording a bullet screen video, as shown in fig. 2, the device includes:
a connection module 201, configured to establish a connection with a bullet screen server;
an initialization module 202, configured to initialize a live encoder;
a first creating module 203, configured to create a video capture class for recording video content in the bullet screen video;
a second creating module 204, configured to inherit the customized capture class in the live broadcast encoder, and create a bullet screen capture class for recording bullet screen content in the bullet screen video;
and the recording module 205 is configured to record the bullet screen video based on the video capturing class and the bullet screen capturing class, and obtain a bullet screen video recording file including the video content and the bullet screen content.
Preferably, the initialization module 202 includes:
the creation unit is used for creating a live broadcast interface;
the first initialization unit is used for initializing video coding parameters based on the coding parameter information of the barrage video;
and the second initialization unit is used for initializing the live broadcast interface based on the initialized video coding parameters.
Preferably, the apparatus further comprises:
the first closing module is used for closing the playing sound of the video capturing class;
the second closing module is used for closing the acquisition of the system sound card and the microphone sound by the live broadcast encoder;
the calling module is used for calling a setting callback function of the live broadcast encoder and registering an audio buffering callback function in the live broadcast encoder;
and the transmitting module is used for transmitting the audio data of the barrage video into an audio encoder of the live broadcast encoder based on the audio buffering callback function.
Preferably, the second creating module 204 includes:
the filling unit is used for filling the customized capture parameter structure of the customized capture class according to the size of the bullet screen image corresponding to the bullet screen video;
a drawing unit for drawing the bullet screen image in the customized capture class;
and the obtaining unit is used for creating a bullet screen drawing method in the customized capture class to obtain the bullet screen capture class.
Preferably, the obtaining unit includes:
the first creation subunit is used for creating a bullet screen object corresponding to the bullet screen after receiving the bullet screen from the bullet screen video and storing the bullet screen object into a bullet screen list;
and the drawing subunit is used for drawing the bullet screen according to the transverse coordinate value and the longitudinal coordinate value of each bullet screen object in the bullet screen list.
Preferably, the first creating subunit includes:
the acquisition subunit is used for acquiring the width and the height of the bullet screen;
the obtaining subunit is used for obtaining the moving speed of the bullet screen based on the width of the bullet screen;
the determining subunit is used for determining the longitudinal position of the bullet screen;
and the second creating subunit is used for creating the bullet screen object according to the width, the height, the moving speed and the longitudinal position of the bullet screen.
Based on the same inventive concept, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the following steps:
establishing connection with a bullet screen server;
initializing a live broadcast encoder;
creating a video capture class for recording video content in the bullet screen video;
inheriting the customized capture class in the live broadcast encoder, and creating a bullet screen capture class for recording bullet screen content in the bullet screen video;
and recording the bullet screen video based on the video capture class and the bullet screen capture class to obtain a bullet screen video recording file containing the video content and the bullet screen content.
Fig. 3 is a schematic diagram of a computer device, which is shown for convenience of illustration, and only shows a part related to the embodiment of the present invention, and details of the specific technology are not disclosed, please refer to the method part of the embodiment of the present invention. The computer device may be any terminal device including a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), a vehicle-mounted computer, etc., taking the computer device as the mobile phone as an example:
fig. 3 is a block diagram illustrating a partial structure associated with a computer device provided by an embodiment of the present invention. Referring to fig. 3, the computer apparatus includes: a memory 301 and a processor 302. Those skilled in the art will appreciate that the computer device configuration illustrated in FIG. 3 does not constitute a limitation of computer devices, and may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components.
The following describes the components of the computer device in detail with reference to fig. 3:
the memory 301 may be used to store software programs and modules, and the processor 302 executes various functional applications and data processing by operating the software programs and modules stored in the memory 301. The memory 301 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.), and the like. Further, the memory 301 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 302 is a control center of the computer device, and performs various functions and processes data by operating or executing software programs and/or modules stored in the memory 301 and calling data stored in the memory 301. Alternatively, processor 302 may include one or more processing units; preferably, the processor 302 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications.
In an embodiment of the present invention, the processor 302 included in the computer device may have the following functions:
establishing connection with a bullet screen server;
initializing a live broadcast encoder;
creating a video capture class for recording video content in the bullet screen video;
inheriting the customized capture class in the live broadcast encoder, and creating a bullet screen capture class for recording bullet screen content in the bullet screen video;
and recording the bullet screen video based on the video capture class and the bullet screen capture class to obtain a bullet screen video recording file containing the video content and the bullet screen content.
In a word, the method and the device establish connection with a bullet screen server at first, initialize a live encoder, create a video capture class for recording video content in bullet screen video, inherit a customized capture class in the live encoder, create a bullet screen capture class for recording bullet screen content in the bullet screen video, record the bullet screen video based on the video capture class and the bullet screen capture class, obtain a bullet screen video recording file containing the video content and the bullet screen content, solve the problem that the video content and the bullet screen content cannot be recorded in one file in the prior art, and realize mixed recording of the video content and the bullet screen content.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components of a gateway, proxy server, system according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words second, third, etc. do not denote any order. These words may be interpreted as names.

Claims (8)

1. A method for recording a barrage video is applied to a client, and the method comprises the following steps:
establishing connection with a bullet screen server;
initializing a live encoder (L iveEncoder);
creating a video capture class (MediaCapture) for recording video content in the bullet screen video;
inheriting a custom capture class (CustomCapture) in the live broadcast encoder, and creating a bullet screen capture class (BulletCapture) for recording bullet screen contents in the bullet screen video; wherein the video capture class and the barrage capture class are both from a frame of the live encoder;
recording the bullet screen video based on the video capture class and the bullet screen capture class to obtain a bullet screen video recording file containing the video content and the bullet screen content;
wherein after the creating a video capture class for recording video content in the bullet screen video, the method further comprises:
closing the playing sound of the video capture class;
closing the live broadcast encoder to acquire system sound cards and microphone sounds;
calling a setting callback function of the live broadcast encoder, and registering an audio buffering callback function in the live broadcast encoder;
transmitting the audio data of the barrage video into an audio encoder of the live broadcast encoder based on the audio buffering callback function;
wherein, inheriting the customized capture class in the live broadcast encoder, creating a bullet screen capture class for recording bullet screen content in the bullet screen video, comprising:
filling a customized capturing parameter structure of the customized capturing class according to the size of the bullet screen image corresponding to the bullet screen video;
drawing the bullet screen image in the customized capture class;
and creating a bullet screen drawing method in the customized capture class to obtain the bullet screen capture class.
2. The method of claim 1, wherein initializing a live encoder comprises:
creating a live interface;
initializing video coding parameters based on the coding parameter information of the barrage video;
initializing the live broadcast interface based on the initialized video coding parameters.
3. The method of claim 1, wherein the creating a bullet screen drawing method comprises:
after receiving a bullet screen from the bullet screen video, creating a bullet screen object corresponding to the bullet screen, and storing the bullet screen object into a bullet screen list;
and drawing the bullet screen according to the transverse coordinate value and the longitudinal coordinate value of each bullet screen object in the bullet screen list.
4. The method of claim 3, wherein the creating a bullet screen object corresponding to the bullet screen comprises:
acquiring the width and the height of the bullet screen;
obtaining the moving speed of the bullet screen based on the width of the bullet screen;
determining the longitudinal position of the bullet screen;
and creating the bullet screen object according to the width, the height, the moving speed and the longitudinal position of the bullet screen.
5. An apparatus for recording a pop-up screen video, the apparatus comprising:
the connection module is used for establishing connection with the bullet screen server;
an initialization module for initializing a live encoder (L iveEncoder);
a first creating module, configured to create a video capture class (MediaCapture) for recording video content in the bullet screen video;
a second creating module, configured to inherit a custom capture class (custom capture) in the live broadcast encoder, and create a bullet screen capture class (bullet screen capture) for recording bullet screen content in the bullet screen video; wherein the video capture class and the barrage capture class are both from a frame of the live encoder;
the recording module is used for recording the bullet screen video based on the video capture class and the bullet screen capture class to obtain a bullet screen video recording file containing the video content and the bullet screen content;
wherein the apparatus further comprises:
the first closing module is used for closing the playing sound of the video capture class;
the second closing module is used for closing the acquisition of the system sound card and the microphone sound by the live broadcast encoder;
the calling module is used for calling a setting callback function of the live broadcast encoder and registering an audio buffering callback function in the live broadcast encoder;
the transmitting module is used for transmitting the audio data of the barrage video into an audio encoder of the live broadcast encoder based on the audio buffering callback function;
wherein the second creating module comprises:
the filling unit is used for filling the customized capture parameter structure of the customized capture class according to the size of the bullet screen image corresponding to the bullet screen video;
a drawing unit for drawing the bullet screen image in the customized capture class;
and the obtaining unit is used for creating a bullet screen drawing method in the customized capture class to obtain the bullet screen capture class.
6. The apparatus of claim 5, wherein the initialization module comprises:
the creation unit is used for creating a live broadcast interface;
the first initialization unit is used for initializing video coding parameters based on the coding parameter information of the barrage video;
and the second initialization unit is used for initializing the live broadcast interface based on the initialized video coding parameters.
7. A computer-readable storage medium, on which a computer program is stored, which program, when executed by a processor, carries out the steps of:
establishing connection with a bullet screen server;
initializing a live encoder (L iveEncoder);
creating a video capture class (MediaCapture) for recording video content in the bullet screen video;
inheriting a custom capture class (CustomCapture) in the live broadcast encoder, and creating a bullet screen capture class (BulletCapture) for recording bullet screen contents in the bullet screen video; wherein the video capture class and the barrage capture class are both from a frame of the live encoder;
recording the bullet screen video based on the video capture class and the bullet screen capture class to obtain a bullet screen video recording file containing the video content and the bullet screen content;
wherein after the creating a video capture class for recording video content in the bullet screen video, the method further comprises:
closing the playing sound of the video capture class;
closing the live broadcast encoder to acquire system sound cards and microphone sounds;
calling a setting callback function of the live broadcast encoder, and registering an audio buffering callback function in the live broadcast encoder;
transmitting the audio data of the barrage video into an audio encoder of the live broadcast encoder based on the audio buffering callback function;
wherein, inheriting the customized capture class in the live broadcast encoder, creating a bullet screen capture class for recording bullet screen content in the bullet screen video, comprising:
filling a customized capturing parameter structure of the customized capturing class according to the size of the bullet screen image corresponding to the bullet screen video;
drawing the bullet screen image in the customized capture class;
and creating a bullet screen drawing method in the customized capture class to obtain the bullet screen capture class.
8. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executing the program performs the steps of:
establishing connection with a bullet screen server;
initializing a live encoder (L iveEncoder);
creating a video capture class (MediaCapture) for recording video content in the bullet screen video;
inheriting a custom capture class (CustomCapture) in the live broadcast encoder, and creating a bullet screen capture class (BulletCapture) for recording bullet screen contents in the bullet screen video; wherein the video capture class and the barrage capture class are both from a frame of the live encoder;
recording the bullet screen video based on the video capture class and the bullet screen capture class to obtain a bullet screen video recording file containing the video content and the bullet screen content;
wherein after the creating a video capture class for recording video content in the bullet screen video, the method further comprises:
closing the playing sound of the video capture class;
closing the live broadcast encoder to acquire system sound cards and microphone sounds;
calling a setting callback function of the live broadcast encoder, and registering an audio buffering callback function in the live broadcast encoder;
transmitting the audio data of the barrage video into an audio encoder of the live broadcast encoder based on the audio buffering callback function;
wherein, inheriting the customized capture class in the live broadcast encoder, creating a bullet screen capture class for recording bullet screen content in the bullet screen video, comprising:
filling a customized capturing parameter structure of the customized capturing class according to the size of the bullet screen image corresponding to the bullet screen video;
drawing the bullet screen image in the customized capture class;
and creating a bullet screen drawing method in the customized capture class to obtain the bullet screen capture class.
CN201710930602.0A 2017-10-09 2017-10-09 Method and device for recording barrage video, readable storage medium and equipment Active CN107734353B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710930602.0A CN107734353B (en) 2017-10-09 2017-10-09 Method and device for recording barrage video, readable storage medium and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710930602.0A CN107734353B (en) 2017-10-09 2017-10-09 Method and device for recording barrage video, readable storage medium and equipment

Publications (2)

Publication Number Publication Date
CN107734353A CN107734353A (en) 2018-02-23
CN107734353B true CN107734353B (en) 2020-08-04

Family

ID=61208787

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710930602.0A Active CN107734353B (en) 2017-10-09 2017-10-09 Method and device for recording barrage video, readable storage medium and equipment

Country Status (1)

Country Link
CN (1) CN107734353B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109062650B (en) * 2018-08-01 2021-06-15 武汉斗鱼网络科技有限公司 Bullet screen message distribution method, device, equipment and storage medium
CN109600563B (en) * 2018-08-01 2020-05-15 北京微播视界科技有限公司 Method and apparatus for determining a timestamp
CN109121015A (en) * 2018-10-17 2019-01-01 武汉斗鱼网络科技有限公司 A kind of method and relevant apparatus for converting barrage format
CN109495782B (en) * 2018-10-30 2021-04-09 武汉斗鱼网络科技有限公司 Storage method, system and storage medium for barrage message
CN110996167A (en) * 2019-12-20 2020-04-10 广州酷狗计算机科技有限公司 Method and device for adding subtitles in video
CN112423028A (en) * 2020-10-26 2021-02-26 深圳Tcl新技术有限公司 Multimedia file transmission method, device, multimedia terminal and storage medium
CN113784169B (en) * 2021-09-10 2023-06-27 湖南快乐阳光互动娱乐传媒有限公司 Video recording method and device with barrage
CN114449334A (en) * 2022-01-29 2022-05-06 上海哔哩哔哩科技有限公司 Video recording method, video recording device, electronic equipment and computer storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104754396A (en) * 2015-03-12 2015-07-01 腾讯科技(北京)有限公司 Curtain popup data display method and device
CN105847718A (en) * 2016-06-01 2016-08-10 上海幻电信息科技有限公司 Scene recognition-based live video bullet screen display method and display device thereof

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8424052B2 (en) * 2009-12-18 2013-04-16 Samir ABED Systems and methods for automated extraction of closed captions in real time or near real-time and tagging of streaming data for advertisements
CN104980809B (en) * 2015-06-30 2019-03-12 北京奇艺世纪科技有限公司 A kind of barrage treating method and apparatus
CN106254922B (en) * 2016-08-08 2019-06-18 暴风集团股份有限公司 Preload the method and system for playing barrage
CN106658145B (en) * 2016-12-27 2020-07-03 北京奇虎科技有限公司 Live broadcast data processing method and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104754396A (en) * 2015-03-12 2015-07-01 腾讯科技(北京)有限公司 Curtain popup data display method and device
CN105847718A (en) * 2016-06-01 2016-08-10 上海幻电信息科技有限公司 Scene recognition-based live video bullet screen display method and display device thereof

Also Published As

Publication number Publication date
CN107734353A (en) 2018-02-23

Similar Documents

Publication Publication Date Title
CN107734353B (en) Method and device for recording barrage video, readable storage medium and equipment
US11218739B2 (en) Live video broadcast method, live broadcast device and storage medium
US10929460B2 (en) Method and apparatus for storing resource and electronic device
US20240296870A1 (en) Video file generating method and device, terminal, and storage medium
KR102004884B1 (en) Method and apparatus for controlling animated image in an electronic device
JP6300792B2 (en) Enhancing captured data
CN107871000B (en) Audio playing method and device, storage medium and electronic equipment
CN110234005B (en) Method, device, medium and electronic equipment for evaluating video quality
KR20220148915A (en) Audio processing methods, apparatus, readable media and electronic devices
CN110704202A (en) Multimedia recording data sharing method and terminal equipment
CN105430247A (en) Method and device for taking photograph by using image pickup device
CN106470353B (en) Multimedia data processing method and device and electronic equipment
CN106507170A (en) A kind of method for processing video frequency and device
KR20210091082A (en) Image processing apparatus, control method thereof and computer readable medium having computer program recorded therefor
CN115690664A (en) Image processing method and device, electronic equipment and storage medium
CN111601154A (en) Video processing method and related equipment
US11600300B2 (en) Method and device for generating dynamic image
CN105554348A (en) Image display method and device based on video information
CN107431752B (en) Processing method and portable electronic equipment
CN107679205B (en) Multimedia data playing method and device, computer equipment and storage medium
CN110189388B (en) Animation detection method, readable storage medium, and computer device
CN111242116B (en) Screen positioning method and device
CN108989703B (en) Memory video creating method and related device
CN106328174A (en) Method and device for processing recording data
CN108536343B (en) Control display method and device, terminal 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