Game object stylization method and apparatus, and storage medium
By acquiring keyframes from game video files and determining the frame extraction blueprint file, selecting frames to retain for frame extraction processing, and generating a stutter-style target video file, the problem of game object movements appearing smooth in the video is solved, thus improving the user experience.
Patent Information
- Application Number
- CN202111658936.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-30
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2041-12-30
AI Technical Summary
Existing technologies struggle to perform frame-by-frame stylization on game objects in game video files, resulting in game object movements appearing smooth rather than stuttering in the video, thus impacting the user experience.
By acquiring keyframes from the game video file, a frame extraction blueprint file is determined. Based on the blueprint file, frames are selected from the keyframes to be retained, and frame extraction is performed to generate a target video file with a stuttering style.
It reduces the difficulty of making game object movements appear stuttering in videos, thus improving the user experience.
Smart Images

Figure CN114392552B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of stylization processing technology for game objects, and more particularly to a method, apparatus, and storage medium for stylizing game objects. Background Technology
[0002] Frame-by-frame animation is a form of animation that breaks down animation actions into consecutive keyframes. In other words, it involves drawing different content frame by frame on the timeline, playing them continuously to create the animation. Because the content of each frame in a frame-by-frame animation sequence is different, its production method is relatively complex. However, its advantages are also obvious: frame-by-frame animation offers great flexibility, similar to a movie playback mode, making it well-suited for performing delicate animations. Examples include: characters or animals turning sharply, the movement of hair and clothing, walking, talking, and sophisticated 3D effects. However, in game development, game video files are usually obtained by adjusting models (game objects in the game video), making it difficult to perform frame-by-frame stylization on the game objects within the game video file. Summary of the Invention
[0003] This specification provides a method, apparatus, and storage medium for stylizing game objects, in order to partially solve the aforementioned problems existing in the prior art.
[0004] The embodiments in this specification adopt the following technical solutions:
[0005] Firstly, this application provides a method for stylizing game objects, including:
[0006] Obtain a game video file; wherein the game video file contains several keyframes;
[0007] Determine the frame extraction blueprint file; wherein, the frame extraction blueprint file is used to determine the target frames to be retained from the plurality of keyframes;
[0008] The keyframes in the game video file are extracted based on the frame extraction blueprint file to obtain a target video file with a stuttering style.
[0009] In an optional embodiment of this specification, determining the frame extraction blueprint file includes:
[0010] Based on the position information of the keyframes, several designated positions are determined from the video track of the game video file; wherein, the position information is used to characterize the position of the keyframe on the video track, and the designated position is the position of the reserved frame on the video track;
[0011] Generate a frame-skipping blueprint file based on the specified location.
[0012] In an optional embodiment of this specification, determining the frame extraction blueprint file includes:
[0013] Based on the feature information of the game objects represented by the keyframes, several positions are determined from the video track of the game video file as designated positions; wherein, the designated positions are the positions of the reserved frames on the video track;
[0014] Generate a frame-skipping blueprint file based on the specified location.
[0015] In an optional embodiment of this specification, based on the feature information of the game objects represented by the plurality of keyframes, a plurality of positions are determined from the video track of the game video file as designated positions, including:
[0016] From the aforementioned keyframes, a first frame is determined, wherein the similarity between the game object feature information of the first frame and the game object feature information of the adjacent keyframes on the video track is less than a similarity threshold.
[0017] Determine the specified location based on the position of the first frame.
[0018] In an optional embodiment of this specification, determining the specified position based on the position of the first frame includes:
[0019] Based on the position information of the aforementioned keyframes, the second frame is determined from the aforementioned keyframes;
[0020] For the first frame, from the adjacent second frames, determine the second frame that is closer to it on the video track and use it as the frame to be deleted;
[0021] The second frame (excluding the frame to be deleted) and the position of the first frame on the video track are designated as the positions.
[0022] In an optional embodiment of this specification, the keyframes include a first keyframe and a second keyframe; and, acquiring the game video file includes:
[0023] Obtain the original video file; wherein the original video file includes a plurality of first keyframes, and the plurality of first keyframes are used to generate a plurality of non-keyframes;
[0024] Determine the frame information of the first keyframe;
[0025] Based on the frame information of the first keyframe, the non-keyframes are converted into second keyframes to obtain a game video file containing the aforementioned keyframes.
[0026] In an optional embodiment of this specification, converting the non-keyframe into a second keyframe based on the frame information of the first keyframe includes:
[0027] Based on the frame information of the first key frame, complete the information missing in the non-key frames compared to the first key frame;
[0028] The non-key frame with the information completed is determined as the second key frame.
[0029] In an optional embodiment of this specification, based on the frame information of the first keyframe, supplementing the information missing in the non-keyframes compared to the first keyframe includes:
[0030] For the non-key frame, two adjacent first key frames on the video track are determined as their corresponding reference frames;
[0031] Interpolation calculations are performed on the game object feature information of the reference frame to obtain the game object feature information of the game object in the non-keyframe.
[0032] Secondly, this specification provides a stylization processing apparatus for game objects, the apparatus comprising:
[0033] The game video file acquisition module is configured to acquire a game video file, wherein the game video file contains several keyframes.
[0034] The frame extraction blueprint file determination module is configured to: determine the frame extraction blueprint file; wherein, the frame extraction blueprint file is used to determine the target frames to be retained from the plurality of keyframes;
[0035] The target video file determination module is configured to: extract keyframes from the game video file based on the frame extraction blueprint file to obtain a target video file with a stuttering style.
[0036] Thirdly, this specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the stylization method for game objects described in the first aspect above.
[0037] Fourthly, this specification provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the stylization method for game objects described in the first aspect.
[0038] The above-described at least one technical solution adopted in the embodiments of this specification can achieve the following beneficial effects:
[0039] The stylization processing method, apparatus, and storage medium for game objects in the embodiments of this specification obtain target video files with a stuttering style by processing game video files, which helps to reduce the difficulty of obtaining video of game object movements with a stuttering style based on game video files. Attached Figure Description
[0040] The accompanying drawings, which are included to provide a further understanding of this specification and form part of this specification, illustrate exemplary embodiments and are used to explain this specification, but do not constitute an undue limitation thereof. In the drawings:
[0041] Figure 1 A flowchart illustrating the stylization method for game objects provided in the embodiments of this specification;
[0042] Figure 2 This is a flowchart illustrating the process of converting non-keyframes into keyframes in the stylization method for game objects provided in the embodiments of this specification.
[0043] Figure 3 This is a schematic diagram illustrating the process of processing each frame in the stylization method for game objects provided in the embodiments of this specification.
[0044] Figure 4 A flowchart illustrating the process of determining non-keyframe game object features using the stylization method for game objects provided in the embodiments of this specification;
[0045] Figure 5 A flowchart illustrating the process of determining the retained frames for the stylization processing method of game objects provided in the embodiments of this specification;
[0046] Figure 6 This is a schematic diagram of the structure of the stylization processing device for game objects provided in the embodiments of this specification;
[0047] Figure 7 The embodiments provided in this specification correspond to Figure 1 A schematic diagram of an electronic device. Detailed Implementation
[0048] To make the objectives, technical solutions, and advantages of this specification clearer, the technical solutions of this specification will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments in this specification without creative effort are within the scope of protection of this specification.
[0049] The technical solutions provided in the various embodiments of this specification are described in detail below with reference to the accompanying drawings.
[0050] Before describing the technical solutions in this specification, at least some of the concepts involved in this specification will be explained first.
[0051] Game objects are dynamic objects within a game video file. As the game video file plays, the characteristics of these game objects differ across different frames. It is precisely because of these differences in game object characteristics between frames that the game objects exhibit variations in displacement, rotation, scaling, and color values during playback. This, in turn, allows the game video file to display effects such as scaling, translation, flipping, and fade-in / fade-out. In other words, the game object characteristics described in this specification are characteristics related to the effects of the game video file.
[0052] In this manual, "game objects" refers to the visual content corresponding to the same object and exhibiting certain characteristic differences in different frames of the game video file as it is played. Within a given game video file, there can be one or more game objects; game objects can be foreground objects (e.g., a flying dragon) or background objects (e.g., swaying tree branches). For ease of explanation, the following description uses the example of a single game object in a game video file.
[0053] When animations are categorized by frame rate, they can be divided into two types: keyframe animation and frame-by-frame animation.
[0054] Keyframe animation can depict the continuous movements of characters in animation; that is, in keyframe animation, the movements of characters are usually quite smooth.
[0055] Frame-by-frame animation, also known as staccato animation, is drawn frame by frame. In terms of the terminology, it means that every second of the entire film is a standard 24 frames, hand-drawn frame by frame.
[0056] The video track is also known as the "motion track". It can be understood as a number line, where the nodes on the number line (i.e., the positions on the track) represent time, and the direction of the number line represents the continuation of time. As time continues, if the current moment reaches a node on the number line, the image frame associated with that node is displayed, until the current moment reaches the next node on the number line associated with an image frame.
[0057] Taking the process of creating video using Blender software as an example, the video track can be a layered system of NLA (Non-Linear Animation). At its most basic level, it helps to organize segments.
[0058] In related technologies, to obtain frame-stripped video, the usual practice is to draw each image frame of the frame-stripped video separately, and then establish a relationship between the image frame and its position on the video track. Then, the image frames associated with each position on the video track can be displayed sequentially along the time sequence indicated by the video track, thus obtaining the frame-stripped video.
[0059] Keyframe video and frame-by-frame video each have their advantages. Frame-by-frame video, in particular, offers great flexibility, capable of depicting almost anything desired. Its cinematic playback mode makes it well-suited for detailed video performances, such as: sudden turns of people or animals, flowing hair and clothing, walking, speaking, and sophisticated 3D effects.
[0060] To obtain frame-by-frame video, the usual practice is to draw each frame of the video, which results in a large workload for generating frame-by-frame video.
[0061] Furthermore, in game production scenarios, game video files are usually obtained by adjusting models (game objects in the game video), making it difficult to perform frame-by-frame stylization on the game objects in the game video file.
[0062] For example, in a game development scenario, a paper dragon, made by piecing together or folding paper pieces, needs to be created as a game object. This paper dragon swims in the game video. In the game video produced using relevant video editing techniques, the paper dragon's movement is smooth. However, in the user's perception, the paper dragon should be made of paper, which typically lacks flexibility. If the paper's movements are continuous across frames of the game video, it will create a sense of disharmony for the user. If the frames corresponding to changes in the paper dragon's joints (the connection points between the paper pieces that make up the dragon) are retained, while frames corresponding to changes outside of joints are removed, the paper dragon's texture can be displayed in a stuttering style within the game video. This improves the overall presentation of the game video and enhances the user experience.
[0063] In view of this, this specification provides a method for stylizing game objects, which can efficiently generate target video files with a stuttering style from game videos. The stylization process of game objects in this specification can be performed by a game object stylization processing device. Figure 1 The stylization process for game objects provided in the embodiments of this specification may specifically include one or more of the following steps:
[0064] S100: Obtain game video files.
[0065] The game video file in this manual contains several keyframes, each positioned differently on the video track. The position of a keyframe on the video track is its location information.
[0066] In one optional embodiment of this specification, the keyframes in the game video file are uniformly distributed along the video track. In another optional embodiment of this specification, the keyframes in the game video file are non-uniformly distributed along the video track.
[0067] S102: Determine the frame extraction blueprint file.
[0068] The objective of this specification is to obtain a target video file with a stuttering style, which is composed of retained frames. The frame extraction blueprint file in this specification is used to determine the target frames to be retained from the aforementioned keyframes.
[0069] In an optional embodiment of this specification, the frame extraction blueprint file may record the position of each retained frame on the video track (i.e., "retained position" hereinafter).
[0070] Of course, in another optional embodiment of this specification, the frame extraction blueprint file records the frames to be deleted from the game video file. For the sake of clarity, this specification uses the example of a frame extraction blueprint file recording a specified position.
[0071] In an optional embodiment of this specification, the condition for triggering this step is: identifying a game object in the game video file. It is determined whether the game object is composed of at least two object units. An object unit is a part of a game object that has the same material and is structurally connected. If so, the material of the game object is identified as the target material. It is determined whether the target material matches at least one of the preset materials (e.g., matching if they are the same). If they match, this step is triggered. If they do not match, the matching determination for the object unit is performed again when step S100 is executed next time.
[0072] The preset material includes at least one of the following: paper, rigid material. Rigid material includes metal, glass, etc.
[0073] S104: Perform frame extraction processing on the keyframes in the game video file according to the frame extraction blueprint file to obtain a target video file with a stuttering style.
[0074] By deleting keyframes at specified locations according to the records in the frame extraction blueprint file, a target video file with a stuttering style can be obtained.
[0075] The stylization process of game objects in the embodiments of this specification obtains a target video file with a stuttering style by processing the game video file, which helps to reduce the difficulty of obtaining a video of game object movements with a stuttering style based on the game video file.
[0076] Here are the instructions on how to obtain the game video files:
[0077] S200: Obtain the original video file.
[0078] The original video file includes several first keyframes. These first keyframes may be non-uniformly distributed along the video track. These first keyframes are used to generate several non-keyframes. The original video file may be generated during the game development process.
[0079] S202: Determine the frame information of the first keyframe.
[0080] The frame information of the first keyframe in this specification is used to characterize the correspondence between the first keyframe and its position on the video track, as well as the graphic content of the first keyframe.
[0081] In an optional embodiment of this specification, the original video file may consist of a first keyframe, such as... Figure 3 As shown in Video 1, the video playback device (which may be the aforementioned stylization processing device for game objects) can generate corresponding non-keyframes between any two adjacent first keyframes by interpolating frames between the first keyframes of the original video file, resulting in the following: Figure 2 As shown in video 2. Then, following the display order indicated by the video track, each first keyframe and non-keyframe is displayed sequentially, thus completing the video display.
[0082] In another optional embodiment of this specification, the original video file consists of a first keyframe and non-keyframes. The first keyframe can be characterized by its frame information, and the original video file can also provide an interface for editing the first keyframe (the object of editing can be the frame information of the first keyframe). In contrast, non-keyframes do not possess complete frame information compared to the first keyframe; during the display of the original video file, at least some information of the non-keyframes is calculated by an algorithm. Furthermore, the original video file may not provide an interface for editing non-keyframes.
[0083] Optionally, the inter-frame duration of the resulting raw video file is 1 / FPS.
[0084] In this specification, a frame is distinguished as a key frame (key frames such as the first key frame and the second key frame below) based on whether the frame information is complete.
[0085] In an optional embodiment of this specification, the frame information includes at least: the frame's position information on the video track of the original video file (i.e., which node on the video track the frame is associated with). Position information is included in the frame information regardless of whether a frame is a keyframe or a non-keyframe. Furthermore, the frame information of keyframes also includes game object feature information of the game object. For example, in a video where the movement of a game object is controlled by controlling a skeleton, the game object feature information may include skeleton information.
[0086] In this embodiment, the process of determining the frame information of the first keyframe may be to determine the game object feature information of the game object in the first keyframe, and the position information of the first keyframe on the video track of the original video file, as the frame information of the first keyframe.
[0087] S204: Based on the frame information of the first keyframe, the non-keyframe is converted into a second keyframe to obtain a game video file containing the plurality of keyframes.
[0088] The second keyframe in this specification is a frame with complete frame information, and in terms of information completeness, the second keyframe is the same as the first keyframe. This specification does not restrict whether an interface for editing the frame information needs to be created for the second keyframe.
[0089] In the aforementioned embodiment where the original video file contains only the first keyframe, frame interpolation can be performed between two adjacent first keyframes based on the frame information of each first keyframe to obtain non-keyframes, such as... Figure 2 As shown in video 3. Afterwards, the non-keyframe is converted into a second keyframe.
[0090] In the aforementioned embodiment where the original video file contains both a first keyframe and non-keyframes, the non-keyframes can be determined from each frame of the original video file, and then the non-keyframes can be converted into the second keyframes.
[0091] In an optional embodiment of this specification, non-critical frames can be processed by frame information completion to supplement the information missing from the first critical frame. The processed non-critical frames are then identified as second critical frames, thereby converting non-critical frames into second critical frames.
[0092] Since non-keyframes are located between first keyframes on the video track, and the information of non-keyframes has a certain continuity with the first keyframes adjacent to them, information can be supplemented for each non-keyframe based on its frame information and the frame information of the first keyframes in the original video file (specifically, based on the frame information of the first keyframes adjacent to the non-keyframe).
[0093] By following the steps described above, non-keyframes can be converted into second keyframes. Therefore, each frame in the original video file obtained after these steps becomes a keyframe, and each keyframe contains complete frame information. At this point, removing some frames from the original video file will not affect the display of other frames.
[0094] In an optional embodiment of this specification, the frame extraction process may involve determining the retained frames from the keyframes (including the first and second keyframes) of the original video file based on the frame extraction blueprint file, and then deleting the other keyframes from the original video file, resulting in a target video file as shown below. Figure 3 As shown in video 4.
[0095] The stylization process for game objects described in this manual obtains the target video file by processing the original video file, without having to create each frame of the target video file individually, which helps reduce the workload of creating the target video file.
[0096] Furthermore, in some implementations, the video generation process involves first generating keyframes, then interpolating between them to obtain non-keyframes, resulting in a video that includes both keyframes and non-keyframes. If some frames are deleted to achieve a frame-skipping effect, some keyframes will be removed, consequently deleting the information needed for the interpolation process to obtain non-keyframes, negatively impacting the video quality. However, using the game object stylization method described in this specification, even if some frames are extracted from the video, even if those extracted frames are keyframes, it will not affect the video playback quality.
[0097] As can be seen, the process of converting non-keyframes into keyframes plays a certain role in this specification. The frame extraction processing performed on each keyframe yields the stuttering-style target video file desired by the technical solution described in this specification. The following explains how to complete the information for non-keyframes and how to perform frame extraction processing.
[0098] 1. Complete information for non-key frames.
[0099] In one optional embodiment of this specification, such as Figure 4 As shown, the process of completing the information of non-keyframes is as follows:
[0100] S400: Identify each non-keyframe.
[0101] S402: For each non-key frame, determine the two first key frames adjacent to it on the video track as its corresponding reference frames.
[0102] like Figure 3 As shown in video 2, the reference frames for non-keyframe a are the first keyframe A and the first keyframe B.
[0103] S404: Perform interpolation calculation on the game object feature information of the reference frame to obtain the game object feature information of the game object in the non-keyframe.
[0104] In this specification, non-keyframes themselves contain frame information, for example... Figure 3 The position information of non-keyframe a on the video track is the set of position information of non-keyframe a and game object feature information, which is the frame information of the second keyframe a.
[0105] Specifically, for each non-keyframe, based on the frame information of that non-keyframe (specifically, the position information of that non-keyframe), interpolation calculations are performed on the game object feature information of the reference frame of that non-keyframe to obtain the game object feature information of the game object in the non-keyframe. Since the position information of each non-keyframe is different, the game object feature information of each second keyframe obtained in this embodiment will differ to varying degrees.
[0106] For example, in Figure 3 In the example shown in video 3, the game object feature information in the second keyframe a is different from that in the second keyframe b, resulting in a difference in the images displayed in the second keyframe a and the second keyframe b.
[0107] In an optional embodiment of this specification, for each reference frame of the non-keyframe, a weight value for the reference frame is determined based on the position information of the reference frame and the position information of the non-keyframe. The weight value is negatively correlated with the difference between the position information of the reference frame and the position information of the non-keyframe. That is, the greater the distance between the reference frame and the non-keyframe, the smaller the weight value of the reference frame, indicating a lower similarity between the second keyframe based on the non-keyframe and the reference frame. Furthermore, the sum of the weight values of all reference frames of the non-keyframe is made equal to 1. Then, the game object feature information of each reference frame of the non-keyframe is weighted and summed using the weight values determined in the aforementioned steps to obtain the game object feature information of the second keyframe corresponding to the non-keyframe.
[0108] 2. Perform frame extraction processing.
[0109] The frame extraction process in this specification can be summarized as follows: Selecting the retained frames from each keyframe and deleting the keyframes other than the retained ones; this achieves frame extraction. The process of determining the retained frames in this specification will now be illustrated through the following exemplary embodiments.
[0110] (1) Determine the frames to be retained based on the position information of each keyframe.
[0111] In this embodiment, at least one designated position is first determined from the video track of the game video file. Based on the position information contained in each keyframe, the keyframe whose position information matches the designated position is selected as the retained frame. That is, the designated position in this specification is the position of the retained frame on the video track. A frame extraction blueprint file can then be generated based on the designated position.
[0112] The specified locations in this specification can be determined according to the specified location determination rules. The specified location determination rules can be determined according to actual needs.
[0113] For example, the process of determining the specified position according to the specified position determination rule can be as follows: determine the position of the first node on the video track as the starting position. Starting from the starting position, determine a specified position at intervals of a specified step size (the step size can be a preset value in the specified position determination rule, such as 1 frame, 5 frames, etc.) until the position of the last node on the video track is reached (i.e., the position of the last frame of the original video file on the game video file track).
[0114] Then, for each specified location, keyframes whose location information matches the specified location (e.g., identical is a match) are selected from each keyframe and kept as retained frames.
[0115] In addition to these, there are other rules for determining the specified location, which will not be elaborated here.
[0116] (2) Determine the frames to be retained based on the game object feature information of the keyframes.
[0117] In this embodiment, the first frame can be determined from the keyframes. Then, the first frame is kept as the reserved frame. The position of the first frame is designated as the specified position. A frame extraction blueprint file can then be generated based on the specified position.
[0118] The first frame is defined as the frame in which the similarity between the game object's feature information and the game object's feature information in its adjacent keyframes is lower than a similarity threshold (which can be a preset value). In other words, the first frame is the keyframe that is "not very similar" to its adjacent keyframes.
[0119] Frames that don't quite resemble their adjacent frames often contain information not found in those adjacent frames. If this information is removed along with the keyframe, it could lead to the loss of crucial video information. Therefore, the first frame should be appropriately retained.
[0120] (3) Determine the frames to be retained based on the position information of the keyframes and the game object feature information of the keyframes.
[0121] In this embodiment, the step of determining the reserved frame can be as follows: Figure 5 As shown:
[0122] S500: Determine the first frame from the keyframes.
[0123] The process of determining the first frame in this step can be the same as or similar to the process of determining the first frame in the aforementioned embodiments.
[0124] S502: Determine the second frame from the several key frames based on the position information of the several key frames.
[0125] For example, the second frame in this step can be determined by the aforementioned location determination rules.
[0126] It should be noted that the execution order of step S502 can be before or after step S500.
[0127] The first frame determined by the technical solution in this specification may also be the second frame. If a keyframe is both the second and the first frame, then the keyframe can be preferentially determined as the first frame.
[0128] S504: Determine the reserved frame from the second frame and the first frame.
[0129] In an optional embodiment of this specification, both the second frame and the first frame may be reserved frames.
[0130] In another optional embodiment of this specification, for each first frame, a second frame that is closer to it on the video track can be determined from the adjacent second frames and designated as the frame to be deleted. The second frames other than the frame to be deleted, along with the first frame, are designated as the retained frames. This embodiment enables further compression of the game video file without affecting its playback performance.
[0131] For example, the motion direction of the previous keyframe can be calculated based on the difference between the bone positions of the current keyframe and those of the previous keyframe; similarly, the motion direction of the current keyframe can be calculated based on the difference between the bone positions of the next keyframe and those of the current keyframe. The dot product of the two motion direction vectors is then performed. If the result is greater than 0, it indicates that the angle between the two vectors is less than 90 degrees. In this case, the game video file is considered to have not undergone a sudden change in the current frame, and the current keyframe is a keyframe that can be deleted and does not need to be used as the second frame. If the result is less than 0, it indicates that the angle between the two vectors is greater than 90 degrees, the game video file has undergone a sudden change, and the current keyframe is a keyframe that cannot be deleted and can be used as the second frame.
[0132] (4) Determine the frames to be retained based on the emotional intensity of the game objects in the game video file.
[0133] In this embodiment, game objects in the game video file are first identified. It is then determined whether the game object is a specified game object. For example, if the game object is a foreground object, it is the specified game object; if it is a background object, it is not the specified game object. Optionally, the identification of game objects can be implemented using a target recognition model.
[0134] Based on keyframes in the video file, semantic analysis is performed on the game objects to determine the total emotional intensity value corresponding to each object. The total emotional intensity value is positively correlated with the emotional intensity expressed by the game object. For example, if the game object is a character, and that character expresses strong emotions (happiness, sadness, etc.), then the total emotional intensity value corresponding to that character is high; if the character is calm and does not express strong emotions, then the total emotional intensity value corresponding to that character is low. Optionally, the semantic analysis of the game objects can be implemented using a semantic analysis model.
[0135] Determine if the total emotional intensity value is greater than a first threshold (which can be a preset value). If so, perform semantic analysis on each keyframe in the game video file to determine the emotional intensity score represented by the specified game object in the keyframe. If the determined emotional intensity score is greater than a second threshold, then the keyframe is used as the third frame. If the determined emotional intensity score is not greater than the second threshold, then the keyframe is not used as the third frame.
[0136] Then, the retained frames were determined from the third frame.
[0137] In one optional embodiment of this specification, the third frame can be directly used as the reserved frame; or, the reserved frame can be determined from the second frame in the foregoing embodiments and the third frame in this embodiment; or, the reserved frame can be determined from the first frame in the foregoing embodiments and the third frame in this embodiment.
[0138] For example, a retained frame can be determined from a specified frame and a third frame. The specified frame can be at least one of the aforementioned second frame and first frame. Specifically, for each third frame, a specified frame that is closer to it on the video track from the adjacent specified frames can be determined as the frame to be deleted. The specified frames other than the frame to be deleted, as well as the third frame, are selected as retained frames. This embodiment can achieve further compression of the game video file without affecting the playback effect of the game video file.
[0139] In an optional embodiment of this specification, the game video files in this specification are created using UE4 (Unreal Engine 4).
[0140] Based on the same idea, the embodiments in this specification also provide corresponding... Figure 1 The process shown involves a stylization device for game objects, such as... Figure 6 As shown.
[0141] Figure 6 This is a schematic diagram of the structure of the game object stylization processing device provided in the embodiments of this specification. The game object stylization processing device may include one or more of the following modules:
[0142] The game video file acquisition module 600 is configured to acquire a game video file, wherein the game video file contains several keyframes.
[0143] The frame extraction blueprint file determination module 602 is configured to: determine the frame extraction blueprint file; wherein, the frame extraction blueprint file is used to determine the target to retain frames from the plurality of keyframes;
[0144] The target video file determination module 604 is configured to: perform frame extraction processing on the key frames of the game video file according to the frame extraction blueprint file to obtain a target video file with a stuttering style.
[0145] In an optional embodiment of this specification, the frame extraction blueprint file determination module 602 is specifically configured to: determine several designated positions from the video track of the game video file based on the position information of the several key frames; wherein, the position information is used to characterize the position of the key frame on the video track, and the designated position is the position of the reserved frame on the video track; and generate a frame extraction blueprint file based on the designated positions.
[0146] In an optional embodiment of this specification, the frame extraction blueprint file determination module 602 is specifically configured to: determine several positions from the video track of the game video file as designated positions based on the feature information of the game objects represented by the several keyframes; wherein, the designated positions are the positions of the reserved frames on the video track; and generate a frame extraction blueprint file based on the designated positions.
[0147] In an optional embodiment of this specification, the frame extraction blueprint file determination module 602 is specifically configured to: determine a first frame from the keyframes, wherein the similarity between the game object feature information of the first frame and the game object feature information of the adjacent keyframes on the video track is less than a similarity threshold; and determine a specified position based on the position of the first frame.
[0148] In an optional embodiment of this specification, the frame extraction blueprint file determination module 602 is specifically configured to: determine a second frame from the plurality of key frames based on the position information of the plurality of key frames; for the first frame, determine a second frame that is closer to it on the video track from the adjacent second frames, and use it as the frame to be deleted; and use the second frame other than the frame to be deleted and the position of the first frame on the video track as the designated position.
[0149] In an optional embodiment of this specification, the game video file acquisition module 600 is specifically configured to: acquire an original video file; wherein the original video file includes a plurality of first keyframes, the plurality of first keyframes being used to generate a plurality of non-keyframes; determine the frame information of the first keyframes; and based on the frame information of the first keyframes, convert the non-keyframes into second keyframes to obtain a game video file containing the plurality of keyframes.
[0150] In an optional embodiment of this specification, the game video file acquisition module 600 is specifically configured to: based on the frame information of the first key frame, complete the information missing in the non-key frame compared to the first key frame; and determine the non-key frame after information completion as the second key frame.
[0151] In an optional embodiment of this specification, the game video file acquisition module 600 is specifically configured as follows: for the non-keyframe, determine two first keyframes adjacent to it on the video track as their corresponding reference frames; perform interpolation calculation on the game object feature information of the reference frames to obtain the game object feature information of the game objects in the non-keyframe.
[0152] This specification also provides a computer-readable storage medium storing a computer program that can be used to execute the above-described embodiments. Figure 1The process of stylizing the provided game objects.
[0153] The embodiments in this specification also propose Figure 7 The diagram shows a schematic structural representation of the electronic device. Figure 7 At the hardware level, the electronic device may include a processor, internal bus, network interface, memory, and non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into memory and then runs it to implement the stylization process of any of the aforementioned game objects.
[0154] Of course, in addition to the software implementation method, this specification does not exclude other implementation methods, such as the combination of hardware and software XOR logic devices, etc. In other words, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0155] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many methodological improvements today can be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that a methodological improvement cannot be implemented using hardware physical modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program and "integrate" a digital system onto a PLD themselves, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the target code before compilation must be written in a specific programming language, called a Hardware Description Language (HDL). There are many HDLs, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also understand that by simply performing some logic programming on the method flow using one of these hardware description languages and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.
[0156] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.
[0157] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.
[0158] For ease of description, the above devices are described in terms of function, divided into various units. Of course, in implementing this specification, the functions of each unit can be implemented in one or more software and / or hardware components.
[0159] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0160] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0161] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0162] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0163] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0164] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0165] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0166] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0167] Those skilled in the art will understand that the embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this specification may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0168] This specification can be described in the general context of computer-executable instructions that are executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. This specification can also be practiced in distributed computing environments, where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0169] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0170] The above description is merely an embodiment of this specification and is not intended to limit this specification. Various modifications and variations can be made to this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of the claims of this specification.
Claims
1. A method for stylizing game objects, characterized in that, include: Obtain a game video file; wherein the game video file contains several keyframes; Based on the feature information of the game objects represented by the keyframes, several positions are determined from the video track of the game video file as designated positions; wherein, the designated positions are the positions of the reserved frames on the video track; A frame extraction blueprint file is generated based on the specified location; wherein, the frame extraction blueprint file is used to determine the target frames to be retained from the plurality of keyframes; The keyframes in the game video file are extracted based on the frame extraction blueprint file to obtain a target video file with a stuttering style.
2. The method according to claim 1, characterized in that, Based on the feature information of the game objects represented by the aforementioned keyframes, several positions are determined from the video track of the game video file as designated positions, including: From the aforementioned keyframes, a first frame is determined, wherein the first frame is a frame in which the similarity between the game object feature information and the game object feature information of the adjacent keyframes on the video track is lower than a similarity threshold. Determine the specified location based on the position of the first frame.
3. The method according to claim 2, characterized in that, Determining the specified location based on the position of the first frame includes: Based on the position information of the aforementioned keyframes, the second frame is determined from the aforementioned keyframes; For the first frame, from the adjacent second frames, determine the second frame that is closer to it on the video track and use it as the frame to be deleted; The second frame (excluding the frame to be deleted) and the position of the first frame on the video track are designated as the positions.
4. The method according to claim 1, characterized in that, The keyframes include a first keyframe and a second keyframe. And, obtain game video files, including: Obtain the original video file; wherein the original video file includes a plurality of first keyframes, and the plurality of first keyframes are used to generate a plurality of non-keyframes; Determine the frame information of the first keyframe; Based on the frame information of the first keyframe, the non-keyframes are converted into second keyframes to obtain a game video file containing the aforementioned keyframes.
5. The method according to claim 4, characterized in that, Based on the frame information of the first key frame, the non-key frame is converted into a second key frame, including: Based on the frame information of the first key frame, complete the information missing in the non-key frames compared to the first key frame; The non-key frame with the information completed is determined as the second key frame.
6. The method as described in claim 5, characterized in that, Based on the frame information of the first key frame, information missing in the non-key frames compared to the first key frame is supplemented, including: For the non-key frame, two adjacent first key frames on the video track are determined as their corresponding reference frames; Interpolation calculations are performed on the game object feature information of the reference frame to obtain the game object feature information of the game object in the non-keyframe.
7. A stylization processing device for game objects, characterized in that, The device includes: The game video file acquisition module is configured to acquire a game video file, wherein the game video file contains several keyframes. The frame extraction blueprint file determination module is configured to: determine several positions from the video track of the game video file as designated positions based on the feature information of the game objects represented by the several keyframes; wherein, the designated positions are the positions of the retained frames on the video track; and generate a frame extraction blueprint file based on the designated positions; wherein, the frame extraction blueprint file is used to determine the target retained frames from the several keyframes. The target video file determination module is configured to: extract keyframes from the game video file based on the frame extraction blueprint file to obtain a target video file with a stuttering style.
8. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the stylization processing method for game objects as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the stylization processing method for game objects as described in any one of claims 1-6.
Citation Information
Patent Citations
Video data processing method and device, equipment and storage medium
CN113556582A