Video generation method and device

文档序号:156372 发布日期:2021-10-26 浏览:25次 中文

阅读说明:本技术 一种视频生成方法及装置 (Video generation method and device ) 是由 闫耘 于 2021-07-21 设计创作,主要内容包括:本发明实施例提供了一种视频生成方法及装置,涉及视频处理技术领域。该方法包括:获取游戏数据;所述游戏数据包括:游戏视频和所述游戏视频对应的埋点信息;基于所述埋点信息对所述待处理视频进行分析,生成至少一个游戏事件;获取所述至少一个游戏事件中各所述游戏事件的条件概率;根据各游戏事件的条件概率,确定所述游戏视频中各游戏事件对应的视频片段是否为目标视频片段;对所述目标视频片段进行合成以生成目标视频。本发明实施例用于对游戏视频中的视频片段进行提取。(The embodiment of the invention provides a video generation method and device, and relates to the technical field of video processing. The method comprises the following steps: acquiring game data; the game data includes: game video and embedded point information corresponding to the game video; analyzing the video to be processed based on the embedded point information to generate at least one game event; obtaining a conditional probability for each of the at least one game event; determining whether a video clip corresponding to each game event in the game video is a target video clip according to the conditional probability of each game event; and synthesizing the target video clips to generate the target video. The embodiment of the invention is used for extracting the video clips in the game video.)

1. A method of video generation, comprising:

acquiring game data; the game data includes: game video and embedded point information corresponding to the game video;

analyzing the game video based on the buried point information to generate at least one game event;

obtaining a conditional probability for each of the at least one game event;

determining whether a video clip corresponding to each game event in the game video is a target video clip according to the conditional probability of each game event;

and synthesizing the target video clips to generate the target video.

2. The method of claim 1, wherein the game event comprises at least a virtual character in a target game and a game action performed by the virtual character;

the conditional probability of the game event is an action execution conditional probability, and the action execution conditional probability is a probability that the virtual character executes the game action.

3. The method of claim 2, wherein the determining whether the video segment corresponding to each game event in the game video is the target video segment according to the conditional probability of each game event comprises:

acquiring a first judgment factor;

judging whether the action execution conditional probability of each game event is smaller than the first judgment factor;

if the action execution conditional probability of the game event is smaller than the first judgment factor, determining that the video clip corresponding to the game event is the target video clip.

4. The method of claim 3, wherein the game event further comprises a game outcome generated by the virtual character by performing the game action;

the conditional probability of the game event is an outcome generation conditional probability, which is a probability that the game outcome is generated when the virtual character executes the game action.

5. The method of claim 4, wherein the determining whether the video segment corresponding to each game event in the game video is the target video segment according to the conditional probability of each game event comprises:

acquiring a second judgment factor;

judging whether the result generation conditional probability of each game event is smaller than the second judgment factor;

and if the result generation conditional probability of the game event is smaller than the second highlight judgment factor, determining that the video clip corresponding to the game event is the target video clip.

6. The method of claim 4, wherein the game event further comprises a game outcome generated by the virtual character by performing the game action;

the conditional probability of the game event is an event occurrence conditional probability, which is a product of the action execution conditional probability and the outcome generation conditional probability.

7. The method of claim 6, wherein the determining whether the video segment corresponding to each game event in the game video is the target video segment according to the conditional probability of each game event comprises:

acquiring a third judgment factor;

judging whether the event occurrence condition probability of each game event is smaller than the third judgment factor;

and if the event occurrence conditional probability of the game event is smaller than the third judgment factor, determining that the video clip corresponding to the game event is the target video clip.

8. The method of claim 1, further comprising:

according to a preset time period, obtaining game data in the preset time period, and calculating the game event in the preset period based on the game data; the game event at least comprises a virtual in a target game, a game action executed by the virtual character and a game result generated by the virtual character through executing the game action;

and updating the buried points used for acquiring the buried point information according to the game events.

9. The method of claim 5,

the first and second determination factors are the same.

10. The method of claim 5, further comprising:

according to a preset time period, obtaining a target video clip analysis result in the preset time period;

adjusting the first and/or second determination factors based on the analysis result.

11. A video generation apparatus, comprising:

an acquisition unit configured to acquire game data; the game data includes: game video and embedded point information corresponding to the game video;

the analysis unit is used for analyzing the video to be processed based on the embedded point information to generate at least one game event;

the processing unit is used for acquiring the conditional probability of each game event in the at least one game event and determining whether the video clip corresponding to each game event in the game video is the target video clip according to the conditional probability of each game event;

