CN115834953A - Special effect resource rendering method and device, live broadcast system, equipment and storage medium - Google Patents

Special effect resource rendering method and device, live broadcast system, equipment and storage medium Download PDF

Info

Publication number
CN115834953A
CN115834953A CN202211098151.6A CN202211098151A CN115834953A CN 115834953 A CN115834953 A CN 115834953A CN 202211098151 A CN202211098151 A CN 202211098151A CN 115834953 A CN115834953 A CN 115834953A
Authority
CN
China
Prior art keywords
special effect
effect resource
data
background
background picture
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211098151.6A
Other languages
Chinese (zh)
Inventor
甘鹏龙
郭亚斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Cubesili Information Technology Co Ltd
Original Assignee
Guangzhou Cubesili Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Cubesili Information Technology Co Ltd filed Critical Guangzhou Cubesili Information Technology Co Ltd
Priority to CN202211098151.6A priority Critical patent/CN115834953A/en
Publication of CN115834953A publication Critical patent/CN115834953A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The application relates to the technical field of videos and live broadcasts, and provides a special effect resource rendering method, a special effect resource rendering device, a live broadcast system, electronic equipment and a computer readable storage medium. According to the method and the device, the display mode and the style of the special effect resources at the terminal can be enriched, and the rendering display effect is improved. The method comprises the following steps: the method comprises the steps that a terminal receives a special effect resource file, then special effect resource data contained in the special effect resource file are obtained, and if the special effect resource file also contains identification data used for identifying that a special effect resource background can be added, the terminal obtains corresponding background picture data; when rendering the special effect resource data, if the special effect resource data to be rendered is the special effect resource data corresponding to the background picture data, rendering the special effect resource data after rendering the corresponding background picture data by the terminal so as to present the special effect resource taking the corresponding background picture as the background.

Description

