CN111796827B - Bullet screen drawing method, device, equipment and storage medium - Google Patents

Bullet screen drawing method, device, equipment and storage medium Download PDF

Info

Publication number
CN111796827B
CN111796827B CN202010618846.7A CN202010618846A CN111796827B CN 111796827 B CN111796827 B CN 111796827B CN 202010618846 A CN202010618846 A CN 202010618846A CN 111796827 B CN111796827 B CN 111796827B
Authority
CN
China
Prior art keywords
bullet screen
screen information
video frame
time
target position
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
CN202010618846.7A
Other languages
Chinese (zh)
Other versions
CN111796827A (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.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance 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 Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202010618846.7A priority Critical patent/CN111796827B/en
Publication of CN111796827A publication Critical patent/CN111796827A/en
Application granted granted Critical
Publication of CN111796827B publication Critical patent/CN111796827B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the disclosure discloses a bullet screen drawing method, a bullet screen drawing device, bullet screen drawing equipment and a storage medium, wherein the method comprises the following steps: acquiring at least one piece of bullet screen information to be drawn of a current video frame in a bullet screen information set; determining the target position of the bullet screen information in the current video frame according to the rolling speed of the bullet screen information and the accumulated drawing time in the drawn video frame; and drawing the bullet screen information according to the target position of the bullet screen information. According to the technical scheme of the embodiment, the bullet screen information is positioned in the current video frame in a mode of accumulating drawing time, the phenomenon of shaking caused by the blocking of drawing tasks is avoided, the accurate bullet screen information position is ensured, the development efficiency of the bullet screen is greatly improved, and the user experience is improved.

Description

Bullet screen drawing method, device, equipment and storage medium
Technical Field
The embodiment of the disclosure relates to software technologies, and in particular, to a bullet screen drawing method, device, equipment, and storage medium.
Background
With the continuous development of software technology, various video software begins to appear on terminal equipment, and the barrage becomes more and more important as an important component of video playing.
For the drawing of the rolling barrage, the drawing time of the next time is judged according to the timestamp through a postDelay function, when the drawing task is blocked, the current drawing time is longer, and the drawing time is shortened in the next drawing process so as to make up the time loss of the previous time and ensure the accuracy of the final position of the rolling barrage.
The inventor discovers that in the process of realizing the method, the prior rolling barrage drawing method causes the currently drawn barrage to move too fast when a task is blocked, shortens the drawing time when drawing next time, causes the barrage to move too slow, causes the barrage to shake in visual perception, and has poor user experience.
Disclosure of Invention
The disclosure provides a barrage drawing method, a device, equipment and a storage medium, so as to realize the drawing of barrage video frames.
In a first aspect, an embodiment of the present disclosure provides a bullet screen drawing method, including: acquiring at least one piece of bullet screen information to be drawn of a current video frame in a bullet screen information set; determining the target position of the bullet screen information in the current video frame according to the rolling speed of the bullet screen information and the accumulated drawing time in the drawn video frame; and drawing the bullet screen information according to the target position of the bullet screen information.
In a second aspect, an embodiment of the present disclosure provides a bullet screen drawing device, including: the bullet screen information acquisition module is configured to acquire at least one bullet screen information to be drawn of a current video frame in a bullet screen information set; the target position determining module is configured to determine the target position of the bullet screen information in the current video frame according to the rolling speed of the bullet screen information and the accumulated drawing time in the drawn video frame; and the drawing execution module is configured to draw the bullet screen information according to the target position of the bullet screen information.
In a third aspect, an embodiment of the present disclosure provides an electronic device, which includes a memory, a processing apparatus, and a computer program stored in the memory and executable on the processing apparatus, where the processing apparatus implements a bullet screen drawing method according to any embodiment of the present disclosure when executing the program.
In a fourth aspect, embodiments of the present disclosure provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform a method for drawing a bullet screen according to any of the embodiments of the present disclosure.
According to the technical scheme of the embodiment, the target position of the bullet screen information in the screen is determined according to the obtained rolling speed of the bullet screen information and the accumulated drawing time in the drawn video frame, so that drawing is completed, the bullet screen information is positioned in the current video frame in an accumulated drawing time mode, the phenomenon of shaking caused by drawing task blocking is avoided, the accurate bullet screen information position is ensured, the bullet screen development efficiency is greatly improved, and the user experience is improved.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
Fig. 1A is a flowchart of a bullet screen drawing method in a first embodiment of the present disclosure;
fig. 1B is a flowchart of a bullet screen drawing method in a first specific application scenario of the present disclosure;
fig. 1C is a data flow diagram of barrage rendering in a first specific application scenario of the present disclosure;
fig. 2 is a block diagram of a bullet screen drawing device in a second embodiment of the present disclosure;
fig. 3 is a block diagram of a device in a third embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Example one
Fig. 1A is a flowchart of a method for drawing a bullet screen according to an embodiment of the present disclosure, where the present embodiment is applicable to drawing a video frame of bullet screen information, and the method may be executed by a device for drawing a bullet screen according to an embodiment of the present disclosure, where the device may be implemented by software and/or hardware and is integrated in an application program, and the method specifically includes the following steps:
s110, at least one piece of bullet screen information to be drawn of the current video frame in the bullet screen information set is obtained.
The bullet screen information set is a set of all bullet screen information corresponding to the current video, and comprises bullet screen information which is displayed on a screen, bullet screen information which is currently displayed on the screen, and bullet screen information which is not displayed on the screen; the bullet screen information to be drawn of the current video frame comprises bullet screen information which appears on the screen but is not shown completely, namely bullet screen information which appears in the video in a rolling mode but does not finish the rolling mode, and bullet screen information which is about to appear on the screen, namely bullet screen information which is drawn for the first time from the current video frame; a video frame, i.e. a frame of video image, a frame is a still picture, and a plurality of successive frames form a video.
And S120, determining the target position of the bullet screen information in the current video frame according to the rolling speed of the bullet screen information and the accumulated drawing time in the drawn video frame.
In some optional implementations, different bullet screen information may correspond to the same scrolling speed, so that when the user watches bullet screen information, the user keeps the bullet screen information scrolling stably in visual effect.
Alternatively, in alternative implementations, different bullet screen information may correspond to different scroll speeds. Specifically, the matched rolling speed may be determined according to the type of the bullet screen information, where the type of the bullet screen information includes a display style of the bullet screen information and a permission level of a sender of the bullet screen information, for example, the display style includes bullet screen information of pure characters, bullet screen information with a praise icon, and bullet screen information with a head portrait of a publisher and a nickname, and the rolling speeds of the three display styles are sequentially reduced, so that a user can conveniently praise and view personal information of the publisher after viewing the bullet screen information; the bullet screen information issued by the member user can be slower than the bullet screen information issued by the common user in rolling speed, so that the stay time of the bullet screen information issued by the member user in the screen is longer.
Optionally, in the embodiment of the present disclosure, the scrolling speed may also be determined according to the character length of each bullet screen information; for example, a direct proportional relationship may be set between the character length of the bullet screen information and the scrolling speed, and the scrolling speed is calculated according to an equal proportion of the character length, wherein the longer the character length of the bullet screen information is, the faster the scrolling speed is, and the shorter the character length of the bullet screen information is, the slower the scrolling speed is; different character length intervals can be set, bullet screen information in the same character length interval corresponds to the same rolling speed, bullet screen information in different character length intervals corresponds to different rolling speeds, so that the time of each comment appearing in the screen is the same or approximately the same, the comment information with overlong character length is prevented from occupying the screen for a long time, the visual effect of a user is influenced, and the display of bullet screen information published by other users is also influenced.
The accumulated drawing time of the bullet screen information is the time interval between the first drawing time of the bullet screen information and the current time, and specifically, the accumulated drawing time comprises the product of the occurrence frequency of the bullet screen information in a drawn video frame and the frame time; in order to keep the video playing smoothly and prevent the user from blocking during watching, it is necessary to ensure that a certain number of Frames Per Second (FPS) are transmitted in the screen, for example, 60 Frames Per Second are transmitted in the screen, that is, the frame time is 16 milliseconds (1000 milliseconds divided by 60 Frames, which is approximately equal to 16 milliseconds to draw 1 frame); if the bullet-screen information occurs 50 times in a drawn video frame and the frame time is 16 milliseconds, then the corresponding cumulative drawing time is 800 milliseconds.
Optionally, in this embodiment of the present disclosure, determining a target position of the bullet screen information in the current video frame according to the scrolling speed of the bullet screen information and the cumulative drawing time in the drawn video frame includes: determining a first product value based on the product of the rolling speed of the bullet screen information and the accumulated drawing time in the drawn video frame; determining a second product value based on the product of the rolling speed of the bullet screen information and the current frame time; and determining the target position of the bullet screen information in the current video based on the sum of the first product value and the second product value. Specifically, the first product value indicates the distance that the bullet screen information has moved in the video, and the second product value indicates the distance that the bullet screen information should move in the current video frame, for example, the speed of the bullet screen information is 1 mm every 100 ms, the cumulative drawing time is 800 ms, and the frame time is 16 ms, so that the first product value is 1 ÷ 100 × 800 ═ 8 mm, the second product value is 1 ÷ 100 × 16 ═ 0.16 mm, and the target position of the bullet screen information in the screen is 8.16 mm; particularly, the target position in the screen refers to the position of the first character of the bullet screen information in the screen, if the bullet screen information is scrolled from left to right, the target position is the distance from the right end of the first character of the bullet screen to the left end of the screen, and if the bullet screen information is scrolled from right to left, the target position is the distance from the left end of the first character of the bullet screen to the right end of the screen; and finally acquiring an accurate target position through the historical movement distance of the bullet screen information acquired through the first product value and the target movement distance in the current video frame acquired through the second product value, thereby ensuring the position accuracy of the bullet screen information in the current video frame.
Optionally, in this embodiment of the present disclosure, before determining a target position of the bullet screen information in the current video frame according to the scrolling speed of the bullet screen information and the cumulative drawing time in the drawn video frame, the method further includes: determining the current playing speed; determining the target position of the bullet screen information in the current video frame according to the rolling speed of the bullet screen information and the accumulated drawing time in the drawn video frame, wherein the method comprises the following steps: determining a third product value based on the product of the rolling speed of the bullet screen information, the accumulated drawing time in the drawn video frame and the historical playing speed; determining a fourth product value based on the product of the rolling speed of the bullet screen information, the current frame time and the current playing speed; and determining the target position of the bullet screen information in the current video frame based on the sum of the third product value and the fourth product value. When the video is played at double speed, in order to enable the bullet screen information to be matched with the playing content of the video, the bullet screen information also needs to be played at the same speed; for example, in the above technical solution, the speed of the bullet screen information is 1 mm moving every 100 milliseconds, the cumulative drawing time is 800 milliseconds (that is, the bullet screen information appears 50 times in the drawn video frame), the frame time is 16 milliseconds, for example, the historical playing double speed is 1 time, that is, the bullet screen information is normally played, and the current playing double speed is 2 times, that is, the speed-adjusting command is obtained before the current video frame is drawn; then correspondingly, the first product value is 1 ÷ 100 × 00 ═ 8 mm, the second product value is 1 ÷ 100 × 16 × 2 ÷ 0.32 mm, and the target position in the screen is 8.32 mm; by determining the current playing double speed and the historical playing double speed, the accurate target position can still be obtained through the historical moving distance of the bullet screen information obtained through the third product value and the target moving distance in the current video frame obtained through the fourth product value under different playing double speeds, and the position accuracy of the bullet screen information in the current video frame is ensured.
And S130, drawing the bullet screen information according to the target position of the bullet screen information.
After the target position of the barrage information is determined, the barrage information can be drawn through Canvas (Canvas); where Canvas is a container of interface components, a specific drawing job is performed by creating a Canvas object and then calling Draw method.
Optionally, in this embodiment of the present disclosure, drawing bullet screen information further includes: calling a drawing function of the bullet screen information in response to the acquisition of the timing interrupt signal; drawing bullet screen information according to the drawing function; wherein the timing interrupt signal is triggered by a view refresh function; the timing interrupt signal includes a vertical synchronization signal. The drawing of the bullet screen information is carried out by calling a drawing (Draw) function, and the drawing function can be called after a timing interrupt signal is obtained, so that the accuracy of drawing the bullet screen information on a time sequence is ensured; for example, a vertical synchronization (VSync) signal may be triggered by the view refresh function postupdate or postupdate onanimation after each execution of the rendering function. The view refreshing function is used for refreshing the Interface view, since an application program usually has a plurality of threads in operation, besides a UI thread for controlling display, update and control interaction of a User Interface (UI), a non-UI thread, for example, a drawing thread for bullet screen information in the embodiment of the present disclosure, may be called by a postinventate function or a postinventetonanimation function, so as to ensure that the Interface view is refreshed by the non-UI thread. Because the rendering of the interface is performed row-by-row or column-by-column, when the configuration of the device (e.g., a computer and a mobile phone) is insufficient, the tearing condition that the next picture starts before the rendering of the picture is completed occurs in the high-speed moving of the picture, and the VSync signal can keep the FPS of the barrage information synchronous with the refresh rate of the screen, so that the picture is prevented from being torn. Taking the frame time as 16 milliseconds as an example, a VSync signal is received every 16 milliseconds, and when the VSync signal is acquired every time, a screen is refreshed, that is, one frame is drawn, and the VSync signal can ensure that one frame is drawn every 16 milliseconds, so that smooth playing of a video is ensured.
The existing barrage drawing technology depends on that the display duration of barrage information is subtracted from a timestamp during the drawing of the barrage information, for example, the drawing time of a first frame and the drawing time of a second frame are both 16 milliseconds, but a drawing task is blocked when a third frame is drawn, the drawing time is 18 milliseconds, the drawing time during the drawing of a fourth frame is 14 milliseconds, so as to make up the time lost during the drawing of the third frame, and the drawing of the fifth frame and the following frames is kept for 16 milliseconds; when the moving distance of the bullet screen information is calculated according to the time stamp minus the display duration (the result is 18 milliseconds) during drawing in the third frame, the moving distance of the bullet screen information at this time is larger than the moving distance of the actual target (namely, the speed is multiplied by 18 milliseconds > the speed is multiplied by 16 milliseconds), and when the moving distance of the bullet screen information at this time is smaller than the moving distance of the actual target (namely, the speed is multiplied by 14 milliseconds < the speed is multiplied by 16 milliseconds) during drawing in the fourth frame, and jitter is generated in visual perception; according to the technical scheme of the embodiment of the disclosure, the position of the bullet screen information is calculated according to the drawing accumulation time, the drawing of each frame is to calculate the target position of the bullet screen information according to the integral multiple of 16 milliseconds, and the calculation mode is not changed even if a task is blocked, so that when the multiple speed is not changed, the drawing of each frame can be regarded as the equidistant movement of the bullet screen information, and the phenomenon of shaking in visual perception is avoided.
According to the technical scheme of the embodiment, the target position of the bullet screen information in the screen is determined according to the obtained rolling speed of the bullet screen information and the accumulated drawing time in the drawn video frame, so that drawing is completed, the bullet screen information is positioned in the current video frame in an accumulated drawing time mode, the phenomenon of shaking caused by drawing task blocking is avoided, the accurate bullet screen information position is ensured, the bullet screen development efficiency is greatly improved, and the user experience is improved.
Specific application scenario one
Fig. 1B is a data flow diagram of a bullet screen drawing method provided in a first specific application scenario of the present disclosure, where the method specifically includes:
s210, acquiring a plurality of bullet screen information to be drawn of a current video frame in a bullet screen information set from a data management module through a rendering engine module; wherein, each bullet screen information has been marked with the rolling speed.
As shown in fig. 1C, the View (View) module is a bullet screen information control, and is configured to obtain a bullet screen information drawing task and bullet screen information to be drawn; after the view module acquires the drawing task, entrusts processing logic to a Controller module to execute through a Controller module; the controller module separates the acquired bullet screen information to be drawn from the finally presented view, namely, decouples the view and the data, and marks the rolling speed in the bullet screen information to be drawn; the controller module transmits bullet screen information to be drawn to the data management module; the Data Manager module is used for managing the bullet screen information, and the playing, pause, emptying, double-speed playing and the like of the bullet screen information are managed by the Data management module; and the rendering Engine (Reader Engine) module is used for rendering the data information of the barrage into a finally presented display view.
And S220, marking the accumulated drawing time of the acquired bullet screen information through the rendering engine module, and transmitting the marked bullet screen information to each display layer of the display layer set.
The display layer can comprise a top rolling display layer, a bottom rolling display layer and/or a middle rolling display layer; the top end display layer and the bottom end display layer are bullet screen layers respectively displayed at the top end and the bottom end of the screen; the middle rolling display layer is a popup screen layer displayed in the middle of the screen, and can roll from left to right and also can roll from right to left; in particular, the display layers may also include a slant-end display layer, for example, a slant-end display layer that scrolls from the upper right corner of the screen to the lower left corner of the screen, and a slant-end display layer that scrolls from the upper left corner of the screen to the lower right corner of the screen; in the embodiments of the present disclosure, the type of the display layer is not particularly limited.
Different types of display layers can display different types of barrage information, for example, comment information of member users is displayed in the top display layer, comment information of common users is displayed in the middle rolling display layer, and system recommendation information is displayed in the bottom display layer.
And S230, determining the target position of each bullet screen information in the screen through each display layer according to the rolling speed and the accumulated drawing time of each bullet screen information, and transmitting the target position to a rendering engine.
And S240, drawing the current video frame according to the target position of each bullet screen information through the rendering engine.
According to the technical scheme of the embodiment, each display layer determines the target position of the bullet screen information in the screen according to the obtained rolling speed of the bullet screen information and the accumulated drawing time in the drawn video frame, and then the drawing is completed by the rendering engine, so that the bullet screen information is positioned in the current video frame in the accumulated drawing time mode, the phenomenon of shaking caused by the blockage of the drawing task is avoided, the accurate bullet screen information position is ensured, the bullet screen development efficiency is greatly improved, and the user experience is improved.
Example two
Fig. 2 is a block diagram of a structure of a bullet screen drawing device provided in the second embodiment of the present disclosure, which specifically includes: a bullet screen information acquisition module 210, a target position determination module 220 and a drawing execution module 230.
A bullet screen information obtaining module 210 configured to obtain a plurality of bullet screen information to be drawn of a current video frame in a bullet screen information set;
a target position determination module 220 configured to determine a target position of each bullet screen information in the screen according to the scrolling speed of each bullet screen information and the accumulated drawing time in the drawn video frame;
and a drawing execution module 230 configured to draw the current video frame according to the target position of each bullet screen information.
According to the technical scheme of the embodiment, the target position of the bullet screen information in the screen is determined according to the obtained rolling speed of the bullet screen information and the accumulated drawing time in the drawn video frame, so that drawing is completed, the bullet screen information is positioned in the current video frame in an accumulated drawing time mode, the phenomenon of shaking caused by drawing task blocking is avoided, the accurate bullet screen information position is ensured, the bullet screen development efficiency is greatly improved, and the user experience is improved.
Optionally, on the basis of the above technical solution, the accumulated drawing time includes a product of the number of occurrences of the bullet screen information in the drawn video frame and the frame time.
Optionally, on the basis of the above technical solution, the rolling speed is determined according to the bullet screen length of the bullet screen information.
Optionally, on the basis of the foregoing technical solution, the target position determining module 220 specifically includes:
a first product value determination unit configured to determine a first product value based on a product of a scroll speed of the bullet screen information and an accumulated drawing time in the drawn video frame;
a second product value determination unit configured to determine a second product value based on a product of a scroll speed of the bullet screen information and a current frame time;
and the first target position determining unit is configured to determine the target position of the bullet screen information in the current video based on the sum of the first product value and the second product value.
Optionally, on the basis of the above technical solution, the apparatus for drawing bullet curtains further includes:
and the speed determining module is configured to determine the current playing speed.
Optionally, on the basis of the foregoing technical solution, the target position determining module 220 specifically further includes:
a third multiplication value determining unit which determines a third multiplication value based on the product of the rolling speed of the bullet screen information, the accumulated drawing time in the drawn video frame and the historical playing speed;
a fourth product value determination unit which determines a fourth product value based on a product of the scroll speed of the bullet screen information, the current frame time and the current playing double speed;
and the second target position determining unit is used for determining the target position of the bullet screen information in the current video frame based on the sum of the third product value and the fourth product value.
Optionally, on the basis of the above technical solution, the apparatus for drawing bullet curtains further includes:
the drawing function calling module is configured to call a drawing function of the bullet screen information in response to the acquisition of the timed interrupt signal;
and the drawing function execution module is configured to draw the bullet screen information according to the drawing function.
Optionally, on the basis of the above technical solution, the timing interrupt signal is triggered by a view refresh function.
Optionally, on the basis of the above technical solution, the timing interrupt signal includes a vertical synchronization signal.
The device can execute the bullet screen drawing method provided by any embodiment of the disclosure, and has the corresponding functional modules and beneficial effects of the execution method. Technical details that are not elaborated in this embodiment may be referred to a method provided by any embodiment of the present disclosure.
EXAMPLE III
Fig. 3 shows a schematic structural diagram of an electronic device (e.g., the terminal device or the server in fig. 1) 300 suitable for implementing an embodiment of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 3 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 3, the electronic device 300 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 301 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)302 or a program loaded from a storage means 308 into a Random Access Memory (RAM) 303. In the RAM 303, various programs and data necessary for the operation of the electronic apparatus 300 are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
Generally, the following devices may be connected to the I/O interface 305: input devices 306 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 307 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage devices 308 including, for example, magnetic tape, hard disk, etc.; and a communication device 309. The communication means 309 may allow the electronic device 300 to communicate wirelessly or by wire with other devices to exchange data. While fig. 3 illustrates an electronic device 300 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication means 309, or installed from the storage means 308, or installed from the ROM 302. The computer program, when executed by the processing device 301, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText transfer protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring a plurality of bullet screen information to be drawn of a current video frame in a bullet screen information set; determining the target position of each bullet screen information in the screen according to the rolling speed of each bullet screen information and the accumulated drawing time in the drawn video frame; and drawing the current video frame according to the target position of each bullet screen information.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present disclosure may be implemented by software or hardware. Here, the name of the module does not constitute a limitation of the module itself in some cases, for example, the draw function call module may be described as "a draw function configured to call bullet screen information in response to acquisition of the timer interrupt signal". The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, [ example 1 ] there is provided a bullet screen drawing method including:
acquiring at least one piece of bullet screen information to be drawn of a current video frame in a bullet screen information set;
determining the target position of the bullet screen information in the current video frame according to the rolling speed of the bullet screen information and the accumulated drawing time in the drawn video frame;
and drawing the bullet screen information according to the target position of the bullet screen information.
In accordance with one or more embodiments of the present disclosure, [ example 2 ] there is provided the method of example 1, further comprising:
the accumulated drawing time includes the product of the number of occurrences of the bullet screen information in the drawn video frame and the frame time.
In accordance with one or more embodiments of the present disclosure, [ example 3 ] there is provided the method of example 1, further comprising:
and determining the rolling speed according to the bullet screen length of the bullet screen information.
According to one or more embodiments of the present disclosure, [ example 4 ] there is provided the method of example 1 or 2, further comprising:
determining a first product value based on the product of the rolling speed of the bullet screen information and the accumulated drawing time in the drawn video frame;
determining a second product value based on the product of the rolling speed of the bullet screen information and the current frame time;
and determining the target position of the bullet screen information in the current video based on the sum of the first product value and the second product value.
In accordance with one or more embodiments of the present disclosure, [ example 5 ] there is provided the method of example 1, further comprising:
determining the current playing speed;
determining a third product value based on the product of the rolling speed of the bullet screen information, the accumulated drawing time in the drawn video frame and the historical playing speed;
determining a fourth product value based on the product of the rolling speed of the bullet screen information, the current frame time and the current playing speed;
and determining the target position of the bullet screen information in the current video frame based on the sum of the third product value and the fourth product value.
In accordance with one or more embodiments of the present disclosure, [ example 6 ] there is provided the method of example 1, further comprising:
calling a drawing function of the bullet screen information in response to the acquisition of the timing interrupt signal;
and drawing bullet screen information according to the drawing function.
In accordance with one or more embodiments of the present disclosure, [ example 7 ] there is provided the method of example 6, further comprising:
the timed interrupt signal is triggered by a view refresh function.
According to one or more embodiments of the present disclosure, [ example 8 ] there is provided the method of example 7, further comprising:
the timing interrupt signal includes a vertical synchronization signal.
According to one or more embodiments of the present disclosure, [ example 9 ] there is provided a bullet screen drawing device including:
the bullet screen information acquisition module is configured to acquire at least one bullet screen information to be drawn of a current video frame in a bullet screen information set;
the target position determining module is configured to determine the target position of the bullet screen information in the current video frame according to the rolling speed of the bullet screen information and the accumulated drawing time in the drawn video frame;
and the drawing execution module is configured to draw the bullet screen information according to the target position of the bullet screen information.
According to one or more embodiments of the present disclosure, [ example 10 ] there is provided an electronic device comprising a memory, a processing apparatus, and a computer program stored on the memory and executable on the processing apparatus, the processing apparatus implementing the method of bullet screen drawing as in any one of examples 1-8 when executing the program.
According to one or more embodiments of the present disclosure, [ example 11 ] there is provided a storage medium containing computer-executable instructions for performing the method of drawing a bullet screen as in any one of examples 1-8 when executed by a computer processor.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (10)

