Interactive video script generation method and device, electronic equipment and storage medium
By using image recognition processing of the interactive video storyline structure diagram, script files are automatically extracted and generated, solving the problem of low efficiency in manual generation in existing technologies and achieving efficient script file production.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING IQIYI TECH CO LTD
- Filing Date
- 2023-06-25
- Publication Date
- 2026-07-14
AI Technical Summary
Existing interactive video scripts are mainly created manually, which is inefficient.
By acquiring the plot structure diagram of the interactive video, image recognition processing is performed to extract and generate script files, including identifying element information of video clips and interactive nodes, and generating script files by utilizing the relationships between image elements.
It enables the automatic generation of interactive video script files without human intervention, thus improving production efficiency.
Smart Images

Figure CN116708929B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to an interactive video script generation method, apparatus, electronic device, and storage medium. Background Technology
[0002] Interactive videos are a video format that allows users to interact with the storyline. During playback, users can choose branching storylines based on their preferences. These choices influence the plot's development and direction, making users more immersive and enhancing their sense of participation. Interactive video technology has developed rapidly in recent years, with various platforms releasing numerous interactive video works. These interactive video works are all based on script files.
[0003] However, most interactive video scripts currently rely on manual completion, which is very inefficient. Summary of the Invention
[0004] To address the aforementioned technical problems, this application provides an interactive video script generation method, apparatus, electronic device, and storage medium.
[0005] In a first aspect, embodiments of this application provide an interactive video script generation method, including:
[0006] Obtain the plot structure diagram corresponding to the interactive video, wherein the interactive video includes multiple video segments, and the plot structure diagram is used to describe the playback logic of playing multiple video segments;
[0007] The plot structure diagram is subjected to image recognition processing to obtain multiple first image elements, and second image elements used to represent the relationship between the multiple first image elements;
[0008] Based on each of the first image elements, determine the corresponding first element information, and based on each of the second image elements, determine the corresponding second element information;
[0009] Based on the first element information and the second element information, a script file corresponding to the interactive video is generated, wherein the script file is used to record the playback logic.
[0010] In one possible implementation, determining the corresponding first element information based on each first image element includes:
[0011] Determine the first element region corresponding to the first image element from the plot structure diagram;
[0012] The shape of the first element of the first image element is identified based on the first element region, and the corresponding element type is determined based on the shape of the first element.
[0013] When the element type is the first type, the first image element is used to represent the corresponding interactive node, and text recognition processing is performed on the first sub-region in the first element region to obtain the node title of the corresponding interactive node.
[0014] The node title is determined as the corresponding first element information.
[0015] In one possible implementation, determining the corresponding first element information based on each first image element includes:
[0016] When the element type is the second type, the first image element is used to represent the corresponding video segment, and text recognition processing is performed on the second sub-region of the first element region to obtain the segment identifier of the corresponding video segment, and text recognition processing is performed on the third sub-region of the first element region to obtain the segment title of the corresponding video segment.
[0017] The segment identifier and the segment title are determined as the corresponding first element information.
[0018] In one possible implementation, determining the corresponding second element information based on each second image element includes:
[0019] For each second image element, determine the associated image element corresponding to the second image element among a plurality of first image elements, and the association relationship with each of the associated image elements;
[0020] Based on the multiple associated image elements and the association relationship with each of the associated image elements, the corresponding second element information is determined.
[0021] In one possible implementation, determining the corresponding second element information based on the plurality of associated image elements and the association relationship with each of the associated image elements includes:
[0022] Based on the association relationship between the second image element and each of the associated image elements, the target image element is determined among the multiple associated image elements;
[0023] Determine the element type of the target image element;
[0024] When the element type is the first type, the target image element is used to represent the corresponding interactive node, and the connection information consisting of multiple associated image elements and the association relationship with each associated image element is determined as the corresponding second element information.
[0025] In one possible implementation, the method further includes:
[0026] When the element type is the second type, the target image element is used to represent the corresponding video segment, and the second element region corresponding to the second image element is determined from the plot structure diagram;
[0027] Text recognition processing is performed on the second element region to obtain the playback duration information of the corresponding video segment;
[0028] The playback duration information and the connection information are determined as the corresponding second element information.
[0029] In one possible implementation, generating the script file corresponding to the interactive video based on the first element information and the second element information includes:
[0030] Determine the data format information;
[0031] The first element information and the second element information are formatted based on the data format information to obtain the script file corresponding to the interactive video.
[0032] Secondly, embodiments of this application provide an interactive video script generation apparatus, comprising:
[0033] The acquisition module is used to acquire the plot structure diagram corresponding to the interactive video, wherein the interactive video includes multiple video segments, and the plot structure diagram is used to describe the playback logic of playing multiple video segments;
[0034] The processing module is used to perform image recognition processing on the plot structure diagram to obtain multiple first image elements, and second image elements used to represent the relationship between the multiple first image elements;
[0035] The determining module is configured to determine corresponding first element information based on each first image element, and to determine corresponding second element information based on each second image element;
[0036] The generation module is used to generate a script file corresponding to the interactive video based on the first element information and the second element information, wherein the script file is used to record the playback logic.
[0037] In one possible implementation, the determining module is specifically used for:
[0038] Determine the first element region corresponding to the first image element from the plot structure diagram;
[0039] The shape of the first element of the first image element is identified based on the first element region, and the corresponding element type is determined based on the shape of the first element.
[0040] When the element type is the first type, the first image element is used to represent the corresponding interactive node, and text recognition processing is performed on the first sub-region in the first element region to obtain the node title of the corresponding interactive node.
[0041] The node title is determined as the corresponding first element information.
[0042] In one possible implementation, the determining module is further configured to:
[0043] When the element type is the second type, the first image element is used to represent the corresponding video segment, and text recognition processing is performed on the second sub-region of the first element region to obtain the segment identifier of the corresponding video segment, and text recognition processing is performed on the third sub-region of the first element region to obtain the segment title of the corresponding video segment.
[0044] The segment identifier and the segment title are determined as the corresponding first element information.
[0045] In one possible implementation, the determining module is further configured to:
[0046] For each second image element, determine the associated image element corresponding to the second image element among a plurality of first image elements, and the association relationship with each of the associated image elements;
[0047] Based on the multiple associated image elements and the association relationship with each of the associated image elements, the corresponding second element information is determined.
[0048] In one possible implementation, the determining module is further configured to:
[0049] Based on the association relationship between the second image element and each of the associated image elements, the target image element is determined among the multiple associated image elements;
[0050] Determine the element type of the target image element;
[0051] When the element type is the first type, the target image element is used to represent the corresponding interactive node, and the connection information consisting of multiple associated image elements and the association relationship with each associated image element is determined as the corresponding second element information.
[0052] In one possible implementation, the determining module is further configured to:
[0053] When the element type is the second type, the target image element is used to represent the corresponding video segment, and the second element region corresponding to the second image element is determined from the plot structure diagram;
[0054] Text recognition processing is performed on the second element region to obtain the playback duration information of the corresponding video segment;
[0055] The playback duration information and the connection information are determined as the corresponding second element information.
[0056] In one possible implementation, the generation module is specifically used for:
[0057] Determine the data format information;
[0058] The first element information and the second element information are formatted based on the data format information to obtain the script file corresponding to the interactive video.
[0059] Thirdly, an electronic device is provided, including 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;
[0060] Memory, used to store computer programs;
[0061] When a processor executes a program stored in memory, it implements any of the steps described in the first aspect.
[0062] Fourthly, a computer-readable storage medium is provided, characterized in that the computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of any of the methods described in the first aspect.
[0063] Fifthly, a computer program product containing instructions is provided, which, when run on a computer, causes the computer to execute any of the interactive video script generation methods described above.
[0064] Beneficial effects of the embodiments in this application:
[0065] This application provides an interactive video script generation method, apparatus, electronic device, and storage medium. In this embodiment, firstly, a plot structure diagram corresponding to the interactive video is obtained. The interactive video includes multiple video segments, and the plot structure diagram describes the playback logic of playing the multiple video segments. Then, image recognition processing is performed on the plot structure diagram to obtain multiple first image elements and second image elements representing the relationships between the multiple first image elements. First element information is determined based on each first image element, and second element information is determined based on each second image element. Finally, a script file corresponding to the interactive video is generated based on the first element information and the second element information, wherein the script file records the playback logic. Thus, the script file corresponding to the interactive video can be automatically generated based on the plot structure diagram drawn by the user, without manual intervention, improving the production efficiency of script files.
[0066] Of course, implementing any product or method of this application does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description
[0067] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0068] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0069] Figure 1 A flowchart illustrating an interactive video script generation method provided in this application embodiment;
[0070] Figure 2 An example of a plot structure diagram provided in this application embodiment;
[0071] Figure 3 An example of a playback interface that plays to an interactive node according to an interactive script, provided as an embodiment of this application;
[0072] Figure 4 A flowchart illustrating another interactive video script generation method provided in this application embodiment;
[0073] Figure 5 A flowchart illustrating another interactive video script generation method provided in this application embodiment;
[0074] Figure 6A schematic diagram of the structure of an interactive video script generation device provided in an embodiment of this application;
[0075] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0076] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0077] The interactive video script generation method provided in this application will be explained and described below with reference to the accompanying drawings and specific embodiments. The embodiments do not constitute a limitation on the embodiments of this application.
[0078] See Figure 1 This is a flowchart illustrating an embodiment of an interactive video script generation method provided in this application. Figure 1 As shown, the process may include the following steps:
[0079] S101, Obtain the plot structure diagram corresponding to the interactive video, wherein the interactive video includes multiple video segments, and the plot structure diagram is used to describe the playback logic of playing multiple video segments.
[0080] Interactive videos are videos that offer users an interactive storyline. During playback, users can choose from branching storylines based on their preferences to enter different narrative paths. Interactive videos consist of multiple video clips; some clips contain interactive elements for user interaction, while others are ordinary video clips without interactive elements.
[0081] A plot structure diagram is used to describe the playback logic of playing multiple video segments.
[0082] like Figure 2 The diagram shown is a schematic representation of a story structure. The rectangle corresponding to "Story Begins" represents video segment id_1, the rectangle corresponding to "Correct" represents video segment id_2, the rectangle corresponding to "Incorrect" represents video segment id_3, and the ellipse corresponding to "Judgment Right or Wrong" represents an interactive node within video segment id_1. Arrows connect the segments to represent the logical relationships between the video segments and interactive nodes (i.e., the direction of the storyline). The timestamps above the arrows indicate the times when the corresponding video segment or interactive node appears. Figure 2 The "36 seconds" shown indicates the time when the "Judgment Right or Wrong" node appears in video segment id_1.
[0083] S102, perform image recognition processing on the plot structure diagram to obtain multiple first image elements, and second image elements for representing the relationship between the multiple first image elements.
[0084] S103, determine the corresponding first element information based on each of the first image elements, and determine the corresponding second element information based on each of the second image elements.
[0085] S104, Based on the first element information and the second element information, generate a script file corresponding to the interactive video, wherein the script file is used to record the playback logic.
[0086] The following provides a unified explanation of S102-S104:
[0087] The first image element refers to the element used in the plot structure diagram to represent video clips and interactive nodes, for example, Figure 2 In the plot structure diagram shown, rectangles are used to represent video clips, and ellipses are used to represent interactive nodes. The rectangles and ellipses are the first image elements.
[0088] The second image element is used to represent the relationships between multiple first image elements, that is, the playback logic relationships between video clips, and between video clips and interactive nodes. For example, Figure 2 In the plot structure diagram shown, the arrowed line below "36 seconds" represents the playback of the interactive node "Judgment Right or Wrong" after video clip id_1 is played. The arrowed line after the interactive node "Judgment Right or Wrong" represents the playback of either video clip id_2 or video clip id_3 after the interactive node "Judgment Right or Wrong".
[0089] The first element information refers to the information used in the plot structure diagram to describe the corresponding first image element, for example... Figure 2 In the plot structure diagram shown, for the first rectangle on the left, the "Story Begins" and the id_1 above it are the first element information corresponding to the first rectangle. For the elliptical box, the "Judgment Right or Wrong" is the first element information corresponding to the elliptical box.
[0090] The second element information refers to the information used in the plot structure diagram to describe the corresponding second image element, for example... Figure 2In the plot structure diagram shown, the "36 seconds" above the line connecting "Story Begins" and "Judgment of True or False" represents the second element information for that line. For the other lines in the diagram, there is no second element information.
[0091] In the application, a training set of a certain size can be prepared in advance. This training set includes sample plot structure diagrams and corresponding sample interaction script files for these sample plot structure diagrams. Here, each sample interaction script file is the correct script for the corresponding sample plot structure diagram. Using these sample plot structure diagrams as model training data and the sample interaction script files as labels for the corresponding sample plot structure diagrams, the image recognition model (e.g., an AI (Artificial Intelligence) model) is trained until the model converges, resulting in a trained recognition model.
[0092] The size of the training set can be determined based on the complexity of the interactive scripts that the model needs to support in the application; that is, the higher the complexity of the interactive scripts, the larger the size of the training set. In the application, the complexity of the interactive scripts can be determined by the number of video clips and interactive nodes in the script; that is, the more video clips and interactive nodes there are, the higher the complexity.
[0093] To ensure the recognition model's performance, a test set can be prepared and used to evaluate the training results, ensuring the model possesses the following capabilities and outputs compliant interactive scripts (in the form of...). Figure 2 (The plot structure diagram shown is an example):
[0094] A. It can recognize all rectangles and related numbers (such as "id_1", "id_2", "id_3"), titles (such as "Story Begins", "Right", "Wrong"), etc., and generate the playback interval (i.e., video segment) structure in the interactive script. The number of playback intervals generated corresponds to the number of rectangles.
[0095] B. It can recognize all elliptical boxes and related titles (such as "True or False"), and generate the interactive node structure in the interactive script. The number of interactive nodes generated corresponds to the number of elliptical boxes.
[0096] C. It can identify lines starting from a playback interval and associate the endpoint of the line with that playback interval, making that playback interval the corresponding to the interactive node. It also identifies the time on the line and uses it as the start time of the interactive node. This information is then generated into the interactive script.
[0097] D. It can identify connections originating from interactive nodes, and count the playback intervals that start from the same interactive node and end at itself. Each playback interval corresponds to one option of that interactive node. The title of the interactive node serves as the display title for the interaction, and the name of each playback interval is entered into the interaction script as the name of an interactive option.
[0098] Thus, during the playback of the interactive video according to this interactive script, when the video reaches a certain interactive node, it can jump to the corresponding playback section to continue playback based on the user's clicked option. For example... Figure 3 As shown, this is a playback interface that plays to an interactive node according to an interactive script. The top of the interface displays the video content corresponding to the current moment, and the bottom of the interface displays the relevant content of the interactive node "Judgment of Right or Wrong". At this time, the user can choose one of the two options, "Right" and "Wrong". If the user selects "Right", the playback will jump to the playback section corresponding to "Right" and continue playing. If the user selects "Wrong", the playback will jump to the playback section corresponding to "Wrong" and continue playing.
[0099] Based on this, in the embodiments of this application, the plot structure diagram can be input into the recognition model, and the recognition model can perform image recognition processing on the plot structure diagram to obtain multiple first image elements and second image elements used to represent the relationship between the multiple first image elements. Based on each first image element, the corresponding first element information is determined, and based on each second image element, the corresponding second element information is determined. Finally, based on the first element information and the second element information, a script file for recording the playback logic of multiple video segments in the interactive video is generated.
[0100] In applications, the recognition model can also learn the data format of the sample interaction script file during the training process, and obtain data format information such as JSON (JavaScript Object Notation) format, XML (Extensible Markup Language), etc.
[0101] Therefore, the specific implementation of generating the script file corresponding to the interactive video based on the first element information and the second element information may include: determining data format information, and formatting the first element information and the second element information based on the data format information to obtain the script file corresponding to the interactive video. In this way, a script file conforming to the data format of the sample interactive script files in the training data can be generated.
[0102] In another embodiment, all video segments corresponding to the storyline structure diagram can be obtained. After generating the script file, a video playback file corresponding to the interactive video can be generated based on all video segments and the script file. This allows users to conveniently play video segments from the video playback file using the script file within the video playback file.
[0103] In this embodiment, firstly, a storyline diagram corresponding to the interactive video is obtained. The interactive video includes multiple video segments, and the storyline diagram describes the playback logic of playing the multiple video segments. Then, image recognition processing is performed on the storyline diagram to obtain multiple first image elements and second image elements representing the relationships between the multiple first image elements. First element information is determined based on each first image element, and second element information is determined based on each second image element. Finally, a script file corresponding to the interactive video is generated based on the first element information and the second element information, wherein the script file records the playback logic. Thus, a script file corresponding to the interactive video can be automatically generated based on a user-drawn storyline diagram without manual intervention, improving the efficiency of script file production.
[0104] See Figure 4 This is a flowchart illustrating an embodiment of another interactive video script generation method provided in this application. Figure 4 The process shown above Figure 1 Based on the illustrated process, this section describes how to determine the corresponding first element information for each of the first image elements. For example... Figure 4 As shown, the process may include the following steps:
[0105] S401, determine the first element region corresponding to the first image element from the plot structure diagram.
[0106] S402, based on the first element region, the shape of the first element of the first image element is identified, and the corresponding element type is determined based on the shape of the first element.
[0107] S403, when the element type is the first type, the first image element is used to represent the corresponding interactive node, and text recognition processing is performed on the first sub-region in the first element region to obtain the node title of the corresponding interactive node.
[0108] S404, the node title is determined as the corresponding first element information.
[0109] The following provides a unified explanation of S401-S404:
[0110] The first element area refers to the area in the plot structure diagram that contains the first image element and the text or markings surrounding the first image element.
[0111] The first sub-region refers to the area in the story structure diagram used to mark the node titles of corresponding interactive nodes, such as... Figure 2 The area inside the elliptical frame.
[0112] In this embodiment, the region image corresponding to the first element region can be processed to obtain the first element shape of the first image element, and the element type corresponding to the first image element can be distinguished according to the first element shape. For example, if the first element shape is a rectangular frame, the corresponding element type is a video clip; or if the first element shape is an elliptical frame, the corresponding element type is an interactive node.
[0113] When the element type is type one, it is assumed that the first image element is used to represent the corresponding interactive node. In this case, text recognition processing is performed on the first sub-region of the first element region to obtain the node title of the corresponding interactive node (e.g., ...). Figure 2 The node title of the interactive node is "Judgment True or False", and this node title is determined as the corresponding first element information.
[0114] S405, when the element type is the second type, the first image element is used to represent the corresponding video segment, text recognition processing is performed on the second sub-region of the first element region to obtain the segment identifier of the corresponding video segment, and text recognition processing is performed on the third sub-region of the first element region to obtain the segment title of the corresponding video segment.
[0115] S406, the segment identifier and the segment title are determined as the corresponding first element information.
[0116] The following provides a unified explanation of S405-S406:
[0117] The second sub-region refers to the area in the plot structure diagram used to mark the segment identifiers corresponding to the video clips, such as... Figure 2 In the middle, the area above the rectangle.
[0118] The third sub-region refers to the area in the plot structure diagram used to mark the segment titles corresponding to video clips, such as... Figure 2 In the middle, the area inside the rectangle.
[0119] In this embodiment of the application, when the element type is the second type, it is considered that the first image element is used to represent the corresponding video segment. At this time, text recognition processing is performed on the second sub-region of the first element region to obtain the segment identifier of the corresponding video segment, and text recognition processing is performed on the third sub-region of the first element region to obtain the segment title of the corresponding video segment. The segment identifier and the segment title are determined as the corresponding first element information.
[0120] pass Figure 4 The process shown can identify the shape of a first image element based on its corresponding first element region. Compared to directly identifying based on the plot structure diagram, this improves image recognition accuracy. Furthermore, it distinguishes the element type of the corresponding first image element based on its shape and automatically extracts the corresponding first element information based on the element type. The entire process requires no manual intervention, thus improving processing efficiency.
[0121] See Figure 5 This is a flowchart illustrating an embodiment of another interactive video script generation method provided in this application. Figure 5 The process shown above Figure 1 Based on the illustrated process, this section describes how to determine the corresponding second element information for each second image element. For example... Figure 5 As shown, the process may include the following steps:
[0122] S501, for each second image element, determine the associated image element corresponding to the second image element among a plurality of first image elements, and the association relationship with each of the associated image elements;
[0123] S502, based on the multiple associated image elements and the association relationship with each of the associated image elements, determine the corresponding second element information.
[0124] The following provides a unified explanation of S501-S502:
[0125] Associated image element refers to the first image element associated with the corresponding second image element.
[0126] The association relationship refers to the drawing relationship between the corresponding second image element and the image drawing.
[0127] like Figure 2 In the example shown, for the first arrowed line on the left, the associated image elements include a rectangle for "Story Begins" and an ellipse for "True or False". The relationship is that the rectangle for "Story Begins" is the starting point of the line, and the ellipse for "True or False" is the ending point of the line.
[0128] In one embodiment, the specific implementation of determining the corresponding second element information based on the plurality of associated image elements and the association relationship with each of the associated image elements may include the following steps:
[0129] Step A1: Based on the association relationship between the second image element and each of the associated image elements, determine the target image element among the multiple associated image elements;
[0130] Step A2: Determine the element type of the target image element;
[0131] Step A3: When the element type is the first type, the target image element is used to represent the corresponding interactive node, and the connection information consisting of multiple associated image elements and the association relationship with each associated image element is determined as the corresponding second element information.
[0132] Step A4: When the element type is the second type, the target image element is used to represent the corresponding video segment, and the second element region corresponding to the second image element is determined from the plot structure diagram;
[0133] Step A5: Perform text recognition processing on the second element region to obtain the playback duration information of the corresponding video segment;
[0134] Step A6: Determine the playback duration information and the connection information as the corresponding second element information.
[0135] The target image element refers to the associated image element that serves as the logical starting point for the second image element. For example... Figure 2 In the example shown, for the first arrowed line on the left, the associated image elements include a rectangle labeled "Story Begins" and an ellipse labeled "True or False." The relationship is that the rectangle labeled "Story Begins" is the starting point of the line, and the ellipse labeled "True or False" is the ending point. Therefore, the rectangle labeled "Story Begins" is the logical starting point of the line, which is also the target image element.
[0136] The second element area refers to the area in the plot structure diagram that contains the second image element and the text or markings surrounding the second image element.
[0137] In applications, when the logical starting point of the second image element is a video clip, the second element region of the second image element contains information describing the playback duration of that video clip, such as... Figure 2In the example shown, for the first arrowed line on the left, the "36 seconds" above it indicates the playback duration of the "Story Begins" video clip. When the logical starting point of the second image element is an interactive node, since the interactive node only ends based on user interaction, the playback time information will not be marked in the second element area at this time.
[0138] Based on this, in the embodiments of this application, when the element type is the first type, that is, when the target image element is used to represent the corresponding interactive node, the connection information consisting of multiple associated image elements and the association relationship with each associated image element is directly determined as the corresponding second element information; while when the element type is the second type, that is, when the target image element is used to represent the corresponding video segment, the second element region corresponding to the second image element can also be determined from the plot structure diagram, the second element region can be processed by text recognition to obtain the playback duration information of the corresponding video segment, and the playback duration information and connection information can be determined together as the corresponding second element information.
[0139] pass Figure 5 The process shown automatically determines the information of the corresponding second image element based on the associated image elements corresponding to each second image element and the association relationship with each associated image element. The entire process requires no manual intervention, thus improving processing efficiency.
[0140] Based on the same technical concept, embodiments of this application also provide an interactive video script generation device, such as... Figure 6 As shown, the device includes:
[0141] The acquisition module 601 is used to acquire the plot structure diagram corresponding to the interactive video, wherein the interactive video includes multiple video segments, and the plot structure diagram is used to describe the playback logic of playing multiple video segments.
[0142] The processing module 602 is used to perform image recognition processing on the plot structure diagram to obtain a plurality of first image elements, and a second image element used to represent the relationship between the plurality of first image elements;
[0143] The determining module 603 is used to determine corresponding first element information based on each first image element, and to determine corresponding second element information based on each second image element;
[0144] The generation module 604 is used to generate a script file corresponding to the interactive video based on the first element information and the second element information, wherein the script file is used to record the playback logic.
[0145] In one possible implementation, the determining module is specifically used for:
[0146] Determine the first element region corresponding to the first image element from the plot structure diagram;
[0147] The shape of the first element of the first image element is identified based on the first element region, and the corresponding element type is determined based on the shape of the first element.
[0148] When the element type is the first type, the first image element is used to represent the corresponding interactive node, and text recognition processing is performed on the first sub-region in the first element region to obtain the node title of the corresponding interactive node.
[0149] The node title is determined as the corresponding first element information.
[0150] In one possible implementation, the determining module is further configured to:
[0151] When the element type is the second type, the first image element is used to represent the corresponding video segment, and text recognition processing is performed on the second sub-region of the first element region to obtain the segment identifier of the corresponding video segment, and text recognition processing is performed on the third sub-region of the first element region to obtain the segment title of the corresponding video segment.
[0152] The segment identifier and the segment title are determined as the corresponding first element information.
[0153] In one possible implementation, the determining module is further configured to:
[0154] For each second image element, determine the associated image element corresponding to the second image element among a plurality of first image elements, and the association relationship with each of the associated image elements;
[0155] Based on the multiple associated image elements and the association relationship with each of the associated image elements, the corresponding second element information is determined.
[0156] In one possible implementation, the determining module is further configured to:
[0157] Based on the association relationship between the second image element and each of the associated image elements, the target image element is determined among the multiple associated image elements;
[0158] Determine the element type of the target image element;
[0159] When the element type is the first type, the target image element is used to represent the corresponding interactive node, and the connection information consisting of multiple associated image elements and the association relationship with each associated image element is determined as the corresponding second element information.
[0160] In one possible implementation, the determining module is further configured to:
[0161] When the element type is the second type, the target image element is used to represent the corresponding video segment, and the second element region corresponding to the second image element is determined from the plot structure diagram;
[0162] Text recognition processing is performed on the second element region to obtain the playback duration information of the corresponding video segment;
[0163] The playback duration information and the connection information are determined as the corresponding second element information.
[0164] In one possible implementation, the generation module is specifically used for:
[0165] Determine the data format information;
[0166] The first element information and the second element information are formatted based on the data format information to obtain the script file corresponding to the interactive video.
[0167] In this embodiment, firstly, a storyline diagram corresponding to the interactive video is obtained. The interactive video includes multiple video segments, and the storyline diagram describes the playback logic of playing the multiple video segments. Then, image recognition processing is performed on the storyline diagram to obtain multiple first image elements and second image elements representing the relationships between the multiple first image elements. First element information is determined based on each first image element, and second element information is determined based on each second image element. Finally, a script file corresponding to the interactive video is generated based on the first element information and the second element information, wherein the script file records the playback logic. Thus, a script file corresponding to the interactive video can be automatically generated based on a user-drawn storyline diagram without manual intervention, improving the efficiency of script file production.
[0168] Based on the same technical concept, embodiments of this application also provide an electronic device, such as... Figure 7 As shown, it includes a processor 111, a communication interface 112, a memory 113, and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.
[0169] Memory 113 is used to store computer programs;
[0170] When processor 111 executes a program stored in memory 113, it performs the following steps:
[0171] Obtain the plot structure diagram corresponding to the interactive video, wherein the interactive video includes multiple video segments, and the plot structure diagram is used to describe the playback logic of playing multiple video segments;
[0172] The plot structure diagram is subjected to image recognition processing to obtain multiple first image elements, and second image elements used to represent the relationship between the multiple first image elements;
[0173] Based on each of the first image elements, determine the corresponding first element information, and based on each of the second image elements, determine the corresponding second element information;
[0174] Based on the first element information and the second element information, a script file corresponding to the interactive video is generated, wherein the script file is used to record the playback logic.
[0175] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0176] The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0177] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0178] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0179] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of any of the above-described interactive video script generation methods.
[0180] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the interactive video script generation methods described above.
[0181] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0182] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, 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 limitations, 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.
[0183] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for generating interactive video scripts, characterized in that, The method includes: Obtain the plot structure diagram corresponding to the interactive video, wherein the interactive video includes multiple video segments, and the plot structure diagram is used to describe the playback logic of playing multiple video segments; The plot structure diagram is subjected to image recognition processing to obtain multiple first image elements, and second image elements used to represent the relationship between the multiple first image elements; Based on each of the first image elements, determine the corresponding first element information, and based on each of the second image elements, determine the corresponding second element information; Based on the first element information and the second element information, a script file corresponding to the interactive video is generated, wherein the script file is used to record the playback logic; The step of determining the corresponding first element information based on each first image element includes: Determine the first element region corresponding to the first image element from the plot structure diagram; The shape of the first element of the first image element is identified based on the first element region, and the corresponding element type is determined based on the shape of the first element. When the element type is the first type, the first image element is used to represent the corresponding interactive node, and text recognition processing is performed on the first sub-region in the first element region to obtain the node title of the corresponding interactive node. The node title is determined as the corresponding first element information.
2. The method according to claim 1, characterized in that, The method further includes: When the element type is the second type, the first image element is used to represent the corresponding video segment, and text recognition processing is performed on the second sub-region of the first element region to obtain the segment identifier of the corresponding video segment, and text recognition processing is performed on the third sub-region of the first element region to obtain the segment title of the corresponding video segment. The segment identifier and the segment title are determined as the corresponding first element information.
3. The method according to claim 1, characterized in that, The step of determining the corresponding second element information based on each second image element includes: For each second image element, determine the associated image element corresponding to the second image element among a plurality of first image elements, and the association relationship with each of the associated image elements; Based on the multiple associated image elements and the association relationship with each of the associated image elements, the corresponding second element information is determined.
4. The method according to claim 3, characterized in that, The step of determining the corresponding second element information based on multiple associated image elements and the association relationship with each associated image element includes: Based on the association relationship between the second image element and each of the associated image elements, the target image element is determined among the multiple associated image elements; Determine the element type of the target image element; When the element type is the first type, the target image element is used to represent the corresponding interactive node, and the connection information consisting of multiple associated image elements and the association relationship with each associated image element is determined as the corresponding second element information.
5. The method according to claim 4, characterized in that, The method further includes: When the element type is the second type, the target image element is used to represent the corresponding video segment, and the second element region corresponding to the second image element is determined from the plot structure diagram; Text recognition processing is performed on the second element region to obtain the playback duration information of the corresponding video segment; The playback duration information and the connection information are determined as the corresponding second element information.
6. The method according to claim 1, characterized in that, The step of generating the script file corresponding to the interactive video based on the first element information and the second element information includes: Determine the data format information; The first element information and the second element information are formatted based on the data format information to obtain the script file corresponding to the interactive video.
7. An interactive video script generation device, characterized in that, The device includes: The acquisition module is used to acquire the plot structure diagram corresponding to the interactive video, wherein the interactive video includes multiple video segments, and the plot structure diagram is used to describe the playback logic of playing multiple video segments; The processing module is used to perform image recognition processing on the plot structure diagram to obtain multiple first image elements, and second image elements used to represent the relationship between the multiple first image elements; The determining module is configured to determine corresponding first element information based on each first image element, and to determine corresponding second element information based on each second image element; A generation module is used to generate a script file corresponding to the interactive video based on the first element information and the second element information, wherein the script file is used to record the playback logic; The determining module is specifically used for: Determine the first element region corresponding to the first image element from the plot structure diagram; The shape of the first element of the first image element is identified based on the first element region, and the corresponding element type is determined based on the shape of the first element. When the element type is the first type, the first image element is used to represent the corresponding interactive node, and text recognition processing is performed on the first sub-region in the first element region to obtain the node title of the corresponding interactive node. The node title is determined as the corresponding first element information.
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 method described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method described in any one of claims 1-6.
Citation Information
Patent Citations
Video playing method and device, electronic equipment and storage medium
CN110719530A
Game script generation method and device, computer equipment and storage medium
CN113730917A