Special effect resource rendering method and device, live broadcast system, equipment and storage medium
Technical Field
The present application relates to the field of video and live broadcast technologies, and in particular, to a method and an apparatus for rendering special effect resources, a live broadcast system, an electronic device, and a computer-readable storage medium.
Background
With the development of video and network technologies, application programs such as live broadcast can also increase the display of special-effect resources such as live broadcast special effects on the basis of providing live broadcast video play for users, so that the information displayed in a live broadcast room is richer. The special effect resource is usually output after animation is produced by using relevant software and added to a rendering queue, for example, an special effect resource file in an AVI or MP4 format may be output, and the special effect resource file is delivered to the terminal for use.
In the prior art, a terminal can analyze and render a special effect resource file on a screen when a use condition is met after obtaining the special effect resource file, for example, when a specific user enters a live broadcast room, the terminal can render a corresponding live broadcast special effect resource on a live broadcast room interface, however, in the technology, the special effect resource data is directly rendered after the special effect resource data is analyzed from the special effect resource file by the terminal, but a special effect resource pattern corresponding to the special effect resource file made by related software is relatively fixed and single, so that the technology has a poor effect of rendering the special effect resource.
Disclosure of Invention
In view of the foregoing, it is necessary to provide a special effect resource rendering method, apparatus, live broadcast system, electronic device, and computer-readable storage medium.
In a first aspect, the present application provides a method for rendering special effect resources. The method is applied to the terminal. The method comprises the following steps:
receiving a special effect resource file;
acquiring special effect resource data contained in the special effect resource file;
if the special effect resource file also comprises identification data for identifying that a special effect resource background can be added, acquiring corresponding background picture data;
and if the special effect resource data to be rendered is the special effect resource data corresponding to the background picture data, rendering the special effect resource data after rendering the background picture data so as to present the special effect resource taking the corresponding background picture as the background.
In an embodiment, if the special effect resource file further includes identification data for identifying that a special effect resource background can be added, acquiring corresponding background picture data includes: if the special effect resource file also comprises identification data for identifying that the special effect resource background can be added, extracting background addition layer number information from the identification data; and adding layer number information according to the background to acquire background picture data corresponding to each background level.
In one embodiment, if the special effect resource data to be rendered is special effect resource data corresponding to background picture data, rendering the special effect resource data after rendering the background picture data includes: if the special effect resource data to be rendered is the special effect resource data corresponding to the multiple layers of background picture data, determining a background level sequence, rendering the background picture data corresponding to each background level in sequence according to the background level sequence, and then rendering the special effect resource data.
In one embodiment, after acquiring the corresponding background picture data, the method further includes: when the corresponding background picture data belongs to target class background picture data, performing frame number matching on the corresponding background picture data and special effect resource data contained in the special effect resource file to enable the frame number of the corresponding background picture data to be the same as that of the special effect resource data; rendering the special effect resource data after rendering the background picture data comprises: according to the frame index of the special effect resource data to be rendered, acquiring corresponding target background picture data from the corresponding background picture data, and rendering the target background picture data; and after the target background picture data is rendered, according to the frame index of the special effect resource data to be rendered, acquiring corresponding target special effect resource data from the special effect resource data contained in the special effect resource file, and rendering the target special effect resource data.
In one embodiment, the corresponding background picture data comprises respective background picture data for each background level; the matching of the frame number of the corresponding background picture data and the special effect resource data contained in the special effect resource file comprises the following steps: aiming at the background picture data of each background level, performing frame number matching on the background picture data of the background level and the special effect resource data contained in the special effect resource file, so that the frame number of the background picture data of each background level is the same as that of the special effect resource data; the step of obtaining corresponding target background picture data from the corresponding background picture data according to the frame index of the special effect resource data to be rendered, and rendering the target background picture data includes: and according to the frame index of the special effect resource data to be rendered, acquiring target background picture data corresponding to each background level from the background picture data corresponding to each background level, and sequentially rendering the target background picture data corresponding to each background level according to the background level sequence.
In one embodiment, after receiving the special effects resource file, the method further comprises: extracting description information of the special effect resource file; and determining whether the special effect resource file contains identification data for identifying that the special effect resource background can be added or not according to the description information.
In one embodiment, the determining whether the special effect resource file contains identification data for identifying that a special effect resource background can be added according to the description information includes: acquiring a preset field used for writing identification data into the special effect resource providing end in the description information according to the description information; and determining whether the special effect resource file contains identification data for identifying that the special effect resource background can be added or not according to the identification data of the preset field in the description information.
In one embodiment, the determining whether the special effect resource file contains identification data for identifying that a special effect resource background can be added according to the description information includes: determining preset identification data keywords for matching in the description information; matching in the description information according to the preset identification data keywords; and determining whether the special effect resource file contains identification data for identifying that the special effect resource background can be added or not according to the matching result.
In a second aspect, the present application provides a live system. The system comprises: a terminal and a live broadcast server; the terminal is used for rendering live special effect resource data and corresponding background picture data in a live special effect resource file sent by a live server according to the method, and playing the live special effect resource with the corresponding background picture as the background in a live picture.
In a third aspect, the present application provides a special effect resource rendering apparatus. The method is applied to the terminal. The device comprises:
the file receiving module is used for receiving the special effect resource file;
the data acquisition module is used for acquiring special effect resource data contained in the special effect resource file;
the background acquisition module is used for acquiring corresponding background picture data if the special effect resource file also contains identification data for identifying that a special effect resource background can be added;
and the data rendering module is used for rendering the special effect resource data after rendering the background picture data if the special effect resource data to be rendered is the special effect resource data corresponding to the background picture data so as to present the special effect resource taking the corresponding background picture as the background.
In a fourth aspect, the present application provides an electronic device. The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor realizes the following steps when executing the computer program:
receiving a special effect resource file; acquiring special effect resource data contained in the special effect resource file; if the special effect resource file also comprises identification data for identifying that a special effect resource background can be added, acquiring corresponding background picture data; and if the special effect resource data to be rendered is the special effect resource data corresponding to the background picture data, rendering the special effect resource data after rendering the background picture data so as to present the special effect resource taking the corresponding background picture as the background.
In a fifth aspect, the present application provides a computer-readable storage medium. The computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
receiving a special effect resource file; acquiring special effect resource data contained in the special effect resource file; if the special effect resource file also comprises identification data for identifying that a special effect resource background can be added, acquiring corresponding background picture data; if the special effect resource data to be rendered is the special effect resource data corresponding to the background picture data, rendering the special effect resource data after rendering the background picture data to present the special effect resource with the corresponding background picture as the background.
According to the special effect resource rendering method, the special effect resource rendering device, the live broadcast system, the live broadcast equipment and the medium, the terminal receives the special effect resource file, then obtains the special effect resource data contained in the special effect resource file, and if the special effect resource file also contains identification data for identifying that a special effect resource background can be added, the terminal obtains corresponding background picture data; when rendering the special effect resource data, if the special effect resource data to be rendered is the special effect resource data corresponding to the background picture data, rendering the special effect resource data after rendering the corresponding background picture data by the terminal so as to present the special effect resource taking the corresponding background picture as the background. According to the scheme, when the terminal renders the special effect resource data, the special effect resource data obtained by analyzing the file is not directly rendered, whether the file also contains identification data used for identifying that a special effect resource background can be added is judged firstly, if yes, corresponding background picture data needs to be rendered firstly, and then the special effect resource data is rendered, so that the terminal can present the special effect resource with the corresponding background picture as the background on a screen, the addition and flexible change of the background of the special effect resource can be realized on the terminal side, the terminal can dynamically change the background of the special effect resource according to actual business requirements, the display modes and styles of the special effect resource on the terminal are enriched, and the rendering and displaying effects of the special effect resource are improved.
Drawings
Fig. 1 is an application scene diagram of a special effect resource rendering method in an embodiment of the present application;
FIG. 2 is a flowchart illustrating a method for rendering special effect resources according to an embodiment of the present disclosure;
FIG. 3 is a flowchart illustrating a method for rendering special effect resources in an application example of the present application;
fig. 4 is a schematic structural diagram of a live broadcast system in an embodiment of the present application;
fig. 5 is a schematic interface diagram of playing a live special effect resource in an application example of the present application;
fig. 6 is a block diagram illustrating a structure of a special effect resource rendering apparatus according to an embodiment of the present disclosure;
fig. 7 is an internal structural diagram of an electronic device in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The special effect resource rendering method provided by the embodiment of the application may be applied to an application scene shown in fig. 1, where the application scene may include a terminal 110 and a special effect resource providing terminal 120, and the terminal 110 communicates with the special effect resource providing terminal 120 through a network. The terminal 110 may be a device for rendering according to data information such as a special effect resource file to present relevant content such as a special effect resource, the special effect resource providing terminal 120 may be a device for providing data information such as a special effect resource file to the terminal 110, and the terminal 110 may be regarded as a demand terminal or a presentation terminal of the special effect resource with respect to the special effect resource providing terminal 120. Specifically, the terminal 110 may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and the special resource providing terminal 120 may be a terminal or a server, and the server may be implemented by an independent server or a server cluster formed by multiple servers.
In one embodiment, as shown in fig. 2, there is provided a special effects resource rendering method, which may be performed by the terminal 110 shown in fig. 1, and which may include the steps of:
step S201, receiving a special effect resource file.
In this step, the terminal 110 may receive the special effect resource file from the special effect resource providing terminal 120. Specifically, the special effect resource file may be an MP4 format special effect resource file, and is recorded as an MP4 special effect resource file. In practical applications, the terminal 110 may request the special effect resource providing terminal 120 for a corresponding special effect resource file when a special effect resource needs to be presented, the terminal 110 may send a special effect resource file obtaining request to the special effect resource providing terminal 120, and after receiving the request, the special effect resource providing terminal 120 may send a corresponding MP4 special effect resource file to the terminal 110, so that the terminal 110 obtains the MP4 special effect resource file; in addition, the special effect resource providing terminal 120 may also actively send a special effect resource file to the terminal 110 when it is required to make the terminal 110 present a certain special effect resource, and after receiving the special effect resource file, the terminal 110 may render according to special effect resource data in the special effect resource file in a certain manner so as to present a corresponding special effect resource on the screen canvas. As an example, taking a live special effect resource as an example, when a specific user enters a live broadcast room, the special effect resource providing terminal 120 may send a live special effect resource file to the terminal 110, and after receiving the live special effect resource file, the terminal 110 may render the live special effect resource file according to live special effect resource data in the live special effect resource file to play, on a screen canvas, a live special effect resource that welcomes the specific user to enter the live broadcast room.
Step S202, special effect resource data contained in the special effect resource file is obtained.
In this step, the terminal 110 may decapsulate the special effect resource file, extract the video track, and obtain special effect resource data. The special effect resource data may be decoded by the terminal 110 into a frame queue, which may contain the special effect resource data of each frame to be rendered by the terminal 110, and each frame of the special effect resource data may correspond to a respective frame index (frame index).
In step S203, if the special effect resource file further includes identification data for identifying that the special effect resource background can be added, corresponding background picture data is obtained.
In this step, after the terminal 110 decapsulates the special effect resource file, if the extracted special effect resource file further includes identification data for identifying that the special effect resource background can be added, the terminal 110 may further obtain corresponding background picture data. The corresponding background picture data may be background picture data prestored on the terminal 110, or may be background picture data sent to the terminal 110 by the special effect resource providing terminal 120, where the background picture data may be of the type of GIF, PNG, and the like, and the type and content of the background picture data may be changed according to actual service scene requirements, that is, for the same special effect resource, the type and content of the corresponding background picture data obtained by the terminal 110 each time may be changed according to actual service scene requirements, the terminal 110 may obtain the GIF background picture data or the PNG background picture data, may obtain the GIF background picture data a or the GIF background picture data B, and may also obtain the PNG background picture data a or the PNG background picture data B.
Specifically, the special effect resource file sent by the special effect resource providing terminal 120 may further include, in addition to the special effect resource data, identification data that can be written into the special effect resource file by the special effect resource providing terminal 120, for example, the identification data may be written into the special effect resource file in the form of json data, the identification data may be used by the special effect resource providing terminal 120 to identify that the special effect resource corresponding to the special effect resource file has a background addable attribute, specifically, in a case that, for example, the special effect resource providing terminal 120 needs to identify that the special effect resource corresponding to the special effect resource file has the background addable attribute, the special effect resource providing terminal 120 may write background1 as identification data into the special effect resource file, and then send the special effect resource file including the special effect resource data and the identification data to the terminal 110, because the background of the special effect resource identified by the special effect resource providing terminal 120 in the special effect resource file is addable, the terminal 110 further needs to obtain corresponding background picture data, and the background picture data may be pre-stored by the terminal 110, or may be transmitted by the special effect resource providing terminal 120. Therefore, when the terminal 110 decapsulates the special effect resource file, it may be detected whether the special effect resource file includes identification data for identifying that the special effect resource background can be added, and if so, the terminal 110 may obtain corresponding background picture data and cache the background picture data in the content for use when rendering.
Step S204, if the special effect resource data to be rendered is the special effect resource data corresponding to the background picture data, rendering the special effect resource data after rendering the background picture data to present the special effect resource taking the corresponding background picture as the background.
In this step, the terminal 110 renders the special effect resource data, in this stage, the terminal 110 first determines whether the special effect resource data to be rendered is special effect resource data corresponding to background picture data, if not, the terminal 110 may directly render the special effect resource data, if the special effect resource data to be rendered is special effect resource data corresponding to background picture data, the terminal 110 may render the special effect resource data and the corresponding scene picture data in a certain order, the terminal 110 may first render the corresponding background picture data in the step S203 and then render the special effect resource data, thereby, the terminal 110 may present the special effect resource with the corresponding background picture as the background on a screen canvas, in practical applications, if a basic picture has been displayed on the terminal 110, such as a live broadcast picture, the step first renders the background picture corresponding to the live broadcast special effect resource on an upper layer of the live broadcast picture, and then renders the live broadcast picture on the upper layer of the live broadcast picture, so that a live broadcast service may obtain a live broadcast service with a special effect corresponding to the background picture on the same background picture from a relative display hierarchy of the three layers, and thus, the live broadcast service may obtain a live broadcast service with a special effect corresponding to the background picture on the background picture, and if the live broadcast service, the same background picture, the live broadcast service may obtain a special effect corresponding to the special effect of the special effect corresponding to the background picture, which is changed on the live broadcast service.
In the method for rendering special effect resources provided by this embodiment, the terminal 110 receives a special effect resource file, then obtains special effect resource data included in the special effect resource file, and if the special effect resource file further includes identification data for identifying that a background of the special effect resource can be added, the terminal 110 obtains corresponding background picture data; when rendering the special effect resource data, if the special effect resource data to be rendered is the special effect resource data corresponding to the background picture data, the terminal 110 renders the corresponding background picture data and then renders the special effect resource data, so as to present the special effect resource with the corresponding background picture as the background. In the scheme, when rendering the special effect resource data, the terminal 110 does not directly render the special effect resource data obtained by analyzing the file, but judges whether the file also contains identification data for identifying that a special effect resource background can be added, if so, the terminal 110 can present the special effect resource with the corresponding background picture as the background on the screen, and can add and flexibly change the background of the special effect resource at the terminal side, so that the terminal 110 can dynamically change the background of the special effect resource according to the actual service requirement, the display mode and the style of the special effect resource at the terminal are enriched, and the rendering and displaying effect of the special effect resource is improved.
In some embodiments, if the special effect resource file in step S203 further includes identification data for identifying that a special effect resource background can be added, acquiring corresponding background picture data may include:
if the special effect resource file also comprises identification data for identifying that the special effect resource background can be added, extracting background addition layer number information from the identification data; and adding layer number information according to the background to acquire background picture data corresponding to each background level.
Specifically, as described above, in addition to the special effect resource data, for example, the identification data for identifying that the special effect resource background can be added can be written into the special effect resource file sent by the special effect resource providing end 120, in this embodiment, the identification data written by the special effect resource providing end 120 can also be specifically used for carrying information of the number of layers of the background picture that can be added of the special effect resource, that is, background addition layer number information, according to the background addition layer number information, the terminal 110 can add multiple layers of background pictures to the special effect resource, so that the display mode and style of the special effect resource are further enriched, and the rendering display effect of the terminal is improved. Specifically, the special effect resource providing end 120 may write background3 as identification data into the special effect resource file, where the background in the background3 may be used to identify that the special effect resource background is addable, and 3 of the background addable layer number information may be used as the background addable layer number information carried by the background addable layer number information, that is, the number of addable background layers is 3, so that the terminal 110 obtains the background picture data corresponding to each background layer level according to the background addable layer number information.
Based on this, in an embodiment, if the special effect resource data to be rendered in step S204 is special effect resource data corresponding to background picture data, rendering the special effect resource data after rendering the background picture data further includes:
if the special effect resource data to be rendered is the special effect resource data corresponding to the multiple layers of background picture data, determining a background level sequence, rendering the background picture data corresponding to each background level in sequence according to the background level sequence, and then rendering the special effect resource data.
In this embodiment, the terminal 110 parses, from the special effect resource file, identification data for identifying that the special effect resource background can be added, and can extract the number-of-layers information that the background can be added from the identification data, and then obtains, based on this, background picture data corresponding to each background level, and at the rendering stage of the special effect resource data, if the special effect resource data to be rendered is the special effect resource data corresponding to the multiple layers of background picture data, the terminal 110 renders, in addition to the order of rendering the background first and then rendering the special effect resource, according to the order of the background levels when rendering the background, so that the multiple layers of backgrounds can be rendered and displayed correctly. The number of background addable layers is set to 2, the terminal acquires the background layer sequence of the two layers of background picture data after acquiring the background picture data corresponding to the two background layers, the background layer sequence can be predetermined, that is, the layer sequence can be determined after the two layers of background picture data are manufactured, for example, when the background picture data a is manufactured, the background picture data belonging to the 1 st background layer is marked, the background picture data B belonging to the 2 nd background layer is marked, and the like, the background picture data of each background layer can comprise a plurality of background picture data, the types and the content of the background picture data can be different, the terminal 110 can acquire the background picture data from the corresponding background layer as the background picture data for background adding of the special effect resource in the corresponding background layer according to the background addable layer information, so as to enrich the display mode and the style of the special effect resource. Then, the terminal 110 may render the background picture data corresponding to the 2 nd background level first, then render the background picture data corresponding to the 1 st background level, and render the special effect resource data after the background picture data corresponding to the two background levels are rendered, thereby achieving the effect of playing the special effect resource with the corresponding multiple layers of background pictures as the background, so that the display mode and style of the special effect resource are further enriched, and the display effect of the special effect resource is further improved.
In some embodiments, after acquiring the corresponding background picture data in step S203, the following steps may be further included:
and when the corresponding background picture data belongs to the target background picture data, performing frame number matching on the corresponding background picture data and the special effect resource data contained in the special effect resource file, so that the frame number of the corresponding background picture data is the same as that of the special effect resource data.
In this embodiment, the number of frames of special effect resource data that the terminal 110 needs to render is usually multiple frames, and when a background picture needs to be added to the terminal 100, the number of frames of corresponding background picture data that is obtained may be unmatched with the frame number, which may affect the effect of adding and displaying a background picture to a special effect resource, in order to ensure that the terminal can accurately add a background picture, after the terminal 110 obtains the corresponding background picture data, it is determined whether the background picture data belongs to target-class background picture data, the target-class background picture data may be background picture data containing multiple frames in a GIF format, if the background picture data belongs to the target-class background picture data, the terminal 110 may perform frame number matching processing on the background picture data, and when the terminal 110 matches the background picture data with the resource data contained in the resource file, the number of frames of the background picture data is the same as the number of frames of the resource data, specifically, when the number of frames of the background picture data is less than the number of frames of the target-class background picture data, the terminal 110 may perform additional processing on the background picture data to make the frame number of frames of the special effect resource data be the same as the number of frames, and thus, the special effect picture data can be rendered before the special effect picture.
Based on this, rendering the special effect resource data after rendering the background picture data in step S204 further includes:
acquiring corresponding target background picture data from the corresponding background picture data according to the frame index of the special effect resource data to be rendered, and rendering the target background picture data; and after the target background picture data is rendered, according to the frame index of the special effect resource data to be rendered, acquiring corresponding target special effect resource data from the special effect resource data contained in the special effect resource file, and rendering the target special effect resource data.
In this embodiment, as described above, the frame number of the special effect resource data that the terminal 110 needs to render is usually multiple frames, and in the rendering stage, the terminal 110 may obtain the frame index of the special effect resource data to be rendered, because the frame number of the background picture data has been matched with the frame number of the special effect resource data in the foregoing embodiment, the terminal 110 may obtain the background picture data, i.e., the target background picture data, corresponding to the frame index from the background picture data subjected to frame number matching according to the frame index of the special effect resource data to be rendered, then render the target background picture data, and after rendering the target background picture data, the terminal 110 may obtain the special effect resource data, i.e., the target special effect resource data, corresponding to the frame index from the special effect resource data included in the special effect resource file according to the frame index of the special effect resource data to be rendered, and then render the target special effect resource data, so that the terminal 110 may accurately and effectively add a corresponding background picture to each frame of the special effect resource on the basis of frame number matching, so that the background addition effect to the special effect resource is more stable and reliable.
Further, in some embodiments, the corresponding background picture data may include the background picture data corresponding to each background hierarchy. Therefore, in the above embodiment, performing frame number matching on the corresponding background picture data and the special effect resource data included in the special effect resource file further includes: and aiming at the background picture data of each background level, performing frame number matching on the background picture data of the background level and the special effect resource data contained in the special effect resource file, so that the frame number of the background picture data of each background level is the same as that of the special effect resource data. Specifically, under the condition that the corresponding background picture data includes the respective corresponding background picture data of each background level, the terminal 110 performs frame number matching processing on the background picture data of each background level, and if the corresponding background picture data includes the GIF background picture data a of the 1 st background level and the GIF background picture data B of the 2 nd background level, the terminal 110 performs frame number matching on the GIF background picture data a of the 1 st background level and the special effect resource data, and performs frame number matching on the GIF background picture data B of the 2 nd background level and the special effect resource data, so that the frame number of the GIF background picture data a of the 1 st background level is the same as the frame number of the special effect resource data, and the frame number of the GIF background picture data B of the 2 nd background level is also the same as the frame number of the special effect resource data, so as to ensure that the background picture data of each corresponding frame layer can be obtained before each frame of the special effect resource data is rendered under the condition of multiple backgrounds.
Therefore, in the above embodiment, according to the frame index of the special effect resource data to be rendered, the corresponding target background picture data is obtained from the corresponding background picture data, and the rendering of the target background picture data further includes: and according to the frame index of the special effect resource data to be rendered, acquiring target background picture data corresponding to each background level from the background picture data corresponding to each background level, and sequentially rendering the target background picture data corresponding to each background level according to the background level sequence. Specifically, as described above, in the case that the corresponding background picture data includes the respective background picture data corresponding to each background level, the terminal 110 performs frame number matching on the background picture data of each background level and the special effect resource data, based on which, in the rendering stage, after obtaining the frame index of the special effect resource data to be rendered, the terminal 110 may obtain, according to the frame index, the background picture data, i.e., the target background picture data, corresponding to each background level for the frame index, from the background picture data subjected to frame number matching, to obtain the target background picture data corresponding to each background level. And each target background picture data of the frame has a corresponding background hierarchy sequence, so the terminal 110 sequentially renders the target background picture data corresponding to each background hierarchy according to the background hierarchy sequence, for example, for the 1 st frame, the target background picture data corresponding to the 2 nd background hierarchy can be rendered first, then the target background picture data corresponding to the 1 st background hierarchy can be rendered, after the target background picture data corresponding to the two background hierarchies are rendered, the special effect resource data of the 1 st frame can be rendered, and then the 2 nd and subsequent frames are rendered sequentially, so the terminal 110 can accurately and effectively add the corresponding background picture of each background hierarchy for each frame of the special effect resource on the basis of frame number matching of each background hierarchy, thereby achieving the effect of playing the special effect resource with the corresponding multilayer background pictures as the background, and enabling the playing effect to be more stable and reliable.
In some embodiments, after receiving the special effects resource file in step S201, the method further includes the following steps:
extracting description information of the special effect resource file; and determining whether the special effect resource file contains identification data for identifying that the special effect resource background can be added or not according to the description information.
In this embodiment, the special effect resource providing terminal 120 may write the identification data for identifying that the special effect resource background can be added into the description information of the special effect resource file and send the identification data to the terminal 110, and the terminal 110 decapsulates the special effect resource file after receiving the special effect resource file, extracts the special effect resource data and the description information, and determines whether the description information of the special effect resource file includes the identification data for identifying that the special effect resource background can be added. Specifically, with reference to fig. 3, the MP4 special effect resource file provided by the special effect resource providing terminal 120 may include special effect resource data and description information, the terminal 110 extracts the special effect resource data and the description information after receiving the MP4 special effect resource file, if the description information includes identification data for identifying that a special effect resource background can be added, the terminal 110 may obtain and buffer the incoming corresponding background picture data, when rendering each frame, obtain the special effect resource data to be rendered, that is, target special effect resource data and target background picture data, according to a frame index, render the target background picture data first, and then render the target special effect resource data. Specifically, the terminal 110 decapsulates the MP4 special effect resource file, extracts the special effect resource data and the description information, on one hand, the terminal 110 may decode to obtain a frame queue including multiple frames of special effect resource data, on the other hand, the terminal 110 may determine whether the extracted description information includes identification data for identifying that a special effect resource background can be added, and if so, the terminal 110 acquires corresponding background picture data and caches the corresponding background picture data in the memory. In the rendering stage, the terminal 110 obtains a frame index of the special effect resource data to be rendered, if the special effect resource data to be rendered has corresponding background picture data, the terminal 110 obtains and renders target background picture data according to the frame index, and then obtains and renders the target special effect resource data from the frame queue according to the frame index, thereby presenting the special effect resource with the corresponding background picture as the background.
Further, in some embodiments, the determining, according to the description information in the foregoing embodiments, whether the special effect resource file includes identification data for identifying that the special effect resource background is addable may include:
according to the description information, acquiring a preset field used for writing the identification data into the special effect resource providing end in the description information; and determining whether the special effect resource file contains identification data for identifying the addable special effect resource background according to the identification data of the preset field in the description information.
In this embodiment, the terminal 110 may obtain, in the description information, a preset field, such as a metadata field, for writing the identification data into the special effect resource providing terminal 120 in an analytic manner, and the special effect resource providing terminal 120 may write the identification data into the preset field of the description information, where the identification data may be identification data, such as background, for identifying that the special effect resource background may be added, may also be identification data, such as background3, for indicating that the special effect resource background may be added and carrying background addable layer number information, and may also be identification data, such as background0, for identifying that the special effect resource background may not be added, so as to further improve flexibility of setting the background addable attribute of the special effect resource. Therefore, after the terminal 110 analyzes and obtains the preset field used for writing the identification data in the special effect resource providing terminal 120 in the description information, the identification data of the preset field can be extracted, so that whether the special effect resource file contains the identification data used for identifying the changeable background of the special effect resource is determined, and the extraction of information such as the number of layers that can be added to the background and the like can be further facilitated.
Further, in some other embodiments, the determining, according to the description information in the foregoing embodiments, whether the special effect resource file includes identification data for identifying that the special effect resource background is addable may include:
determining preset identification data keywords for matching in the description information; matching in the description information according to the preset identification data keywords; and determining whether the special effect resource file contains identification data for identifying that the special effect resource background can be added or not according to the matching result.
In this embodiment, the terminal 110 may determine whether the special effect resource file includes identification data for identifying that the special effect resource background is addable, the special effect resource providing terminal 120 may use a character string including a preset keyword as the identification data for identifying that the special effect resource background is addable according to a predetermined rule, the character string of the preset keyword may be used as a preset identification data keyword, for example, backsground may be used as a preset identification data keyword, the special effect resource providing terminal 120 may directly write backsground as the identification data for identifying that the special effect resource background is addable into description information of the special effect resource file, the preset identification data keyword may be sent to the terminal 110 by the special effect resource providing terminal 120 in advance for storage, therefore, after the terminal 110 obtains the special effect resource file, the terminal 110 may perform matching in the description information of the special effect resource file according to the determined preset identification data keyword for matching in the description information, and if the matching result indicates that the preset identification data keyword is included in the description information, the terminal 110 may determine that the identification data for identifying that the special effect resource background is addable may be added may be included in the special effect resource file, so that whether the special effect resource file may be used for identifying that the background is more convenient and changeable may be included in the special effect resource file.
In one embodiment, as shown in fig. 4, a live system is provided that may include a terminal and a live server. The terminal can communicate with the live broadcast server through the Internet. In this embodiment, the live broadcast server may send a live broadcast special effect resource file to the terminal, and may also send corresponding background picture data. The terminal of the live broadcast system may render live broadcast special effect resource data and corresponding background picture data in a live broadcast special effect resource file sent by the live broadcast server according to the special effect resource rendering method described in any of the above embodiments, so as to play the live broadcast special effect resource with the corresponding background picture as a background in a live broadcast picture. As an application example, as shown in fig. 5, a terminal of the live broadcast system may play a live broadcast special effect resource 520 with a corresponding background picture 530 as a background in a live broadcast picture 510, and from the relative hierarchy of the live broadcast picture and the live broadcast picture, the live broadcast picture is located at a lower layer, the live broadcast special effect resource is located at an upper layer, and a background picture is between the live broadcast special effect resource and the live broadcast special effect resource, so that an effect of presenting the live broadcast special effect resource with the corresponding background picture as the background on a screen canvas is achieved, and for the same live broadcast special effect resource, background pictures added by the terminal may be different, so that the terminal can dynamically change the background of the live broadcast special effect resource according to a service scene need. Therefore, the special effect resource rendering method provided by the embodiment can be applied to a live broadcast system, so that the background of the live broadcast special effect resource is added by the terminal side in a live broadcast scene, the dynamic change according to the live broadcast service scene can be supported, the display mode and the style of the live broadcast special effect resource at the terminal are enriched, and the rendering display effect of the live broadcast special effect resource is improved.
It should be understood that, although the steps in the flowcharts related to the embodiments as described above are sequentially displayed as indicated by arrows, the steps are not necessarily performed sequentially as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the flowcharts related to the embodiments described above may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the execution order of the steps or stages is not necessarily sequential, but may be rotated or alternated with other steps or at least a part of the steps or stages in other steps.
Based on the same inventive concept, the embodiment of the application also provides a special effect resource rendering device for realizing the special effect resource rendering method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the method, so specific limitations in one or more embodiments of the special effect resource rendering device provided below may refer to the limitations on the special effect resource rendering method in the foregoing, and details are not described herein again.
In one embodiment, as shown in fig. 6, there is provided a special effects resource rendering apparatus, which is applicable to a terminal, and the apparatus 600 may include:
a file receiving module 601, configured to receive a special effect resource file;
a data obtaining module 602, configured to obtain special effect resource data included in the special effect resource file;
a background obtaining module 603, configured to obtain corresponding background picture data if the special effect resource file further includes identification data for identifying that a special effect resource background can be added;
a data rendering module 604, configured to render the special effect resource data after rendering the background picture data if the special effect resource data to be rendered is special effect resource data corresponding to background picture data, so as to present a special effect resource with a corresponding background picture as a background.
In an embodiment, the background obtaining module 603 is configured to, if the special effect resource file further includes identification data for identifying that a special effect resource background can be added, extract background addable layer number information from the identification data; and adding layer number information according to the background to acquire background picture data corresponding to each background level.
In an embodiment, the data rendering module 604 is configured to determine a background hierarchy order if the special effect resource data to be rendered is special effect resource data corresponding to multiple layers of background picture data, and render the special effect resource data after rendering the background picture data corresponding to each of the background hierarchies in sequence according to the background hierarchy order.
In an embodiment, the background obtaining module 603 may be further configured to, when the corresponding background picture data belongs to target-class background picture data, perform frame number matching on the corresponding background picture data and special effect resource data included in the special effect resource file, so that a frame number of the corresponding background picture data is the same as a frame number of the special effect resource data; a data rendering module 604, configured to obtain corresponding target background picture data from the corresponding background picture data according to the frame index of the special effect resource data to be rendered, and render the target background picture data; and after the target background picture data is rendered, according to the frame index of the special effect resource data to be rendered, acquiring corresponding target special effect resource data from the special effect resource data contained in the special effect resource file, and rendering the target special effect resource data.
In one embodiment, the corresponding background picture data comprises background picture data corresponding to each background level; the background obtaining module 603 may be further configured to perform frame number matching on the background picture data of each background level and the special effect resource data included in the special effect resource file, so that the frame number of the background picture data of each background level is the same as the frame number of the special effect resource data; and a data rendering module 604, configured to obtain, according to the frame index of the special effect resource data to be rendered, target background picture data corresponding to each background level from the background picture data corresponding to each background level, and sequentially render the target background picture data corresponding to each background level according to a background level sequence.
In one embodiment, the apparatus 600 may further include: the identification determining module is used for extracting the description information of the special effect resource file; and determining whether the special effect resource file contains identification data for identifying that the special effect resource background can be added or not according to the description information.
In an embodiment, the identifier determining module may be configured to obtain, according to the description information, a preset field used by the special effect resource providing end to write the identifier data in the description information; and determining whether the special effect resource file contains identification data for identifying that the special effect resource background can be added or not according to the identification data of the preset field in the description information.
In one embodiment, the identifier determining module may be configured to determine a preset identifier data keyword used for matching in the description information; matching in the description information according to the preset identification data keyword; and determining whether the special effect resource file contains identification data for identifying that the special effect resource background can be added or not according to the matching result.
The modules in the special effect resource rendering device can be wholly or partially realized by software, hardware and a combination thereof. The modules may be embedded in a hardware form or may be independent of a processor in the electronic device, or may be stored in a memory in the electronic device in a software form, so that the processor calls and executes operations corresponding to the modules.
In one embodiment, an electronic device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 7. The electronic device comprises a processor, a memory, a communication interface, a display screen and an input device which are connected through a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic equipment comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program to run on the non-volatile storage medium. The communication interface of the electronic device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a special effects resource rendering method. The display screen of the electronic equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the electronic equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is a block diagram of only a portion of the architecture associated with the subject application, and does not constitute a limitation on the electronic devices to which the subject application may be applied, and that a particular electronic device may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, an electronic device is further provided, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the steps of the above method embodiments when executing the computer program.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high-density embedded nonvolatile Memory, resistive Random Access Memory (ReRAM), magnetic Random Access Memory (MRAM), ferroelectric Random Access Memory (FRAM), phase Change Memory (PCM), graphene Memory, and the like. Volatile Memory can include Random Access Memory (RAM), external cache Memory, and the like. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), for example. The databases referred to in various embodiments provided herein may include at least one of relational and non-relational databases. The non-relational database may include, but is not limited to, a block chain based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, quantum computing based data processing logic devices, etc., without limitation.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims (12)