and the generating unit is used for synthesizing the target video clips to generate the target video.

12. An electronic device, comprising: a memory for storing a computer program and a processor; the processor is configured to cause the electronic device to implement the video generation method of any one of claims 1-10 when the computer program is invoked.

13. A computer-readable storage medium, having stored thereon a computer program which, when executed by a computing device, causes the computing device to implement the video generation method of any one of claims 1-10.

14. A computer program product, characterized in that it causes a computer to implement the video generation method of any of claims 1-10 when said computer program product is run on said computer.

Technical Field

The present invention relates to the field of video processing technologies, and in particular, to a video generation method and apparatus.

Background

With the development of science and technology, electronic games have been merged into mainstream culture and become a very common leisure and entertainment mode. For most games, the time of one game is long, and the game video is inconvenient to be directly used for game propaganda or sharing among game users, so that highlight segments in the game video are often required to be extracted when the game propaganda or sharing is carried out, and the game propaganda or sharing is carried out through highlight video collection consisting of the highlight segments.

Currently, the main way to extract highlight segments in game video is manual extraction. Namely, recording a game picture in the game process to obtain a game video, and editing highlight segments in the game video by manually watching and analyzing the game video. However, the highlight segments in the game video are extracted manually, so that the defects of serious homogeneity, high cost, low efficiency and the like exist.

Disclosure of Invention

In view of this, the present invention provides a video generation method and apparatus, which are used to solve the problem associated with manual highlight segment extraction in a game video.

In order to achieve the above object, the embodiments of the present invention provide the following technical solutions:

in a first aspect, embodiments of the present invention provide a video generation method,

acquiring game data; the game data includes: game video and embedded point information corresponding to the game video;

analyzing the video to be processed based on the embedded point information to generate at least one game event;

obtaining a conditional probability for each of the at least one game event;

determining whether a video clip corresponding to each game event in the game video is a target video clip according to the conditional probability of each game event;

and synthesizing the target video clips to generate the target video.

As an optional implementation manner of the embodiment of the present invention, the game event includes a virtual character in the target game and a game action performed by the virtual character; the conditional probability of the game event is an action execution conditional probability, and the action execution conditional probability is a probability that the virtual character executes the game action.

As an optional implementation manner of the embodiment of the present invention, the determining, according to the conditional probability of each game event, whether a video clip corresponding to each game event in the game video is a target video clip includes:

acquiring a first highlight judgment factor;

judging whether the action execution conditional probability of each game event is smaller than the first highlight judgment factor;

and if the action execution conditional probability of the game event is smaller than the first highlight judgment factor, determining that the video clip corresponding to the game event is the target video clip.

As an optional implementation manner of the embodiment of the present invention, the game event further includes a game result generated by the virtual character by executing the game action;

the conditional probability of the game event is an outcome generation conditional probability, which is a probability that the game outcome is generated when the virtual character executes the game action.

As an optional implementation manner of the embodiment of the present invention, the determining, according to the conditional probability of each game event, whether a video clip corresponding to each game event in the game video is a target video clip includes:

acquiring a second highlight judgment factor;

judging whether the result generation conditional probability of each game event is smaller than the second highlight judgment factor;

and if the result generation conditional probability of the game event is smaller than the second highlight judgment factor, determining that the video clip corresponding to the game event is the target video clip.

As an optional implementation manner of the embodiment of the present invention, the game event further includes a game result generated by the virtual character by executing the game action;

the conditional probability of the game event is an event occurrence conditional probability, which is a product of the action execution conditional probability and the outcome generation conditional probability.

As an optional implementation manner of the embodiment of the present invention, the determining, according to the conditional probability of each game event, whether a video clip corresponding to each game event in the game video is a target video clip includes:

acquiring a third judgment factor;

judging whether the event occurrence condition probability of each game event is smaller than the third judgment factor;

and if the event occurrence conditional probability of the game event is smaller than the third judgment factor, determining that the video clip corresponding to the game event is the target video clip.

As an optional implementation manner of the embodiment of the present invention, the acquiring game data includes:

and periodically acquiring the latest preset number of embedded point information and the game video corresponding to the preset number of embedded point information by taking the preset duration as a period.

As an optional implementation manner of the embodiment of the present invention, the method further includes:

according to a preset time period, obtaining game data in the preset time period, and calculating the game event in the preset period based on the game data; the game event at least comprises a virtual in a target game, a game action executed by the virtual character and a game result generated by the virtual character through executing the game action;

and updating the buried points used for acquiring the buried point information according to the game events.

