Data rendering processing method, device, equipment and medium
By encapsulating video comment data as material files supported by animation components in the comment rendering thread of the application client and utilizing the rendering capabilities of the animation components, the problem of low efficiency in barrage rendering is solved, and more efficient video comment display is achieved.
Patent Information
- Application Number
- CN202310803924.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-30
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2043-06-30
AI Technical Summary
In the existing technology, the bullet screen rendering process requires the transmission of a large amount of data, resulting in low rendering efficiency and prone to lag problems.
By encapsulating the video comment data into a comment material file supported by the animation component in the comment rendering thread of the application client, and utilizing the rendering capabilities of the animation component to generate and display video presentation comments, the amount of data in the rendering process is reduced, and drawing operations are performed only based on the updated comment movement position and texture identifier.
The rendering efficiency of video comments has been improved, the display smoothness of video comments has been improved, the rendering time has been reduced, and better rendering performance and diversified text effects have been achieved.
Smart Images

Figure CN119233002B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a data rendering processing method, apparatus, device, and medium. Background Art
[0002] With the development of computer technology, people are increasingly communicating in a variety of ways. Using "bullet screen" (danmu) to comment on videos and interact with others is becoming increasingly common. Danmu refers to the commentary subtitles that pop up at specific moments while watching a video. Danmu can be thought of as video comments that appear on the same screen as the video.
[0003] In the current barrage rendering technology, the pre-embedded rendering logic in the operating system corresponding to the terminal device (for example, the Android system) is usually used to implement the barrage rendering process in the video scene. In order to achieve the playback effect of the barrage in the video, it is usually necessary to perform a function callback through the main thread used to render the barrage, so that each barrage is rendered multiple times to display the barrage at different positions in the video screen. However, in the multiple rendering processes of the barrage, the latter barrage rendering process is based on the updated barrage position and is rendered on the basis of the previous barrage rendering result. That is to say, each rendering process of the barrage involves the transmission of the complete barrage rendering result. When there are a large number of barrages that need to be rendered, the amount of data that needs to be transmitted during the rendering process is huge, resulting in too low rendering efficiency of the barrage, and the problem of barrage playback being stuck easily. Summary of the Invention
[0004] The embodiments of the present application provide a data rendering processing method, apparatus, device, and medium, which can improve the rendering efficiency of video comments and enhance the display fluency of video comments.
[0005] An embodiment of the present application provides a data rendering processing method, including:
[0006] Obtain video comment data and encapsulate the video comment data into a comment material file; the data type corresponding to the comment material file is the data type supported by the animation component integrated in the application client;
[0007] Rendering the comment material file in the comment rendering thread corresponding to the application client to generate a first video display comment;
[0008] Storing the first video display comment in a view component corresponding to the application client, and displaying the first video display comment in a video screen of the application client through the view component;
[0009] Obtaining a texture identifier corresponding to the comment displayed on the first video, updating the position of the comment material file to obtain a comment movement position, rendering the comment movement position and the texture identifier in a comment rendering thread, and generating a second video display comment;
[0010] The second video display comments are stored in the view component, and the second video display comments are displayed in the video screen of the application client through the view component.
[0011] In one aspect, an embodiment of the present application provides a data rendering processing device, comprising:
[0012] The data encapsulation module is used to obtain video comment data and encapsulate the video comment data into a comment material file; the data type corresponding to the comment material file is the data type supported by the animation component integrated in the application client;
[0013] A first rendering module is used to render the comment material file in the comment rendering thread corresponding to the application client to generate a first video display comment;
[0014] A first display module is configured to store the first video display comment in a view component corresponding to the application client, and display the first video display comment in a video screen of the application client through the view component;
[0015] A second rendering module is configured to obtain a texture identifier corresponding to a comment displayed on the first video, update the position of the comment material file to obtain a comment movement position, render the comment movement position and the texture identifier in a comment rendering thread, and generate a second video display comment;
[0016] The second display module is used to store the second video display comments in the view component, and display the second video display comments in the video screen of the application client through the view component.
[0017] The data encapsulation module includes:
[0018] A request sending unit, configured to send a data acquisition request to a service device upon detecting a comment display operation in a video playback page of an application client; the data acquisition request is used to instruct the service device to acquire video comment data for a requested time period, where the requested time period is associated with the video playback progress in the application client;
[0019] The material file construction unit is used to receive the video comment data returned by the service device, and encapsulate the video comment data into a comment material file corresponding to the comment type according to the comment type in the video comment data.
[0020] Among them, the comment types include text outline animation type;
[0021] The material file construction unit encapsulates the video comment data into a comment material file corresponding to the comment type according to the comment type in the video comment data, including:
[0022] Get the text resources and text attribute information in the video comment data, call the text setting interface of the animation component, and fill the text resources and text attribute information into the text layer of the animation component;
[0023] The outline projection attribute information matching the text outline animation type is obtained in the video comment data, and the comment material file corresponding to the text outline animation type is determined according to the text layer containing text resources and text attribute information, as well as the outline projection attribute information.
[0024] The first rendering module includes:
[0025] A comment drawing unit is used to draw the text resources in the text layer according to the text attribute information in the text layer contained in the comment material file in the comment rendering thread corresponding to the application client to generate an initial video comment;
[0026] The comment projection unit is used to obtain the projection filter corresponding to the text outline animation type, render the initial video comment according to the shader corresponding to the projection filter and the outline projection attribute information in the comment material file, and generate the first video display comment.
[0027] Among them, the review types include texture review types;
[0028] The material file construction unit encapsulates the video comment data into a comment material file corresponding to the comment type according to the comment type in the video comment data, including:
[0029] Get the text resources and text attribute information in the video comment data, call the text setting interface of the animation component, and fill the text resources and text attribute information into the text layer of the animation component;
[0030] The dynamic mask information in the video comment data is constructed as an image layer of the animation component, and texture binding is performed on the text layer containing text resources and text attribute information, and the image layer containing dynamic mask information to generate a comment material file corresponding to the texture comment type; the dynamic mask information includes the location address used to represent the image resource.
[0031] The first rendering module includes:
[0032] A comment drawing unit is used to draw the text resources in the text layer according to the text attribute information in the text layer contained in the comment material file in the comment rendering thread corresponding to the application client to generate an initial video comment;
[0033] The image resource acquisition unit is used to acquire the image resource indicated by the location address in the dynamic mask information according to the dynamic mask information in the image layer included in the comment material file;
[0034] The image texture adding unit is used to add the texture content in the image resource to the initial video comment according to the texture binding between the text layer and the image layer in the comment material file to generate the first video display comment.
[0035] Among them, the comment types include gradient comment types;
[0036] The material file construction unit encapsulates the video comment data into a comment material file corresponding to the comment type according to the comment type in the video comment data, including:
[0037] Get the text resources and text attribute information in the video comment data, call the text setting interface of the animation component, and fill the text resources and text attribute information into the text layer of the animation component;
[0038] Color gradient change information associated with the gradient comment type is obtained in the video comment data, and a comment material file corresponding to the gradient comment type is determined based on a text layer containing text resources and text attribute information, as well as the color gradient change information.
[0039] The first rendering module includes:
[0040] A comment drawing unit is used to draw the text resources in the text layer according to the text attribute information in the text layer contained in the comment material file in the comment rendering thread to generate an initial video comment;
[0041] The color gradient processing unit is used to obtain the color gradient filter corresponding to the gradient comment type, render the initial video comment according to the shader corresponding to the color gradient filter and the color gradient change information in the comment material file, and generate the first video display comment.
[0042] The number of review material files is M, where M is a positive integer;
[0043] The first rendering module includes:
[0044] A rendering tree generation unit is used to call the typesetting interface of the animation component, combine the M comment material files, and generate a comment rendering tree structure associated with the video comment data;
[0045] The video comment rendering unit is used to render the M comment material files in the comment rendering tree structure in the comment rendering thread corresponding to the application client to generate a first video display comment.
[0046] Wherein, the first display module includes:
[0047] A view component allocation unit, configured to allocate a view component to the animation component in a graphics processor corresponding to a terminal device running the application client;
[0048] A video comment drawing unit is configured to store the first video display comment in a view component, and in the view component, perform a drawing operation on the first video display comment according to the comment setting information in the video screen of the application client to obtain an adjusted first video display comment;
[0049] The video comment display unit is used to call the playback control interface of the animation component and display the adjusted first video display comments in the video screen through the view component.
[0050] The second rendering module includes:
[0051] a texture identifier acquisition unit, configured to acquire a texture identifier corresponding to the first video display comment returned by a graphics processor of a terminal device, and cache the texture identifier in a cache area corresponding to the animation component; the terminal device is a device running an application client, and the graphics processor is configured to provide a view component for the animation component;
[0052] A movement displacement determination unit is used to respond to a comment movement instruction in the application client, obtain a texture identifier from a cache area, and determine a movement displacement of a comment material file associated with the texture identifier based on comment setting information in the video playback page;
[0053] a comment position updating unit, configured to add the movement displacement to the initial position of the comment material file associated with the texture identifier to obtain a comment movement position of the comment material file associated with the texture identifier;
[0054] The comment updating and displaying unit is used to render the comment material file associated with the comment moving position and the texture identifier in the comment rendering thread to generate a second video display comment.
[0055] In one aspect, an embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory is connected to the processor, the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device executes the method provided in the above aspect of the embodiment of the present application.
[0056] On one hand, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. The computer program is suitable for being loaded and executed by a processor, so that a computer device with a processor executes the method provided in the above aspect of the embodiment of the present application.
[0057] According to one aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method provided in the above aspect.
[0058] In an embodiment of the present application, the rendering process of the video comment can be implemented through the animation component integrated in the application client. After obtaining the video comment data, the video comment data can be encapsulated as a comment material file supported by the animation component, and then the comment material file can be rendered in the comment rendering thread corresponding to the application client to generate a first video display comment. The rendered first video display comment can be stored in the view component, and the first video display comment can be displayed in the video screen of the application client through the view component. Furthermore, the texture identifier corresponding to the first video display comment can be obtained, the position of the comment material file can be updated to obtain the comment movement position, and the comment material file and the texture identifier can be rendered in the comment rendering thread to generate a second video display comment. The second video display comment can also be stored in the view component, and the second video display comment can be displayed in the video screen of the application client through the view component. When using the animation components integrated in the application client to implement video comments, the rendering operations of the video comments can be completed in the comment rendering thread. In order to achieve the playback effect of the first video display comments in the video screen, the comment material file needs to be rendered multiple times, and in the subsequent rendering process, the drawing operation can be completed based on the updated comment movement position and the texture identifier of the first video display comments. This can reduce the amount of data in the video comment rendering process, reduce rendering time, and thus improve the rendering efficiency of the video comments, thereby improving the display smoothness of the video comments. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0060] Figure 1 This is a schematic diagram of a network architecture provided by an embodiment of the present application;
[0061] Figure 2 This is a schematic diagram of a data interaction scenario provided by an embodiment of the present application;
[0062] Figure 3This is a flow diagram of a data rendering processing method provided in an embodiment of the present application. Figure 1 ;
[0063] Figure 4 This is a schematic diagram of a comment rendering tree structure provided by an embodiment of the present application;
[0064] Figure 5 This is a timing diagram of a video comment rendering process provided by an embodiment of the present application;
[0065] Figure 6 This is a timing diagram of updating the position of video comments provided by an embodiment of the present application;
[0066] Figure 7 This is a flow diagram of a data rendering processing method provided in an embodiment of the present application. Figure 2 ;
[0067] Figure 8 This is a schematic diagram of a comment setting interface in a video playback interface provided by an embodiment of the present application;
[0068] Figure 9 This is a schematic diagram of rendering a video comment of a text outline animation type provided by an embodiment of the present application;
[0069] Figure 10 This is a rendering diagram of a video comment of a texture comment type provided in an embodiment of the present application;
[0070] Figure 11 This is a schematic diagram of rendering of a video comment of a gradual comment type provided in an embodiment of the present application;
[0071] Figure 12 This is a schematic diagram of video comment rendering based on animation components provided by an embodiment of the present application;
[0072] Figure 13 This is a schematic diagram of a video comment drawing process based on an animation component provided in an embodiment of the present application;
[0073] Figure 14 This is a schematic diagram of the structure of a data rendering processing device provided in an embodiment of the present application. Figure 1 ;
[0074] Figure 15 This is a schematic diagram of the structure of a data rendering processing device provided in an embodiment of the present application. Figure 2 ;
[0075] Figure 16 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0076] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0077] To facilitate understanding of the subsequent content, the following is a brief introduction to the relevant technologies involved in the embodiments of this application.
[0078] Portable Animated Graphics (PAG) is a complete motion effects workflow solution. Its goal is to reduce or eliminate the R&D costs associated with motion effects. It supports one-click export of motion effects content created by designers in graphics and video processing software (for example, post-production special effects software Adobe After Effects, referred to as AE software) into material files, and quickly put them online and applied to almost all current mainstream platforms, such as Android and iOS (a handheld device operating system) platforms.
[0079] Lottie is an open source, complete cross-platform animation effect solution. Using the Bodymovin plug-in provided by Lottie (used to export vector animation illustrations), designers can export animations created in AE software into JSON (JavaScript Object Notation, a syntax for storing and exchanging text information) format, and directly apply it to multiple current mainstream platforms without any additional operations.
[0080] React Native (RN) is an open source cross-platform mobile application development framework. It is a derivative of the open source JS (JavaScript, a programming language) framework React on the native mobile application platform, supporting both Android and iOS platforms.
[0081] Surface is an important view component in the Android system. As a basic component of Android, Surface can be considered as a memory area used to store image data to be displayed, which can be directly drawn and operated. By using Surface, applications can hand over image data to the system for processing, and then present the image data on the terminal screen. A large number of applications in the Android platform use Surface, including but not limited to game applications, video playback applications, cameras, barrage, etc. In addition, in applications involving OpenGL ES (OpenGL for Embedded Systems, a set of 3D graphics application programming interfaces for handheld embedded devices), Surface is also an important component. It can assist OpenGL ES in achieving efficient 2D (two-dimensional) and 3D (three-dimensional) graphics rendering effects.
[0082] See Figure 1 , Figure 1 This is a schematic diagram of a network architecture provided by an embodiment of the present application. The network architecture may include a server 10d and a terminal cluster. The terminal cluster may include one or more terminal devices. The network architecture may also include one or more servers. There is no restriction on the number of terminal devices and servers included in the network architecture. Figure 1 As shown, the terminal cluster may specifically include terminal device 10a, terminal device 10b, and terminal device 10c, etc.; all terminal devices in the terminal cluster (for example, terminal device 10a, terminal device 10b, and terminal device 10c, etc.) may be connected to the server 10d through a network, and the network may be a wide area network, a local area network, or a combination of a wide area network and a local area network, and data transmission between each terminal device and the server 10d may be achieved using wired or wireless methods.
[0083] in, Figure 1 The server 10d shown can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. This application does not limit the type of server.
[0084] Figure 1The terminal devices in the terminal cluster shown may include but are not limited to: smart phones, tablet computers, laptop computers, desktop computers, mobile internet devices (MID), wearable devices (such as smart watches, smart bracelets, etc.), smart voice interaction devices, smart home appliances (such as smart TVs, etc.), vehicle-mounted devices, aircraft and other electronic devices with video commentary and playback functions. This application does not limit the type of terminal devices. It is understandable that, if Figure 1 Each terminal device in the terminal cluster shown can install an application client. When the application client runs in each terminal device, it can be connected to the above Figure 1 The server 10d shown in FIG. 10B performs data interaction between the two terminals. The application client running in each terminal device can be an independent client or an embedded sub-client integrated in a certain client, which is not limited in this application.
[0085] Application clients may specifically include, but are not limited to, in-vehicle clients, smart home clients, entertainment clients (e.g., game clients), multimedia clients (e.g., video clients, video players), information clients (e.g., news clients), and browsers that provide video comment and playback functions. If the terminal device included in the terminal cluster is an in-vehicle device, then the in-vehicle device may be an intelligent terminal in a smart transportation scenario, and the application client running on the in-vehicle device may be referred to as an in-vehicle client.
[0086] It is understandable that Figure 1 Each terminal device in the terminal cluster shown can be installed with the same application client, and the server 10d in this case can be the background server corresponding to the application client. When different objects use their own terminal devices to watch the same video in the application client, they can post video comments for the video they are watching; when the object turns on the video comment playback function for the video they are watching, the video comments posted by each object can be displayed on the video screen watched by the object. Among them, the video comments involved in the embodiments of the present application can refer to the commentary subtitles displayed on the same screen as the video when watching the video, which can also be called video barrage.
[0087] For example, suppose Figure 1The terminal device 10a shown is an electronic device used by the first object, the terminal device 10b is an electronic device used by the second object, and the terminal device 10c is an electronic device used by the third object, and the terminal device 10a, the terminal device 10b and the terminal device 10c are all installed with the application client A. When the first object uses the terminal device 10a to watch the video B in the application client A, he can post a video comment for the video B during the viewing process; similarly, the second object and the third object can also post a video comment for the video B when watching the video B in the application client A. It should be understood that the relevant data of the video comments posted by each object for the video B in the application client A can be transmitted to the background server corresponding to the application client A (for example, Figure 1 Server 10d is shown in FIG. That is, server 10d can obtain relevant data for all video comments corresponding to video B. The relevant data for video comments may include comment resource information and resource attribute information. Comment resource information may include, but is not limited to, text and images, and resource attribute information may include, but is not limited to, the starting coordinates, font, color, and font size of the comment resource. Comment resource information may be content entered by an object, and resource attribute information may be customized by the object or default settings in application client A. This application does not limit this.
[0088] Among them, if the first object chooses to turn on the video comment playback function (which can also be understood as triggering the comment display operation) when watching video B, then the application client A running in the terminal device 10a can generate a data acquisition request for video B, and send the data acquisition request to the server 10d to request the server 10d to obtain the video comment data corresponding to the video B (that is, the relevant data of each video comment corresponding to video B). After receiving the data acquisition request, the server 10d can obtain the video comment data corresponding to the video B according to the current playback progress of video B, and return the video comment data to the application client A in the terminal device 10a. This process can be considered as the process of application client A pulling video comment data from the background server. After obtaining the video comment data, application client A can use the rendering capability of the animation component integrated in application client A to render the video comment data, and display the rendered video display comments in the video screen played by application client A. Among them, the rendering capability of the animation component integrated in the application client A can be used to achieve the video comment playback effect in the application client A. The animation components integrated in the application client A may include but are not limited to PAG, Lottie and RN, etc. The embodiment of this application does not limit the type of animation component integrated in the application client A.
[0089] It is understandable that the data rendering processing method provided in the embodiment of the present application (specifically, a video comment rendering method) can be executed by a computer device, which can be a terminal device or a server, such as being independently executed by a terminal device, or being executed by a server, or being executed collaboratively by a terminal device and a server. For example, when a terminal device executes the data rendering processing method provided in the embodiment of the present application, the rendering capability of the animation component integrated in the application client A can be used to replace the rendering logic pre-embedded in the terminal device (the rendering logic pre-embedded in the terminal device can be understood as the rendering logic pre-embedded in the operating system in the terminal device). Video comments drawn with the rendering capability of the animation component have fewer freezes and better performance, and a variety of text effects can be quickly achieved through the animation component, including but not limited to text animation, font size, transparency, font, thickness, etc.
[0090] Optionally, the terminal device can implement the data rendering processing method provided in the embodiment of the present application by running a computer program. For example, the computer program can be a native program or software module in the operating system; or it can be a local (Native) application (APP, Application), that is, a program that needs to be installed in the operating system to run; or it can be a subroutine (or it can be called a mini-program), that is, a program that can be run only after being downloaded to a browser environment; or it can also be a subroutine that can be embedded in any application. In short, the above-mentioned computer program can be any form of application, module or plug-in; for example, the computer program can be any application client that provides a video comment playback function.
[0091] Further, see Figure 2 , Figure 2 This is a schematic diagram of a data interaction scenario provided in an embodiment of the present application. Figure 2 The terminal device 20a shown can be the above Figure 1 For any terminal device in the terminal cluster of the corresponding embodiment, the application server 20f can be the above Figure 1 The server 10d shown; for ease of understanding, the object using the terminal device 20a in the embodiment of the present application will be referred to as the first object. The embodiment of the present application takes the application client as a video player as an example to illustrate the playback effect of the video comments. At this time, the video comments can be called video barrage.
[0092] like Figure 2 As shown, the current display page of the terminal device 20a may be Figure 2The video playback page 20b shown in FIG. 20b can play the video (e.g., video B) that the first subject is currently watching in the video player. The video playback page 20b can display a play / pause control, a play next video control, a speed control, a volume setting control, a full-screen switch control, a playback progress indicator 20d, and a progress indicator 20e. Among them, the play / pause control can be used to control the play status and pause status of video B; the play next video control can be used to control the video playback page 20b to switch from video B to the next video for playback; the speed control can be used to control the playback speed of video B in the video playback page 20b; the volume setting control can be used to set the playback volume of video B in the video playback page 20b; the full-screen switching control can be used to switch the display size of video B in the video playback page 20b, such as the display size of video B in the video playback page 20b is full screen (full screen here refers to the entire terminal screen of the terminal device 20a), then after triggering the full-screen switching control, the display size of video B can be switched from full screen to non-full screen; the progress indicator 20e can be displayed on the playback progress indicator axis 20d, and the position of the progress indicator on the playback progress indicator axis 20d indicates the current playback progress of video B.
[0093] like Figure 2 As shown, the video playback page 20b can also display a barrage display control 20c, and the barrage display control 20c can include two states, namely, an open state and a closed state; wherein the barrage display control 20c in the open state can be used to indicate that the barrage of video B is displayed in the video playback page 20b, and the barrage display control 20c in the closed state can be used to indicate that the barrage of video B does not need to be displayed in the video playback page 20b, such as Figure 2The barrage display control 20c in the video playback page 20b shown is currently in a closed state. When the first object wants to interact with other objects watching video B through video barrage while watching video B, or to watch barrages posted by other objects for video B, the barrage display control 20c can be triggered to enable barrage display for video B. When the first object triggers the barrage display control 20c, the terminal device 20a can respond to the triggering operation on the barrage display control 20c, generate a barrage acquisition request for video B, and send the barrage acquisition request to the application server 20f. At this time, the barrage display control 20c can be switched to the on state, and a new barrage setting control 20h and a barrage posting area 20i are added to the video playback page 20b; the barrage setting control 20h can be used to set the barrage style in the video playback page 20b (such as including but not limited to font size, font, transparency, thickness, color, etc.); the barrage posting area 20i can provide the object with a barrage posting function, such as the object can input the barrage content it wants to publish by triggering the barrage posting area 20i, and the barrage content it input can be rendered in the video playback page 20b. Among them, the barrage acquisition request may include the barrage display instruction generated by the terminal device 20a for video B according to the triggering operation of the barrage display control 20c by the first object, and the barrage display instruction is used to instruct the application server 20f to obtain the video barrage data corresponding to video B.
[0094] Furthermore, after receiving the barrage acquisition request sent by the terminal device 20a, the application server 20f can obtain the current video playback progress of video B in the video playback page 20b, and then can search for video barrage data that matches the current video playback progress in the database corresponding to the application server 20f; for example, if the current video playback progress is 1:41 seconds in video B, then the application server 20f can determine that the request time period corresponding to the data acquisition request is 1:30-2:00, or it can refer to the remaining video time end with 1:41 as the starting time, or it can be other custom settings or default settings. This application does not limit this. After the application server 20f obtains the video barrage data from the database, it can return the video barrage data to the video player in the terminal device 20a.
[0095] After receiving the video bullet screen data returned by the application server 20f, the video player in the terminal device 20a can use the animation component integrated in the video player to render the video bullet screen data and generate a video bullet screen for display on the video playback page 20b. The video bullet screen displayed on the same screen as video B on the video playback page 20b can be as follows: Figure 2Area 20g shown. In other words, the video bullet comments posted by each object before and after the current video playback progress are displayed in area 20g of the video playback page 20b. It can be understood that the transparency, number of display lines, movement speed, bullet comment font size of the video bullet comment in the video playback page 20b, and the display position area of the video bullet comment in the video screen of the video playback page 20b can all be set through the bullet comment setting control 20h. For example, video bullet comments of different colors, video bullet comments with gradient colors, and video bullet comments with other bullet comment display effects can be displayed in area 20g of the video playback page 20b; through the data rendering processing solution provided in the embodiment of the present application, the display effect of the video bullet comment can be quickly achieved.
[0096] It is understood that the process of the terminal device using the rendering capability of the animation component integrated in the application client (for example, the aforementioned video player) to achieve the video comment (for example, video barrage) playback effect can be seen in the following Figures 3 to 13 The corresponding embodiment.
[0097] See Figure 3 , Figure 3 This is a flow diagram of a data rendering processing method provided in an embodiment of the present application. Figure 1 It is understood that the data rendering processing method can be executed by a computer device, which can be a terminal device (for example, Figure 1 Any terminal device in the terminal cluster of the corresponding embodiment), or it can be a server (for example, Figure 1 The embodiment of the present application takes the data rendering processing method executed by the terminal device as an example for explanation; wherein, the data rendering processing method may include the following steps S101 to S105:
[0098] Step S101: Obtain video comment data, and encapsulate the video comment data into a comment material file; the data type corresponding to the comment material file is the data type supported by the animation component integrated in the application client.
[0099] Specifically, the terminal device may be deployed with the above-mentioned application client, which may be a video client or other client with a video comment playback function. The embodiment of the present application does not limit the type of application client. After the object using the terminal device (for example, the first object mentioned above) starts the application client, the video display page of the application client may be displayed on the terminal device, and the video in the application client may be displayed on the video display page; if the object wants to watch the video on the video display page of the application client, the object may select the video of interest (for example, the video B mentioned above) on the video display page for playback, and then the video playback page corresponding to the video selected by the object may be displayed on the terminal device (for example, Figure 2 The corresponding embodiment of the video playback page 20b); that is, the video playback page can display the video screen of the video selected by the object.
[0100] It is understandable that in addition to displaying the video screen corresponding to the video selected by the object, the video playback page can also display various controls with different functions. For details, please refer to Figure 2 The description of the video playing page 20b in the corresponding embodiment will not be repeated here. It should be understood that the video playing page may include a comment display control (for example, Figure 2 In the corresponding embodiment, when the object performs a comment display operation on the comment display control in the video playback page, the application client in the terminal device can respond to the comment display operation for the comment display control, and the application client can send a message from the service device corresponding to the application client (for example, Figure 2 The application server 20f) in the corresponding embodiment obtains the video comment data corresponding to the currently playing video in the video playback page. Among them, the comment display operation can refer to the object setting the comment display control in the video playback page to the open state. When the comment display operation is in the open state, the application client in the terminal device can regularly request video comment data from the service device, such as the application client can pull video comment data from the service device every one minute, or can pull video comment data from the next service device every half minute, etc. The embodiment of the present application does not limit the time interval for the application client to pull video comment data. The video comment data can be the relevant data of the video comments published by each object for the currently playing video in the video playback page, such as the video comment data includes comment resource information and resource attribute information. The comment resource information can include resources such as text and pictures, and the resource attribute information includes attributes such as starting coordinates, font, color, font size, and transparency.
[0101] Furthermore, the application client deployed in the terminal device can integrate animation components, such as PAG, Lottie, and RN, etc. The embodiment of the present application does not limit the type of animation components integrated in the application client; the embodiment of the present application can use the rendering capabilities of the animation component to replace the rendering logic pre-embedded in the terminal device to implement the rendering implementation process of the video comments in the application client. Therefore, after the application client in the terminal device pulls the video comment data from the database of the service device, it can encapsulate the video comment data into a comment material file that can be recognized by the animation component. In other words, the data type of the encapsulated comment material file is the data type supported by the animation component integrated in the application client.
[0102] It is understood that the video comment data obtained by the application client may include one or more video comment data. Therefore, the video comment data can be encapsulated into different comment material files based on the attribute information and animation effects of each video comment data contained in the video comment data. Encapsulation here can also be considered as construction or modification. The number of comment material files can be one or more.
[0103] Step S102: Rendering the comment material file in the comment rendering thread corresponding to the application client to generate a first video display comment.
[0104] Specifically, the application client can add the encapsulated comment material files to the rendering structure, such as the number of comment material files is M, M is a positive integer, such as M can take the value of 1, 2, ...; when M is a positive integer greater than 1, the typesetting interface of the animation component can be called to freely combine the M comment material files to generate a comment rendering tree structure associated with the video comment data, and then the M comment material files in the comment rendering tree structure can be rendered in the comment rendering thread corresponding to the application client to generate the first video display comment. It can be understood that when the comment display control in the video playback page of the application client is set to the open state, the comment rendering thread corresponding to the main thread for rendering video comments can be started; for example, the comment rendering thread can be specifically a Render (rendering) thread, and the typesetting interface (such as the relevant interface of the PAGComposition of the PAG component) can be a container in the comment rendering tree, which can contain multiple layers, support the object to add, delete, and change the rendering order, and support obtaining the layer corresponding to the name through the layer name, etc. The comment rendering tree can complete the free combination of multiple layers and multiple comment material files by using the typesetting interface.
[0105] The animation component integrated into the application client can set its running process through a configuration file. When the object launches the application client, a process running the animation component can be created and started. The aforementioned main thread can be a thread within the process running the animation component, and the aforementioned comment rendering thread can be a child thread corresponding to the main thread. A process is an active running process of an application (for example, an application client deployed on a terminal device). It is the basic unit for the operating system to allocate and schedule resources, providing the operating environment for the running application. A process includes at least one main thread, and each process has its own independent memory address space. A thread is the entity that executes code within a process and is the smallest unit for the central processing unit (CPU) to schedule resources. Multiple threads can run concurrently within a process. Threads do not have their own independent memory resources, only their own execution stack and local variables. Therefore, threads cannot execute independently and must be hosted on a process. Multiple threads within the same process can share the process's memory resources. In this embodiment of the present application, all video comment rendering operations on the video playback page of the application client can be completed in the comment rendering thread, which runs on the terminal device's CPU. This can reduce the data processing pressure on the main thread running on the CPU.
[0106] See Figure 4 , Figure 4 This is a schematic diagram of a comment rendering tree structure provided by an embodiment of the present application. This embodiment of the present application takes the animation component as PAG as an example to describe the comment rendering tree structure. Figure 4 As shown, assuming that the video comment data received by the application client contains information about multiple video comments, the application client can construct the video comment data into different comment material files (the comment material file here can be represented as PAGFile), that is, the video comment data can be constructed into multiple comment material files (for example, M comment material files), such as Figure 4The comment material file 201a, comment material file 201b, comment material file 201c, comment material file 201d, etc. are shown. It can be understood that every time the application client constructs a comment material file (PAGFile), the comment material file can be inserted into the comment rendering tree structure. For example, after constructing the comment material file 201a, the comment material file 201a can be inserted into the comment rendering tree structure; after constructing the comment material file 201b, the comment material file 201b can also be inserted into the comment rendering tree structure, and so on. After constructing the comment material file 201d, the comment material file 201d can be inserted into the comment rendering tree structure. The typesetting interface (the related interface of PAGComposition) in the animation component (PAG) can be called to freely combine multiple comment material files in the comment rendering tree structure. As Figure 4 The preview tool shown (such as PAGView) can support local path and PAGComposition loading, and call the play method for playback. It has a timer inside, which can be used to regularly call the play method to play the video display comments.
[0107] Step S103: storing the first video display comment in a view component corresponding to the application client, and displaying the first video display comment in the video screen of the application client through the view component.
[0108] Specifically, when using the rendering capability of the animation component integrated in the application client to achieve the video comment display effect, the application client can apply for a display window from the graphics processing unit (GPU) in the terminal device. This display window can be called a view component (such as Surface), or it can be understood that the GPU can allocate a view component to the animation component in the application client, and the view component can be understood as the interface of the GPU. After completing the rendering operation of the comment material file in the comment rendering thread, the first video display comment is generated in the comment rendering thread. The first video display comment here can be represented in the form of image data. The first video display comment can be stored in the view component corresponding to the application client, and then the first video display comment can be displayed in the video screen of the video playback page through the view component, that is, the on-screen operation of the first video display comment is completed through the view component, and the first video display comment can be presented in the same video screen as the video currently being played on the video playback page.
[0109] See Figure 5 , Figure 5This is a timing diagram of a video comment rendering process provided by an embodiment of the present application. This embodiment of the present application takes the animation component as PAG as an example to describe the video comment rendering process, such as Figure 5 As shown, the video comment rendering process may include but is not limited to the following steps: the application client deployed in the terminal device can receive the video comment from the service device (the backend server of the application client, as mentioned above) Figure 2 The application server 20f) in the corresponding embodiment pulls the video comment data corresponding to the currently playing video in the video playback page, and the video comment data can include the text, font size, color, etc. of the comment. Specifically, the application client can request the video comment data from the service device, and the service device can send the video comment data requested by the application client to the application client. The application client can construct the video comment data into different comment material files (PAGFile), and then mount the constructed comment material files into PAGComposition to complete the operation of adding video animation comments (PAG comments). The rendering operation of the comment material file is completed in the comment rendering thread (Render thread) to generate a first video display comment. The first video display comment can be stored in the view component corresponding to the application client (such as Surface, which can be considered as the interface of the GPU), and the on-screen operation of the first video display comment is completed through the view component, so as to achieve the effect of video comment playback in the video playback page of the application client.
[0110] Step S104: obtain the texture identifier corresponding to the first video display comment, update the position of the comment material file to obtain the comment movement position, render the comment movement position and the texture identifier in the comment rendering thread, and generate the second video display comment.
[0111] Specifically, the GPU in the terminal device can return the texture identifier corresponding to the first video display comment to the application client, which can be essentially understood as the GPU of the terminal device returning the texture identifier corresponding to the first video display comment to the CPU. When the first video display comment is played on the video playback page, if the first video display comment can be moved in the video screen of the video playback page, the position of the comment material file associated with the first video display comment can be updated to obtain the comment movement coordinates corresponding to the comment material file; the comment movement position and texture identifier are rendered in the comment rendering thread to generate a second video display comment, and the second video display comment here can be represented in the form of image data. Among them, the first video display comment and the second video display comment can have the same video comments and comment animation effects, but the display coordinates of the video comments in the two are different in the video playback page; or, the video comments and comment animation effects in the first video display comment and the second video display comment can be only partially the same, of course, the display coordinates of the same part of the video comments in the video playback page are different; this application does not limit this.
[0112] Step S105: store the second video display comment in the view component, and display the second video display comment in the video screen of the application client through the view component.
[0113] Specifically, the second video display comments generated above can be stored in the view component corresponding to the application client, and then the second video display comments can be displayed in the video screen of the video playback page through the view component, that is, the on-screen operation of the second video display comments is completed through the view component, and the second video display comments can be presented in the same video screen as the video currently being played on the video playback page.
[0114] See Figure 6 , Figure 6 This is a timing diagram of updating the video comment position provided by the embodiment of the present application. The embodiment of the present application still takes the animation component as PAG as an example to describe the process of updating the video comment position, such as Figure 6As shown, the application client can periodically call back the player (for example, PAG's playback control class PAGPlayer, which can be used to control the rendering progress of the comment material file in the comment rendering thread) to obtain the texture identifier corresponding to the first video display comment. Furthermore, when the first video display comment needs to be moved, the application client can calculate the comment movement position, that is, recalculate the coordinates of the comment material file in the video playback page, and continuously update the comment movement position corresponding to the comment material file, and then render the comment movement position and texture identifier in the comment rendering thread to generate a second video display comment. The second video display comment can be stored in the view component corresponding to the application client, and the view component can be used to implement the on-screen operation of the second video display comment.
[0115] In an embodiment of the present application, when video comments are implemented using the animation component integrated in the application client, the rendering operations of the video comments can be completed in the comment rendering thread. In order to achieve the playback effect of the first video display comment in the video screen, the comment material file needs to be rendered multiple times, and in the subsequent rendering process, the drawing operation can be completed based on the updated comment movement position and the texture identification of the first video display comment. This can reduce the amount of data in the video comment rendering process, reduce the rendering time, and thus improve the rendering efficiency of the video comment, thereby improving the display smoothness of the video comment.
[0116] See Figure 7 , Figure 7 This is a flow diagram of a data rendering processing method provided in an embodiment of the present application. Figure 2 It is understood that the data rendering processing method can be executed by a computer device, which can be a terminal device (for example, Figure 1 Any terminal device in the terminal cluster of the corresponding embodiment), or it can be a server (for example, Figure 1 The embodiment of the present application takes the data rendering processing method executed by the terminal device as an example for explanation; wherein, the data rendering processing method may include the following steps S201 to S211:
[0117] Step S201, when a comment display operation is detected in the video playback page of the application client, a data acquisition request is sent to the service device; the data acquisition request is used to instruct the service device to obtain video comment data in the requested time period, and the requested time period is associated with the video playback progress in the application client.
[0118] Specifically, the terminal device may be deployed with the above-mentioned application client. When an object using the terminal device (for example, the above-mentioned first object) starts the application client, a video display page of the application client may be displayed on the terminal device, and the video display page may display the video in the application client. If the object wants to watch a video on the video display page of the application client, the object may select a video of interest to play on the video display page, and then a video playback page corresponding to the video selected by the object may be displayed on the terminal device (for example, Figure 2 The corresponding embodiment of the video playback page 20b); that is, the video playback page can display the video screen of the video selected by the object.
[0119] When the object performs a comment display operation on the comment display control in the video playback page, the application client in the terminal device can respond to the comment display operation in the video playback page, which can also be understood as detecting the comment display operation in the video playback page, and then generating a data acquisition request for the video being played in the video playback page (for example, the aforementioned Figure 2 The data acquisition request in the corresponding embodiment can be sent to the service device (which can be understood as the background server corresponding to the application client). The data acquisition request can be used to request the service device to obtain the video comment data corresponding to the video being played on the video playback page. The video comment data may include all information of the video comments posted by each object, including but not limited to text, pictures and other resources, as well as corresponding color, start and end positions, fonts, font size, transparency, thickness and other attribute information.
[0120] After receiving the data acquisition request sent by the application client, the service device can determine the requested time period based on the current video playback progress in the video playback page of the application client, and then search the database corresponding to the service device for video comment data within the requested time period, and the video comment data can be returned to the application client. It is understandable that the database of the service device can include data on all video comments posted by the object for the video, and each video comment can correspond to a publishing timestamp. The publishing timestamp here can refer to a time point relative to the video duration (the publishing time point of the video comment is less than the video duration). When the video is played to the publishing timestamp, the video comment can be rendered to the video screen of the video playback page; for example, the publishing timestamp of a video comment is 14:01 (the default video duration is greater than 14:01), then when the video is played to 14:01, the video comment can be rendered to the video screen. The above-mentioned request time period may also refer to a time period in the video length, and the request time period is used to indicate the amount of data that the service device needs to return to the application server; the request time period may be associated with the current video playback progress of the video played in the video playback page, and the time interval for the application client to request video comment data from the service device; for example, the application client requests video comment data in sequence from the service device every minute, and the current playback progress of the video played in the video playback page is 10:00, then the request time period may be 10:00 to 11:00; optionally, the request time period may also be set according to the actual needs of the application scenario, and this application does not limit this.
[0121] For example, the video comment data sent by the service device to the application client in the terminal device can be expressed as follows:
[0122] {
[0123] "text":"Comment 1", / / The text content of the video comment is: Comment 1;
[0124] "fontSize":13, / / The font size of video comments is set to 13;
[0125] "color":"#FFFFFF", / / The text color of video comments is set to white;
[0126] "dropshadow":[{ / / Set the projection effect (external glow effect) for video comments;
[0127] "color":"#FFFF00", / / The projection color of video comments is set to red;
[0128] "size":5, / / The projection size of the video comment is set to 5;
[0129] "spread":"45%" / / The projection offset of the video comment is set to 45%;
[0130] }],
[0131] "gradientColor":{ / / Set the color gradient effect for video comments;
[0132] "angle":"45", / / Set the color gradient angle of video comments to 45;
[0133] "startColor":"#FFFFFF", / / Set the starting color of the color gradient for video comments to white;
[0134] "endColor":"#000000" / / Set the end color of the color gradient of the video comment to black;
[0135] },
[0136] "trackMatte":{ / / Set texture effect for video comments;
[0137] "url":"xxxx" / / The location address of the image used to set the texture effect for video comments;
[0138] },
[0139] "Other business fields": "Other business fields"
[0140] }
[0141] It should be noted that the above-mentioned video comment data is only an example in the embodiment of the present application, and the embodiment of the present application does not limit the comment display effects involved in the video comment data. Among them, the video comment data may contain different comment display effects, and the comment display effects may include comment styles and comment animations. The comment style is a static effect, including but not limited to font size, transparency, font, thickness, color, etc.; the comment animation is a dynamic effect, including but not limited to adding light effects, flashing, etc. to the video comments. It should be understood that the display effect of the video comment can be determined by the comment setting information of the object in the video playback page (for example, it can specifically be the barrage setting information of the object in the video playback page).
[0142] Further, see Figure 8 , Figure 8 This is a schematic diagram of a comment setting interface in a video playback interface provided by an embodiment of the present application. Figure 8 As shown, the current display page of the terminal device can be Figure 8The video playing page 30a shown in FIG. 3 is a video playing page. For a description of the video playing page 30a, please refer to the aforementioned Figure 2 The relevant description of the video playback page 20b in the corresponding embodiment will not be repeated here.
[0143] Among them, the video playback page 30a may include a bullet screen display control 30b. When the bullet screen display control 30b is in the turned-on state, the video playback page 30a may also display a bullet screen setting control 30c and a bullet screen posting area 30d. When the object performs a trigger operation on the bullet screen setting control 30c in the video playback page 30a, the terminal device may respond to the trigger operation on the bullet screen setting control 30c, and pop up a bullet screen setting page 30e in the video playback page 30a. The bullet screen setting page 30e may be a display area in the video playback page 30a, or may be a sub-page displayed independently in the video playback page 30a. The embodiment of the present application does not limit this. The bullet screen setting page 30e can be considered as a bullet screen toolbox in the video playback page 30a. In the bullet screen setting page 30e, the object can set the bullet screen display, bullet screen mode, and bullet screen type of the video comment in the video playback page 30a. The information such as the bullet screen display, bullet screen mode, and bullet screen type here can all belong to the comment setting information. Among them, the barrage display may include information such as the number of display lines, transparency, movement speed, font size, etc. of the video comments in the video playback page 30a. The barrage style may include but is not limited to two modes: complete and selected. The complete mode may refer to displaying all video comments posted by all objects for the video being played in the video playback page 30a, and the selected mode refers to filtering the video comments posted by all objects and only displaying a part of the filtered video comments in the video playback page 30a. The barrage type may include but is not limited to the top barrage type and the bottom barrage type. The top barrage type may refer to displaying the video comments in the top area of the video screen, and the bottom barrage type may refer to displaying the video comments in the bottom area of the video screen. Optionally, the object can also restore the default settings in the barrage setting page 30e.
[0144] Optionally, the display color of the video comments in the video playback page 30a can be included in the bullet style tab (multi-tab, a component commonly used in front-end development, the tab can be divided into a selected state and an unselected state. Generally speaking, in order to highlight the selected state, the font color can be changed, the font size can be enlarged, lines can be added, the background color can be increased, etc.), and the color (including gradient colors) that the object is interested in can be selected for a single video comment (single bullet). When the object performs a trigger operation on the bullet posting area 30d in the video playback page 30a, the terminal device can respond to the trigger operation on the bullet posting area 30d, and pop up the bullet posting page 30f in the video playback page 30a. The bullet posting page 30f may include a position tab, a color tab, a font tab (such as flower fonts), etc. Among them, the position tab in the bullet posting page 30f may include but is not limited to a scrolling tab and a top tab, etc. The scrolling tab may refer to the video comments being displayed in a scrolling form in the video playback page 30a, and the top tab may refer to the video comments being displayed in a top fixed form in the video playback page 30a, etc. Color tabs can include, but are not limited to, tabs with different gradient colors such as Cool Gold, Colorful, Starry, Heart-beating, and Blue. When commenting on a video, the user can select the location tab, color tab, and flowery text tab of their interest as comment setting information.
[0145] Step S202: receiving the video comment data returned by the service device, and encapsulating the video comment data into a comment material file corresponding to the comment type according to the comment type in the video comment data.
[0146] Step S203: Rendering the comment material file in the comment rendering thread corresponding to the application client to generate a first video display comment.
[0147] Specifically, the application client can receive the video comment data returned by the service device. The video comment rendering in the application client is realized by the animation component (for example, PAG, Lottie and RN, etc.) integrated in the application client. The video comment data sent by the service device to the application client cannot be recognized by the animation component. Therefore, the video comment data needs to be constructed as a data type that can be recognized by the animation component, such as the video comment data can be constructed as a comment material file that can be recognized by the animation component. It can be understood that the different comment display effects contained in the video comment data can correspond to different comment types, that is, different comment types indicate different display effects of the video comments. Therefore, the application client can construct the video comment data into different comment material files according to the different comment types in the video comment data, and the data types of all comment material files are data types that can be recognized by the animation component. Among them, the comment type of the video comment (video comment display effect) can include but is not limited to ordinary comment type (text comment type without display effect), text outline animation type (for example, external glow comment type), texture comment type, gradient comment type (gradient color comment type), etc. The embodiment of the present application does not limit the comment type. For ease of understanding, the embodiment of the present application is described by taking the animation component integrated in the application client as PAG as an example.
[0148] In one or more embodiments, when the comment type is an ordinary text comment type, ordinary video text comments can directly correspond to the properties in the text layer (e.g., PAGTextLayer, which can support objects to modify default text information, text color, change fonts, font size, etc.) of the animation component (e.g., PAG), and can generate a comment material file (e.g., PAGFile) by directly constructing or modifying it. In other words, the terminal device can obtain the text resources and text attribute information in the video comment data, call the text setting interface of the animation component (e.g., setText, which can return or set a string containing the selected text), set the text resources and text attribute information to PAGTextLayer, and generate a PAGFile corresponding to the ordinary text comment type. For example, assuming that the video comment data can be expressed as: {"text":"Comment One","fontSize":13,"color":"#FFFFFF"}, then the text resource at this time can be "Comment One", and the text attribute information can include: "fontSize":13,"color":"#FFFFFF", and the text resource and text attribute information can be set to PAGTextLayer by calling setText. After the PAGFile corresponding to the ordinary text comment type completes the rendering process in the comment rendering thread (Render thread), the first video display comment obtained can be a video comment with a color (color) of white and a font size (fontSize) of 13 (the text content is "Comment One").
[0149] In one or more embodiments, when the comment type is a text outline animation type (for example, an external glowing barrage), the text resources and text attribute information in the video comment data are obtained, the text setting interface of the animation component (such as setText) is called, and the text resources and text attribute information are filled into the text layer (PAGTextLayer) in the animation component (PAG); the outline projection attribute information matching the text outline animation type is obtained in the video comment data (for example, dropshadow attribute information, dropshadow can add a projection to the non-transparent area of an element or picture), and the comment material file (PAGFile) corresponding to the text outline animation type is determined based on the text layer (PAGTextLayer) containing the text resources and text attribute information, as well as the outline projection attribute information (dropshadow attribute information). In the comment rendering thread (Render thread) corresponding to the application client, the text resources in the text layer are drawn according to the text attribute information in the text layer contained in the comment material file to generate the initial video comment; the projection filter (Filter) corresponding to the text outline animation type is obtained, and the initial video comment is rendered according to the shader (Shader) corresponding to the projection filter and the outline projection attribute information in the comment material file to generate the first video display comment.
[0150] See Figure 9 , Figure 9 This is a rendering diagram of a video comment of a text outline animation type provided by an embodiment of the present application. Figure 9 As shown, it is assumed that the video comment data sent by the service device to the terminal device Figure 9 The information in the area 40a shown in the figure can be used to determine that the text resource (text) in the video comment data is "Comment 1". The text attribute information corresponding to the text resource includes: font size (fontSize) is 13, color (color) is black, and the text resource and text attribute information can directly correspond to the attributes in the text layer (PAGTextLayer). For example, the content "Comment 1" in the text resource can be set to PAGTextLayer by calling the text setting interface (setText), that is, Figure 9 The information in the illustrated area 40b is constructed as a PAGTextLayer.
[0151] like Figure 9As shown, the information in area 40c can be used to determine that the comment type in the video comment data is a text outline animation type (such as an external glowing bullet screen). The Dropshadow (projection) attribute in area 40c (the color is chrysanthemum blue, the projection size is 4, and the projection offset is 45%) can be filled into the corresponding field of the PAG. Figure 9 The information in the shown area 40c is constructed as the Dropshadow of the PAG. The PAGTextLayer and Dropshadow constructed here can be used as the comment material file 40f (PAGFile) corresponding to the video comment data (such as the information in area 40a), and the comment material file 40f can be added to the comment rendering tree structure.
[0152] Furthermore, when rendering in the comment rendering thread (Render thread), the rendering tree can read the projection filter corresponding to the text outline animation type, and find the corresponding shader code according to this projection filter to render the text outline animation. After the rendering of the comment material file 40f is completed in the Render thread, a video display comment can be generated for display in the video playback page 40d of the application client, such as Figure 9 Video comments are shown in area 40e.
[0153] In one or more embodiments, when the comment type is a texture comment type (such as texture barrage), the text resources and text attribute information in the video comment data are obtained, the text setting interface (such as setText) of the animation component is called, and the text resources and text attribute information are filled into the text layer of the animation component; the dynamic mask (for example, trackMatte) information in the video comment data is constructed as the image layer of the animation component, and the text layer containing the text resources and text attribute information, and the image layer containing the dynamic mask information (for example, PAGImageLayer) are texture bound to generate a comment material file corresponding to the texture comment type; the dynamic mask information includes a location address for representing the image resource, and the location address can be a Uniform Resource Locator (URL) for indicating the source of the image resource. In the comment rendering thread (Render thread) corresponding to the application client, the text resources in the text layer are drawn according to the text attribute information in the text layer contained in the comment material file to generate an initial video comment; according to the dynamic mask information in the image layer contained in the comment material file, the image resource indicated by the positioning address in the dynamic mask information is obtained; according to the texture binding between the text layer and the image layer in the comment material file, the texture content in the image resource is added to the initial video comment to generate the first video display comment.
[0154] See Figure 10 , Figure 10 Schematic diagram of rendering of a video comment of a texture comment type provided by an embodiment of the present application. Figure 10 As shown, it is assumed that the video comment data sent by the service device to the terminal device Figure 10 According to the information in the area 50a shown in FIG. 5 , the text resource (text) in the video comment data can be determined to be “Comment 1”. The text attribute information corresponding to the text resource includes: the font size (fontSize) is 13, the color (color) is black, and the specific example is: Figure 10 As shown in the area 50b, that is, Figure 10 The information in the illustrated area 50b is constructed as a text layer (PAGTextLayer).
[0155] like Figure 10 As shown, the information in area 50c can determine that the comment type in the video comment data is a texture comment type, and a picture layer (PAGImageLayer) can be constructed based on the trackMatte (dynamic mask) structure in area 50c. The trackMatte structure contains a url, which is used to indicate the source of the picture resource. This constructed PAGImageLayer can be texture bound to the aforementioned PAGTextLayer. The PAGTextLayer and PAGImageLayer texture-bound here can be used as the comment material file 50f (PAGFile) corresponding to the video comment data (such as the information in area 50a), and the comment material file 50f can be added to the comment rendering tree structure.
[0156] Furthermore, when rendering is performed in the comment rendering thread (Render thread), since the PAGTextLayer and PAGImageLayer in the comment material file 50f are texture bound, the content on the image resource indicated by the url can be displayed on the text of the text resource. After the rendering of the comment material file 50f is completed in the Render thread, a video display comment can be generated for display in the video playback page 50d of the application client, such as Figure 10 Video comments in area 50e are shown.
[0157] In one or more embodiments, when the comment type is a gradient comment type (such as a gradient color barrage), the text resources and text attribute information in the video comment data are obtained, and the text setting interface (such as setText) in the animation component (such as PAG) is called to fill the text resources and text attribute information into the text layer (such as PAGTextLayer) in the animation component (PAG); the color gradient change (gradientColor) information associated with the gradient comment type is obtained in the video comment data, and the comment material file corresponding to the gradient comment type is determined according to the text layer containing the text resources and text attribute information, and the color gradient change information. In the comment rendering thread (Render thread), the text resources in the text layer (PAGTextLayer) contained in the comment material file are drawn to generate an initial video comment; the color gradient filter (Filter) corresponding to the gradient comment type is obtained, and the initial video comment is rendered according to the shader (Shader) corresponding to the color gradient filter and the color gradient change information in the comment material file to generate a first video display comment.
[0158] See Figure 11 , Figure 11 This is a rendering diagram of a video comment of a gradual comment type provided by an embodiment of the present application. Figure 11 As shown, it is assumed that the video comment data sent by the service device to the terminal device Figure 11 According to the information in the area 60a shown in FIG. 6 , the text resource (text) in the video comment data can be determined to be “Comment 1”. The text attribute information corresponding to the text resource includes: the font size (fontSize) is 13, the color (color) is black, and the specific example is: Figure 11 As shown in the area 60b in FIG. Figure 11 The information in the illustrated area 60b is constructed as a text layer (PAGTextLayer).
[0159] like Figure 11 As shown, the information in area 60c can determine that the comment type in the video comment data is a gradient comment type, and the gradientColor (color gradient change) attribute in area 60c (angle is 45, starting color is white, and ending color is black) can be filled into the corresponding field of PAG, such as Figure 11The information in the shown area 60c is constructed as the gradientColor of PAG. The PAGTextLayer and gradientColor constructed here can be used as the comment material file 60f (PAGFile) corresponding to the video comment data (such as the information in area 60a), and the comment material file 60f can be added to the comment rendering tree structure.
[0160] Furthermore, when rendering in the comment rendering thread (Render thread), the rendering tree can read the color gradient filter corresponding to the gradient comment type, find the corresponding shader code according to the color gradient filter, and perform color gradient rendering. After the rendering of the comment material file 60f is completed in the Render thread, a video display comment can be generated for display in the video playback page 60d of the application client, such as Figure 11 Video comments are shown in area 60e.
[0161] Step S204: Allocate a view component to the animation component in a graphics processor corresponding to the terminal device running the application client.
[0162] Specifically, when using the rendering capabilities of the PAG component integrated in the application client to achieve the video comment display effect, the application client can apply for a display window from the GPU of the terminal device, and this display window can be called a view component (such as Surface); in other words, PAG can apply for a view component (Surface) from the GPU, so that the drawing operations in the Surface can be completed in the comment rendering thread (Render thread).
[0163] Step S205: Store the first video display comment in the view component. In the view component, a drawing operation is performed on the first video display comment according to the comment setting information in the video screen of the application client to obtain an adjusted first video display comment.
[0164] Specifically, the first video display comment obtained by the aforementioned rendering can be stored in the view component (Surface) corresponding to the application client. It can be understood that the first video display comment stored in the view component can be considered as a video comment that has completed the rendering of the comment display effect. In the view component, a drawing operation can be performed on the first video display comment obtained by the aforementioned rendering based on the comment setting information of the object in the video playback page of the application client to obtain an adjusted first video display comment.
[0165] Among them, the adjusted first video display comment may refer to a video comment that has completed comment display effect rendering and bullet screen position drawing; for example, in the view component, the comment position of the first video display comment in the video screen of the video playback page can be drawn according to the number of display rows and bullet screen type (for example, it can include top bullet screen, bottom bullet screen, etc.) in the comment setting information, to obtain the first video display comment with the comment position, that is, the adjusted first video display comment. It should be understood that the drawing operation in the view component can also be implemented in the comment rendering thread (that is, the child thread).
[0166] Step S206: calling the playback control interface of the animation component, and displaying the adjusted first video display comments in the video screen through the view component.
[0167] Specifically, the application client in the terminal device can call the playback control interface of the animation component (PAG) (for example, it can be PAGPlayer) and display the adjusted first video display comments in the video screen being played by the application client through the view component (Surface), that is, complete the on-screen operation of the adjusted first video display comments. It should be noted that from the perspective of the resources of the terminal device (including the CPU and GPU of the terminal device), the comment rendering thread is a sub-thread running in the CPU of the terminal device, and the final rendered video display comments are completed by the GPU of the terminal device (the view component Surface can be understood as the interface of the GPU) to complete the on-screen operation. In other words, the comment material file can be rendered in the comment rendering thread running on the CPU, and the rendered first video display comments can be stored in the view component of the GPU, and the on-screen operation of the first video display comments is completed by the view component.
[0168] Among them, PAGPlayer is the playback control class of the PAG component, which holds the view component (Surface. For PAG, the Surface here can be specifically PAGSurface) and PAGComposition (a container in the comment rendering tree, inherited from the PAG layer, such as the image layer and text layer that can be inherited from PAG). PAGPlayer, PAGSurface and PAGComposition are the three components of PAG. PAGComposition can provide rendering data, such as the comment material file in the comment rendering tree structure, PAGSurface can provide the rendering canvas, and PAGPlayer can control the rendering progress. In other words, PAGPlayer can be used to control when the video display comments stored in the view component are drawn to the video screen of the video playback page.
[0169] Step S207, obtain the texture identifier corresponding to the first video display comment returned by the graphics processor of the terminal device, and cache the texture identifier to the cache area corresponding to the animation component; the terminal device is a device running the application client, and the graphics processor is used to provide a view component for the animation component.
[0170] Specifically, the application client of the terminal device can obtain the texture identifier corresponding to the first video display comment returned by the GPU of the terminal device. The texture identifier here can be simply referred to as texture ID (identity), which is actually transmitted from the GPU of the terminal device to the CPU of the terminal device. The texture ID is used to represent the first video display comment that has completed the rendering of the comment display effect. In other words, during the rendering implementation process of the video comment, only the texture identifier of the video display comment that has completed the rendering of the comment display effect needs to be transmitted between the CPU and GPU of the terminal device, without transmitting the video display comment itself that has completed the rendering of the comment display effect, thereby reducing the rendering efficiency of the video comment.
[0171] After obtaining the texture ID returned by the GPU, the application client in the terminal device can cache the texture ID in the cache area corresponding to the animation component. The cache area can also be a cache module in the CPU of the terminal device, which can be a memory area for storing the texture ID returned by the GPU.
[0172] Step S208 , responding to the comment movement instruction in the application client, obtaining the texture identifier from the cache area, and determining the movement displacement of the comment material file associated with the texture identifier according to the comment setting information in the video playback page.
[0173] Specifically, when the first video display comment in the video playback page of the application client needs to be moved, such as the comment setting information in the video playback page of the application client indicates that the first video display comment needs to be moved in the video screen, the application client can generate a comment movement instruction for the first video display comment, and based on the comment movement instruction, obtain the texture ID from the cache area, and then calculate the movement displacement of the comment material file associated with the texture ID according to the movement speed in the comment setting information and the display size of the video screen.
[0174] Step S209 : Add the movement displacement and the initial position of the comment material file associated with the texture identifier to obtain the comment movement position of the comment material file associated with the texture identifier.
[0175] Specifically, the movement displacement and the initial position of the comment material file associated with the texture ID (the display coordinates of the first video display comment on the video playback page) can be added to obtain the comment movement position of the comment material file associated with the texture ID; wherein the comment movement position can refer to the position coordinates of the first video display comment after the update. It is understandable that when each video comment (for example, the first video display comment) in the video screen of the video playback page moves, the application client can continuously update the comment movement position of each comment material file.
[0176] Step S210 , rendering the comment material file associated with the comment movement position and the texture identifier in the comment rendering thread to generate a second video display comment.
[0177] Step S211: store the second video display comment in the view component, and display the second video display comment in the video screen of the application client through the view component.
[0178] Specifically, the rendering process of the texture ID and the comment moving position of the comment material file can also be completed in the comment rendering thread, that is, the texture ID and the comment moving position of the comment material file associated with the texture ID are rendered in the comment rendering thread to generate a second video display comment. The second video display comment can be stored in the view component corresponding to the application client, and then the view component completes the on-screen operation of the second video display comment, that is, the second video display comment can be displayed in the current video screen of the video playback page. It should be noted that every time the application client updates the position coordinates of the comment material file, it can continuously render the updated position coordinates (i.e., the comment moving position) and the comment material file associated with the texture ID in the comment rendering thread to generate an updated video display comment, and then the view component completes the on-screen operation of the updated video display comment to achieve the effect of playing the video comment in the video playback page; the embodiment of the present application uses PAG rendering capabilities to replace the rendering logic pre-embedded in the terminal device, so that the rendering processing of the video comment can be completed in the sub-thread (comment rendering thread), which can improve the rendering performance of the video comment and reduce the jamming of the video comment during playback.
[0179] In one or more embodiments, from the perspective of terminal device resources, the rendering process of video comments in the application client can be referred to Figure 12 , Figure 12 This is a schematic diagram of a video comment rendering based on an animation component provided by an embodiment of the present application. Figure 12As shown, the rendering processing of video comments in the application client can be implemented in the comment rendering (Render) thread, which refers to a sub-thread running in the CPU (central processing unit) of the terminal device, that is, the rendering processing of video comments can be implemented in the CPU of the terminal device; the operation of drawing the rendered video display comments to the video screen of the video playback page can be implemented by the GPU of the terminal device, and specifically the on-screen operation can be completed through the GPU interface (that is, the view component).
[0180] The application client can obtain background data, that is, obtain the video comment data sent by the service device, and then parse the background data (video comment data) in the CPU of the terminal device to construct a comment material file that can be recognized by the animation component integrated in the application client; the comment material file can be inserted into the comment rendering tree structure, and the video animation comment is added in the comment rendering thread, that is, the comment material file is rendered in the comment rendering thread to generate a video animation comment (such as the aforementioned first video display comment), and the generated video animation comment is stored in the view component to complete the operation of adding the video animation comment. When the video comment is playing, such as sliding from the right end to the left end of the video playback page, the comment movement position of each comment material file can be continuously updated over time, and then the rendering of the current video comment can be completed by calling Flush to refresh, and a drawing instruction can be initiated to the GPU of the terminal device, and the GPU completes the operation of putting the rendered video display comment on the screen to achieve the effect of video comment playback.
[0181] It should be noted that the performance of the CPU and GPU of the terminal device depends on the amount of data transmitted. The larger the amount of data transmitted per frame, the longer the time taken to transmit. The amount of data per frame is determined by the cumulative amount of all instructions and the data carried by the instructions in each frame. Figure 13 , Figure 13 This is a schematic diagram of a video comment drawing process based on an animation component provided by an embodiment of the present application. Figure 13As shown, if the video comment data is constructed as a comment material file, and the constructed comment material file needs to be drawn into the video screen of the video playback page, then the process of drawing the video comment data into the video screen may include but is not limited to the following steps: ① After the application client obtains the video comment data sent by the service device, it can construct the video comment data into a comment material file; ② The comment material file can be passed to the GPU by calling the draw method, and the comment material file can be drawn in the GPU to obtain a drawing result (for example, the first video display comment); ③ The texture identifier (ID) corresponding to the drawing result can be returned to the CPU through the interface; ④ After the CPU of the terminal device obtains the texture identifier returned by the GPU, it can save the texture identifier to the cache area; ⑤ When the video comment needs to be moved, the position coordinates of the comment material file are updated to obtain the comment movement position of the updated comment material file; ⑥ The texture identifier can be read from the cache area, and the texture identifier can be transmitted to the GPU in conjunction with the draw instruction, and the texture representation of the associated comment material file and the drawing of the updated comment movement position are completed in the GPU.
[0182] It is understandable that the current video comment rendering process mainly uses the rendering logic pre-embedded in the terminal device. Although the CPU will only pass a few instructions to the GPU, due to the limitations of the terminal device's operating system, the amount of data transferred between the CPU and GPU of the terminal device for each frame is very large. For example, the GPU needs to pass the complete drawing result to the CPU, and after the CPU calculates the updated comment movement position, it needs to pass the complete drawing result to the GPU for display. In the data rendering processing scheme proposed in the embodiment of the present application, the GPU of the terminal device only needs to return the texture identifier corresponding to the drawing result to the CPU. After calculating the updated comment movement position, the CPU only needs to pass the texture identifier and the comment movement position to the GPU. The actual drawing result will not be returned to the CPU and then back to the GPU. The overall data transmission volume is greatly reduced, which can reduce the rendering time of the video comments, thereby improving the rendering efficiency of the video comments.
[0183] Among them, all CPU operations of the terminal device can be placed in the comment rendering thread, and the pressure on the main thread is reduced. In the current technology that uses the rendering logic pre-embedded in the terminal device to perform video comment rendering processing, although some CPU operations can be placed in the comment rendering thread, due to the limitations of the operating system, the draw (drawing) instructions and the drawing result acquisition instructions must be placed in the main thread, and these two steps are the most time-consuming steps in the video rendering process, so the main thread will always be occupied. In the data rendering processing scheme proposed in the embodiment of the present application, since the rendering capability of the animation component is used to replace the rendering logic pre-embedded in the terminal device, the view component (Surface) can be used to implement the on-screen operation, and the drawing operation of the view component (Surface) in the terminal device can also be implemented in the comment rendering thread, that is, all drawing operations in the video comment rendering process can be placed in the comment rendering thread, which can reduce the data processing pressure of the main thread and thus improve the rendering efficiency of the video comments.
[0184] In an embodiment of the present application, when video comments are implemented using the animation component integrated in the application client, the rendering operations of the video comments can be completed in the comment rendering thread. In order to achieve the playback effect of the first video display comment in the video screen, the comment material file needs to be rendered multiple times, and in the subsequent rendering process, the drawing operation can be completed based on the updated comment movement position and the texture identification of the first video display comment. The amount of data in the video comment rendering process can be reduced, the rendering time can be reduced, and the rendering efficiency of the video comments can be improved, thereby improving the display smoothness of the video comments; further, the animation component integrated in the application client can quickly realize the playback effect of the video comments, including but not limited to text animation (external glow, color gradient, texture, etc.), font size, transparency, font, thickness, etc., which can enrich the display style of the video comments.
[0185] It is understandable that in the specific implementation of this application, it may involve the account login information, video playback records and other information of the object in the application client. When the above embodiments of this application are applied to specific products or technologies, the user's permission or consent must be obtained, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions.
[0186] See Figure 14 , Figure 14 This is a schematic diagram of the structure of a data rendering processing device provided in an embodiment of the present application. Figure 1 .like Figure 14 As shown, the data rendering processing device 1 may include: a data encapsulation module 11, a first rendering module 12, a first display module 13, a second rendering module 14, and a second display module 15;
[0187] The data encapsulation module 11 is used to obtain video comment data and encapsulate the video comment data into a comment material file; the data type corresponding to the comment material file is the data type supported by the animation component integrated in the application client;
[0188] A first rendering module 12 is configured to render the comment material file in a comment rendering thread corresponding to the application client to generate a first video display comment;
[0189] A first display module 13 is configured to store the first video display comment in a view component corresponding to the application client, and display the first video display comment in a video screen of the application client through the view component;
[0190] The second rendering module 14 is used to obtain the texture identifier corresponding to the first video display comment, update the position of the comment material file to obtain the comment movement position, and render the comment movement position and texture identifier in the comment rendering thread to generate the second video display comment;
[0191] The second display module 15 is used to store the second video display comments in the view component, and display the second video display comments in the video screen of the application client through the view component.
[0192] The specific implementation functions of the data encapsulation module 11, the first rendering module 12, the first display module 13, the second rendering module 14, and the second display module 15 can be found in the aforementioned Figure 3 The description of steps S101 to S105 in the corresponding embodiment will not be repeated here.
[0193] In an embodiment of the present application, when video comments are implemented using the animation component integrated in the application client, the rendering operations of the video comments can be completed in the comment rendering thread. In order to achieve the playback effect of the first video display comment in the video screen, the comment material file needs to be rendered multiple times, and in the subsequent rendering process, the drawing operation can be completed based on the updated comment movement position and the texture identification of the first video display comment. This can reduce the amount of data in the video comment rendering process, reduce the rendering time, and thus improve the rendering efficiency of the video comment, thereby improving the display smoothness of the video comment.
[0194] See Figure 15 , Figure 15 This is a schematic diagram of the structure of a data rendering processing device provided in an embodiment of the present application. Figure 2 .like Figure 15 As shown, the data rendering processing device 2 may include: a data encapsulation module 21, a first rendering module 22, a first display module 23, a second rendering module 24, and a second display module 25;
[0195] The data encapsulation module 21 is used to obtain video comment data and encapsulate the video comment data into a comment material file; the data type corresponding to the comment material file is the data type supported by the animation component integrated in the application client;
[0196] A first rendering module 22 is configured to render the comment material file in a comment rendering thread corresponding to the application client to generate a first video display comment;
[0197] A first display module 23 is configured to store the first video display comment in a view component corresponding to the application client, and display the first video display comment in a video screen of the application client through the view component;
[0198] The second rendering module 24 is used to obtain the texture identifier corresponding to the first video display comment, update the position of the comment material file to obtain the comment movement position, and render the comment movement position and texture identifier in the comment rendering thread to generate the second video display comment;
[0199] The second display module 25 is used to store the second video display comments in the view component, and display the second video display comments in the video screen of the application client through the view component.
[0200] In one or more embodiments, the data encapsulation module 21 may include: a request sending unit 211, a material file construction unit 212;
[0201] A request sending unit 211 is configured to send a data acquisition request to a service device when a comment display operation is detected in a video playback page of an application client; the data acquisition request is used to instruct the service device to acquire video comment data for a requested time period, where the requested time period is associated with the video playback progress in the application client;
[0202] The material file construction unit 212 is configured to receive the video comment data returned by the service device, and encapsulate the video comment data into a comment material file corresponding to the comment type according to the comment type in the video comment data.
[0203] In one or more embodiments, the comment type includes a text outline animation type;
[0204] The material file construction unit 212 encapsulates the video comment data into a comment material file corresponding to the comment type according to the comment type in the video comment data, including:
[0205] Get the text resources and text attribute information in the video comment data, call the text setting interface of the animation component, and fill the text resources and text attribute information into the text layer of the animation component;
[0206] The outline projection attribute information matching the text outline animation type is obtained in the video comment data, and the comment material file corresponding to the text outline animation type is determined according to the text layer containing text resources and text attribute information, as well as the outline projection attribute information.
[0207] Wherein, when the comment type includes a text outline animation type, the first rendering module 22 includes: a comment drawing unit 221, a comment projection unit 222;
[0208] The comment drawing unit 221 is used to draw the text resources in the text layer according to the text attribute information in the text layer contained in the comment material file in the comment rendering thread corresponding to the application client to generate an initial video comment;
[0209] The comment projection unit 222 is used to obtain the projection filter corresponding to the text outline animation type, render the initial video comment according to the shader corresponding to the projection filter and the outline projection attribute information in the comment material file, and generate the first video display comment.
[0210] In one or more embodiments, the review type includes a texture review type;
[0211] The material file construction unit 212 encapsulates the video comment data into a comment material file corresponding to the comment type according to the comment type in the video comment data, including:
[0212] Get the text resources and text attribute information in the video comment data, call the text setting interface of the animation component, and fill the text resources and text attribute information into the text layer of the animation component;
[0213] The dynamic mask information in the video comment data is constructed as an image layer of the animation component, and texture binding is performed on the text layer containing text resources and text attribute information, and the image layer containing dynamic mask information to generate a comment material file corresponding to the texture comment type; the dynamic mask information includes the location address used to represent the image resource.
[0214] Wherein, when the comment type includes a texture comment type, the first rendering module 22 includes: a comment drawing unit 221, a picture resource acquisition unit 223, and a picture texture adding unit 224;
[0215] The comment drawing unit 221 is used to draw the text resources in the text layer according to the text attribute information in the text layer contained in the comment material file in the comment rendering thread corresponding to the application client to generate an initial video comment;
[0216] The image resource acquisition unit 223 is configured to acquire the image resource indicated by the location address in the dynamic mask information according to the dynamic mask information in the image layer included in the comment material file;
[0217] The image texture adding unit 224 is used to add the texture content in the image resource to the initial video comment according to the texture binding between the text layer and the image layer in the comment material file to generate the first video display comment.
[0218] In one or more embodiments, the comment type includes a gradient comment type;
[0219] The material file construction unit 212 encapsulates the video comment data into a comment material file corresponding to the comment type according to the comment type in the video comment data, including:
[0220] Get the text resources and text attribute information in the video comment data, call the text setting interface of the animation component, and fill the text resources and text attribute information into the text layer of the animation component;
[0221] Color gradient change information associated with the gradient comment type is obtained in the video comment data, and a comment material file corresponding to the gradient comment type is determined based on a text layer containing text resources and text attribute information, as well as the color gradient change information.
[0222] Wherein, when the comment type includes a gradient comment type, the first rendering module 22 includes: a comment drawing unit 221, a color gradient processing unit 225;
[0223] The comment drawing unit 221 is used to draw the text resources in the text layer according to the text attribute information in the text layer contained in the comment material file in the comment rendering thread to generate an initial video comment;
[0224] The color gradient processing unit 225 is used to obtain the color gradient filter corresponding to the gradient comment type, render the initial video comment according to the shader corresponding to the color gradient filter and the color gradient change information in the comment material file, and generate the first video display comment.
[0225] In one or more embodiments, the number of review material files is M, where M is a positive integer;
[0226] The first rendering module 22 includes: a rendering tree generation unit 226, a video comment rendering unit 227;
[0227] The rendering tree generation unit 226 is used to call the typesetting interface of the animation component, combine the M comment material files, and generate a comment rendering tree structure associated with the video comment data;
[0228] The video comment rendering unit 227 is used to render the M comment material files in the comment rendering tree structure in the comment rendering thread corresponding to the application client to generate a first video display comment.
[0229] In one or more embodiments, the first display module 23 includes: a view component allocation unit 231 , a video comment drawing unit 232 , and a video comment display unit 233 ;
[0230] The view component allocation unit 231 is configured to allocate a view component to the animation component in a graphics processor corresponding to a terminal device running the application client;
[0231] The video comment drawing unit 232 is configured to store the first video display comment in the view component, and in the view component, perform a drawing operation on the first video display comment according to the comment setting information in the video screen of the application client to obtain an adjusted first video display comment;
[0232] The video comment display unit 233 is used to call the playback control interface of the animation component and display the adjusted first video display comments in the video screen through the view component.
[0233] In one or more embodiments, the second rendering module 24 includes: a texture identification obtaining unit 241 , a movement displacement determining unit 242 , a comment position updating unit 243 , and a comment update display unit 244 ;
[0234] A texture identifier acquisition unit 241 is configured to acquire a texture identifier corresponding to the first video display comment returned by a graphics processor of a terminal device, and cache the texture identifier in a cache area corresponding to the animation component; the terminal device is a device running an application client, and the graphics processor is configured to provide a view component for the animation component;
[0235] The movement displacement determining unit 242 is configured to respond to the comment movement instruction in the application client, obtain the texture identifier from the cache area, and determine the movement displacement of the comment material file associated with the texture identifier based on the comment setting information in the video playback page;
[0236] A comment position updating unit 243 is configured to add the movement displacement to the initial position of the comment material file associated with the texture identifier to obtain a comment movement position of the comment material file associated with the texture identifier;
[0237] The comment updating and displaying unit 244 is configured to render the comment material file associated with the comment movement position and the texture identifier in the comment rendering thread to generate a second video display comment.
[0238] According to an embodiment of the present application, the steps involved in the data rendering processing method shown above can be performed by Figure 15 The data rendering processing device 2 shown in the figure is executed by each module and each unit. For example, Figure 3 The step S101 shown can be performed by Figure 15 The data encapsulation module 21 shown is used to execute, Figure 3 Step S102 shown can be performed by Figure 15 The first rendering module 22 shown is used to execute, Figure 3 Step S103 shown can be performed by Figure 15 The first display module 23 shown is used to perform, Figure 3 Step S104 shown can be performed by Figure 15 The second rendering module 24 shown is used to execute, Figure 3 Step S105 shown can be performed by Figure 15 The second display module 25 shown is used to perform the same.
[0239] According to one embodiment of the present application, Figure 15 The various modules (units) in the data rendering processing device 2 shown can be individually or all combined into one or several modules (units) to constitute, or one (some) of the modules (units) can be further divided into at least two functionally smaller sub-units, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above modules (units) are divided based on logical functions. In actual applications, the functions of one module (unit) can also be implemented by at least two modules (units), or the functions of at least two modules (units) can be implemented by one module (unit). In other embodiments of the present application, the data rendering processing device 2 may also include other modules (units). In actual applications, these functions can also be implemented with the assistance of other modules (units), and can be implemented by the collaboration of at least two modules (units).
[0240] In an embodiment of the present application, when video comments are implemented using the animation component integrated in the application client, the rendering operations of the video comments can be completed in the comment rendering thread. In order to achieve the playback effect of the first video display comment in the video screen, the comment material file needs to be rendered multiple times, and in the subsequent rendering process, the drawing operation can be completed based on the updated comment movement position and the texture identification of the first video display comment. The amount of data in the video comment rendering process can be reduced, the rendering time can be reduced, and the rendering efficiency of the video comments can be improved, thereby improving the display smoothness of the video comments; further, the animation component integrated in the application client can quickly realize the playback effect of the video comments, including but not limited to text animation (external glow, color gradient, texture, etc.), font size, transparency, font, thickness, etc., which can enrich the display style of the video comments.
[0241] See Figure 16 , Figure 16 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. Figure 16 As shown, the computer device 1000 can be Figure 1 Any terminal device in the terminal cluster in the corresponding embodiment (for example, terminal device 10a), or a server (for example Figure 1 The server 10d shown in the figure will not be restricted here. For ease of understanding, the embodiment of the present application takes the computer device as an example of a terminal device. The computer device 1000 may include: a processor 1001, a network interface 1004 and a memory 1005. In addition, the computer device 1000 may also include: a user interface 1003, and at least one communication bus 1002. The communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display (Display), a keyboard (Keyboard), and optionally, the user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 1005 may optionally also be at least one storage device located away from the aforementioned processor 1001. As Figure 16 As shown, the memory 1005 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a device control application.
[0242] in, Figure 16 The network interface 1004 in the computer device 1000 shown can also provide network communication functions; and the user interface 1003 is mainly used to provide an interface for user input. It is understood that the processor 1001 can be used to call the device control application stored in the memory 1005 to achieve:
[0243] Obtain video comment data and encapsulate the video comment data into a comment material file; the data type corresponding to the comment material file is the data type supported by the animation component integrated in the application client;
[0244] Rendering the comment material file in the comment rendering thread corresponding to the application client to generate a first video display comment;
[0245] Storing the first video display comment in a view component corresponding to the application client, and displaying the first video display comment in a video screen of the application client through the view component;
[0246] Obtaining a texture identifier corresponding to the comment displayed on the first video, updating the position of the comment material file to obtain a comment movement position, rendering the comment movement position and the texture identifier in a comment rendering thread, and generating a second video display comment;
[0247] The second video display comments are stored in the view component, and the second video display comments are displayed in the video screen of the application client through the view component.
[0248] It should be understood that the computer device 1000 described in the embodiment of the present application can execute the above Figure 3 and Figure 7 The description of the data rendering processing method in any corresponding embodiment can also be performed as described above. Figure 15 The description of the data rendering processing device 1 in the corresponding embodiment, or the above description can be executed Figure 15 The description of the data rendering processing device 2 in the corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated here either.
[0249] In addition, it should be noted that: the embodiment of the present application also provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program executed by the data rendering processing device 1 or the data rendering processing device 2 mentioned above, and the computer program includes computer instructions. When the processor executes the computer instructions, it can execute the above-mentioned Figure 3 and Figure 7 The description of the data rendering processing method in any corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc. For technical details not disclosed in the computer-readable storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application. As an example, computer instructions can be deployed on a computing device for execution, or executed on multiple computing devices located at one location, or executed on multiple computing devices distributed at multiple locations and interconnected by a communication network. Multiple computing devices distributed at multiple locations and interconnected by a communication network can constitute a blockchain system.
[0250] In addition, it should be noted that: the embodiment of the present application also provides a computer program product or computer program, which may include computer instructions, which may be stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor may execute the computer instructions, so that the computer device performs the above Figure 3 and Figure 7 The description of the data rendering processing method in any corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of using the same method will not be repeated. For technical details not disclosed in the computer program product or computer program embodiments involved in this application, please refer to the description of the method embodiments of this application.
[0251] The terms "first", "second", etc. in the description, claims, and drawings of the embodiments of the present application are used to distinguish different media contents, rather than to describe a specific order. In addition, the terms "including" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, product, or device that includes a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules that are not listed, or may optionally include other step units inherent to these processes, methods, apparatuses, products, or devices.
[0252] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0253] The methods and related devices provided by the embodiments of the present application are described with reference to the method flow charts and / or structural diagrams provided by the embodiments of the present application. Specifically, each process and / or block in the method flow charts and / or structural diagrams, as well as the combination of processes and / or blocks in the flow charts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 Schematic diagram of one or more processes and / or structures Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including the instruction device, which implements the function specified in the process. Figure 1 Schematic diagram of one or more processes and / or structures Figure 1These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the process. Figure 1 The flow or flows and / or structures illustrate the steps of the functions specified in one block or multiple blocks.
[0254] The above disclosure is only a preferred embodiment of the present application, and certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A data rendering processing method, characterized in that: include: Acquire video comment data, and encapsulate the video comment data into a comment material file; The data type corresponding to the comment material file is the data type supported by the animation component integrated in the application client; Rendering the comment material file in a comment rendering thread corresponding to the application client to generate a first video display comment; Storing the first video display comment in a view component corresponding to the application client, and displaying the first video display comment in a video screen of the application client through the view component; Obtaining a texture identifier corresponding to the first video display comment, updating the position of the comment material file to obtain a comment movement position, rendering the comment movement position and the texture identifier in the comment rendering thread to generate a second video display comment; The second video display comments are stored in the view component, and the second video display comments are displayed in the video screen of the application client through the view component.
2. The method according to claim 1, characterized in that The step of obtaining video comment data and packaging the video comment data into a comment material file includes: When a comment display operation is detected in the video playback page of the application client, a data acquisition request is sent to the service device; the data acquisition request is used to instruct the service device to obtain video comment data for a requested time period, and the requested time period is associated with the video playback progress in the application client; The video comment data returned by the service device is received, and according to the comment type in the video comment data, the video comment data is encapsulated into a comment material file corresponding to the comment type.
3. The method according to claim 2, characterized in that The comment type includes a text outline animation type; The step of encapsulating the video comment data into a comment material file corresponding to the comment type according to the comment type in the video comment data includes: Acquire text resources and text attribute information in the video comment data, call the text setting interface of the animation component, and fill the text resources and text attribute information into the text layer of the animation component; Contour projection attribute information matching the text contour animation type is obtained from the video comment data, and a comment material file corresponding to the text contour animation type is determined based on a text layer including the text resource and the text attribute information, and the contour projection attribute information.
4. The method according to claim 3, characterized in that The rendering process of the comment material file in the comment rendering thread corresponding to the application client to generate a first video display comment includes: In the comment rendering thread corresponding to the application client, the text resources in the text layer are drawn according to the text attribute information in the text layer contained in the comment material file to generate an initial video comment; Obtain a projection filter corresponding to the text outline animation type, render the initial video comment according to the shader corresponding to the projection filter and the outline projection attribute information in the comment material file, and generate a first video display comment.
5. The method according to claim 2, characterized in that The review type includes a texture review type; The step of encapsulating the video comment data into a comment material file corresponding to the comment type according to the comment type in the video comment data includes: Acquire text resources and text attribute information in the video comment data, call the text setting interface of the animation component, and fill the text resources and text attribute information into the text layer of the animation component; The dynamic mask information in the video comment data is constructed as the image layer of the animation component, and texture binding is performed on the text layer containing the text resource and the text attribute information, and the image layer containing the dynamic mask information to generate a comment material file corresponding to the texture comment type; the dynamic mask information includes a location address for representing the image resource.
6. The method according to claim 5, characterized in that The rendering process of the comment material file in the comment rendering thread corresponding to the application client to generate a first video display comment includes: In the comment rendering thread corresponding to the application client, the text resources in the text layer are drawn according to the text attribute information in the text layer contained in the comment material file to generate an initial video comment; According to the dynamic mask information in the image layer included in the comment material file, obtaining the image resource indicated by the location address in the dynamic mask information; According to the texture binding between the text layer and the picture layer in the comment material file, the texture content in the picture resource is added to the initial video comment to generate a first video display comment.
7. The method according to claim 2, characterized in that The comment type includes a gradual comment type; The step of encapsulating the video comment data into a comment material file corresponding to the comment type according to the comment type in the video comment data includes: Acquire text resources and text attribute information in the video comment data, call the text setting interface of the animation component, and fill the text resources and text attribute information into the text layer of the animation component; Color gradient change information associated with the gradient comment type is obtained in the video comment data, and a comment material file corresponding to the gradient comment type is determined based on a text layer containing the text resource and the text attribute information, and the color gradient change information.
8. The method according to claim 7, characterized in that The rendering process of the comment material file in the comment rendering thread corresponding to the application client to generate a first video display comment includes: In the comment rendering thread, the text resources in the text layer are drawn according to the text attribute information in the text layer contained in the comment material file to generate an initial video comment; Obtain a color gradient filter corresponding to the gradient comment type, render the initial video comment according to a shader corresponding to the color gradient filter and color gradient change information in the comment material file, and generate a first video display comment.
9. The method according to claim 1, characterized in that The number of the review material files is M, where M is a positive integer; The rendering process of the comment material file in the comment rendering thread corresponding to the application client to generate a first video display comment includes: Calling the typesetting interface of the animation component, combining the M comment material files, and generating a comment rendering tree structure associated with the video comment data; In the comment rendering thread corresponding to the application client, the M comment material files in the comment rendering tree structure are rendered to generate a first video display comment.
10. The method according to claim 1, characterized in that The step of storing the first video display comment in a view component corresponding to the application client, and displaying the first video display comment on a video screen of the application client through the view component includes: Allocating the view component to the animation component in a graphics processor corresponding to a terminal device running the application client; Storing the first video display comment in the view component, and performing a drawing operation on the first video display comment in the view component according to the comment setting information in the video screen of the application client to obtain an adjusted first video display comment; The playback control interface of the animation component is called, and the adjusted first video display comments are displayed in the video screen through the view component.
11. The method according to claim 1, wherein The obtaining of the texture identifier corresponding to the first video display comment, updating the position of the comment material file to obtain a comment movement position, rendering the comment movement position and the texture identifier in the comment rendering thread to generate a second video display comment, includes: Obtaining a texture identifier corresponding to the first video display comment returned by a graphics processor of a terminal device, and caching the texture identifier in a cache area corresponding to the animation component; the terminal device is a device running the application client, and the graphics processor is used to provide the view component for the animation component; In response to the comment movement instruction in the application client, the texture identifier is obtained from the cache area, and the movement displacement of the comment material file associated with the texture identifier is determined according to the comment setting information in the video playback page; Adding the movement displacement and the initial position of the comment material file associated with the texture identifier to obtain the comment movement position of the comment material file associated with the texture identifier; The comment material file associated with the comment movement position and the texture identifier is rendered in the comment rendering thread to generate a second video display comment.
12. A data rendering processing device, characterized in that: include: A data packaging module is used to obtain video comment data and package the video comment data into a comment material file; The data type corresponding to the comment material file is the data type supported by the animation component integrated in the application client; A first rendering module is configured to render the comment material file in a comment rendering thread corresponding to the application client to generate a first video display comment; A first display module is configured to store the first video display comment in a view component corresponding to the application client, and display the first video display comment in a video screen of the application client via the view component; a second rendering module configured to obtain a texture identifier corresponding to the comment displayed on the first video, update the position of the comment material file to obtain a comment movement position, render the comment movement position and the texture identifier in the comment rendering thread, and generate a second video display comment; The second display module is used to store the second video display comments in the view component, and display the second video display comments in the video screen of the application client through the view component.
13. A computer device, characterized in that: including memory and processor; The memory is connected to the processor, the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device executes the method according to any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which is suitable for being loaded and executed by a processor, so that a computer device having the processor executes the method according to any one of claims 1 to 11.
15. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 11 when the computer program is executed by a processor.
Citation Information
Patent Citations
Bullet screen generation method and device, electronic equipment and storage medium
CN110784773A
Information system, method, device and method providing system for conveying predetermined information as comment data
US20040059778A1