1. A special effect resource rendering method is applied to a terminal, and the method comprises the following steps:
receiving a special effect resource file;
acquiring special effect resource data contained in the special effect resource file;
if the special effect resource file also comprises identification data for identifying that a special effect resource background can be added, acquiring corresponding background picture data;
and if the special effect resource data to be rendered is the special effect resource data corresponding to the background picture data, rendering the special effect resource data after rendering the background picture data so as to present the special effect resource taking the corresponding background picture as the background.
2. The method according to claim 1, wherein if the special effect resource file further includes identification data for identifying that a special effect resource background can be added, acquiring corresponding background picture data, includes:
if the special effect resource file also comprises identification data for identifying that the special effect resource background can be added, extracting background addition layer number information from the identification data;
and adding layer number information according to the background to acquire background picture data corresponding to each background level.
3. The method according to claim 2, wherein rendering the special effect resource data after rendering the background picture data if the special effect resource data to be rendered is special effect resource data corresponding to background picture data comprises:
if the special effect resource data to be rendered is the special effect resource data corresponding to the multiple layers of background picture data, determining a background level sequence, rendering the background picture data corresponding to each background level in sequence according to the background level sequence, and then rendering the special effect resource data.
4. The method according to claim 1, wherein after obtaining the corresponding background picture data, further comprising:
when the corresponding background picture data belongs to target background picture data, performing frame number matching on the corresponding background picture data and special effect resource data contained in the special effect resource file, so that the frame number of the corresponding background picture data is the same as that of the special effect resource data;
rendering the special effect resource data after rendering the background picture data comprises:
according to the frame index of the special effect resource data to be rendered, acquiring corresponding target background picture data from the corresponding background picture data, and rendering the target background picture data;
and after the target background picture data is rendered, according to the frame index of the special effect resource data to be rendered, acquiring corresponding target special effect resource data from the special effect resource data contained in the special effect resource file, and rendering the target special effect resource data.
5. The method according to claim 4, wherein the corresponding background picture data comprises background picture data corresponding to each background level;
the matching of the frame number of the corresponding background picture data and the special effect resource data contained in the special effect resource file comprises the following steps:
aiming at the background picture data of each background level, performing frame number matching on the background picture data of the background level and the special effect resource data contained in the special effect resource file, so that the frame number of the background picture data of each background level is the same as that of the special effect resource data;
the obtaining, according to the frame index of the special effect resource data to be rendered, corresponding target background picture data from the corresponding background picture data, and rendering the target background picture data includes:
and according to the frame index of the special effect resource data to be rendered, acquiring target background picture data corresponding to each background level from the background picture data corresponding to each background level, and sequentially rendering the target background picture data corresponding to each background level according to the background level sequence.
6. The method of any of claims 1 to 5, wherein after receiving the special effects resource file, the method further comprises:
extracting description information of the special effect resource file;
and determining whether the special effect resource file contains identification data for identifying that the special effect resource background can be added or not according to the description information.
7. The method according to claim 6, wherein the determining whether the special effect resource file includes identification data for identifying that a special effect resource context is addable according to the description information comprises:
acquiring a preset field used for writing identification data into the special effect resource providing end in the description information according to the description information;
and determining whether the special effect resource file contains identification data for identifying that the special effect resource background can be added or not according to the identification data of a preset field in the description information.
8. The method according to claim 6, wherein the determining whether the special effect resource file includes identification data for identifying that a special effect resource context can be added according to the description information comprises:
determining preset identification data keywords for matching in the description information;
matching in the description information according to the preset identification data keyword;
and determining whether the special effect resource file contains identification data for identifying that the special effect resource background can be added or not according to the matching result.
9. A special effect resource rendering device is applied to a terminal, and the device comprises:
the file receiving module is used for receiving the special effect resource file;
the data acquisition module is used for acquiring special effect resource data contained in the special effect resource file;
the background acquisition module is used for acquiring corresponding background picture data if the special effect resource file also contains identification data for identifying that a special effect resource background can be added;
and the data rendering module is used for rendering the special effect resource data after rendering the background picture data if the special effect resource data to be rendered is the special effect resource data corresponding to the background picture data so as to present the special effect resource taking the corresponding background picture as the background.
10. A live system, the system comprising: a terminal and a live broadcast server; wherein,
the terminal is configured to render live special effect resource data and corresponding background picture data in a live special effect resource file sent by a live server according to the method of any one of claims 1 to 8, and play the live special effect resource with the corresponding background picture as a background in a live picture.
11. An electronic device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor realizes the steps of the method of any of claims 1 to 8 when executing the computer program.
12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 8.
CN202211098151.6A 2022-09-08 2022-09-08 Special effect resource rendering method and device, live broadcast system, equipment and storage medium Pending CN115834953A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211098151.6A CN115834953A (en) 2022-09-08 2022-09-08 Special effect resource rendering method and device, live broadcast system, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211098151.6A CN115834953A (en) 2022-09-08 2022-09-08 Special effect resource rendering method and device, live broadcast system, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115834953A true CN115834953A (en) 2023-03-21