As an optional implementation manner of the embodiment of the present invention, the first determination factor is the same as the second determination factor.

As an optional implementation manner of the embodiment of the present invention, the method further includes:

according to a preset time period, obtaining a target video clip analysis result in the preset time period;

adjusting the first and/or second determination factors based on the analysis result.

In a second aspect, an embodiment of the present invention provides a video generating apparatus, including:

an acquisition unit configured to acquire game data; the game data includes: game video and embedded point information corresponding to the game video;

the analysis unit is used for analyzing the video to be processed based on the embedded point information to generate at least one game event;

the processing unit is used for acquiring the conditional probability of each game event in the at least one game event and determining whether the video clip corresponding to each game event in the game video is the target video clip according to the conditional probability of each game event;

and the generating unit is used for synthesizing the target video clips to generate the target video.

As an optional implementation manner of the embodiment of the present invention, the game event includes a virtual character in the target game and a game action performed by the virtual character;

the conditional probability of the game event is an action execution conditional probability, and the action execution conditional probability is a probability that the virtual character executes the game action.

As an optional implementation manner of the embodiment of the present invention, the processing unit is specifically configured to obtain a first highlight judging factor; judging whether the action execution conditional probability of each game event is smaller than the first highlight judgment factor; and if the action execution conditional probability of the game event is smaller than the first highlight judgment factor, determining that the video clip corresponding to the game event is the target video clip.

As an optional implementation manner of the embodiment of the present invention, the game event further includes a game result generated by the virtual character by executing the game action;

the conditional probability of the game event is an outcome generation conditional probability, which is a probability that the game outcome is generated when the virtual character executes the game action.

As an optional implementation manner of the embodiment of the present invention, the processing unit is specifically configured to obtain a second highlight judging factor; judging whether the result generation conditional probability of each game event is smaller than the second highlight judgment factor; and if the result generation conditional probability of the game event is smaller than the second highlight judgment factor, determining that the video clip corresponding to the game event is the target video clip.

As an optional implementation manner of the embodiment of the present invention, the game event further includes a game result generated by the virtual character by executing the game action;

the conditional probability of the game event is an event occurrence conditional probability, which is a product of the action execution conditional probability and the outcome generation conditional probability.

As an optional implementation manner of the embodiment of the present invention, the processing unit is specifically configured to obtain a third determination factor; judging whether the event occurrence condition probability of each game event is smaller than the third judgment factor; and if the event occurrence conditional probability of the game event is smaller than the third judgment factor, determining that the video clip corresponding to the game event is the target video clip.

As an optional implementation manner of the embodiment of the present invention, the obtaining unit is further configured to obtain game data in a preset time period according to the preset time period, and calculate the game event in the preset time period based on the game data; the game event at least comprises the virtualization in the target game, the game action executed by the virtual character and the game result generated by the virtual character through executing the game action, and the embedded point used for acquiring the embedded point information is updated according to the game event.

As an optional implementation manner of the embodiment of the present invention, the first determination factor is the same as the second determination factor.

As an optional implementation manner of the embodiment of the present invention, the processing unit is further configured to obtain an analysis result of the target video segment within a preset time period according to the preset time period; adjusting the first and/or second determination factors based on the analysis result.

In a third aspect, an embodiment of the present invention provides an electronic device, including: a memory for storing a computer program and a processor; the processor is configured to, when the computer program is invoked, cause the electronic device to implement the video generation method according to the first aspect or any one of the optional implementation manners of the first aspect.

In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a computing device, the computing device is enabled to implement the video generation method according to the first aspect or any optional implementation manner of the first aspect.

In a fifth aspect, an embodiment of the present invention provides a computer program product, which when run on a computer, causes the computer to implement the video generation method according to the first aspect or any one of the optional embodiments of the first aspect.

The video generation method provided by the embodiment of the invention firstly obtains game data comprising game videos and embedded point information corresponding to the game videos, then analyzes the videos to be processed based on the embedded point information to generate at least one game event, then obtains the conditional probability of each game event, and determines whether a video clip corresponding to each game event in the game videos is a target video clip according to the conditional probability of each game event; and finally, synthesizing the target video clips to generate the target video. Compared with the prior art that highlight segments in the game video are extracted manually, the method and the device for extracting the highlight segments in the game video can determine whether the video segments corresponding to the game events in the game video are the target video segments according to the conditional probability of the game events, and further extract the wonderful segments in the game video, so that the defects of serious homogenization, high cost, low efficiency and the like caused by manually extracting the video segments in the game video can be overcome.