1. A bullet screen drawing method is characterized by comprising the following steps:
acquiring at least one piece of bullet screen information to be drawn of a current video frame in a bullet screen information set;
determining the target position of the bullet screen information in the current video frame according to the rolling speed of the bullet screen information and the accumulated drawing time in the drawn video frame; the accumulated drawing time is the interval time between the time when the bullet screen information is drawn for the first time and the current time;
determining the target position of the bullet screen information in the current video frame according to the rolling speed of the bullet screen information and the accumulated drawing time in the drawn video frame, wherein the determining comprises the following steps:
determining a first product value based on the product of the rolling speed of the bullet screen information and the accumulated drawing time in the drawn video frame;
determining a second product value based on the product of the rolling speed of the bullet screen information and the current frame time;
determining the target position of the bullet screen information in the current video based on the sum of the first product value and the second product value;
and drawing the bullet screen information according to the target position of the bullet screen information.
2. The method of claim 1, wherein the accumulated drawing time comprises a product of a number of occurrences of the barrage information in a drawn video frame and a frame time.
3. The method of claim 1, further comprising:
and determining the rolling speed according to the bullet screen length of the bullet screen information.
4. The method of claim 1, wherein before determining the target position of the bullet screen information in the current video frame according to the scroll speed of the bullet screen information and the accumulated drawing time in the drawn video frame, further comprising:
determining the current playing speed;
determining the target position of the bullet screen information in the current video frame according to the rolling speed of the bullet screen information and the accumulated drawing time in the drawn video frame, wherein the determining comprises the following steps:
determining a third product value based on the product of the rolling speed of the bullet screen information, the accumulated drawing time in the drawn video frame and the historical playing speed;
determining a fourth product value based on the product of the rolling speed of the bullet screen information, the current frame time and the current playing speed;
and determining the target position of the bullet screen information in the current video frame based on the sum of the third product value and the fourth product value.
5. The method of claim 1, wherein said drawing said bullet screen information further comprises:
calling a drawing function of the bullet screen information in response to the acquisition of the timing interrupt signal;
and drawing the bullet screen information according to the drawing function.
6. The method of claim 5, wherein the timed interrupt signal is triggered by a view refresh function.
7. The method of claim 6, wherein the timing interrupt signal comprises a vertical synchronization signal.
8. The utility model provides a drawing side device of barrage which characterized in that includes:
the bullet screen information acquisition module is configured to acquire at least one bullet screen information to be drawn of a current video frame in a bullet screen information set;
a target position determination module configured to determine a target position of the bullet screen information in a current video frame according to the rolling speed of the bullet screen information and the accumulated drawing time in the drawn video frame; the accumulated drawing time is the interval time between the time when the bullet screen information is drawn for the first time and the current time;
the target position determining module specifically includes:
a first product value determination unit configured to determine a first product value based on a product of a scroll speed of the bullet screen information and an accumulated drawing time in a drawn video frame;
a second product value determination unit configured to determine a second product value based on a product of a scroll speed of the bullet screen information and a current frame time;
a first target position determination unit configured to determine a target position of the bullet screen information in the current video based on a sum of the first product value and the second product value; and the drawing execution module is configured to draw the bullet screen information according to the target position of the bullet screen information.
9. An electronic device comprising a memory, a processing means, and a computer program stored on the memory and executable on the processing means, wherein the processing means implements the bullet screen rendering method according to any one of claims 1 to 7 when executing the program.
10. A storage medium containing computer-executable instructions for performing the method of bullet screen rendering of any of claims 1-7 when executed by a computer processor.
CN202010618846.7A 2020-06-30 2020-06-30 Bullet screen drawing method, device, equipment and storage medium Active CN111796827B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010618846.7A CN111796827B (en) 2020-06-30 2020-06-30 Bullet screen drawing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010618846.7A CN111796827B (en) 2020-06-30 2020-06-30 Bullet screen drawing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111796827A CN111796827A (en) 2020-10-20
CN111796827B true CN111796827B (en) 2022-02-18

