Audio and video analysis method, device, computer equipment and storage medium
Automatically identifying the start and end positions of non-substantive content in video programs through audio and video analysis methods solves the problem of manual annotation dependence in the existing technology, improves efficiency, and supports the personalized function of the video management platform.
Patent Information
- Application Number
- CN202211690921.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-27
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2042-12-27
AI Technical Summary
Existing methods for identifying non-substantive content in video programs rely on manual annotation, resulting in high labor costs and low efficiency.
Through the audio and video analysis method, the audio and video data to be analyzed is obtained, the target audio frame and video frame are determined, and the start and end positions of the preset content are located based on these frames, reducing manpower dependence and improving annotation efficiency.
It realizes automatic identification of non-substantive content in video programs, reduces dependence on human resources, improves annotation efficiency, and supports personalized management of video management platforms, such as intelligent skipping of endings, recommendation of related content and other functions.
Smart Images

Figure CN116017036B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of multimedia technology, and in particular to an audio and video analysis method, device, computer equipment, and storage medium. Background Art
[0002] With the development of video networks, more and more netizens watch video programs through the Internet. These video programs usually include substantial content and non-substantial content. For example, when the video program is a movie, the substantial content may be the plot and the non-substantial content may be the opening, ending, highlights and the like.
[0003] When a video management platform manages the video program or a user watches the video program through an application, there is a need to distinguish between the substantial content and the insubstantial content of the video program. However, in existing solutions for identifying insubstantial content, it is usually necessary for labelers to manually mark the starting points of the insubstantial content in the video program, which results in high labor costs and low recognition efficiency. Summary of the invention
[0004] The embodiments of the present disclosure at least provide an audio and video analysis method, apparatus, computer equipment, and storage medium.
[0005] In a first aspect, an embodiment of the present disclosure provides an audio and video analysis method, characterized by comprising:
[0006] Obtain audio and video data to be analyzed;
[0007] Determine a target audio frame in the audio and video data to be analyzed, and determine a target video frame in the audio and video data to be analyzed; wherein the target audio frame and the target video frame are used to indicate an area where a preset content in the audio and video data to be analyzed is located;
[0008] A target point frame is determined in the target audio frame and the target video frame, so as to determine the start and end positions of the preset content based on the target video frame.
[0009] In an optional implementation manner, determining a target point frame in the target audio frame and the target video frame includes:
[0010] In the case where the target video frame includes a first video frame, determining a reference point frame in the target audio frame and the target video frame; wherein the first video frame is a video frame corresponding to a video scene transition in the audio and video data to be analyzed;
[0011] Determine a first data region where the reference point frame is located in the audio and video data to be analyzed;
[0012] The first video frame is matched with the first data region, and based on the matching result, a target point frame is determined in the first video frame and the reference point frame.
[0013] In an optional implementation, determining the target point frame in the first video frame and the reference point frame based on the matching result includes:
[0014] Based on the matching result, determining whether the first video frame is in the first data area;
[0015] In a case where the first video frame is not in the first data area, determining the reference point frame as the target point frame;
[0016] When the first video frame is in the first data area, the first video frame is determined as the target point frame.
[0017] In an optional implementation manner, determining a reference point frame in the target audio frame and the target video frame includes:
[0018] In the case where the target video frame includes a second video frame, determining a second data region where the second video frame is located in the audio and video data to be analyzed; wherein the second video frame is used to indicate a video frame including key content;
[0019] In a case where the target audio frame is not in the second data area, determining the second video frame as the reference point frame;
[0020] In a case where the target audio frame is in the second data region, the target audio frame is determined as the reference point frame.
[0021] In an optional implementation manner, the step of determining a reference point frame in the target audio frame and the target video frame 5 includes:
[0022] In the case where the target video frame includes a third video frame, determining a positional relationship between the third video frame and the target audio frame; wherein the third video frame is used to indicate a video frame including a preset type of content;
[0023] Based on the positional relationship, a reference zero-point frame is determined in the target video frame and the third video frame.
[0024] In an optional implementation manner, the determining the target video frame in the audio and video data to be analyzed includes:
[0025] Performing frame extraction processing on the video data in the audio and video data to be analyzed to obtain a collection of video frames corresponding to the video data;
[0026] 5. Determine a first video frame in the video frame collection whose pixel value does not meet a preset condition, and determine the target video frame based on the first video frame; wherein the first video frame is a video frame corresponding to a video scene transition in the audio and video data to be analyzed.
[0027] In an optional implementation manner, the determining the target audio frame in the audio and video data to be analyzed includes:
[0028] Determine audio data in the audio and video data to be analyzed, and determine at least one audio segment to be confirmed in the audio data;
[0029] Based on the playback order of each of the to-be-confirmed audio segments in the audio data, and based on the playback order, determine the target audio segment;
[0030] A target audio frame is determined according to the target audio segment.
[0031] In a second aspect, the present disclosure also provides an audio and video analysis device, including:
[0032] An acquisition unit, used to acquire audio and video data to be analyzed;
[0033] A first determining unit is used to determine a target audio frame in the audio and video data to be analyzed, and to determine a target video frame in the audio and video data to be analyzed; wherein the target audio frame and the target video frame are used to indicate an area where a preset content is located in the audio and video data to be analyzed;
[0034] The second determining unit is used to determine a target point frame in the target audio frame and the target video frame, so as to determine the start and end positions of the preset content based on the target video frame.
[0035] In a third aspect, an embodiment of the present disclosure further provides a computer device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the above-mentioned first aspect, or any possible implementation of the first aspect are performed.
[0036] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned first aspect or any possible implementation of the first aspect are executed.
[0037] The audio and video analysis method, device, computer equipment and storage medium provided by the embodiments of the present disclosure. In the embodiments of the present disclosure, the audio and video data to be analyzed can be first obtained, and the audio and video data to be analyzed can be analyzed to determine the target audio frame and the target video frame in the audio and video data to be analyzed, wherein the target audio frame and the target video frame can be used to indicate the area where the preset content in the audio and video data to be analyzed is located, and here, the preset content can be the above-mentioned non-essential content. Next, the target point frame can be determined in the target audio frame and the target video frame to locate the start and end positions of the preset content based on the target point frame, thereby reducing the dependence on human resources and improving the annotation efficiency of the audio and video data to be analyzed.
[0038] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.
[0040] Figure 1 A flow chart of an audio and video analysis method provided by an embodiment of the present disclosure is shown;
[0041] Figure 2 A schematic diagram showing a frame of pictures corresponding to the end credits provided by an embodiment of the present disclosure;
[0042] Figure 3 A flowchart of another audio and video analysis method provided by an embodiment of the present disclosure is shown;
[0043] Figure 4 A schematic diagram of an audio and video analysis device provided by an embodiment of the present disclosure is shown;
[0044] Figure 5 A schematic diagram of a computer device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.
[0046] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0047] The term "and / or" herein only describes an association relationship, indicating that three relationships may exist. For example, A and / or B may represent the following three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C may represent including any one or more elements selected from the set consisting of A, B, and C.
[0048] When a video management platform manages the video program or a user watches the video program through an application, there is a need to distinguish between the substantial content and the insubstantial content of the video program. However, in existing solutions for identifying insubstantial content, it is usually necessary for labelers to manually mark the starting points of the insubstantial content in the video program, which results in high labor costs and low recognition efficiency.
[0049] Based on the above research, the present disclosure provides an audio and video analysis method, device, computer equipment and storage medium. In the embodiment of the present disclosure, the audio and video data to be analyzed can be first obtained, and the audio and video data to be analyzed can be analyzed to determine the target audio frame and the target video frame in the audio and video data to be analyzed, wherein the target audio frame and the target video frame can be used to indicate the area where the preset content in the audio and video data to be analyzed is located, and here, the preset content can be the above-mentioned non-essential content. Next, the target point frame can be determined in the target audio frame and the target video frame to locate the start and end positions of the preset content based on the target point frame, thereby reducing the dependence on human resources and improving the annotation efficiency of the audio and video data to be analyzed.
[0050] To facilitate understanding of this embodiment, an audio and video analysis method disclosed in the embodiment of the present disclosure is first introduced in detail. The execution subject of the audio and video analysis method provided in the embodiment of the present disclosure is generally a computer device with certain computing capabilities. In some possible implementations, the audio and video analysis method can be implemented by a processor calling a computer-readable instruction stored in a memory.
[0051] In the audio and video analysis method provided by the present disclosure, the video management platform can be installed in the computer device. The video management platform can perform personalized management on the video program based on the start and end positions of the preset content in the determined video program. For example, when the preset content is the ending credits of a film or TV program, the personalized management can include: intelligently skipping the ending credits when the user is watching, determining whether the user's viewing progress is the ending credits, and delivering related content of the film or TV program based on the start and end positions of the ending credits, such as recommendations for film and TV programs of the same type, jumps to the next episode, promotions, etc.
[0052] See also Figure 1 FIG. 1 is a flowchart of an audio and video analysis method provided by an embodiment of the present disclosure, wherein the method includes steps S101 to S105, wherein:
[0053] S101: Acquire audio and video data to be analyzed.
[0054] In the disclosed embodiment, firstly, the video program can be obtained through the above-mentioned video management platform, and the audio and video data to be analyzed can be determined in the video program. Here, the audio and video data to be analyzed can be intercepted in the video program according to a preset ratio to reduce the amount of calculation when marking the video program.
[0055] Specifically, when intercepting the video program, an estimate can be made based on the area where the content to be identified is located, and interception can be performed according to the estimated result. For example, if the content to be identified is the ending of the above-mentioned non-essential content, then an estimate can be made for the ending, and the determined preset ratio can be 20%. When intercepting, the last 20% of the audio and video part of the above-mentioned video program can be intercepted, thereby obtaining the above-mentioned audio and video data to be analyzed.
[0056] S103: Determine a target audio frame in the audio and video data to be analyzed, and determine a target video frame in the audio and video data to be analyzed; wherein the target audio frame and the target video frame are used to indicate an area where a preset content is located in the audio and video data to be analyzed.
[0057] In the disclosed embodiment, the audio and video data to be analyzed can be first split to obtain audio data and video data, and the audio frames of the audio data and the video frames of the video data can be analyzed respectively to obtain the target audio frame and the target video frame. Here, the content in the target audio frame and the target video frame can be used to indicate the start and end features of the above-mentioned preset content. For example, when the preset content is the end credits of a film or TV video, the content in the target video frame can be the end credits keywords, the end credits, and the fixed content during the end credits transition, and the content in the target audio can be the end credits song, etc.
[0058] When determining the target audio frame in the above audio data, the audio frames generated per second can be first analyzed by an audio classification algorithm to determine the audio category of the audio frames generated per second, and multiple audio frames of a preset audio category can be determined based on the audio category, wherein the preset audio category can include: male singing, female singing, BGM (background music), etc. Next, it can be determined whether these multiple audio frames are continuous audio frames, and the continuous time is a preset continuous time. If so, they can be determined as target audio frames based on these multiple audio frames. For example, the first audio frame among these multiple audio frames can be used as the target audio frame, wherein the continuous time can be used to filter out audio that is not the ending song. For example, the continuous time can be set to 4s.
[0059] When determining the target video frame in the above video data, a collection of video frames corresponding to the video data can be obtained by frame extraction, wherein the frame extraction method can be second-level frame extraction, that is, extracting a fixed number of video frames from the video data per second to obtain the collection of video frames, so as to further reduce the amount of computation of the device. For example, if the length of the video data is 20 minutes and the number of frames per second is 24, then during the frame extraction process, the first video frame of the 24 frames corresponding to each second can be extracted to obtain the collection of video frames.
[0060] After determining the above-mentioned video frame collection, the content of each video frame in the video frame collection can be identified to obtain a target video frame including start and end features for indicating the above-mentioned preset content. The specific process of determining the target video frame is described as follows and will not be repeated here.
[0061] S105: Determine a target point frame in the target audio frame and the target video frame, so as to determine the start and end positions of the preset content based on the target point frame.
[0062] In an embodiment of the present disclosure, a confidence analysis can be performed based on the determined target audio frame and target video frame to determine a target point frame that meets the confidence condition. For example, the confidence condition can be to determine the target audio frame or target video frame with the highest confidence as the target point frame, wherein the determined target point frame has the highest possibility of being the starting and ending positions of the preset content. The specific method for determining the confidence of the target audio frame and the target video frame is described as follows and will not be repeated here.
[0063] It should be understood that the start and end positions may include the starting position and the ending position of the above-mentioned audio and video data to be analyzed. When determining the start and end positions, the playback time node corresponding to the target point frame in the audio and video data to be analyzed can be determined first, and the playback time node can be determined as the start and end positions of the preset content, wherein the time node can be accurate to seconds or milliseconds.
[0064] It can be known from the above description that in the embodiment of the present disclosure, the audio and video data to be analyzed can be first obtained, and the audio and video data to be analyzed can be analyzed to determine the target audio frame and the target video frame in the audio and video data to be analyzed, wherein the target audio frame and the target video frame can be used to indicate the area where the preset content in the audio and video data to be analyzed is located, and here, the preset content can be the above-mentioned non-essential content. Next, the target point frame can be determined in the target audio frame and the target video frame to locate the start and end positions of the preset content based on the target point frame, thereby reducing the dependence on human resources and improving the efficiency of labeling the audio and video data to be analyzed.
[0065] In an optional implementation, the above step S103, determining the target audio frame in the audio and video data to be analyzed, specifically includes the following process:
[0066] S1031: Determine audio data in the audio and video data to be analyzed, and determine at least one audio segment to be confirmed in the audio data.
[0067] In the embodiment of the present disclosure, firstly, the audio data in the audio and video data to be analyzed can be obtained through a preset audio interface, and then, the audio data can be analyzed through the above-mentioned audio classification algorithm to determine multiple audio frames of the preset audio type in the audio data, and then, the continuous audio frames whose continuous time is the preset continuous time in the multiple audio frames can be determined, and the continuous audio frames can be determined as the above-mentioned audio segments to be confirmed. The specific method of determining the continuous audio frames is as described above. Figure 1 The corresponding implementation methods are described herein and will not be repeated here.
[0068] S1032: Determine a target audio segment based on a playback order of each of the to-be-confirmed audio segments in the audio data and based on the playback order.
[0069] In the disclosed embodiment, the analysis can be performed based on the playback order of each audio segment to be confirmed in the audio data, and the audio segments to be confirmed can be filtered based on the playback order according to a preset filtering method. Here, the filtering method can be determined based on the above-mentioned start and end positions to be determined. For example, when the starting position to be determined is the preset content, the filtering method can be to determine the audio segment to be confirmed that is played first in the playback order as the target audio segment, and when the ending position to be determined is the preset content, the filtering method can be to determine the audio segment to be confirmed that is played last in the playback order as the target audio segment.
[0070] S1033: Determine a target audio frame according to the target audio segment.
[0071] In the disclosed embodiment, the target audio node can be first determined based on the start and end positions of the preset content to be determined, and the audio frame corresponding to the target audio node can be determined as the target audio frame. For example, when the start position of the preset content to be determined is the first second of the target audio frame, and when the end position of the preset content to be determined is the last second of the target audio frame.
[0072] Based on this, in an embodiment of the present disclosure, when there is at least one audio segment to be confirmed in the audio data, the target audio segment can be determined based on the playback order of the audio segments to be confirmed in the audio data, so as to determine the target audio frame based on the target audio segment, thereby minimizing the interference of audio segments that are not related to the preset content and improving the accuracy of the determined target audio frame.
[0073] In an optional implementation, the above step S103, determining the target video frame in the audio and video data to be analyzed, specifically includes the following process:
[0074] S1034: Perform frame extraction processing on the video data in the audio and video data to be analyzed to obtain a video frame collection corresponding to the video data.
[0075] In the embodiment of the present disclosure, the above Figure 1 It can be known from the corresponding embodiment that the frame extraction process can be performed by extracting frames at the second level, that is, extracting a fixed number of video frames from the video data per second, thereby obtaining the video frame collection. Based on this, a tool that can implement the second-level frame extraction can be selected to implement the frame extraction process of the video data, for example, ffmpeg (a video processing tool).
[0076] When performing frame extraction processing, a fixed number of video frames can be extracted from the video frames at a fixed interval. For example, the fixed interval can be the first frame per second, the last frame per second, etc. The fixed number of frames can be one frame or more frames, and the present disclosure does not make any specific limitations on this.
[0077] S1035: Determine the first video frame in the video frame collection whose pixel value does not meet the preset conditions, and determine the target video frame based on the first video frame; wherein the first video frame is the video frame corresponding to the transition of the video scene in the audio and video data to be analyzed.
[0078] In the embodiment of the present disclosure, a target video frame may be determined in a video frame collection, wherein the target video frame may include multiple types, for example, a first video frame, a second video frame, and a third video frame. A specific method for determining the target video frame is as follows:
[0079] Method 1: Determine the first video frame in the video frame collection, and determine the first video frame as the target video frame.
[0080] In the disclosed embodiment, the first video frame is a video frame corresponding to a video scene transition in the audio and video data to be analyzed. It should be understood that in film and television works, a transition (i.e., a video scene transition) is often performed at the end or beginning of the film to switch the beginning to the main film, or from the main film to the end. When the transition is performed, the corresponding video frame often has a fixed screen content, for example, a black screen. When the screen is black, the pixel value of each pixel in the video frame is often close to 0 (when the pixel value of a pixel is 0, the color of the pixel is black).
[0081] Based on this, a preset condition can be set in advance to filter out the first video frame corresponding to the black screen based on the preset condition. Specifically, the proportion of pixel points in the video frame whose pixel values are lower than the preset pixel value can be determined first, and the video frame whose proportion is greater than the preset proportion is determined as the first video frame that does not meet the preset condition.
[0082] Since when the pixel value of a pixel is 0, the color corresponding to the pixel is black, the preset pixel value can be close to 0, for example, 10. At the same time, since the proportion of pixels below the preset pixel value in the video frame is larger, the picture in the video frame is closer to a black screen. Therefore, the preset ratio can be close to 100%, for example, 95%.
[0083] It should be understood that the corresponding video frame during the transition may be displayed in other ways besides a black screen, such as a screen switch. Therefore, when determining the first video frame, the screen switch node in the video data may also be identified. Specifically, since the content of adjacent video frames is quite different when the screen switches, the pixel values of each pixel point of adjacent video frames may also change significantly when rendering.
[0084] Based on this, when determining the video frame corresponding to the transition, the pixel value difference of each pixel point between adjacent video frames can be analyzed, and the adjacent video frames whose pixel value difference exceeds the difference threshold are determined as the video frames corresponding to the transition. Next, the last video frame in the adjacent video frames corresponding to the transition can be determined as the first video frame.
[0085] Method 2: Determine a second video frame in the video frame collection, and determine the second video frame as the target video frame.
[0086] In the embodiment of the present disclosure, the second video frame can be used to indicate a video frame including key content in the video data, wherein the key content can be determined based on the content characteristics of the preset content, for example, when the preset content is the end credits of a film or television work, the key content can be the end credits keyword. Specifically, when the audio and video data to be analyzed is a film or television work, the end credits keyword can be "director", "cast", etc.
[0087] Based on this, when determining the second video frame in the video frame collection, text detection and recognition processing can be performed on the video frames in the video frame collection, and the recognized text and the keywords in the above key content can be matched to obtain the second video frame including the keyword.
[0088] Method three: determine the third video frame in the video frame collection, and determine the third video frame as the target video frame.
[0089] In an embodiment of the present disclosure, when the second video frame is not detected in the video frame collection, a third video frame may be detected in the video frame collection, where the third video frame may be used to indicate a video frame including a preset type of content in the video data, wherein when the preset content is the ending credits of a film or television work, the preset type of content may be the ending subtitles.
[0090] It should be understood that the above end credits are usually scrolling subtitles, such as Figure 2 The diagram shown is a schematic diagram of a picture frame corresponding to the end subtitles. The content of the end subtitles displayed in the next frame can be determined according to the scrolling speed set for the scrolling subtitles, thereby realizing the scrolling display of the end subtitles.
[0091] Based on this, in the process of determining the third video frame, the text box in the video frame in the video collection can be first identified, wherein the text box includes the identified text content. After identifying the text box, the video frame n frames after the video frame can be obtained to determine whether the same text box is included in the video frame n frames.
[0092] After determining that the video frame includes the same text box in the subsequent n frames, the displacement direction and displacement distance of the same text box in the subsequent n frames can be determined based on the position of the same text box. Next, it can be determined whether the displacement direction and displacement distance meet the preset displacement requirements, and if the displacement requirements are met, the n+1 frames of video frames are determined as video frames including the above-mentioned end subtitles, and the first frame of video frames therein is determined as the third video frame. Specifically, the displacement direction of the same text box can be horizontal or vertical, and the n+1 frames of video frames with a displacement distance exceeding 20px can be determined as video frames including end subtitles.
[0093] In the embodiments of the present disclosure, the target video frame can be determined in a variety of ways, wherein each way can correspond to at least one feature of the start and end positions of the preset content, thereby improving the accuracy of the start and end positions of the preset content indicated by the target video frame determined based on the target video frame.
[0094] In an optional implementation, the above step S105, determining the target point frame in the target audio frame and the target video frame, specifically includes the following process:
[0095] S1051: When the target video frame includes a first video frame, determine a reference point frame between the target audio frame and the target video frame; wherein the first video frame is a video frame corresponding to a transition of a video scene in the audio and video data to be analyzed.
[0096] In the disclosed embodiments, it can be seen from the above that in a film or TV work, a transition (i.e., a video scene transition) is often performed at the end or beginning of the film to switch from the beginning to the main film, or from the main film to the end. When the transition is performed, the corresponding video frame is the first video frame, so it is highly likely that the first video frame is the start and end position of the preset content.
[0097] Based on this, the first video frame in the video data may be identified first. The specific method of identifying the first video frame is as described in the embodiment corresponding to the above step S103, which will not be repeated here.
[0098] At the same time, considering that the first video frame is more likely to be the starting and ending positions of the preset content, but not necessarily the starting and ending positions, the reference point frame can be used to verify whether the first video frame is the target video frame used to indicate the starting and ending positions of the preset content.
[0099] Specifically, when the first video frame is identified, a reference point frame can be determined in the target audio frame and the target video frame. The reference point frame can be used to compare with the position of the first video frame, so as to determine the target video frame based on the comparison result to improve the confidence of the target video frame.
[0100] In the embodiment of the present disclosure, the reference point frame can be determined based on the positional relationship between the target audio frame and the second video frame or the third video frame. When the target video frame includes the second video frame or the third video frame, the method for determining the reference point frame is as follows, which will not be repeated here. In addition, if the target video frame does not include the second video frame and the third video frame, the target audio frame can be directly determined as the reference point frame.
[0101] S1052: Determine a first data region where the reference point frame is located in the audio and video data to be analyzed.
[0102] S1053: Match the first video frame with the first data region, and determine a target point frame in the first video frame and the reference point frame based on the matching result.
[0103] In the embodiment of the present disclosure, the first data region where the reference point frame is located in the audio and video data to be analyzed is first determined. Specifically, the region division method corresponding to the reference point frame can be determined first, and the first data region where the reference point frame is located in the audio and video data to be analyzed is determined based on the region division method. For example, the region division method can be used to indicate that 30 seconds before and after the reference point frame is determined as the first data region where the reference point frame is located in the audio and video data to be analyzed.
[0104] It should be understood that when the type of the reference point frame is different, the region division method corresponding to the reference point frame may be different. For example, when the reference point frame is a target audio frame, the region division method may be: 60 seconds before and after the reference point frame is determined as the first data region where the reference point frame is located in the audio and video data to be analyzed. When the reference point frame is a target video frame, the region division method may be: 30 seconds before and after the reference point frame is determined as the first data region where the reference point frame is located in the audio and video data to be analyzed.
[0105] After determining the first data area where the reference point frame is located in the audio and video data to be analyzed, the first video frame can be matched with the first data area to obtain a matching result, which can be used to indicate whether the first video frame is in the first data area. Specifically based on the matching result, a method for determining the target point frame in the first video frame and the reference point frame is described as follows and will not be repeated here.
[0106] In the embodiment of the present disclosure, since the first video frame is likely to be the starting and ending positions of the preset content, when the first video frame is included in the target video frame, the reference point frame can be determined, and the first video frame can be verified based on the reference point frame, and the target point frame can be determined based on the verification result, thereby improving the confidence of the determined target point frame.
[0107] In an optional implementation, the above step S1053, based on the matching result, determines the target point frame in the first video frame and the reference point frame, specifically includes the following process:
[0108] (1) determining, based on the matching result, whether the first video frame is in the first data area;
[0109] (2) when the first video frame is not in the first data area, determining the reference point frame as the target point frame;
[0110] (3) When the first video frame is in the first data area, the first video frame is determined as the target point frame.
[0111] In the embodiment of the present disclosure, firstly, it can be determined whether the first video is in the first data area based on the matching result, which specifically includes the following situations:
[0112] Case 1: The first video frame is not in the first data area.
[0113] In the disclosed embodiment, when the audio and video data to be analyzed is a film or television work, and the preset content is the ending credits, since the content and the display method of the ending credits of different types of film or television works are different, the time interval between the first video frame and the reference point frame may also be different.
[0114] In an optional implementation, the first video frame may be located before the first data area. In this case, there may be substantial content between the first video frame and the reference point frame. In this case, the reference point frame may be determined as the target point frame for indicating the starting position of the end of the film.
[0115] In another optional implementation, when the first video frame is located after the first data area, the ending content displayed between the first video frame and the reference point frame may be longer, for example, the ending content may be a tidbit of a film or TV work. In this case, if the first video frame is still determined as the target point frame, the starting position of the ending determined based on the target point frame will be biased. Therefore, the reference point frame may be determined as the target point frame used to indicate the starting position of the ending.
[0116] Case 2: The first video frame is in the first data area.
[0117] In the embodiment of the present disclosure, when the above-mentioned audio and video data to be analyzed is a film or television work, and the preset content is the ending credits, if the first video frame is in the first data area, it means that the time interval between the first video frame and the first data area is small. At the same time, since the first video frame is likely to be the starting and ending positions of the ending credits, the first video frame can be determined as the target point frame.
[0118] Based on this, in the embodiment of the present disclosure, since the first video frame is likely to be the starting and ending positions of the preset content, it is possible to determine whether the first video frame is in the above-mentioned first video frame, so as to determine whether the target point frame is the first video frame or the reference point frame based on the determined result, thereby improving the confidence of the determined target point frame.
[0119] In an optional implementation, the above step S1051, determining the reference point frame in the target audio frame and the target video frame, specifically includes the following process:
[0120] (1) when the target video frame includes a second video frame, determining a second data region where the second video frame is located in the audio and video data to be analyzed; wherein the second video frame is used to indicate a video frame including key content;
[0121] (2) when the target audio frame is not in the second data area, determining the second video frame as the reference point frame;
[0122] (3) When the target audio frame is in the second data area, the target audio frame is determined as the reference point frame.
[0123] In the embodiment of the present disclosure, since the second video frame is more likely to be the start and end position of the preset content than the third video frame, and is smaller than the target audio frame, when the target video frame includes the second video frame, the target audio frame can be verified by the second video frame. In specific implementation, the second data area where the second video frame is located in the audio data to be analyzed can be determined first, wherein the second data area can be n seconds before and after the second video frame, for example, 2 seconds.
[0124] Next, it may be determined whether the target audio frame is in the second data area, specifically including the following situations:
[0125] Case 1: the target audio frame is not in the second data area.
[0126] In the disclosed embodiment, it is considered that in some film and television works, the target audio frame used to indicate the ending song and the second video frame used to indicate the cast list are not played synchronously. For example, the ending song is played before the plot ends, or the timing of playing the ending song lags behind the display of the cast list. In this case, the target audio frame is not in the second data area. In this case, the second video frame can more accurately reflect the start and end positions of the ending song. Therefore, when the target audio frame is not in the second data area, the second video frame can be determined as the reference point frame.
[0127] Case 2: the target audio frame is in the second data area.
[0128] In the embodiment of the present disclosure, when the target audio frame is in the second data area, it can be considered that the playback of the ending song is synchronized with the cast and crew list. At this time, since the possibility that the second video frame is the start and end position of the preset content is lower than that of the target audio frame, the target audio frame can be determined as the above-mentioned reference point frame.
[0129] Based on this, in the embodiment of the present disclosure, considering that the possibility that the second video frame is the starting and ending position of the preset content is greater than that of the third video frame, and smaller than the target audio frame, the target audio frame can be verified by the second video frame, thereby determining the reference point frame in the second video frame and the target audio frame, thereby improving the confidence of the determined reference point frame.
[0130] In an optional implementation, the above step S1051, determining the reference point frame in the target audio frame and the target video frame, specifically includes the following process:
[0131] (1) when the target video frame includes a third video frame, determining a positional relationship between the third video frame and the target audio frame; wherein the third video frame is used to indicate a video frame including a preset type of content;
[0132] (2) Based on the positional relationship, a reference point frame is determined in the target video frame and the third video frame.
[0133] In an optional implementation, when the target video frame includes a third video frame, since the possibility that the third video frame is the start and end position of the preset content is less than that of the target audio frame, the target audio frame can be directly determined as the reference point frame.
[0134] In another optional implementation, when the target video frame includes a third video frame, the positional relationship between the third video frame and the target audio frame in the audio and video data to be analyzed can be determined to determine the reference point frame based on the positional relationship.
[0135] Specifically, when the positional relationship between the target audio frame and the third video frame is non-overlapping and the starting position of the preset content needs to be determined, the frame with an earlier playback order corresponding to the positional relationship between the target audio frame and the third video frame in the audio and video data to be analyzed can be determined as the reference point frame.
[0136] When the position relationship between the target audio frame and the third video frame overlaps, since the possibility that the third video frame is the start and end position of the preset content is less than that of the target audio frame, the target audio frame can be determined as the reference point frame.
[0137] In the embodiment of the present disclosure, considering that the possibility that the third video frame is the starting and ending positions of the preset content is lower than that of the target audio frame, the reference point frame can be determined in the third video frame and the target audio frame based on the positional relationship between the third video frame and the target audio frame, thereby improving the confidence of the determined reference point frame.
[0138] See Figure 3 FIG. 1 is a flowchart of another audio and video analysis method provided by an embodiment of the present disclosure, wherein the method includes steps S301 to S308, wherein:
[0139] S301: Acquire audio and video data to be analyzed.
[0140] S302: Extract frames from the audio and video data to be analyzed to obtain the above video frame collection.
[0141] S303: Determine audio data in the audio and video data to be analyzed, and determine a target audio frame based on the audio data.
[0142] In the embodiment of the present disclosure, the method for determining the target audio data is as described in the embodiment corresponding to the above step S103, and will not be repeated here.
[0143] S304: Based on the above video frame collection, determine the second video frame and the third video frame.
[0144] S305: Determine a first video frame corresponding to a video scene transition in the audio and video data to be analyzed.
[0145] In the embodiment of the present disclosure, the method for determining the first video frame is as described in the embodiment corresponding to the above step S103, and will not be repeated here.
[0146] S306: Determine a second video frame in the video frame collection that includes key content.
[0147] In the embodiment of the present disclosure, the method for determining the second video frame is as described in the embodiment corresponding to the above step S103, which will not be repeated here.
[0148] S307: Determine that the video frame collection includes a third video frame of a preset type of content.
[0149] In the embodiment of the present disclosure, the method for determining the third video frame is as described in the embodiment corresponding to the above step S103, which will not be repeated here.
[0150] S308: Based on a preset processing logic, a target point frame is determined from the target video frame and the target audio frame.
[0151] In the embodiment of the present disclosure, the method of determining the target point frame based on the preset processing logic is as described in the embodiment corresponding to the above step S105, which will not be repeated here.
[0152] In summary, in the embodiments disclosed herein, the audio and video data to be analyzed can first be obtained, and the audio and video data to be analyzed can be analyzed to determine the target audio frame and the target video frame in the audio and video data to be analyzed, wherein the target audio frame and the target video frame can be used to indicate the area where the preset content in the audio and video data to be analyzed is located, and here, the preset content can be the above-mentioned non-essential content. Next, the target point frame can be determined in the target audio frame and the target video frame to locate the start and end positions of the preset content based on the target point frame, thereby reducing the dependence on human resources and improving the efficiency of labeling the audio and video data to be analyzed.
[0153] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0154] Based on the same inventive concept, an audio and video analysis device corresponding to the audio and video analysis method is also provided in the embodiment of the present disclosure. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned audio and video analysis method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0155] Reference Figure 4 FIG. 1 is a schematic diagram of an audio and video analysis device provided by an embodiment of the present disclosure, wherein the device comprises: an acquisition unit 41, a first determination unit 42, and a second determination unit 43; wherein:
[0156] An acquisition unit 41 is used to acquire audio and video data to be analyzed;
[0157] A first determining unit 42 is used to determine a target audio frame in the audio and video data to be analyzed, and to determine a target video frame in the audio and video data to be analyzed; wherein the target audio frame and the target video frame are used to indicate an area where a preset content is located in the audio and video data to be analyzed;
[0158] The second determining unit 43 is used to determine a target point frame in the target audio frame and the target video frame, so as to determine the start and end positions of the preset content based on the target video frame.
[0159] In the disclosed embodiment, the audio and video data to be analyzed can be first obtained, and the audio and video data to be analyzed can be analyzed to determine the target audio frame and the target video frame in the audio and video data to be analyzed, wherein the target audio frame and the target video frame can be used to indicate the area where the preset content in the audio and video data to be analyzed is located, and here, the preset content can be the above-mentioned non-essential content. Next, the target point frame can be determined in the target audio frame and the target video frame to locate the start and end positions of the preset content based on the target point frame, thereby reducing the dependence on human resources and improving the annotation efficiency of the audio and video data to be analyzed.
[0160] In a possible implementation manner, the second determining unit 43 is further configured to:
[0161] In the case where the target video frame includes a first video frame, determining a reference point frame in the target audio frame and the target video frame; wherein the first video frame is a video frame corresponding to a video scene transition in the audio and video data to be analyzed;
[0162] Determine a first data region where the reference point frame is located in the audio and video data to be analyzed;
[0163] The first video frame is matched with the first data region, and based on the matching result, a target point frame is determined in the first video frame and the reference point frame.
[0164] In a possible implementation manner, the second determining unit 43 is further configured to:
[0165] Based on the matching result, determining whether the first video frame is in the first data area;
[0166] In a case where the first video frame is not in the first data area, determining the reference point frame as the target point frame;
[0167] When the first video frame is in the first data area, the first video frame is determined as the target point frame.
[0168] In a possible implementation manner, the second determining unit 43 is further configured to:
[0169] In the case where the target video frame includes a second video frame, determining a second data region where the second video frame is located in the audio and video data to be analyzed; wherein the second video frame is used to indicate a video frame including key content;
[0170] In a case where the target audio frame is not in the second data area, determining the second video frame as the reference point frame;
[0171] In a case where the target audio frame is in the second data region, the target audio frame is determined as the reference point frame.
[0172] In a possible implementation manner, the second determining unit 43 is further configured to:
[0173] In the case where the target video frame includes a third video frame, determining a positional relationship between the third video frame and the target audio frame; wherein the third video frame is used to indicate a video frame including a preset type of content;
[0174] Based on the positional relationship, a reference point frame is determined in the target video frame and the third video frame.
[0175] In a possible implementation manner, the first determining unit 42 is further configured to:
[0176] Performing frame extraction processing on the video data in the audio and video data to be analyzed to obtain a collection of video frames corresponding to the video data;
[0177] Determine a first video frame in the video frame collection whose pixel value does not meet a preset condition, and determine the target video frame based on the first video frame; wherein the first video frame is a video frame corresponding to a video scene transition in the audio and video data to be analyzed.
[0178] In a possible implementation manner, the first determining unit 42 is further configured to:
[0179] Determine audio data in the audio and video data to be analyzed, and determine at least one audio segment to be confirmed in the audio data;
[0180] Based on the playback order of each of the to-be-confirmed audio segments in the audio data, and based on the playback order, determine the target audio segment;
[0181] A target audio frame is determined according to the target audio segment.
[0182] For descriptions of the processing flow of each unit in the device and the interaction flow between each unit, reference may be made to the relevant descriptions in the above method embodiments, which will not be described in detail here.
[0183] Corresponds to Figure 1 The audio and video analysis method in the present disclosure also provides a computer device 500, such as Figure 5 FIG. 5 is a schematic diagram of the structure of a computer device 500 provided in an embodiment of the present disclosure, including:
[0184] Processor 51, memory 52, and bus 53; memory 52 is used to store execution instructions, including memory 521 and external memory 522; memory 521 here is also called internal memory, which is used to temporarily store operation data in processor 51 and data exchanged with external memory 522 such as hard disk. Processor 51 exchanges data with external memory 522 through memory 521. When the computer device 500 is running, the processor 51 communicates with the memory 52 through bus 53, so that the processor 51 executes the following instructions:
[0185] Obtain audio and video data to be analyzed;
[0186] Determine a target audio frame in the audio and video data to be analyzed, and determine a target video frame in the audio and video data to be analyzed; wherein the target audio frame and the target video frame are used to indicate an area where a preset content in the audio and video data to be analyzed is located;
[0187] A target point frame is determined in the target audio frame and the target video frame, so as to determine the start and end positions of the preset content based on the target video frame.
[0188] The present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the audio and video analysis method described in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.
[0189] The present disclosure also provides a computer program product that carries a program code. The program code includes instructions that can be used to execute the steps of the audio and video analysis method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.
[0190] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).
[0191] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.
[0192] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0193] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0194] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0195] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. An audio and video analysis method, characterized in that: include: Obtain audio and video data to be analyzed; Determine a target audio frame in the audio and video data to be analyzed, and determine a target video frame in the audio and video data to be analyzed; wherein the target audio frame and the target video frame are used to indicate an area where a preset content in the audio and video data to be analyzed is located; Determining a target point frame in the target audio frame and the target video frame, so as to determine the start and end positions of the preset content based on the target video frame; The step of determining a target point frame in the target audio frame and the target video frame comprises: determining a reference point frame in the target audio frame and the target video frame when the target video frame includes a first video frame; wherein the first video frame is a video frame corresponding to a video scene transition in the audio and video data to be analyzed; determining a first data region where the reference point frame is located in the audio and video data to be analyzed; matching the first video frame with the first data region, and determining a target point frame in the first video frame and the reference point frame based on the matching result; The method of determining a target point frame between the first video frame and the reference point frame based on the matching result includes: determining whether the first video frame is in the first data area based on the matching result; if the first video frame is not in the first data area, determining the reference point frame as the target point frame; if the first video frame is in the first data area, determining the first video frame as the target point frame.
2. The method according to claim 1, characterized in that The step of determining a reference point frame in the target audio frame and the target video frame comprises: In the case where the target video frame includes a second video frame, determining a second data region where the second video frame is located in the audio and video data to be analyzed; wherein the second video frame is used to indicate a video frame including key content; In a case where the target audio frame is not in the second data area, determining the second video frame as the reference point frame; In a case where the target audio frame is in the second data region, the target audio frame is determined as the reference point frame.
3. The method according to claim 1, characterized in that The step of determining a reference point frame in the target audio frame and the target video frame comprises: In the case where the target video frame includes a third video frame, determining a positional relationship between the third video frame and the target audio frame; wherein the third video frame is used to indicate a video frame including a preset type of content; Based on the positional relationship, a reference point frame is determined in the target video frame and the third video frame.
4. The method according to claim 1, characterized in that: The determining of the target video frame in the audio and video data to be analyzed includes: Performing frame extraction processing on the video data in the audio and video data to be analyzed to obtain a collection of video frames corresponding to the video data; Determine a first video frame in the video frame collection whose pixel value does not meet a preset condition, and determine the target video frame based on the first video frame; wherein the first video frame is a video frame corresponding to a video scene transition in the audio and video data to be analyzed.
5. The method according to claim 1, characterized in that The determining of the target audio frame in the audio and video data to be analyzed includes: Determine audio data in the audio and video data to be analyzed, and determine at least one audio segment to be confirmed in the audio data; Based on the playback order of each of the to-be-confirmed audio segments in the audio data, and based on the playback order, determine the target audio segment; A target audio frame is determined according to the target audio segment.
6. An audio and video analysis device, characterized in that: include: An acquisition unit, used to acquire audio and video data to be analyzed; A first determining unit is used to determine a target audio frame in the audio and video data to be analyzed, and to determine a target video frame in the audio and video data to be analyzed; wherein the target audio frame and the target video frame are used to indicate an area where a preset content is located in the audio and video data to be analyzed; A second determining unit, configured to determine a target point frame in the target audio frame and the target video frame, so as to determine the start and end positions of the preset content based on the target video frame; Determining a target point frame in the target audio frame and the target video frame includes: determining a reference point frame in the target audio frame and the target video frame when the target video frame includes a first video frame; wherein the first video frame is a video frame corresponding to a video scene transition in the audio and video data to be analyzed; determining a first data region where the reference point frame is located in the audio and video data to be analyzed; matching the first video frame with the first data region, and determining a target point frame in the first video frame and the reference point frame based on the matching result; Based on the matching result, a target point frame is determined in the first video frame and the reference point frame, including: based on the matching result, determining whether the first video frame is in the first data area; if the first video frame is not in the first data area, determining the reference point frame as the target point frame; if the first video frame is in the first data area, determining the first video frame as the target point frame.
7. A computer device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the audio and video analysis method as described in any one of claims 1 to 5 are performed.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the audio and video analysis method as described in any one of claims 1 to 5 are executed.