Drawings

The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.

Fig. 1 is a flowchart illustrating steps of a video generation method according to an embodiment of the present invention;

FIG. 2 is a second flowchart illustrating steps of a video generation method according to an embodiment of the present invention;

fig. 3 is a schematic diagram of a video generating apparatus according to an embodiment of the present invention;

fig. 4 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention.

Detailed Description

In order that the above objects, features and advantages of the present invention may be more clearly understood, a solution of the present invention will be further described below. It should be noted that the embodiments of the present invention and features of the embodiments may be combined with each other without conflict.

In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, but the present invention may be practiced in other ways than those described herein; it is to be understood that the embodiments described in this specification are only some embodiments of the invention, and not all embodiments.

In the embodiments of the present invention, words such as "exemplary" or "for example" are used to mean serving as examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "e.g.," an embodiment of the present invention is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion. Further, in the description of the embodiments of the present invention, "a plurality" means two or more unless otherwise specified.

An embodiment of the present invention provides a video generation method, and as shown in fig. 1, the video generation method includes the following steps S101 to S105:

s101, game data are obtained.

Wherein the game data includes: the game video and the embedded point information corresponding to the game video.

The embedded point information corresponding to the game video in the embodiment of the invention refers to: and (4) the embedded point information acquired at the same time of acquiring the game video. That is, the game video and the embedded point information are acquired synchronously, and if a piece of game video and a certain amount of embedded point information are acquired in a certain time period, the embedded point information corresponding to the game video acquired in the time period is the embedded point information acquired in the time period.

In the embodiment of the present invention, the manner of obtaining the embedded point information may be: embedding points are implanted in key positions of the game codes according to game characteristics, and embedding point information is reported through the embedding points in the game process. Specifically, the embedded points may include two types, one type is embedded points for reporting that a game user actively operates a virtual character to execute a game action and generate a game result, and the other type is embedded points for reporting that the virtual character passively executes the game action and generates the game result due to a change in a game environment.

S102, analyzing the video to be processed based on the embedded point information to generate at least one game event.

Optionally, the game event in the embodiment of the present invention includes a virtual character in the target game and a game action performed by the virtual character.

For example, in the embodiment of the present invention, the game event may be represented by two tuples consisting of a virtual character (character) and a game action (action). For example: in a basketball-type game, the game event of a center shot with a three-point shot may be represented as [ center shot, three-point shot ].

Optionally, the game event in the embodiment of the present invention includes a virtual character in the target game, a game action performed by the virtual character, and a game result generated by the virtual character by performing the game action.

For example, in the embodiment of the present invention, the game event may be represented by a triplet composed of a virtual character (character), a game action (action), and a game result (result). For example: in a basketball-type game, the game events of a center shot in three shots may be represented as [ center shot, three shots, center shot ].

S103, acquiring the conditional probability of each game event in the at least one game event.

Specifically, the conditional probability refers to an occurrence probability in the case where one event has occurred while another event has occurred. For example: the probability of occurrence of event 1 under the condition that event 2 has occurred can be expressed as: p (event 1| event 2). Specifically, in the embodiment of the present invention, the conditional probability of the game event may be a probability that the virtual character executes the game action, and is denoted as P (a | C), and the conditional probability of the game event may also be a probability that the virtual character generates the game result when executing the game action, and is denoted as P (R | a, C); the conditional probability of the game event may be a probability that a game action of the game event is executed and a game result of the game event is generated when the virtual character is a virtual character of the game event, and may be represented as P (a | C) × P (R | a, C).

For example: the conditional probability of a game event [ center, three shots, center ] may be P (three shots | center) or P (center | three shots, center) or P (three shots | center) × P (center | three shots, center).

And S104, determining whether the video clip corresponding to each game event in the game video is the target video clip according to the conditional probability of each game event.

Optionally, one implementation manner of determining whether the video segment corresponding to each game event in the game video is the target video segment according to the conditional probability of each game event may be:

judging whether the conditional probability of each game event is smaller than a probability threshold value;

if the conditional probability of the game event is smaller than the threshold probability, determining that the video frequency band corresponding to the game event is a target video clip;

and if the conditional probability of the game event is greater than or equal to the threshold probability, determining that the video frequency band corresponding to the game event is not the target video clip.