Family

ID=72809806

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010618846.7A Active CN111796827B (en) 2020-06-30 2020-06-30 Bullet screen drawing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111796827B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113099285A (en) * 2021-03-30 2021-07-09 上海哔哩哔哩科技有限公司 Display method and device
CN116095382B (en) * 2022-06-02 2023-10-31 荣耀终端有限公司 Barrage identification method and related device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105979337A (en) * 2015-12-28 2016-09-28 武汉斗鱼网络科技有限公司 Video comment playing device and method
CN108391154A (en) * 2018-01-30 2018-08-10 广州虎牙信息科技有限公司 Barrage display control method, storage medium and terminal
CN108696767A (en) * 2018-05-15 2018-10-23 北京字节跳动网络技术有限公司 Barrage playback method, device, computer readable storage medium and terminal
CN109862414A (en) * 2019-03-22 2019-06-07 武汉斗鱼鱼乐网络科技有限公司 A kind of masking-out barrage display methods, device and server
CN110740338A (en) * 2019-10-29 2020-01-31 网易(杭州)网络有限公司 bullet screen processing method and device, electronic equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110012306B (en) * 2019-04-02 2021-05-14 广州虎牙信息科技有限公司 Bullet screen display method, device, equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105979337A (en) * 2015-12-28 2016-09-28 武汉斗鱼网络科技有限公司 Video comment playing device and method
CN108391154A (en) * 2018-01-30 2018-08-10 广州虎牙信息科技有限公司 Barrage display control method, storage medium and terminal
CN108696767A (en) * 2018-05-15 2018-10-23 北京字节跳动网络技术有限公司 Barrage playback method, device, computer readable storage medium and terminal
CN109862414A (en) * 2019-03-22 2019-06-07 武汉斗鱼鱼乐网络科技有限公司 A kind of masking-out barrage display methods, device and server
CN110740338A (en) * 2019-10-29 2020-01-31 网易(杭州)网络有限公司 bullet screen processing method and device, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
电视直播弹幕系统的设计和实现;杨舟 等;《中国优秀博硕士学位论文全文数据库(硕士) 信息科技辑》;20170215;第I136-1815页 *