Family

ID=85523527

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211098151.6A Pending CN115834953A (en) 2022-09-08 2022-09-08 Special effect resource rendering method and device, live broadcast system, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115834953A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160293134A1 (en) * 2013-12-26 2016-10-06 Square Enix Holdings Co., Ltd. Rendering system, control method and storage medium
CN106385591A (en) * 2016-10-17 2017-02-08 腾讯科技(上海)有限公司 Video processing method and video processing device
CN111078169A (en) * 2019-11-29 2020-04-28 武汉虹信技术服务有限责任公司 Front-end device of visual large-screen system and construction method thereof
CN113613062A (en) * 2021-07-08 2021-11-05 广州云智达创科技有限公司 Video data processing method, apparatus, device, storage medium, and program product

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160293134A1 (en) * 2013-12-26 2016-10-06 Square Enix Holdings Co., Ltd. Rendering system, control method and storage medium
CN106385591A (en) * 2016-10-17 2017-02-08 腾讯科技(上海)有限公司 Video processing method and video processing device
CN111078169A (en) * 2019-11-29 2020-04-28 武汉虹信技术服务有限责任公司 Front-end device of visual large-screen system and construction method thereof
CN113613062A (en) * 2021-07-08 2021-11-05 广州云智达创科技有限公司 Video data processing method, apparatus, device, storage medium, and program product