For example, the above step S104 will be described below by taking the game as a basketball game. The game events generated by analyzing the video to be processed based on the embedded point information comprise 3 game events, wherein the 3 game events are game events 1[ defending, three-step basket-putting, scoring ], game events 2[ center, three-point ball-throwing, middle-throwing ], and game events 3[ front, penalty and non-middle-throwing ]. Wherein, the conditional probability of the game event 1 is 50%, the conditional probability of the game event 2 is 5%, the conditional probability of the game event 3 is 50%, if the probability threshold is set to 20%, the conditional probability of the game event 2[ center, triple throw, and middle throw ] is less than the threshold probability, and the conditional probabilities of the game event 1[ rear guard, three-step basket, score ] and the game event 3[ front, penalty, and non-middle throw ] are all greater than the threshold probability, so that the video frequency band corresponding to the game event 2[ center, triple throw, and middle throw ] is determined as the target video clip.

And S105, synthesizing the target video clips to generate a target video.

The video generation method provided by the embodiment of the invention firstly obtains game data comprising game videos and embedded point information corresponding to the game videos, then analyzes the videos to be processed based on the embedded point information to generate at least one game event, then obtains the conditional probability of each game event, and determines whether a video clip corresponding to each game event in the game videos is a target video clip according to the conditional probability of each game event; and finally, synthesizing the target video clips to generate the target video. Compared with the prior art that highlight segments in the game video are extracted manually, the method and the device for extracting the highlight segments in the game video can determine whether the video segments corresponding to the game events in the game video are the target video segments according to the conditional probability of the game events, and further extract the wonderful segments in the game video, so that the defects of serious homogenization, high cost, low efficiency and the like caused by manually extracting the video segments in the game video can be overcome.

An implementation of step S104 (determining whether a video clip corresponding to each game event in the game video is a target video clip according to the conditional probability of each game event) will be described below.

The first implementation mode,

The game event comprises a virtual character in a target game and a game action performed by the virtual character; the conditional probability of the game event is an action execution conditional probability, and the action execution conditional probability is a probability that the virtual character executes the game action.

That is, the conditional probability of a game event is P (a | C).

The step S104 (determining whether the video clip corresponding to each game event in the game video is the target video clip according to the conditional probability of each game event) includes the following steps a to d.

Step a, obtaining a first highlight judgment factor.

Optionally, the highlight judging factor in the embodiment of the present invention may be a preset probability value. For example: 30%, 20%, etc.

In addition, the size of the first highlight judging factor is not limited in the embodiment of the present invention, and the first highlight judging factor may be determined according to the data amount of the acquired game data in actual use. For example: when the data volume of the acquired game data is large, the first highlight judgment factor can be set to be small so as to extract a relatively more wonderful video clip, and when the data volume of the acquired game data is small, the first highlight judgment factor can be set to be large so as to avoid that a target video clip cannot be extracted.

And b, judging whether the action execution conditional probability of each game event is smaller than the first highlight judgment factor.

In the step b, if the action execution conditional probability of the game event is smaller than the first highlight judgment factor, the following step c is executed.

And c, determining the video clip corresponding to the game event as the target video clip.

In the step b, if the action execution conditional probability of the game event is greater than or equal to the first highlight judgment factor, the following step d is executed.

And d, determining that the video clip corresponding to the game event is not the target video clip.

For example, the first implementation is described below by taking the game as a basketball game. The game events generated by analyzing the video to be processed based on the embedded point information comprise 3 game events, wherein the 3 game events are game event 1[ defending, three-step basket playing ], game event 2[ center, three-score ball throwing ] and game event 3[ front and penalty ball ]. Wherein, P (three-step basketball shooting | rear defending) ' 50%, P (triple ball throwing | center peak) ' 5%, and P (penalty | front) ' 60%, if the first judgment factor is 20%, the conditional probability of the game event 2[ center peak, triple ball throwing, and middle throwing ] is smaller than the first judgment factor, and the conditional probabilities of the game event 1[ rear defending, three-step basketball shooting, scoring ] and the game event 3[ front peak, penalty ball, and non-middle throwing ] are all larger than the first judgment factor, so that the video frequency band corresponding to the game event 2[ center peak, triple ball throwing, and middle throwing ] is determined as the target video clip.

The second implementation mode,

The game event comprises a virtual character in a target game, a game action executed by the virtual character and a game result generated by the virtual character through executing the game action; the conditional probability of the game event is an outcome generation conditional probability, which is a probability that the game outcome is generated when the virtual character executes the game action.

That is, the conditional probability of each game event is P (R | a, C).

The step S104 (determining whether the video clip corresponding to each game event in the game video is the target video clip according to the conditional probability of each game event) includes the following steps 1 to 4:

and step 1, obtaining a second highlight judgment factor.