Also Published As

Publication number Publication date
CN111796827A (en) 2020-10-20

Similar Documents

Publication Publication Date Title
CN113110783B (en) Control display method and device, electronic equipment and storage medium
CN113489937B (en) Video sharing method, device, equipment and medium
EP4178188A1 (en) Landscape interaction method and apparatus, electronic device, and storage medium
CN112423084B (en) Display method and device of hotspot list, electronic equipment and storage medium
CN111796827B (en) Bullet screen drawing method, device, equipment and storage medium
CN113923499B (en) Display control method, device, equipment and storage medium
CN112565868B (en) Video playing method and device and electronic equipment
CN111177610A (en) Material display method and device, electronic equipment and storage medium
CN114699767A (en) Game data processing method, device, medium and electronic equipment
CN111796825B (en) Bullet screen drawing method, bullet screen drawing device, bullet screen drawing equipment and storage medium
CN111796826B (en) Bullet screen drawing method, device, equipment and storage medium
CN114168018A (en) Data interaction method, data interaction device, electronic equipment, storage medium and program product
CN112905134A (en) Method and device for refreshing display and electronic equipment
CN113342230A (en) Control display method, device, equipment and medium
CN114860139A (en) Video playing method, video playing device, electronic equipment, storage medium and program product
CN111310632A (en) Terminal control method and device, terminal and storage medium
CN110321042B (en) Interface information display method and device and electronic equipment
CN115904591B (en) Media content display method and device, electronic equipment and storage medium
CN116483239A (en) Interaction method, interaction device, electronic equipment and storage medium
CN114416263B (en) Processing method, processing device, electronic equipment and medium
CN112765511B (en) Business object display method, device, equipment, storage medium and program product
CN112650465A (en) Terminal control method and device, terminal and storage medium
CN110267089B (en) Video playing control method and device, electronic equipment and storage medium
CN111770385A (en) Card display method and device, electronic equipment and medium
CN112188274B (en) Method and device for adjusting video playing progress and electronic equipment

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