Similar Documents

Publication Publication Date Title
CN109819284B (en) Short video recommendation method and device, computer equipment and storage medium
CN110139162B (en) Media content sharing method and device, storage medium and electronic device
US10929460B2 (en) Method and apparatus for storing resource and electronic device
CN113204659B (en) Label classification method and device for multimedia resources, electronic equipment and storage medium
EP4075299A1 (en) Method and apparatus for recommending multimedia resource
JP2022531339A (en) Resource configuration method, resource configuration device, computer equipment, and computer program
CN106095816B (en) Information delivery method and device
CN115544183A (en) Data visualization method and device, computer equipment and storage medium
US20180314698A1 (en) Media sharing based on identified physical objects
CN113096218B (en) Dynamic image playing method, dynamic image playing device, storage medium and computer equipment
CN115834953A (en) Special effect resource rendering method and device, live broadcast system, equipment and storage medium
US20150142576A1 (en) Methods and mobile devices for displaying an adaptive advertisement object and systems for generating the adaptive advertisement object
CN117113302B (en) Text watermark generation method and text verification method
CN116628257B (en) Video retrieval method, device, computer equipment and storage medium
CN115587074A (en) Method, device, live broadcast system, equipment and medium for generating special-effect resource file
CN115118616B (en) Display result testing method, device, computer equipment and storage medium
CN118467873A (en) Page data processing method, device, computer equipment and readable storage medium
CN118193083A (en) Software resource loading method and device, computer equipment and storage medium
CN117290540A (en) Song recommendation model training method, song recommendation method, device and storage medium
CN117763247A (en) Link downloading method, device, computer equipment and storage medium
CN117216425A (en) Financial business page display method, device, computer equipment and storage medium
CN117193924A (en) Page display method and device and computer equipment
CN116661921A (en) Method, device and equipment for determining information display page of financial service system
CN118096171A (en) Data gray level verification method, device, computer equipment, medium and product
CN117251081A (en) Method, apparatus, computer device and storage medium for detecting picked-up object

Legal Events

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