In the embodiment of the present invention, the size of the second highlight judging factor is not limited, and the second highlight judging factor may be determined by the data amount of the game data acquired in actual use, and the size of the second highlight judging factor is inversely related to the data amount of the acquired game data. That is, the larger the data amount of the acquired game data is, the smaller the second highlight judgment factor is.

And 2, judging whether the result generation conditional probability of each game event is smaller than the second highlight judgment factor.

In the step 2, if the result generation conditional probability of the game event is smaller than the second highlight judgment factor, the following step 3 is executed.

And 3, determining the video clip corresponding to the game event as the target video clip.

In the step 2, if the conditional probability of the result generation of the game event is greater than or equal to the second highlight judgment factor, the following step 4 is performed.

And 4, determining that the video clip corresponding to the game event is not the target video clip.

Optionally, the first determination factor in the first implementation manner is the same as the second determination factor in the second implementation manner.

For example, the second implementation will be described below by taking the game as a basketball game. At least one game event generated by analyzing the video to be processed based on the embedded point information comprises 3 game events, wherein the 3 game events are game event 1[ defending, three-step basket-putting, scoring ], game event 2[ center front, three-point ball-throwing, middle-throwing ], and game event 3[ front, penalty and non-middle-throwing ]. Wherein, P (score | three-step basketball shooting, back game) ' 80%, P (middle | triple shot, center shot) ' 10%, P (no middle | penalty ball, front shot) ' 10%, if the second judgment factor is 15%, the conditional probabilities of game event 2[ middle shot, triple shot, middle shot ] and game event 3[ front shot, penalty ball, no middle shot ] are less than the second judgment factor, and the conditional probabilities of game event 1[ back game, three-step basketball shooting, score ] are all greater than the second judgment factor, so that the video frequency bands corresponding to game event 2[ middle shot, triple shot, middle shot ] and game event 3[ front shot, penalty ball, no middle shot ] are determined as the target video segments.

The third implementation mode,

The game event comprises a virtual character in a target game, a game action executed by the virtual character and a game result generated by the virtual character through executing the game action; the conditional probability of the game event is an event occurrence conditional probability, which is a product of the action execution conditional probability and the outcome generation conditional probability.

The event occurrence conditional probability in the embodiment of the invention is used for representing the probability of the virtual character executing the game action and generating the game result. Since the conditional probability (action execution conditional probability) of the virtual character executing the game event is P (a | C), the conditional probability (outcome generation conditional probability) of the outcome of the game when the virtual character executes the game event is P (R | a, C), the event occurrence conditional probability of each game event is the product of the action execution conditional probability and the outcome generation conditional probability, and the event occurrence conditional probability of each game event is P (a | C) × P (R | a, C).

The step S104 (determining whether the video clip corresponding to each game event in the game video is the target video clip according to the conditional probability of each game event) includes the following steps i to v:

and step I, acquiring a third judgment factor.

In the embodiment of the present invention, the size of the third determination factor is not limited, and the third determination factor may be determined by the data amount of the acquired game data in actual use, and the size of the third determination factor is inversely related to the data amount of the acquired game data. That is, the larger the data amount of the acquired game data is, the smaller the third determination factor is.

And II, judging whether the event occurrence condition probability of each game event is smaller than the third judgment factor.

In the above step ii, if the event occurrence conditional probability of the game event is smaller than the third determination factor, the following step iii is performed.

And step III, determining the video clip corresponding to the game event as the target video clip.

In the above step ii, if the event occurrence conditional probability of the game event is greater than or equal to the third determination factor, the following step v is executed.

And V, determining that the video clip corresponding to the game event is not the target video clip.

For example, the second implementation will be described below by taking the game as a basketball game. At least one game event generated by analyzing the video to be processed based on the embedded point information comprises 3 game events, wherein the 3 game events are game event 1[ defending, three-step basket-putting, scoring ], game event 2[ center front, three-point ball-throwing, middle-throwing ], and game event 3[ front, penalty and non-middle-throwing ]. Where P (three-step basketball in | rear play) ═ 50%, P (triple ball in | center throw) ═ 5%, P (penalty | front) ═ 60%, P (score | three-step basketball in, rear play) ═ 80%, P (center | triple ball in, center throw) ═ 10%, and P (no center | penalty ball in, center throw) ═ 10%, the conditional probability of game event 1 is: p (three-step basket, back) × P (score | three-step basket, back) = 50% × 80% >, 40%, conditional probability of game event 2 is: p (three-ball-throw | center point) × P (5% × 10% × 0.5%), and the conditional probability of game event 2 is: p (penalty | front) × P (no penalty | front), 60% × 10% × 6%. If the third judgment factor is 2%, the conditional probability of the game event 2[ center, three-point and middle-point throwing ] is smaller than the third judgment factor, and the conditional probability of the game event 1[ rear, three-step basket, score ] and the game event 3[ front, penalty and non-middle-point ] is larger than the third judgment factor, so that the video frequency band corresponding to the game event 2[ center, three-point and middle-point throwing ] is determined to be the target video clip.

