Video generation method and apparatus, electronic device, and storage medium
By generating animated textures and utilizing scene identifier information to quickly render target animated videos, the problem of low rendering efficiency under the limited performance of terminal devices is solved, achieving improved rendering speed and user experience while reducing storage requirements.
Patent Information
- Application Number
- CN202211194243.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-28
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2042-09-28
AI Technical Summary
Existing technologies, given the limited performance of terminal devices, result in low rendering efficiency due to the storage of large amounts of animation data, making it impossible to render target animation videos in real time.
By determining the scene identification information of the target object, an animation texture is generated. The animation texture contains the display position information of each mesh model of the target model in the preset video frame, which reduces the amount of data storage and quickly renders the target animation video.
While reducing data storage requirements, it enables the rapid generation of target animation videos and the simultaneous rendering of different target animation videos on the same display interface, thereby improving the user experience.
Smart Images

Figure CN115588064B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present disclosure relate to image processing technology, and in particular, to a video generation method and device, electronic equipment and a storage medium. BACKGROUND
[0002] With the continuous development of image processing technology, the video processing function integrated in the related application software is also constantly enriched. For example, an animation data of a target object can be played based on a terminal device.
[0003] Currently, the processing method mainly includes storing a model structure corresponding to the target object in each frame of animation data. Correspondingly, when the number of frames corresponding to the animation data is large, multiple model structures need to be stored, resulting in a large amount of stored data. Correspondingly, when rendering the animation data, multiple model structures need to be called, and when the terminal device performance is poor, real-time rendering cannot be achieved. SUMMARY
[0004] The present disclosure provides a video generation method and device, electronic equipment and a storage medium to achieve the effect of quickly and simultaneously rendering different target animation videos in the same display interface under the premise of reducing data storage.
[0005] In a first aspect, the embodiments of the present disclosure provide a video generation method, which includes:
[0006] determining scene identification information to which at least one target object currently belongs;
[0007] determining a target animation video of the at least one target object according to the scene identification information and an animation map corresponding to the at least one target object;
[0008] The animation map includes display position information of each mesh model on a target model corresponding to the target object in a preset video frame, and the target animation video includes the preset video frame.
[0009] In a second aspect, the embodiments of the present disclosure also provide a video generation device, which includes:
[0010] a scene identification information determination module configured to determine scene identification information to which at least one target object currently belongs;
[0011] a target animation video determination module configured to determine a target animation video of the at least one target object according to the scene identification information and an animation map corresponding to the at least one target object;
[0012] The animation map includes display position information of each mesh model on a target model corresponding to the target object in a preset video frame.
[0013] In a third aspect, the present disclosure also provides an electronic device, which comprises:
[0014] one or more processors;
[0015] a storage device configured to store one or more programs,
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the video generation method according to any of the embodiments of the present disclosure.
[0017] In a fourth aspect, the present disclosure also provides a storage medium containing computer executable instructions, which, when executed by a computer processor, are used to perform the video generation method according to any of the embodiments of the present disclosure.
[0018] The technical solution of the embodiments of the present disclosure determines the scene identification information to which the at least one target object currently belongs, and further determines the target animation video of the at least one target object according to the scene identification information and the animation map corresponding to the at least one target object. The technical solution solves the problem that the corresponding target animation video cannot be rendered when the terminal device has limited performance, and realizes the effect of quickly generating the target animation video corresponding to each target object under the premise of reducing the data storage amount. In addition, by making the target animation video correspond to the corresponding scene identification information, different target animation videos can be simultaneously rendered in the same display interface, so as to achieve the effect of cluster animation, and the user experience is improved. BRIEF DESCRIPTION OF DRAWINGS
[0019] The above and other features, advantages, and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the original and elements are not necessarily drawn according to the scale.
[0020] Figure 1 is a flowchart of an animation map creation method provided by the embodiments of the present disclosure;
[0021] Figure 2 is a flowchart of a video generation method provided by the embodiments of the present disclosure;
[0022] Figure 3 is a flowchart of a video generation method provided by the embodiments of the present disclosure;
[0023] Figure 4 is a flowchart of a video generation method provided by an embodiment of the present disclosure;
[0024] Figure 5 is a flowchart of a video generation method provided by an embodiment of the present disclosure;
[0025] Figure 6 is a structural diagram of a video generation apparatus provided by an embodiment of the present disclosure;
[0026] Figure 7 is a structural diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0027] Embodiments of the present disclosure will be described in more detail by referring to the drawings. Although certain embodiments of the present disclosure are shown in the drawings, it is understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein, but rather the embodiments are provided so as to more completely and thoroughly understand the present disclosure. It is understood that the drawings and embodiments of the present disclosure are for exemplary purposes only and are not intended to limit the scope of the present disclosure.
[0028] It should be understood that the various steps in the method embodiments of the present disclosure can be performed in different orders and / or in parallel. In addition, the method embodiments can include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0029] The term "comprising" and variations thereof as used herein are open-ended, that is, "comprising but not limited to." The term "based on" is "based, at least in part, on." The term "one embodiment" means "at least one embodiment." The term "another embodiment" means "at least one additional embodiment." The term "some embodiments" means "at least some embodiments." Related definitions are given below in the description of the application.
[0030] It should be noted that the terms "first", "second", and the like in the present disclosure are merely used to distinguish different devices, modules or units, and are not intended to limit the order or interdependence of the functions performed by these devices, modules or units.
[0031] It should be noted that the terms "one", "multiple" in the present disclosure are illustrative and not restrictive, and those skilled in the art should understand that "one or more" should be understood unless otherwise explicitly indicated in the context.
[0032] The names of the messages or information exchanged between the plurality of devices in the embodiments of the present disclosure are only for illustrative purposes, and are not intended to limit the scope of the messages or information.
[0033] It can be understood that, before using the technical solutions disclosed in the embodiments of the present disclosure, the type, use range, use scenario, etc. of the personal information involved in the present disclosure should be informed to the user and the authorization of the user should be obtained in a proper manner according to relevant laws and regulations.
[0034] For example, in response to receiving the active request of the user, prompt information is sent to the user to explicitly prompt the user that the operation requested to be performed will require obtaining and using the personal information of the user. Thus, the user can autonomously select whether to provide the personal information to the software or hardware such as the electronic device, application program, server or storage medium, etc. that performs the operation of the technical solutions of the present disclosure according to the prompt information.
[0035] As an optional but non-limiting implementation manner, in response to receiving the active request of the user, the manner of sending the prompt information to the user may, for example, be a pop-up window manner, and the prompt information may be presented in the form of text in the pop-up window. In addition, the pop-up window may also carry selection controls for the user to select "agree" or "disagree" to provide the personal information to the electronic device.
[0036] It can be understood that the above notification and obtaining of the authorization of the user are only illustrative, and do not limit the implementation manners of the present disclosure, and other manners that meet the relevant laws and regulations can also be applied to the implementation manners of the present disclosure.
[0037] It can be understood that the data (including but not limited to the data itself, the acquisition or use of the data) involved in the present technical solutions should comply with the requirements of the relevant laws and regulations and relevant provisions.
[0038] Before introducing the technical solution, the application scenario can be exemplarily described. The technical solution of the embodiment of the present disclosure can be applied to a scenario of playing an animation video of a certain target object in any display picture. Exemplarily, the display picture can include a plurality of target objects. When a target animation video corresponding to any target object needs to be played, a plurality of preset animation clips can be pre-stored, and each preset animation clip corresponds to an animation map of a different row number range. When a corresponding special effect prop is triggered, scene identification information to which each target object currently belongs is determined, and then a row number range corresponding to the scene identification information in the animation map is determined to determine a corresponding target animation video based on the row number range. The pixel value of each pixel point in the animation map can represent the display position of each model vertex of a target model corresponding to the target object in a corresponding preset video frame. Thus, the target animation video corresponding to each target object can be simultaneously rendered under the premise of reducing the data storage amount, so that a group animation effect can be presented in the display interface including a plurality of target objects.
[0039] It should be further noted that the corresponding special effect prop can also be integrated based on the method provided by the embodiment of the present disclosure to generate a corresponding special effect video based on the triggering operation of the special effect prop. It can also be that the special effect prop is used as a special effect package in a certain special effect prop. After the special effect prop is triggered and a corresponding target object is added to the display interface, the target animation video corresponding to the target object can be generated in the collected video frame based on the special effect package. Thus, the animation video corresponding to the corresponding object can be included in the special effect video to improve the effect of rich content of the display picture.
[0040] Figure 1 FIG. 1 is a flowchart of an animation map creation method provided by an embodiment of the present disclosure. The embodiment of the present disclosure is applicable to a case of storing preset animation clips corresponding to a target object under different scene identification information into the same animation map.
[0041] As shown in FIG. 1, the method includes the following steps. Figure 1
[0042] S110, creating a target model corresponding to a target object.
[0043] In the embodiment, the target object can be any object displayed in the display interface, any object added to the display interface by the user, or an object for which a corresponding model needs to be created. For example, the target object can be an animation character or a pet. The target model can be a 3D model created based on the target object. The target model is composed of at least one mesh model. Each mesh model can be composed of at least three vertices, which can be used as model vertices.
[0044] In a specific implementation, when the target object is detected, the model vertex number of the corresponding target model can be determined based on the overall information of the target object, and then the limb information, torso information and head information of the target object are determined to construct a plurality of grid models based on the information, and each grid model can be composed of at least three model vertices. Further, the pixel information corresponding to the target object is filled in each grid model, and each grid model is spliced to obtain the target model corresponding to the target object.
[0045] In S120, a preset animation clip corresponding to the target object under different scene identification information is created, and an animation map corresponding to the target object is generated according to each preset animation clip and each grid model on the target model.
[0046] In the embodiment, the scene identification information can be information used to identify the scene position. The scene identification information can represent the range of any scene. The scene can be the occasion or environment in which the target object performs the corresponding action. For example, the scene can include a football field, a track, a stand or a stadium, etc. It should be noted that the scene identification information can be a scene name, a scene picture or a string composed of a pre-set number, letter or symbol. For example, when the scene is a football field, the corresponding scene identification information can be "football field" text information, a football field picture or a pre-set custom string corresponding to the football field.
[0047] The preset animation clip is composed of a plurality of video frames and serves as a preset video frame. It should be noted that the playing time of the preset animation clip corresponding to different scene identification information can be different, that is, different scene identification information can correspond to preset animation clips with different video frame numbers. The preset animation clip can be any preset animation, which can optionally include a standby animation clip, a slow walk animation clip, a running animation clip, a jumping in place animation clip and an evading animation clip, etc. It should be noted that the specific content of the preset animation clip can be set according to actual needs.
[0048] It should be noted that the action information contained in the preset animation clip can be the action information corresponding to the completion of an action by the target object. For example, the action information contained in the running animation clip can be the action corresponding to one step of the target object, and the action information contained in the slow walk animation clip can be the action corresponding to one step of the target object.
[0049] In the embodiment, the animation map can be a map for representing display position information of each model vertex in the target model in a corresponding preset video frame. The map includes a plurality of pixel points, each of which is used to represent a pixel value corresponding to a model vertex in a corresponding preset video frame, so that the display position of the model vertex in the corresponding preset video frame can be determined based on the pixel value.
[0050] In the embodiment, the animation map includes display position information of at least part of the grid models on the target model corresponding to the target object in the preset video frame. It should be noted that, if the video picture definition is limited, or if the terminal device performance is not high, not all model vertices of the grid models can be detected by the user. In this case, only part of the grid models can be processed to generate the corresponding animation map.
[0051] Next, the content information of the animation map will be described in detail. Each column of the animation map represents a corresponding model vertex, and each row represents a preset video frame in each preset animation segment. The pixel value of each pixel point in the animation map is the display position of the model vertex in the corresponding preset video frame.
[0052] In the embodiment, the columns of the animation map can be used to represent each model vertex of the target model, and the rows of the animation map can be used to represent each preset video frame of the preset animation segment. It should be noted that the animation map can include at least one preset animation segment, and the arrangement of each preset animation segment in the animation map can be based on user-defined settings, which are not limited in the embodiments of the present disclosure. In actual application, the pixel value of each pixel point in the animation map can be used to represent the display position of the model vertex in the corresponding preset video frame. The display position can be the spatial position information of each model vertex in the preset video frame. For example, if the total number of model vertices of the target model is 100 and the number of preset video frames of the preset animation segment is 20, the number of columns of the finally generated animation map is 100 and the number of rows is 20. The advantage of such setting is that the model structure of the target model in all preset video frames of each preset animation segment can be stored in different rows of the same animation map, so that when the number of rows is determined, the pixel value in the corresponding number of rows can be quickly read to render the target object based on the pixel value, and obtain the target animation video corresponding to the target object.
[0053] In actual application, the action information corresponding to the target object under different scene identification information can be determined, and a corresponding preset animation segment can be created based on the action information. For example, when the scene identification information to which the target object belongs is identification information corresponding to a runway, the action information corresponding thereto can include slow walking or running, etc. At this time, the preset animation segment created based on the action information is a slow walking animation segment or a running animation segment. Further, after obtaining the target model and the preset animation segments, an animation map corresponding to the target object can be generated. Next, the creation process of the animation map will be described in detail.
[0054] Optionally, the animation map corresponding to the target object is generated according to the preset animation segments and the mesh models on the target model, including: for each preset animation segment, obtaining a first preset video frame in the current preset animation segment, determining the spatial position information of at least three model vertices on each mesh model in the first preset video frame, and determining the pixel value of the nth row of pixels in the animation map based on the spatial position information; obtaining a next preset video frame of the first preset video frame, and repeatedly determining the pixel value corresponding to the spatial position information of at least three model vertices in each mesh model, and updating the nth+1 row in the animation map until all preset video frames in the current preset animation segment are traversed.
[0055] It should be noted that the determination method of the pixel value corresponding to the spatial position information of at least three model vertices in each preset video frame of each preset animation segment is the same, and therefore, one of the preset animation segments will be taken as an example for description.
[0056] It should be noted that the model structure of different target objects can be the same or different. For example, if the body types of the target objects are quite different, the target model structures corresponding thereto are different. At this time, an animation map corresponding to each target object can be created. If the body types of each target object are consistent, one animation map can be created based on the preset animation segments, and the animation map is bound to each target object, or each target object calls the animation map together. However, the determination method of the corresponding animation map of each target object is the same, and therefore, the target model is not distinguished when the animation map is introduced.
[0057] Wherein, n corresponds to the frame number of the first preset video frame in the preset animation segment. For example, for the first preset video frame of the first preset animation segment, n can be 1. For the first preset video frame of the next preset animation segment of the first preset animation segment, when the frame number of the first preset animation segment is 20, n corresponding to the first preset video frame of the next preset animation segment can be 21.
[0058] In practical applications, for each preset animation segment, the first preset video frame can be determined based on the timestamps displayed on each preset video frame in the current preset animation segment, then the model structure of the target model in the first video frame is determined, and the spatial position information of at least three model vertices on each mesh model is determined based on the model structure, further, the corresponding pixel values are determined according to the spatial position information, and each pixel value is filled into the nth row of the animation map corresponding to the first preset video frame of the current preset animation segment to obtain an animation map containing the nth row of pixel values. The advantage of this setting is that the model structure of the target model in all preset video frames of each preset animation segment can be stored in the same animation map, achieving the effect of reducing data storage.
[0059] Optionally, determining the pixel value of the nth row of pixels in the animation map based on the spatial position information includes: determining the pixel value corresponding to each spatial position information; and assigning the pixel value to each pixel point in the nth row according to the model vertex corresponding to each column in the animation map.
[0060] In practical applications, after obtaining the spatial position information of at least three model vertices on each mesh model, the value range of the spatial position information of each model vertex of the target model and the value range of the pixel value in the animation map can be determined, and then each spatial position information is converted into the corresponding pixel value by linear mapping to obtain the pixel value corresponding to each spatial position information, and then according to the model vertex corresponding to each column in the animation map, each pixel value can be filled into the corresponding pixel point to obtain an animation map containing the nth row of pixel values. The advantage of this setting is that it achieves the effect of reducing data storage, and for the spatial position information of each model vertex, it can be converted into a pixel value and filled into the pixel point in the animation map, so that the animation video of the target model can be quickly generated based on the animation map.
[0061] Further, the next preset video frame of the first preset video frame is determined based on the timestamps displayed on each preset video frame in the current preset animation segment, the spatial position information of at least three model vertices on each mesh model is determined based on the model structure of the target model in the next preset video frame, the spatial position information is converted into a pixel value by linear mapping, and each pixel value is updated into the nth+1 row of the vertex animation map, until all preset video frames in the current preset animation segment are traversed, and an animation map containing the pixel values of each model vertex of the target model in all preset video frames of the current preset animation segment is obtained.
[0062] In practical applications, after each preset animation segment is traversed, an animation map corresponding to the target object can be obtained.
[0063] The technical solutions of the embodiments of the present disclosure create a target model corresponding to a target object, further create preset animation clips corresponding to the target object under different scene identification information, and generate an animation map corresponding to the target object according to each preset animation clip and each mesh model on the target model, so as to store the model structures corresponding to each video frame into the same animation map, thereby reducing the data storage amount and improving the response speed of the terminal device when rendering the target animation video.
[0064] It should be noted that different scene identification information corresponds to different preset animation clips, and the number of rows corresponding to each preset animation clip in the animation map is also different. Therefore, in order to improve the generation efficiency of the target animation video corresponding to the target object, a corresponding relationship between the scene identification information and the number of rows of the animation map can be established, so that after the scene identification information to which the target object belongs is determined, the corresponding target animation video can be quickly generated.
[0065] On the basis of the above technical solutions, the following is further included: a mapping relationship between the scene identification information and the corresponding number of rows is established according to the number of rows corresponding to the preset animation clip in the animation map, so as to determine the target animation video of the corresponding target object based on the mapping relationship.
[0066] In the present embodiment, the arrangement order of each preset animation clip in the animation map can be preset during the animation map generation stage, so as to determine the number of rows corresponding to each preset animation clip in the animation map based on the arrangement order of each preset animation clip and all preset video frames included in each preset animation clip. For example, if the preset animation clips include a standby animation clip, a slow walk animation clip and a running animation clip, all preset video frames included in the standby animation clip are 20 frames, all preset video frames included in the slow walk animation clip are 30 frames, all preset video frames included in the running animation clip are 40 frames, and the arrangement order of each preset animation clip in the animation map is: 1, standby animation clip; 2, slow walk animation clip; 3, running animation clip, then the number of rows corresponding to the standby animation clip in the animation map is the first 1 row to the 20th row, the number of rows corresponding to the slow walk animation clip in the animation map is the 21st row to the 50th row, and the number of rows corresponding to the running animation clip is the 51st row to the 90th row.
[0067] In actual application, after determining the corresponding row numbers of each preset animation segment in the animation map, the scene identification information can be associated with the corresponding row numbers of each preset animation segment based on the pre-determined corresponding relationship between each preset animation segment and the scene identification information, so as to establish the mapping relationship between the scene identification information and the corresponding row numbers. When determining the scene identification information to which the target object currently belongs, the corresponding row numbers in the animation map corresponding to the scene identification information can be determined based on the mapping relationship, so that the target animation video corresponding to the target object can be generated based on the corresponding row numbers. The advantage of this setting is that the association relationship between the scene identification information and the corresponding row number range in the animation map is established, so that when the scene identification information to which the target object currently belongs is determined, the pixel values in the corresponding row number range can be quickly read to achieve the effect of quickly generating the target animation video corresponding to the target object.
[0068] Figure 2 is a flowchart of a video generation method provided by an embodiment of the present disclosure. The embodiment of the present disclosure is applicable to a case of determining a target animation video corresponding to a target object based on a pre-constructed animation map and scene identification information to which the target object currently belongs. The method can be executed by a video generation device, which can be implemented in the form of software and / or hardware. Optionally, the video generation device can be implemented by an electronic device, which can be a mobile terminal, a PC terminal, or a server, etc.
[0069] The device for executing the method for generating a special effect video provided by the embodiment of the present disclosure can be integrated in application software supporting special effect video processing function, and the software can be installed in an electronic device. Optionally, the electronic device can be a mobile terminal or a PC terminal, etc. The application software can be a kind of software for image / video processing, and specific application software will not be described here again, as long as it can realize image / video processing. It can also be a specially developed application program to realize the software of adding and displaying special effects, or be integrated in the corresponding page, and the user can realize the processing of the special effect video through the integrated page in the PC terminal.
[0070] As shown in Figure 2 , the method comprises:
[0071] S210, determining scene identification information to which at least one target object currently belongs.
[0072] It should be noted that the number of target objects can be one or multiple, and the scene identification information corresponding to each target object can be the same or different. For example, when the scene is a sports field and contains multiple target objects, the scene identification information can include scene identification information corresponding to a running track, scene identification information corresponding to a football field, and scene identification information corresponding to a stand, etc.
[0073] In practical application, when determining the scene identification information corresponding to each target object, the current location of each target object can be read first, so that the scene identification information corresponding to each target object can be determined based on the current location of each target object.
[0074] Optionally, determining the scene identification information to which the at least one target object currently belongs comprises: determining current location information of the at least one target object; and determining a target sub-scene corresponding to the current location information and corresponding scene identification information according to the current location information and pre-set spatial range information corresponding to each sub-scene.
[0075] In the embodiment, the current location information can be information for representing the location of the corresponding target object. The spatial range information of the sub-scene can be pre-set information for reflecting the spatial distribution area of the sub-scene. Optionally, the spatial range information can be represented by spatial range coordinates.
[0076] In practical application, a plurality of sub-scenes can be determined in advance, and the range coordinates of each sub-scene can be set to obtain the spatial range information corresponding to each sub-scene. When each target object is detected, the current location information of each target object can be determined based on the display position of each target object in the display interface. Further, each current location information is compared with each spatial range information. When any current location information is detected within the spatial range information of one sub-scene, the sub-scene can be taken as the target sub-scene of the current location information, and the scene identification information of the target sub-scene can be determined based on the pre-set scene identification information corresponding to each sub-scene. The advantage of such setting is that the scene identification information to which the target object currently belongs can be quickly determined, and the row number to which the corresponding animation map belongs can be determined based on the scene identification information, so as to generate the target animation video corresponding to the target object.
[0077] S220, determining the target animation video of the at least one target object according to the scene identification information and the animation map corresponding to the at least one target object.
[0078] The animation map comprises display position information of each mesh model on the target model corresponding to the target object in a preset video frame, and the target animation video comprises the preset video frame.
[0079] In the embodiment, after the scene identification information to which the target object currently belongs is determined, the animation map corresponding to each target object can be acquired, and based on the mapping relationship between the scene identification information and each row number in the animation map, the row number range corresponding to the corresponding scene identification information in each animation map is determined respectively. Further, based on each row number range, the corresponding preset video frame and the display position information of each mesh model on the target model in the corresponding preset video frame can be determined, so that the target animation video corresponding to the target object can be rendered based on each display position information. The target animation video can be a video for representing the animation display effect of the target object under the corresponding scene identification information. For example, when the scene identification information to which the target object currently belongs is the scene identification information corresponding to a runway, the finally generated target animation video can be an animation video of the target object running.
[0080] It should be noted that, when determining the target animation video corresponding to the target object, in order to make the rendering effect of the target animation video more close to the expected effect of the preset animation segment, the parameter information corresponding to the target animation video can also be determined to determine the corresponding target animation video in combination with the parameter information.
[0081] Optionally, the target animation video of the at least one target object is determined according to the scene identification information and the animation map corresponding to the at least one target object, comprising: determining the target animation video according to the scene identification information, the animation map corresponding to the at least one target object and the video parameter corresponding to the target animation video.
[0082] In the embodiment, the video parameter can be a variable for representing the feature information of the target animation video, and can also be understood as a parameter such as the number of playing frames or resolution of the target animation video. The video parameter can be a parameter customized by the user in the application development stage. Optionally, the video parameter can include the target frame number of the target animation video.
[0083] It should be noted that, since different target objects correspond to different target animation videos, the video parameters of each target animation video can also be different, that is, different target animation videos can correspond to different video parameters respectively.
[0084] In actual application, after the scene identification information to which the target object currently belongs is determined, and the row number range corresponding to the scene identification information in each animation map is determined, the video parameter of the target animation video can also be acquired to determine the target animation video corresponding to the target object based on each row number range and the corresponding video parameter. The advantage of such setting is that the target animation video can be more consistent with the corresponding preset animation segment, so as to improve the display effect of the target animation video.
[0085] It should be noted that the target animation video can only include the preset video frames, or can include other animation video frames in addition to the preset video frames. Since the rows in the animation map can be used to represent the preset video frames, whether the animation video frames included in the target animation video are all composed of the preset video frames can depend on the video parameters of the target animation video and the range of the number of rows in the animation map.
[0086] It should also be noted that in order to determine the playing effect of the target animation video, after determining the target animation video corresponding to the target object, it can also be played, and in order to make the display screen render the effect of the cluster animation, different playing modes can be used to play different target animation videos.
[0087] Based on the above technical solutions, the video playing parameters corresponding to each target animation video are obtained, and the target animation video is played according to the video playing parameters.
[0088] In this embodiment, the video playing parameters can be parameters for representing the playing situation of the target animation video, or can be understood as playing duration or playing mode and the like when playing the target animation video. The video playing parameters can be parameters generated by the user in the application development stage. Optionally, the video playing parameters can include at least one of loop playing, single playing, playing duration, and the next preset animation segment of the target animation video.
[0089] In actual application, when playing each target animation video, the video playing parameters corresponding to each target animation video can be obtained in advance, and then the corresponding target animation video can be played based on the video playing parameters. For example, when the video playing parameters corresponding to the running animation video include loop playing, and the video playing parameters corresponding to the standby animation video include single playing, the running animation video in the display interface can be played in loop, and the standby animation video can be played in single. The advantage of this setting is that the effect of the cluster animation can be rendered in the display interface, thereby improving the display effect of the target animation video in the display interface.
[0090] The technical scheme of the embodiment of the present disclosure determines the scene identification information to which at least one target object currently belongs, and further determines the target animation video of the at least one target object according to the scene identification information and the animation map corresponding to the at least one target object. The technical scheme solves the problem that the corresponding target animation video cannot be rendered when the target animation video is rendered under the condition that the terminal device has limited performance, and realizes the effect that the target animation video corresponding to each target object can be quickly generated under the premise of reducing the data storage amount. In addition, by making the target animation video correspond to the corresponding scene identification information, different target animation videos can be simultaneously rendered in the same display interface, so that the effect of a cluster animation is achieved, and the user experience is improved.
[0091] Figure 3 is a video generation method flowchart provided by the embodiment of the present disclosure. On the basis of the foregoing embodiment, when generating the target animation video corresponding to the target object, it can also be judged whether the target frame number is consistent with the total number of the corresponding row range in the animation map, and the corresponding target animation video is generated based on the judgment result. The specific implementation can be referred to the technical scheme of the present embodiment. Among them, the same or corresponding technical terms as the above embodiments will not be described here.
[0092] As shown in Figure 3 , the method specifically includes the following steps:
[0093] S310, determining the scene identification information to which at least one target object currently belongs.
[0094] S320, determining the row range and the total number of rows corresponding to the scene identification information in the animation map based on the scene identification information and the mapping relationship.
[0095] In the present embodiment, after determining the scene identification information to which each target object currently belongs, the mapping relationship between the scene identification information and the row range in the animation map can be used to determine the row range and the total number of rows corresponding to each scene identification information in the animation map. The row range can be used to represent the frame number range of the preset video frame corresponding to the preset animation segment. The total number of rows can be used to represent the total number of preset video frames corresponding to the preset animation segment.
[0096] In actual application, after determining the scene identification information, the mapping relationship between the scene identification information and the corresponding row in the animation map can be obtained, and further, the row range and the total number of rows corresponding to the corresponding scene identification information can be determined in the animation map corresponding to the corresponding target object according to each scene identification information.
[0097] S330, determine whether the target frame number of the target animation video is consistent with the total row number, if yes, execute S340, if not, execute S350-S370.
[0098] In the embodiment, the target frame number can be the total number of animation video frames contained in the target animation video.
[0099] It should be noted that the generation mode of the target animation video corresponding to the case where the target frame number is equal to the total row number is different from the generation mode of the target animation video corresponding to the case where the target frame number is not equal to the total row number.
[0100] In specific implementation, while determining the total row number of each scene identification information in the animation map, the target frame number of the target animation video corresponding to each target object can be determined, and further, whether each target frame number is consistent with the corresponding total row number is determined, so as to determine the target animation video corresponding to each target object based on the determination result.
[0101] It should be noted that when the display interface contains multiple target objects, the target frame numbers of the target animation videos corresponding to the target objects can be the same or different, and the embodiment of the present disclosure does not make specific limitation thereon.
[0102] S340, read the pixel value of each row in the row number range in sequence, so as to render the target object based on the pixel value of each row to obtain the target animation video corresponding to the preset animation segment.
[0103] In the embodiment, when the target frame number is consistent with the total row number, it can be determined that the target frame number of the target animation video is consistent with the preset video frame number of the preset animation segment. Since the pixel value of each row in the animation map corresponds to the display position of each model vertex in the corresponding preset video frame, the pixel value of each row in the corresponding row number range can be read in sequence, and further, for each row pixel value in the row number range, each pixel value can be converted into the display position of each model vertex in the corresponding preset video frame by linear mapping, so as to render the target object based on the display position of each model vertex, and thus the target animation video corresponding to the preset animation segment can be obtained.
[0104] The advantage of such setting is that the effect of quickly generating the target animation video under the premise of reducing the data storage amount is achieved, the generation time of the target animation video is saved, and the user experience is improved.
[0105] S350, based on the target frame number and the total row number, determine the insertion frame number of the video frame inserted in the adjacent two preset video frames.
[0106] In the embodiment, when the target frame number is inconsistent with the total number of rows, i.e., the target frame number is greater than the total number of rows, it can be determined that the target frame number of the target animation video is greater than the preset video frame number of the preset animation segment. At this time, in order to make the preset video frame number of the preset animation segment consistent with the target frame number, the preset animation segment can be processed in the manner of inserting frames. The inserted video frame can be a newly added video frame between the adjacent two preset video frames.
[0107] In actual application, the difference between the target frame number and the total number of rows can be determined first to obtain the video frame number difference between the preset animation segment and the target animation video. Further, based on the video frame number difference, the total number of inserted frames of the video frames inserted in the preset animation segment can be determined. Finally, based on the total number of inserted frames, the number of inserted frames of the video frames inserted in the adjacent two preset video frames can be determined.
[0108] It should be noted that when determining the number of inserted frames of the video frames inserted in the adjacent two preset video frames, the total number of inserted frames can be evenly distributed between each adjacent two preset video frames, or the total number of inserted frames can be randomly distributed between each adjacent two preset video frames, which is not limited in the embodiment of the present disclosure.
[0109] S360, the pixel values of the adjacent two rows in the range of the number of rows are read in sequence, and based on the pixel values corresponding to the same model vertex and the number of inserted frames, the spatial position information corresponding to each model vertex in the inserted video frame is determined.
[0110] In actual application, the pixel values of the adjacent two rows in the range of the number of rows can be read in sequence to determine the pixel values corresponding to the same model vertex in the adjacent two rows. Then, according to these pixel values and the number of inserted frames of the inserted video frame in the current adjacent two rows, the pixel values of the same model vertex in the inserted video frame are determined by linear interpolation. Further, each pixel value is converted into spatial position information by linear mapping, so as to obtain the spatial position information corresponding to each model vertex in the inserted video frame.
[0111] It should be noted that when determining the spatial position information corresponding to each model vertex in the inserted video frame, the spatial position information of each model vertex in the preset video frame can also be determined based on the pixel values of each row in the range of the number of rows.
[0112] S370, based on the inserted video frame and the preset video frame, the target animation video is determined.
[0113] In actual application, after the spatial position information of each model vertex in the inserted video frame and the preset video frame is determined, the target object can be rendered based on the spatial position information to obtain the target animation video corresponding to the target object.
[0114] The advantage of the arrangement is that the problem of the frame number of the target animation video not being equal to that of the preset animation segment is solved, and the pixel information of the inserted video frame is determined based on the pixel information of the adjacent two frames, so that more accurate image information can be obtained, thereby improving the display effect of the target animation video.
[0115] The technical solution of the embodiment of the present disclosure determines the scene identification information to which at least one target object currently belongs, then determines the corresponding row range and total number of rows of the scene identification information in the animation map based on the scene identification information and the mapping relationship, further judges whether the target frame number is consistent with the total number of rows, and based on the judgment result, determines the corresponding target animation video generation mode respectively, so as to finally obtain the target animation video corresponding to the target object, realizes the effect of making the target animation video more consistent with the preset animation segment, and enhances the diversity of the target animation video generation mode, so that the target animation video corresponding to the target object can be quickly obtained in the face of different situations.
[0116] Figure 4 is a video generation method flowchart provided by the embodiment of the present disclosure, and on the basis of the foregoing embodiment, for at least two target objects having a mutual relationship, the target animation video of each target object can also be updated based on the mutual relationship. The specific implementation can be referred to the technical solution of the present embodiment. Among them, the same or corresponding technical terms as the above embodiments are not repeated here.
[0117] As shown in Figure 4 , the method specifically includes the following steps:
[0118] S410, determining the scene identification information to which at least one target object currently belongs.
[0119] S420, determining the target animation video of at least one target object according to the scene identification information and the animation map corresponding to at least one target object.
[0120] S430, if it is detected that there is a mutual relationship between at least two target objects, updating the target animation video of at least two target objects based on the mutual relationship and the target animation video of at least two target objects.
[0121] In the embodiment, the mutual relationship can be understood as a relationship corresponding to an interaction between the at least two target objects. Optionally, the mutual relationship can include a cooperative relationship or a mutual exclusion relationship. The cooperative relationship can be a cooperative relationship between the at least two target objects, and based on the cooperative relationship, a corresponding action is performed. The mutual exclusion relationship can be a relationship corresponding to an action of the at least two target objects having a mutual exclusion effect at the same timestamp. For example, the cooperative relationship can be that when one target object is lifting a heavy object, another target object helps the target object to lift the heavy object; the mutual exclusion relationship can be that when two target objects collide during running, the two target objects can be moved to different tracks to prevent the collision.
[0122] In actual application, when the display interface includes a plurality of target objects, and it is detected that the at least two target objects have a mutual relationship, in order to present the mutual relationship in the display interface in the form of an animation video, the target animation video of the at least two target objects having the mutual relationship can be updated, so that the updated target animation video can continue to be played in the display interface.
[0123] Optionally, based on the mutual relationship and the target animation video of the at least two target objects, the target animation video of the at least two target objects is updated, including: if the mutual relationship is a cooperative relationship or a mutual exclusion relationship, determining a preset animation segment to be updated based on a preset logical relationship; and adjusting the target animation video of the at least two target objects based on a row range of the preset animation segment in an animation map.
[0124] In the embodiment, the logical relationship can be a basis for determining a next preset animation segment of the target animation video, which is preset. For example, when the mutual relationship is a cooperative relationship, the logical relationship can be a cooperative relationship between the at least two target objects; when the mutual relationship is a mutual exclusion relationship, the logical relationship can be that the at least two target objects no longer collide. In actual application, when it is detected that the at least two target objects have a mutual relationship, the target animation video of each target object can be updated, and the target animation video can be updated based on a preset animation segment, and a next preset animation segment of the target animation video corresponding to a current time can be used as a preset animation segment to be updated.
[0125] In actual application, when it is detected that there is a mutual relationship between at least two target objects, and the mutual relationship is a cooperative relationship or a mutual exclusion relationship, a preset logical relationship can be called to determine, based on the logical relationship, a preset animation segment to be updated corresponding to each target object when there is a cooperative relationship, or a preset animation segment to be updated corresponding to each target object when there is a mutual exclusion relationship. Further, based on each preset animation segment, a row range thereof in a corresponding animation map is determined, and pixel values of each row in the row range are read in sequence, so as to render the corresponding target object based on the pixel values of each row, so that the adjusted target animation video corresponds to the corresponding preset animation segment to be updated. For example, if the target animation video corresponding to two target objects is a running animation video, and there is a mutual exclusion relationship between the two target objects, that is, a collision occurs on the same track, for example, a collision occurs on track 2, the preset animation segment to be updated of the two target objects can be determined as an animation segment of switching tracks to continue running. At this time, the target animation video of one of the target objects can be switching to track 1 to continue running, and the target animation video of the other target object can be switching to track 2 to continue running. The advantage of such setting is that for target objects with a mutual relationship, the target animation video can be updated to make the updated target animation video more consistent with the preset logical relationship, so that the target animation video corresponding to each target object is more close to the real world.
[0126] The technical scheme of the embodiment of the present disclosure determines the scene identification information to which at least one target object currently belongs, and then determines the target animation video of the at least one target object according to the scene identification information and the animation map corresponding to the at least one target object. Further, if it is detected that there is a mutual relationship between at least two target objects, the target animation video of the at least two target objects is updated based on the mutual relationship and the target animation video of the at least two target objects, so that the target animation video can be quickly updated under the premise of reducing the amount of stored data, so that the updated target animation video is more close to the real world, and the display effect of the target animation video is improved.
[0127] For example, the technical scheme can be combined with a method for generating a target animation video. Figure 5The flowchart shown illustrates the generation process of the target animation video: 1, creating preset animation segments under different scene identification information; 2, generating an animation map containing each preset animation segment; 3, importing the animation map into a self-developed engine, and simultaneously, splitting each preset animation segment in the animation map based on frame offset, each preset animation segment can include standby animation segments 1st-30th, slow walk animation segments 31st-50th, running animation segments 51st-70th, jumping in place animation segments 71st-90th, and evasion animation segments 91st-130th, etc. 4, rendering the animation map based on a shader; 5, determining at least one target object, which can include target object 1, target object 2, target object 3, target object 4, etc., and simultaneously, reading the scene identification information of each target object; 6, based on the scene identification information, determining the target animation video corresponding to each target object; 7, if target object 1 and target object 2 do not have a mutual relationship, the target animation video can be played repeatedly, or the next preset animation segment of the target animation video is randomly determined to update the target animation video; 8, if target object 1 and target object 2 have a mutual relationship, it is determined whether the mutual relationship is a cooperative relationship or a mutual exclusion relationship; 9, if the mutual relationship is a cooperative relationship, the preset animation segment to be updated is determined according to the cooperative relationship, so as to update the target animation video based on the preset animation segment; 10, if the mutual relationship is a mutual exclusion relationship, the preset animation segment to be updated is determined according to the mutual exclusion relationship, so as to update the target animation video based on the preset animation segment.
[0128] Figure 6 is a video generation device structure schematic diagram provided by the embodiment of the disclosure, as Figure 6 shown, the device comprises a scene identification information determination module 510 and a target animation video determination module 520.
[0129] Among them, the scene identification information determination module 510 is used to determine the scene identification information to which at least one target object currently belongs;
[0130] The target animation video determination module 520 is used to determine the target animation video of the at least one target object according to the scene identification information and the animation map corresponding to the at least one target object.
[0131] Among them, the animation map includes the display position information of each mesh model on the target model corresponding to the target object in the preset video frame, and the target animation video includes the preset video frame.
[0132] On the basis of each technical solution described above, the scene identification information determination module 510 comprises a current position information determination unit and a scene identification information determination unit.
[0133] A current position information determining unit is configured to determine current position information of the at least one target object.
[0134] A scene identification information determining unit is configured to determine a target sub-scene corresponding to the current position information and corresponding scene identification information according to the current position information and pre-set spatial range information corresponding to each sub-scene.
[0135] On the basis of the above technical solutions, the device further comprises a target model creating module and an animation texture generating module.
[0136] The target model creating module is configured to create a target model corresponding to the target object; wherein the target model is composed of at least one mesh model.
[0137] The animation texture generating module is configured to create pre-set animation clips corresponding to the target object under different scene identification information, and generate an animation texture corresponding to the target object according to each pre-set animation clip and each mesh model on the target model.
[0138] The pre-set animation clip is composed of a plurality of video frames and serves as the pre-set video frame.
[0139] On the basis of the above technical solutions, the animation texture generating module comprises a pixel value determining submodule and an animation texture updating submodule.
[0140] The pixel value determining submodule is configured to, for each pre-set animation clip, acquire a first pre-set video frame in the current pre-set animation clip, determine spatial position information of at least three model vertices on each mesh model in the first pre-set video frame, and determine a pixel value of an nth row of pixel points in the animation texture based on the spatial position information; wherein n corresponds to a frame number of the first pre-set video frame in all pre-set animation clips.
[0141] The animation texture updating submodule is configured to acquire a next pre-set video frame of the first pre-set video frame, repeatedly determine a pixel value corresponding to spatial position information of at least three model vertices in each mesh model, and update an nth+1 row in the animation texture until all pre-set video frames in the current pre-set animation clip are traversed.
[0142] Each column in the animation texture corresponds to a model vertex of the mesh model.
[0143] On the basis of the above technical solutions, the pixel value determining submodule comprises a pixel value determining unit and a pixel value assigning unit.
[0144] The pixel value determining unit is configured to determine a pixel value corresponding to each spatial position information.
[0145] The pixel value assignment unit is used to assign the pixel value to each pixel in the nth row according to the model vertices corresponding to each column of the pre-set animation texture.
[0146] Based on the above technical solutions, each column of the animation texture represents the corresponding model vertex, each row represents the preset video frame in each preset animation segment, and the pixel value of each pixel in the animation texture is the display position of the model vertex in the corresponding preset video frame.
[0147] Based on the above technical solutions, the device further includes: a mapping relationship establishment module.
[0148] The mapping relationship establishment module is used to establish a mapping relationship between the scene identification information and the corresponding row number according to the row number corresponding to the preset animation segment in the animation texture, so as to determine the target animation video of the corresponding target object based on the mapping relationship.
[0149] Based on the above technical solutions, the target animation video determination module 520 is specifically used to determine the target animation video according to the scene identification information, the animation texture corresponding to the at least one target object, and the video parameters corresponding to the target animation video.
[0150] Based on the above technical solutions, the video parameters include the target frame number of the target animation video, and the target animation video determination module 520 includes: a line number range determination unit and a target animation video determination unit.
[0151] The row number range determination unit is used to determine the row number range and total number of rows corresponding to the scene identification information in the animation texture based on the scene identification information and the mapping relationship;
[0152] The target animation video determination unit is used to render the target object based on the pixel values of each row within the range of the number of rows if the target frame number is equal to the total number of rows, thereby obtaining a target animation video corresponding to the preset animation segment.
[0153] Based on the above technical solutions, the device further includes: an insertion frame number determination module, a spatial position information determination module, and a target animation video determination module.
[0154] The insertion frame number determination module is used to determine the number of video frames to be inserted between two adjacent preset video frames based on the target frame number and the total number of rows if the target frame number is greater than the total number of rows.
[0155] The spatial position information determination module is configured to sequentially read pixel values of two adjacent pixels in the row number range, and determine spatial position information corresponding to each model vertex in the inserted video frame based on the pixel values corresponding to the same model vertex and the inserted frame number.
[0156] The target animation video determination module is configured to determine the target animation video based on the inserted video frame and the preset video frame.
[0157] On the basis of the above technical solutions, the device further comprises a target animation video updating module.
[0158] The target animation video updating module is configured to, if it is detected that there is a mutual relationship between at least two target objects, update target animation videos of the at least two target objects based on the mutual relationship and the target animation videos of the at least two target objects.
[0159] On the basis of the above technical solutions, the mutual relationship comprises a cooperative relationship or a mutual exclusion relationship, and the target animation video updating module comprises a preset animation segment determination unit and a target animation video adjustment unit.
[0160] The preset animation segment determination unit is configured to, if the mutual relationship is a cooperative relationship or a mutual exclusion relationship, determine a preset animation segment to be updated based on a pre-set logical relationship.
[0161] The target animation video adjustment unit is configured to adjust the target animation videos of the at least two target objects based on a row number range of the preset animation segment in the animation map.
[0162] On the basis of the above technical solutions, the device further comprises a target animation video playing module.
[0163] The target animation video playing module is configured to play the target animation video according to a video playing parameter corresponding to each target animation video.
[0164] On the basis of the above technical solutions, the video playing parameter comprises at least one of a loop playing, a single playing, a playing time length, and a next preset animation segment of the target animation video.
[0165] The technical solution of this disclosure, by determining the scene identification information to which at least one target object currently belongs, and further, by determining the target animation video of at least one target object based on the scene identification information and the animation texture corresponding to at least one target object, solves the problem that the corresponding target animation video cannot be rendered when rendering the target animation video under the condition of limited terminal device performance. It achieves the effect of quickly generating target animation videos corresponding to each target object while reducing data storage. Furthermore, by making the target animation video correspond to the corresponding scene identification information, different target animation videos can be rendered simultaneously on the same display interface, thereby achieving the effect of clustered animation and improving the user experience.
[0166] The video generation apparatus provided in this disclosure can execute the video generation method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects of executing the method.
[0167] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the protection scope of the embodiments of this disclosure.
[0168] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Refer to the following... Figure 7 It illustrates an electronic device suitable for implementing embodiments of the present disclosure (e.g., Figure 7 The diagram below shows the structure of the terminal device or server 500. The terminal device in this embodiment may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and vehicle terminals (e.g., vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 7 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0169] like Figure 7As shown, the electronic device 500 can include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501 that can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 502 or loaded into a random access memory (RAM) 503 from a storage device 508. Various programs and data required for the operation of the electronic device 500 are also stored in the RAM 503. The processing device 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0170] Generally, the following devices can be connected to the I / O interface 505: input devices 506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 508 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 509. The communication devices 509 can allow the electronic device 500 to communicate wirelessly or wired with other devices to exchange data. Although Figure 7 The electronic device 500 is shown with various devices, but it should be understood that not all of the shown devices are required to be implemented or possessed. More or fewer devices can alternatively be implemented or possessed.
[0171] In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network through the communication devices 509, or installed from the storage devices 508, or installed from the ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are performed.
[0172] The names of the messages or information exchanged between the plurality of devices in the embodiments of the present disclosure are only for illustrative purposes, and are not intended to limit the scope of the messages or information.
[0173] The electronic device provided by the embodiments of the present disclosure and the video determination method provided by the above-mentioned embodiments belong to the same inventive concept, and the technical details not described in detail in the present embodiments can be referred to the above-mentioned embodiments, and the present embodiments have the same beneficial effects as the above-mentioned embodiments.
[0174] The embodiments of the present disclosure provide a computer storage medium having a computer program stored thereon, which, when executed by a processor, implements the video generation method provided by the above-mentioned embodiments.
[0175] Note that the computer readable medium described above in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination thereof. The computer readable storage medium can be, for example and without limitation, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any suitable combination of the foregoing. More specific examples of the computer readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium can be any tangible medium that contains or stores a program used by or in connection with an instruction execution system, apparatus or device. In the present disclosure, a computer readable signal medium can include a computer readable program code carried in a baseband or as a part of a carrier wave, in which the computer readable program code can be used by or in connection with an instruction execution system, apparatus or device. Such a propagated computer readable signal medium can take various forms, including but not limited to electro-magnetic, optical or any suitable combination of the foregoing. The computer readable signal medium can also be any computer readable medium that can be used to carry or transmit a program for use by or in connection with an instruction execution system, apparatus or device, except for the computer readable storage media described above. The program code carried by the computer readable media can be transmitted in any suitable media, including but not limited to wire, cable, fiber optic, RF (radio frequency), or any suitable combination of the foregoing.
[0176] In some embodiments, the client, server, or both can communicate using any current known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include local area networks ("LAN"), wide area networks ("WAN"), the Internet, and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any current known or future developed networks.
[0177] The computer readable medium described above can be included in the electronic device described above; or can exist separately from the electronic device, and can not be assembled in the electronic device.
[0178] The computer readable medium described above carries one or more programs, when the one or more programs are executed by the electronic device, cause the electronic device to:
[0179] determine scene identification information to which the at least one target object currently belongs;
[0180] determine a target animation video of the at least one target object according to the scene identification information and an animation map corresponding to the at least one target object;
[0181] The animation map includes display position information of each mesh model on a target model corresponding to the target object in preset video frames, and the target animation video includes the preset video frames.
[0182] Alternatively, the computer readable medium carries one or more programs, when the one or more programs are executed by the electronic device, the electronic device is caused to:
[0183] determine scene identification information to which the at least one target object currently belongs;
[0184] determine a target animation video of the at least one target object according to the scene identification information and an animation map corresponding to the at least one target object;
[0185] The animation map includes display position information of each mesh model on a target model corresponding to the target object in preset video frames, and the target animation video includes the preset video frames.
[0186] Computer program code for carrying out operations of the present disclosure can be written in one or more programming languages or combinations of languages including object oriented programming languages such as Java, Smalltalk, C++ or conventional procedural programming languages such as "C" or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0187] The flow and block diagrams in the drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flow and block diagrams can represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks may be executed in the reverse order, depending on the functionality involved. It will also be noted that each block of the block diagrams and / or flowchart illustrations, and combinations thereof, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0188] The units described in the embodiments of the present disclosure can be implemented by software, or by hardware. In some cases, the name of the unit does not constitute a limitation on the unit itself. For example, the first obtaining unit can also be described as a unit for obtaining at least two Internet protocol addresses.
[0189] The functions described above in the specification can be implemented in part or in whole by one or more hardware logic components. For example, and without limitation, illustrative types of hardware logic components that can be used include Field-programmable Gate Arrays (FPGAs), Program-specific Integrated Circuits (ASICs), Program-specific Standard Products (ASSPs), System-on-a-chip systems (SOCs), Complex Programmable Logic Devices (CPLDs), etc.
[0190] In the context of the present disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium will include one or more of: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0191] According to one or more embodiments of the present disclosure, Example One provides a video generation method, the method comprising:
[0192] determining scene identification information to which the at least one target object currently belongs;
[0193] determining a target animation video of the at least one target object according to the scene identification information and an animation map corresponding to the at least one target object;
[0194] wherein the animation map comprises display position information of each mesh model on a target model corresponding to the target object in preset video frames, and the target animation video comprises the preset video frames.
[0195] According to one or more embodiments of the present disclosure, Example Two provides a video generation method, which further comprises:
[0196] Optionally, current position information of the at least one target object is determined;
[0197] According to the current position information and pre-set spatial range information corresponding to each sub-scene, a target sub-scene corresponding to the current position information and corresponding scene identification information are determined.
[0198] According to one or more embodiments of the present disclosure, Example Three provides a video generation method, which further comprises:
[0199] Optionally, a target model corresponding to the target object is created, wherein the target model is composed of at least one mesh model;
[0200] Pre-set animation clips corresponding to the target object under different scene identification information are created, and an animation map corresponding to the target object is generated according to each pre-set animation clip and each mesh model on the target model;
[0201] wherein the pre-set animation clip is composed of multiple video frames and serves as the preset video frames.
[0202] According to one or more embodiments of the present disclosure, Example Four provides a video generation method, which further comprises:
[0203] Optionally, for each pre-set animation clip, a first preset video frame in the current pre-set animation clip is obtained, spatial position information of at least three model vertices on each mesh model in the first preset video frame is determined, and pixel values of nth row of pixel points in the animation map are determined based on the spatial position information; wherein n corresponds to a frame number of the first preset video frame in all pre-set animation clips.
[0204] acquiring a next preset video frame of the first preset video frame, and repeatedly performing the determining of the pixel value corresponding to the spatial position information of the at least three model vertices of the mesh model and the updating in the n+1th row of the animation map until all the preset video frames in the current preset animation segment are traversed;
[0205] wherein each column in the animation map corresponds to a model vertex of the mesh model.
[0206] According to one or more embodiments of the present disclosure, Example Five provides a video generation method, the method further comprising:
[0207] Optionally, the pixel value corresponding to each spatial position information is determined.
[0208] According to the model vertex corresponding to each column in the animation map preset, the pixel value is assigned to each pixel point in the n th row.
[0209] According to one or more embodiments of the present disclosure, Example Six provides a video generation method, the method further comprising:
[0210] Optionally, each column of the animation map represents a corresponding model vertex, each row represents a preset video frame in a preset animation segment, and the pixel value of each pixel point in the animation map is the display position of the model vertex in the corresponding preset video frame.
[0211] According to one or more embodiments of the present disclosure, Example Seven provides a video generation method, the method further comprising:
[0212] Optionally, according to the number of rows corresponding to the preset animation segment in the animation map, a mapping relationship between the scene identification information and the corresponding number of rows is established, so as to determine the target animation video of the corresponding target object based on the mapping relationship.
[0213] According to one or more embodiments of the present disclosure, Example Eight provides a video generation method, the method further comprising:
[0214] Optionally, according to the scene identification information, the animation map corresponding to the at least one target object, and the video parameter corresponding to the target animation video, the target animation video is determined.
[0215] According to one or more embodiments of the present disclosure, Example Nine provides a video generation method, the video parameter comprising a target frame number of a target animation video, the method further comprising:
[0216] Optionally, based on the scene identification information and the mapping relationship, the number of rows corresponding to the scene identification information in the animation map and the total number of rows are determined.
[0217] If the target frame number is equal to the total number of rows, pixel values of each row in the row number range are sequentially read to render the target object based on the pixel values of each row, so as to obtain a target animation video corresponding to the preset animation clip.
[0218] According to one or more embodiments of the present disclosure, Example Ten provides a video generation method, the method further comprising:
[0219] Optionally, if the target frame number is greater than the total number of rows, based on the target frame number and the total number of rows, an insertion frame number of inserted video frames in adjacent two preset video frames is determined;
[0220] Pixel values of adjacent two in the row number range are sequentially read, and based on the pixel values corresponding to the same model vertex and the insertion frame number, spatial position information corresponding to each model vertex in the inserted video frame is determined;
[0221] Based on the inserted video frame and the preset video frame, the target animation video is determined.
[0222] According to one or more embodiments of the present disclosure, Example Eleven provides a video generation method, the method further comprising:
[0223] Optionally, if it is detected that there is a mutual relationship between at least two target objects, based on the mutual relationship and the target animation video of the at least two target objects, the target animation video of the at least two target objects is updated.
[0224] According to one or more embodiments of the present disclosure, Example Twelve provides a video generation method, the mutual relationship comprising a cooperative relationship or a mutual exclusion relationship, the method further comprising:
[0225] Optionally, if the mutual relationship is a cooperative relationship or a mutual exclusion relationship, a preset animation clip to be updated is determined based on a pre-set logical relationship;
[0226] Based on the row number range of the preset animation clip in the animation map, the target animation video of the at least two target objects is adjusted.
[0227] According to one or more embodiments of the present disclosure, Example Thirteen provides a video generation method, the method further comprising:
[0228] Optionally, based on a video playing parameter corresponding to each target animation video, the target animation video is played.
[0229] According to one or more embodiments of the present disclosure, Example Fourteen provides a video generation method, the method further comprising:
[0230] Optionally, the video playing parameter comprises at least one of loop playing, single playing, playing duration, and a next preset animation clip of the target animation video.
[0231] According to one or more embodiments of the present disclosure, Example XV provides a video generation apparatus, comprising:
[0232] a scene identification information determination module configured to determine scene identification information to which at least one target object currently belongs;
[0233] a target animation video determination module configured to determine a target animation video of the at least one target object according to the scene identification information and an animation map corresponding to the at least one target object;
[0234] wherein the animation map comprises display position information of each mesh model on a target model corresponding to the target object in a preset video frame, and the target animation video comprises the preset video frame.
[0235] The above description is merely preferred embodiments of the present disclosure and a description of the principles of the technology employed. It should be understood by those skilled in the art that the disclosed scope of the present disclosure is not limited to the technical solutions formed by the specific combinations of the above technical features, and should also encompass other technical solutions formed by any combinations of the above technical features or equivalent features without departing from the above disclosed concept. For example, the above features can be replaced with other technical features disclosed in the present disclosure (but not limited to) having similar functions to form technical solutions.
[0236] Furthermore, while operations are depicted in a particular, chronological sequence in this disclosure, this should not be understood as requiring such order unless specifically specified. In some cases, for example, multiple operations can be performed at the same time. In addition, while a number of specific implementation details have been discussed, these should not be construed as limiting the scope of the disclosure. Certain features described in the context of separate embodiments can also be implemented in combination. Conversely, various features described in the context of a single embodiment can also be implemented separately or in any suitable subcombination.
[0237] Although the subject matter has been described in language specific to structural features and / or methodological acts, it is to be understood that the subject defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.
Claims
1. A method of video generation, the method comprising: The method comprises: determining scene identification information to which at least one target object currently belongs; determining a target animation video of the at least one target object according to the scene identification information and an animation map corresponding to the at least one target object; wherein the animation map comprises display position information of at least part of mesh models on a target model corresponding to the target object in preset video frames, and the target animation video comprises the preset video frames; each column of the animation map represents a model vertex of each mesh model on the target model corresponding to the target object, and each row represents a preset video frame in a preset animation segment of the target object under different scene identification information; the determination manner of the target animation video of the target object comprises: determining a target animation video corresponding to the target object according to a pre-established mapping relationship, the scene identification information and the animation map corresponding to the target object; wherein the mapping relationship represents a corresponding relationship between the scene identification information and a row range in the animation map.
2. The method of claim 1, wherein, The determination of the scene identification information to which the at least one target object currently belongs comprises: determining current position information of the at least one target object; determining a target sub-scene corresponding to the current position information and corresponding scene identification information according to the current position information and pre-set spatial range information corresponding to at least one sub-scene.
3. The method of claim 1, wherein, The method further comprises: creating a target model corresponding to the target object; wherein the target model is composed of at least one mesh model; creating preset animation segments corresponding to the target object under different scene identification information, and generating an animation map corresponding to the target object according to each preset animation segment and each mesh model on the target model; wherein the preset animation segment is composed of a plurality of video frames and serves as the preset video frame.
4. The method of claim 3, wherein, The generation of the animation map corresponding to the target object according to each preset animation segment and each mesh model on the target model comprises: for each preset animation segment, obtaining a first preset video frame in the current preset animation segment, determining spatial position information of at least three model vertices on each mesh model in the first preset video frame, and determining pixel values of n-th pixel points in the animation map based on the spatial position information; wherein n corresponds to a frame number of the first preset video frame in all preset animation segments; obtaining a next preset video frame of the first preset video frame, and repeatedly determining pixel values corresponding to the spatial position information of the at least three model vertices on each mesh model and updating in the n+1-th row of the animation map until all preset video frames in the current preset animation segment are traversed; wherein each column in the animation map corresponds to a model vertex of the mesh model.
5. The method of claim 4, wherein, The determination of the pixel values of the n-th pixel points in the animation map based on the spatial position information comprises: determining pixel values corresponding to each spatial position information; assigning the pixel values to each pixel point in the n-th row according to a pre-set model vertex corresponding to each column in the animation map.
6. The method according to any one of claims 1 to 5, characterized in that, Each row of the animation map represents a corresponding model vertex, and each column represents a preset video frame in each preset animation segment. A pixel value of each pixel point in the animation map is a display position of the model vertex in the corresponding preset video frame.
7. The method of claim 3, wherein, Further comprising: According to a number of rows corresponding to the preset animation segment in the animation map, a mapping relationship between the scene identification information and the corresponding number of rows is established, so as to determine the target animation video of the corresponding target object based on the mapping relationship.
8. The method of claim 1, wherein, The determination of the target animation video of the at least one target object according to the scene identification information and the animation map corresponding to the at least one target object comprises: According to the scene identification information, the animation map corresponding to the at least one target object, and the video parameter corresponding to the target animation video, the target animation video is determined.
9. The method of claim 8, wherein, The video parameter comprises a target frame number of the target animation video, and the determination of the target animation video according to the scene identification information, the animation map corresponding to the at least one target object, and the video parameter corresponding to the target animation video comprises: Based on the scene identification information and the mapping relationship, a range of the number of rows and a total number of rows corresponding to the scene identification information in the animation map are determined; If the target frame number is equal to the total number of rows, pixel values of each row in the range of the number of rows are read in sequence, and the target object is rendered based on the pixel values of each row to obtain the target animation video corresponding to the preset animation segment.
10. The method of claim 9, wherein, Further comprising: If the target frame number is greater than the total number of rows, the number of inserted frames of the inserted video frame between adjacent two preset video frames is determined based on the target frame number and the total number of rows; The pixel values of adjacent two rows in the range of the number of rows are read in sequence, and the spatial position information of each model vertex corresponding to the inserted video frame is determined based on the pixel values corresponding to the same model vertex and the number of inserted frames; The target animation video is determined based on the inserted video frame and the preset video frame.
11. The method of claim 1, wherein, Further comprising: If it is detected that there is a mutual relationship between at least two target objects, the target animation video of the at least two target objects is updated based on the mutual relationship and the target animation video of the at least two target objects.
12. The method of claim 11, wherein, The mutual relationship comprises a cooperative relationship or a mutual exclusion relationship, and correspondingly, the updating of the target animation video of the at least two target objects based on the mutual relationship and the target animation video of the at least two target objects comprises: If the mutual relationship is a cooperative relationship or a mutual exclusion relationship, a preset animation segment to be updated is determined based on a pre-set logical relationship; The target animation video of the at least two target objects is adjusted based on the range of the number of rows of the preset animation segment in the animation map.
13. The method of claim 1, wherein, Further comprising: The target animation video is played according to the video playing parameter corresponding to each target animation video.
14. The method of claim 13, wherein, The video playing parameter comprises at least one of loop playing, single playing, playing duration, and the next preset animation segment of the target animation video.
15. A video generating apparatus, comprising: Comprise: A scene identification information determination module is configured to determine scene identification information to which at least one target object currently belongs. The target animation video determination module is configured to determine a target animation video of the at least one target object according to the scene identification information and an animation map corresponding to the at least one target object. The animation map includes display position information of each mesh model on a target model corresponding to the target object in preset video frames, and the target animation video includes the preset video frames. Each row of the animation map represents a model vertex of each mesh model on the target model corresponding to the target object, and each column represents a preset video frame in a preset animation clip of the target object under different scene identification information. The target animation video determination module is specifically configured to determine a target animation video corresponding to the target object according to a pre-established mapping relationship, the scene identification information, and the animation map corresponding to the target object. The mapping relationship represents a corresponding relationship between the scene identification information and a row range in the animation map.
16. An electronic device, comprising: The electronic device includes: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the video generation method as claimed in any one of claims 1-14.
17. A storage medium containing computer-executable instructions for performing the video generation method as claimed in any one of claims 1-14 when executed by a computer processor.
Citation Information
Patent Citations
Virtual article presentation method and device, terminal and computer readable storage medium
CN112752162A