As an optional implementation manner of the embodiment of the present invention, on the basis of the first implementation manner and the second implementation manner, the video generation method provided by the embodiment of the present invention further includes:

according to a preset time period, obtaining a target video clip analysis result in the preset time period;

adjusting the first and/or second determination factors based on the analysis result.

In the embodiment, the analysis result of the target video segment within the preset time period may be obtained, and the first determination factor and/or the second determination factor may be adjusted based on the analysis result, so that the embodiment may select the more reasonable first determination factor and/or second determination factor to extract the target video segment.

As an alternative embodiment of the present invention, the step S101 (obtaining game data) includes:

and periodically acquiring the latest preset number of embedded point information and the game video corresponding to the preset number of embedded point information by taking the preset duration as a period.

For example, the preset time period may be 12 hours, 24 hours, a week, etc.

On one hand, the latest preset number of pieces of embedded point information and the game video corresponding to the preset number of pieces of embedded point information are obtained periodically, so that data needing to be processed in the target video clip extraction process can be reduced, and further, the power consumption of relevant equipment and the time consumption of target video clip extraction are reduced. On the other hand, the latest preset number of pieces of embedded point information and the game video corresponding to the preset number of pieces of embedded point information are obtained periodically, so that the influence of game versions and play iteration on judgment of the target video clip can be effectively solved, and the target video clip can be extracted more accurately.

As an alternative embodiment of the present invention, the step S101 (obtaining game data) includes:

artificial intelligence and/or game data generated by a game user during game playing are obtained.

Illustratively, the game data may be obtained by playing a game through at least one of artificial intelligence based on decision trees, artificial intelligence based on reinforcement learning, and artificial intelligence based on mock learning.

At the initial stage of game development, no game user plays the game, so that the game can be played through artificial intelligence, and the game data generated by playing the game through artificial intelligence is acquired, so as to realize cold start of target video clip extraction. With the increase of game data generated when the game user plays the game, the game data acquired by playing the game through artificial intelligence can be gradually reduced according to the data amount of the game data generated when the game user plays the game until the game data generated when the game user plays the game is completely used, so that the extracted target video clip can be more gradually in line with the game video generated when the game user plays the game.

As an optional implementation manner of the embodiment of the present invention, the method further includes:

according to a preset time period, obtaining game data in the preset time period, and calculating the game event in the preset period based on the game data; the game event at least comprises a virtual in a target game, a game action executed by the virtual character and a game result generated by the virtual character through executing the game action;

and updating the buried points used for acquiring the buried point information according to the game events.

According to the embodiment of the invention, the embedded point used for acquiring the embedded point information can be updated according to the game event in the preset period, so that the embedded point information corresponding to the game video capable of generating the target video can be acquired more accurately, and the video generation efficiency is further improved.

As an optional implementation manner of the embodiment of the present invention, referring to fig. 2, on the basis of the video generating method shown in fig. 1, the step S105 (synthesizing the target video segment to generate the target video) includes:

s201, classifying the target video clips according to at least one of the virtual characters, the game actions and the game results, and acquiring at least one target video clip set.

For example: in the basketball game, the target video segments can be classified according to the virtual roles, so that a target video segment set consisting of the target video segments with the forward virtual roles, a target video segment set consisting of the target video segments with the central virtual roles and a target video segment set consisting of the target video segments with the rear virtual roles are obtained.

For another example: in basketball games, the target video clips can be classified according to the virtual characters and game actions, so that a target video clip set consisting of the target video clips of which the virtual characters are all forward and the game actions are all caps, a target video clip set consisting of the target video clips of which the virtual characters are all center and the game actions are all first three-minute balls, and a target video clip set consisting of the target video clips of which the virtual characters are all defended and the game actions are all snap-off are obtained.

S202, generating a target video corresponding to each video clip set according to the target video clips in each video clip set.

For example, the target video clips in each video clip set may be connected end to end, so as to generate the target video corresponding to each video clip set.

For example: the target video clips in the target video clip set, which are formed by the target video clips of which the virtual characters are all the center points and the game actions are all the three-score-throwing target video clips, can be combined into a video of which the center points throw three-score-throwing target video.

And S203, outputting the target video corresponding to each video clip set.

Based on the same inventive concept, as an implementation of the foregoing method, an embodiment of the present invention further provides a video generating apparatus, where an embodiment of the apparatus corresponds to the foregoing method embodiment, and for convenience of reading, details in the foregoing method embodiment are not repeated in this apparatus embodiment one by one, but it should be clear that the video generating apparatus in this embodiment can correspondingly implement all the contents in the foregoing method embodiment.

The embodiment of the invention provides a video generation device, wherein a preview example runs on the video generation device. Fig. 3 is a schematic structural diagram of the video generating apparatus, and as shown in fig. 3, the video generating apparatus 300 includes:

an acquisition unit 31 for acquiring game data; the game data includes: game video and embedded point information corresponding to the game video;

an analysis unit 32, configured to analyze the video to be processed based on the embedded point information, and generate at least one game event;

the processing unit 33 is configured to obtain a conditional probability of each game event in the at least one game event, and determine whether a video clip corresponding to each game event in the game video is a target video clip according to the conditional probability of each game event;

a generating unit 34, configured to synthesize the target video segments to generate a target video.

As an optional implementation manner of the embodiment of the present invention, the game event includes a virtual character in the target game and a game action performed by the virtual character; the conditional probability of the game event is an action execution conditional probability, and the action execution conditional probability is a probability that the virtual character executes the game action.

As an optional implementation manner of the embodiment of the present invention, the processing unit 33 is specifically configured to obtain a first highlight judging factor; judging whether the action execution conditional probability of each game event is smaller than the first highlight judgment factor; and if the action execution conditional probability of the game event is smaller than the first highlight judgment factor, determining that the video clip corresponding to the game event is the target video clip.

As an optional implementation manner of the embodiment of the present invention, the game event further includes a game result generated by the virtual character by executing the game action;

the conditional probability of the game event is an outcome generation conditional probability, which is a probability that the game outcome is generated when the virtual character executes the game action.

As an optional implementation manner of the embodiment of the present invention, the processing unit 33 is specifically configured to obtain a second highlight judging factor; judging whether the result generation conditional probability of each game event is smaller than the second highlight judgment factor; and if the result generation conditional probability of the game event is smaller than the second highlight judgment factor, determining that the video clip corresponding to the game event is the target video clip.

As an optional implementation manner of the embodiment of the present invention, the game event further includes a game result generated by the virtual character by executing the game action;

the conditional probability of the game event is an event occurrence conditional probability, which is a product of the action execution conditional probability and the outcome generation conditional probability.

As an optional implementation manner of the embodiment of the present invention, the processing unit 33 is specifically configured to obtain a third determination factor; judging whether the event occurrence condition probability of each game event is smaller than the third judgment factor; and if the event occurrence conditional probability of the game event is smaller than the third judgment factor, determining that the video clip corresponding to the game event is the target video clip.

As an optional implementation manner of the embodiment of the present invention, the obtaining unit 31 is further configured to obtain game data in a preset time period according to the preset time period, and calculate the game event in the preset time period based on the game data; the game event at least comprises the virtualization in the target game, the game action executed by the virtual character and the game result generated by the virtual character through executing the game action, and the embedded point used for acquiring the embedded point information is updated according to the game event.

As an optional implementation manner of the embodiment of the present invention, the first determination factor is the same as the second determination factor.

As an optional implementation manner of the embodiment of the present invention, the processing unit is further configured to obtain an analysis result of the target video segment within a preset time period according to the preset time period; adjusting the first and/or second determination factors based on the analysis result.

Based on the same inventive concept, the embodiment of the invention also provides electronic equipment. Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 4, the electronic device according to the embodiment includes: a memory 41 and a processor 42, the memory 41 being for storing computer programs; the processor 42 is configured to, when the computer program is called, enable the electronic device to implement the video generation method provided by the above-mentioned embodiment.

An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a computing device, the computing device is enabled to implement the video generation method provided in the foregoing embodiment.

An embodiment of the present invention provides a computer program product, which, when running on a computer, enables the computer to implement the video generation method provided in the above embodiment.

As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media having computer-usable program code embodied in the medium.

The Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.

The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.

Computer readable media include both permanent and non-permanent, removable and non-removable storage media. Storage media may implement information storage by any method or technology, and the information may be computer-readable instructions, data structures, modules of a program, 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 technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.

Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:视频生成方法、装置、终端及存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类