Automatic video editing method and device and electronic equipment
By matching the timestamps of the keyframe sequence of multi-came video streams, synchronous editing and playback of multi-came videos is realized, solving the problems of low efficiency and large errors in the existing technology, and providing an efficient and accurate multi-view video experience.
Patent Information
- Application Number
- CN202411778561.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-03-21
AI Technical Summary
The prior art has problems of low efficiency and large errors in synchronous editing and playback of multi-camera videos, and cannot effectively deal with the problem of time out-of-synchronization, resulting in users being unable to obtain a multi-view viewing experience similar to live broadcasts.
通过获取与目标场景关联的多段视频流,根据多段视频流各自的关键帧序列进行时间戳匹配,得到视频帧映射信息集合,实现对多段视频流的同步剪辑,确保各机位视频的时间轴一致。
It improves the editing efficiency and accuracy of multi-camera videos, solves the problems of low video editing efficiency and large errors, realizes synchronous playback of multi-view videos, and provides a similar viewing experience as live broadcast.
Smart Images

Figure CN119676510A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of video editing, and in particular to a method, device and electronic equipment for automatic video editing. Background Art
[0002] With the widespread application of multi-camera live broadcast technology, users can use the cloud director function to watch videos from multiple cameras simultaneously during the live broadcast. However, after the live broadcast content is converted to on-demand, due to the inconsistent recording time of the videos from multiple cameras, the existing technology has obvious deficiencies in the synchronous editing and playback of multi-camera videos, which often leads to complicated editing processes and inconsistent playback effects. In the traditional multi-camera video editing process, editors need to manually adjust the editing points of each camera, which is time-consuming and prone to errors, and cannot guarantee the precise synchronization of the videos from each camera.
[0003] In the process of converting multi-camera videos to on-demand, the existing technology cannot effectively handle the time asynchrony problem and cannot provide users with a multi-view viewing experience similar to live broadcast. Therefore, how to efficiently and accurately achieve the synchronous editing and playback of multi-camera videos has become a technical problem that needs to be solved urgently in this field. In other words, the existing technology has the problem of low video editing efficiency and errors.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present application provide a method, device and electronic device for automatic video editing, so as to at least solve the technical problems of low efficiency and errors in video editing in the current related technologies.
[0006] According to one aspect of an embodiment of the present application, a method for automatic video editing is provided, comprising: obtaining multiple video streams associated with a target scene, wherein the multiple video streams are obtained by respectively capturing the target scene by multiple cameras; performing timestamp matching on video frames included in each of the multiple video streams according to key frame sequences corresponding to each of the multiple video streams to obtain a video frame mapping information set, wherein the video frame mapping information set includes multiple natural timestamps and multiple video frames that respectively match the multiple natural timestamps, and the multiple video frames respectively correspond to a video stream; in a case where a first video sequence is obtained by editing a first video stream among the multiple video streams, synchronously editing at least one second video stream among the multiple video streams according to the video frame mapping information set to obtain a second video sequence that matches the first video sequence.
[0007] According to another aspect of an embodiment of the present application, there is also provided an apparatus for automatic video editing, comprising: an acquisition unit, for acquiring multiple video streams associated with a target scene, wherein the multiple video streams are acquired by respectively capturing the target scene by multiple cameras; a matching unit, for performing timestamp matching on video frames included in each of the multiple video streams according to key frame sequences corresponding to each of the multiple video streams, to obtain a video frame mapping information set, wherein the video frame mapping information set includes multiple natural timestamps and multiple video frames respectively matched with the multiple natural timestamps, and the multiple video frames respectively correspond to a video stream; and an editing unit, for synchronously editing at least one second video stream in the multiple video streams according to the video frame mapping information set, to obtain a second video sequence matching the first video sequence, when a first video sequence is acquired by editing a first video stream in the multiple video streams.
[0008] Optionally, the above-mentioned editing unit includes: a determination module for obtaining the starting key frame and the ending key frame that respectively match multiple target editing video sequences in the first video sequence, wherein the target editing video sequence is a video sequence on which the editing operation has been performed; and determining the starting natural timestamp that matches the starting key frame of each target editing video sequence and the ending natural timestamp that matches the ending key frame of each target editing video sequence according to the video frame mapping information set.
[0009] Optionally, the above-mentioned determination module includes: a first acquisition module, used to obtain a natural timestamp matching each key frame in the first video sequence; obtain key frames corresponding to the natural timestamps that meet the continuous time condition to obtain a key frame set, wherein the continuous time condition is that the difference results between any two natural timestamps have the same sign; determine the video sequence matching the key frame set as the target clip video sequence; and respectively determine the starting key frame and the ending key frame matching each target clip video sequence.
[0010] Optionally, the above-mentioned determination module includes: a first determination module, used to determine multiple video sequences to be edited that match at least one second video stream based on a video frame mapping information set, wherein the starting natural timestamp and the ending natural timestamp of the video sequences to be edited and the target editing video sequences to match them are the same; and respectively determine the editing start key frame that matches the starting natural timestamp of each video sequence to be edited in at least one second video stream, and the editing end key frame that matches the ending natural timestamp of each video sequence to be edited.
[0011] Optionally, the above-mentioned first determination module also includes a second determination module, which is used to determine the target editing interval matching each target editing video sequence in the first video sequence according to the current editing timeline, wherein the target editing interval is the interval between the current start timestamp and the current end timestamp matching the target editing video sequence; move the editing start key frame of each video sequence to be edited to the corresponding position of the current start timestamp of the target editing video sequence that matches it respectively, move the editing end key frame of each video sequence to be edited to the corresponding position of the current end timestamp of the target editing video sequence that matches it respectively, and fill the video sequence between the editing start key frame and the editing end key frame into the target editing interval to obtain a second video sequence.
[0012] Optionally, the above-mentioned matching unit includes: a second acquisition module, used to extract frames from multiple video streams to obtain a set of video frames that match each video stream respectively; when two consecutive video frames in the video frame set meet the target scene switching condition, determine that the video frame is a key frame; match the key frames of multiple videos according to natural timestamps to obtain a video frame mapping information set.
[0013] Optionally, the above-mentioned second acquisition module includes: a third acquisition module, used to respectively obtain the duration of any two video streams and the number of key frames matching the video streams from multiple video streams; determine the time deviation between the two video streams based on the ratio of the difference in duration between the two video streams to the difference in the number of key frames; and adjust the duration of the multiple video streams based on the average value of multiple time deviations.
[0014] Optionally, the above-mentioned matching unit includes: a third determination module, which is used to obtain the first video frame of the first video sequence that matches the host position player and the playback status that matches the host position player at each time-aligned monitoring node; and determine the second video frame of the second video sequence that matches the slave position player based on the first video frame and the playback status that match the host position player at each time-aligned monitoring node.
[0015] According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-mentioned automatic video editing method through the computer program.
[0016] In an embodiment of the present application, after obtaining multiple video streams associated with a target scene, timestamp matching is performed on the video frames included in each of the multiple video streams according to the key frame sequences corresponding to each of the multiple video streams to obtain a video frame mapping information set, wherein the video frame mapping information set includes multiple natural timestamps and multiple video frames that match the multiple natural timestamps, respectively, and the multiple video frames correspond to a video stream respectively; further, when a first video sequence is obtained by clipping a first video stream in the multiple video streams, synchronous clipping of at least one second video stream in the multiple video streams is implemented according to the video frame mapping information set to obtain a second video sequence that matches the first video sequence, thereby solving the technical problems of low efficiency and errors in video clipping in the current related technologies. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0018] Figure 1 is a schematic diagram of an application environment of an optional automatic video editing method according to an embodiment of the present application;
[0019] Figure 2 is a flow chart of an optional method for automatic video editing according to an embodiment of the present application;
[0020] Figure 3 is a schematic diagram of an optional method for automatic video editing according to an embodiment of the present application;
[0021] Figure 4 is a flowchart of another optional automatic video editing method according to an embodiment of the present application;
[0022] Figure 5 is a schematic diagram of another optional automatic video editing method according to an embodiment of the present application;
[0023] Figure 6 is a schematic structural diagram of an optional automatic video editing device according to an embodiment of the present application;
[0024] Figure 7 It is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] According to one aspect of the embodiment of the present application, a method for automatic video editing is provided. Optionally, as an optional implementation, the method for automatic video editing can be but is not limited to being applied to: Figure 1 in the environment shown.
[0028] The server 112 includes a database 114 and a processing engine 116. The server 112 executes S102 to obtain multiple video streams associated with the target scene, wherein the multiple video streams are obtained by capturing the target scene by multiple camera devices respectively;
[0029] S104, performing timestamp matching on video frames included in each of the multiple video streams according to key frame sequences corresponding to each of the multiple video streams to obtain a video frame mapping information set, wherein the video frame mapping information set includes multiple natural timestamps and multiple video frames respectively matched with the multiple natural timestamps, and the multiple video frames respectively correspond to a video stream;
[0030] S106, when a first video sequence is obtained by clipping a first video stream among the multiple video streams, synchronously clipping at least one second video stream among the multiple video streams according to the video frame mapping information set to obtain a second video sequence matching the first video sequence;
[0031] The server 112 executes S108 to play the video sequence to the terminal device 102 through the network 110 ; the terminal device 102 includes a display 108 , a processor 106 , and a memory 104 .
[0032] Optionally, in this embodiment, the terminal device may be a terminal device configured with a target client, which may include but is not limited to at least one of the following: a mobile phone (such as an Android phone, an iOS phone, etc.), a laptop, a tablet computer, a PDA, a MID (Mobile Internet Devices), a PAD, a desktop computer, a smart TV, etc. The target client may be a video client, an instant messaging client, a browser client, an education client, etc. The network may include but is not limited to: a wired network, a wireless network, wherein the wired network includes: a local area network, a metropolitan area network and a wide area network, and the wireless network includes: Bluetooth, WIFI and other networks that realize wireless communication. The server may be a single server, or a server cluster consisting of multiple servers, or a cloud server. The above is only an example, and this embodiment does not impose any limitation on this.
[0033] Optionally, as an optional implementation, as Figure 2 As shown, the above-mentioned method of automatic video editing includes:
[0034] S202, acquiring multiple video streams associated with a target scene, wherein the multiple video streams are acquired by multiple camera devices respectively capturing the target scene;
[0035] S204, performing timestamp matching on video frames included in each of the multiple video streams according to key frame sequences corresponding to each of the multiple video streams, to obtain a video frame mapping information set, wherein the video frame mapping information set includes multiple natural timestamps and multiple video frames respectively matched with the multiple natural timestamps, and the multiple video frames respectively correspond to a video stream;
[0036] S206, when a first video sequence is obtained by clipping a first video stream from multiple video streams, synchronously clip at least one second video stream from the multiple video streams according to a video frame mapping information set to obtain a second video sequence matching the first video sequence.
[0037] In step S202, multiple video streams associated with the target scene are obtained. It should be noted that the multiple video streams can be collected for different objects in the same scene. For example, the main video is collected by the main camera facing the center of the stage, slave camera 1 corresponds to the guest seats, and slave camera 2 corresponds to the audience seats, respectively collecting slave videos corresponding to the same scene as the main video.
[0038] In step S204, timestamp matching is performed on the video frames included in each of the multiple video streams according to the key frame sequences corresponding to each of the multiple video streams to obtain a video frame mapping information set, wherein the video frame mapping information set includes multiple natural timestamps and multiple video frames that match the multiple natural timestamps respectively, and the multiple video frames respectively correspond to a video stream.
[0039] As an optional implementation, key frames can be collected in real time for each camera's video stream during the live broadcast. The selection of key frames can be based on scene changes in the video content (such as scene switching points or I frame detection). Each collected key frame will be stamped with a high-precision natural timestamp, using NTP (Network Time Protocol) or other high-precision time synchronization mechanisms to ensure that each acquisition end has a consistent time base for collecting key frames for each camera.
[0040] The key frames of all camera positions and their time stamps are further synchronously stored in the system database as a basis for subsequent editing and synchronization; specifically, a mapping table of multi-camera key frames is generated in the system database.
[0041] The mapping table records the correspondence between the key frame timestamps of the main camera and the other cameras. For example, the main camera frame A corresponds to the frame B of the auxiliary camera 1 and the frame C of the auxiliary camera 2. The above video frame mapping information set can specifically include the natural time of each key frame in the video of each camera, the corresponding frame number and scene switching information; the mapping table is stored in the database to provide basic data for subsequent automated editing and synchronous playback.
[0042] S206, when a first video sequence is obtained by clipping a first video stream among the multiple video streams, synchronously clipping at least one second video stream among the multiple video streams according to the video frame mapping information set to obtain a second video sequence matching the first video sequence;
[0043] In some optional implementations, the system finds the key frame timestamps of other camera positions corresponding to the editing points of the host position by reading the video frame mapping information set, and automatically performs corresponding editing operations on the videos of other camera positions. For example: the starting key frame time of the editing segment of the host position is 10:00:00, and the ending key frame time is 10:05:00. The system will find the corresponding editing segments of other camera positions through the video frame mapping information set and perform automatic editing. That is, according to the video frame mapping information set, the key frames corresponding to the natural timestamps of 10:00:00 and 10:05:00 from the camera position are found, and all video sequences within 5 minutes are edited. After the editing is completed, the videos of multiple camera positions will maintain time synchronization to ensure that the time axis of all videos is consistent.
[0044] Through the above-mentioned implementation mode of the present application, after obtaining multiple video streams associated with the target scene, timestamp matching is performed on the video frames included in each of the multiple video streams according to the key frame sequences corresponding to each of the multiple video streams to obtain a video frame mapping information set, wherein the video frame mapping information set includes multiple natural timestamps and multiple video frames that match the multiple natural timestamps, respectively, and the multiple video frames respectively correspond to a video stream; and then, when a first video sequence is obtained by clipping a first video stream in the multiple video streams, it is achieved that at least one second video stream in the multiple video streams is synchronously clipped according to the video frame mapping information set to obtain a second video sequence matching the first video sequence, thereby solving the problems of low editing efficiency and low accuracy.
[0045] In an optional implementation, before synchronously editing at least one second video stream in the multiple video streams according to the video frame mapping information set, the method includes:
[0046] S1, obtaining a start key frame and an end key frame respectively matching a plurality of target clipping video sequences in a first video sequence, wherein the target clipping video sequence is a video sequence on which a clipping operation is performed;
[0047] S2, determining, according to the video frame mapping information set, a start natural timestamp that matches a start key frame of each target clip video sequence, and an end natural timestamp that matches an end key frame of each target clip video sequence.
[0048] In the above steps S1-S2, the start key frame and the end key frame respectively matching the multiple target clipping video sequences in the first video sequence are obtained, wherein the target clipping video sequence is a video sequence on which the clipping operation is performed; the start natural timestamp matching the start key frame of each target clipping video sequence and the end natural timestamp matching the end key frame of each target clipping video sequence are respectively determined according to the video frame mapping information set;
[0049] As an optional implementation, Figure 3 The video sequence shown includes key frames 1 to 9, wherein the target editing video sequence 1 includes key frames 1 to 3, and the target editing video sequence 2 includes key frames 6 to 9. For example, the editing operations of the target editing video sequence 1 and the target editing video sequence 2 may be to adjust the playback speed, playback order, and position;
[0050] Taking the target editing video sequence 1 as an example, the starting key frame that matches the target editing video sequence 1 is determined to be key frame 1, and the ending key frame that matches the target editing video sequence 1 is key frame 3. The real natural timestamps that match the key frames are determined according to the video frame mapping information set. For example, the natural timestamp of key frame 1 is 10:00:00, and the natural timestamp of key frame 3 is 10:01:00. It can be determined that the video sequence within 10:00:00-10:01:00 is edited. Since the video sequence of the main video and the key frames of the slave video are both marked and extracted based on the natural timestamps, the accuracy of key frame matching is improved, and automatic video editing is achieved.
[0051] Through the above-mentioned implementation mode of the present application, by accurately determining the start and end time of the edited video sequence, the accuracy of the editing operation is ensured, the redundancy or loss of video content is avoided, and the accuracy of automated video editing is improved.
[0052] In an optional implementation, obtaining start key frames and end key frames that respectively match a plurality of target clip video sequences in the first video sequence includes:
[0053] S1, obtaining a natural timestamp matching each key frame in a first video sequence;
[0054] S2, obtaining key frames corresponding to natural time stamps that meet the continuous time condition, and obtaining a key frame set, wherein the continuous time condition is that the difference results between any two natural time stamps have the same sign;
[0055] S3, determining the video sequence matching the key frame set as the target clip video sequence;
[0056] S4, respectively determining the start key frame and the end key frame that match each target clip video sequence.
[0057] In the above steps S1-S4, a natural timestamp matching each key frame in the first video sequence is obtained; key frames corresponding to the natural timestamps satisfying the continuous time condition are obtained to obtain a key frame set, wherein the continuous time condition is that the difference results between any two natural timestamps have the same sign; the video sequence matching the key frame set is determined as the target clip video sequence; and the start key frame and the end key frame matching each target clip video sequence are respectively determined.
[0058] The above-mentioned continuous time condition means that the difference results between the natural timestamps of any two adjacent key frames have the same sign, that is, if the difference between the two timestamps is positive, all subsequent differences should be positive. The continuous time condition can be used to determine which video clips in the video sequence are edited. For example, there are key frames 1 to 10 in the video sequence, where the natural timestamps of key frames 1 to 4 are increasing, and the natural timestamps corresponding to key frames 5 to 10 are less than the natural timestamp of key frame 1. It is determined that key frames 1 to 4 are edited from the latter part of the timeline to the former part, and all video clips contained in key frames 1 to 4 are edited clips.
[0059] As an optional implementation, assume that there are three cameras in a live broadcast event, camera 1 is the main camera, and cameras 2 and 3 are auxiliary cameras. The system collects key frames in real time from the video stream of camera 1 and obtains the following key frame numbers-natural timestamps: [1,13:00:00.000], [2,13:00:20.001], [3,13:00:40.002], [4,13:01:00.003];
[0060] Assuming that the key frames that meet the continuous time condition in a video clip are frames between 13:00:20 and 13:01:00, the system will determine the starting key frame as number 2 and the ending key frame as number 4 from the above key frame set. Then, for auxiliary cameras 2 and 3, the system will use the pre-generated key frame mapping table to find the natural timestamps corresponding to the starting key frame and ending key frame of camera 1, and automatically perform the corresponding editing operations to ensure that all camera videos remain synchronized on the timeline.
[0061] Through the implementation of the present application, a natural timestamp matching each key frame in the first video sequence is obtained; key frames corresponding to the natural timestamps that meet the continuous time condition are obtained to obtain a key frame set; the video sequence matching the key frame set is determined as the target editing video sequence; and the starting key frame and the ending key frame matching the target editing video sequence are determined respectively. This method can automatically identify important events or scene changes in the video by analyzing the time sequence of key frames, providing a more intelligent and efficient basis for video editing.
[0062] In an optional implementation, after determining the start natural timestamps matching the start key frames of each target clip video sequence and the end natural timestamps matching the end key frames of each target clip video sequence respectively according to the video frame mapping information set, the method further includes:
[0063] S1, determining a plurality of to-be-edited video sequences that match at least one second video stream according to a video frame mapping information set, wherein the to-be-edited video sequences and the target edited video sequences that match the to-be-edited video sequences have the same starting natural timestamp and ending natural timestamp;
[0064] S2, respectively determining a clip start key frame that matches a start natural timestamp of each to-be-cut video sequence in at least one second video stream, and a clip end key frame that matches an end natural timestamp of each to-be-cut video sequence.
[0065] In the above step S1, a plurality of to-be-edited video sequences matching at least one second video stream are determined according to a video frame mapping information set, wherein the to-be-edited video sequences and the matching target editing video sequences have the same starting natural timestamp and ending natural timestamp.
[0066] As an optional implementation, after determining a plurality of video sequences to be edited in the first video sequence, namely, target edited video sequences, a start key frame and an end key frame matching each target edited video sequence are further determined according to a video frame mapping information set, and a video sequence to be edited corresponding to a video sequence corresponding to the slave video can be determined according to the video frame mapping information set. For example, if the target video edited sequence is determined according to the key frames to be a video sequence of the main stage recorded from 12:00 to 12:30 in the morning at the master position, then the slave position can be a video sequence of a slave position recording the audience seats or judges seats in the same time period;
[0067] In the above step S2, a clip start key frame matching the start natural timestamp of each to-be-cut video sequence in at least one second video stream and a clip end key frame matching the end natural timestamp of each to-be-cut video sequence are determined respectively.
[0068] For example, to determine the clip start key frame and the clip end key frame in the time period of 12:00-12:30, it should be noted that if the timestamp of a key frame of the host position is 10:00:00.500, the frames with corresponding frame timestamps of other positions in the range of 10:00:00.480 to 10:00:00.520 will be considered to correspond to the key frame.
[0069] By determining multiple video sequences to be edited that match at least one second video stream according to a video frame mapping information set; determining the editing start key frame that matches the start natural timestamp of each video sequence to be edited in at least one second video stream, and the editing end key frame that matches the end natural timestamp of each video sequence to be edited. Through the above implementation method recorded in this application, it is ensured that videos shot by different cameras maintain time synchronization during editing, avoiding the problem of misalignment during video playback, and is suitable for scenes of multi-camera synchronous live broadcast or recording, such as live broadcast of sports events and multi-camera movie shooting.
[0070] In an optional implementation, according to the video frame mapping information set, synchronously editing at least one second video stream in the multiple video streams to obtain a second video sequence matching the first video sequence includes:
[0071] S1, determining a target clipping interval matching each target clipping video sequence in a first video sequence according to a current clipping timeline, wherein the target clipping interval is an interval between a current start timestamp and a current end timestamp matching the target clipping video sequence;
[0072] S2, move the clip start key frame of each video sequence to be clipped to the corresponding position of the current start timestamp of the target clip video sequence that matches it, move the clip end key frame of each video sequence to be clipped to the corresponding position of the current end timestamp of the target clip video sequence that matches it, and fill the video sequence between the clip start key frame and the clip end key frame into the target clip interval to obtain a second video sequence.
[0073] As an optional implementation, in the above step S1, a target clipping interval matching each target clipping video sequence in the first video sequence is determined according to the current clipping timeline, wherein the target clipping interval is an interval between a current start timestamp and a current end timestamp matching the target clipping video sequence;
[0074] For example, the natural timestamp interval of the target editing video sequence is 12:00-12:10 in the morning, which corresponds to the 1st minute to the 10th minute in the current editing timeline, that is, the target editing interval is the 1st minute to the 10th minute. It should be noted that if the natural timestamp interval is different from the target editing interval, fast forward or slow processing can be performed, and no specific restrictions are made here.
[0075] Further in step S2, the editing start key frame of each video sequence to be edited is moved to the corresponding position of the current start timestamp of the target editing video sequence that matches it, and the editing end key frame of each video sequence to be edited is moved to the corresponding position of the current end timestamp of the target editing video sequence that matches it, and the video sequence between the editing start key frame and the editing end key frame is filled into the target editing interval to obtain a second video sequence.
[0076] Optionally, the editing start key frame and the editing end key frame of the video sequence to be edited are determined according to the interval of the natural timestamp that matches the target editing sequence, and then the entire video sequence including the editing start key frame and the editing end key frame is directly obtained, and the entire video sequence including the editing start key frame and the editing end key frame is automatically filled to the period from the 1st minute to the 10th minute according to the rule of editing the editing start key frame to the 1st minute of the current editing timeline and editing the editing end key frame to the 10th minute of the current editing timeline, thereby realizing the automatic editing of the slave camera video.
[0077] The above method realizes seamless editing of video streams, improves the efficiency of video editing and the continuity of video content, and is particularly suitable for scenarios that require rapid generation of high-quality video content, such as game highlights, quick news editing, etc.
[0078] In an optional implementation, according to the key frame sequences corresponding to the multiple video streams, timestamp matching is performed on the video frames included in the multiple video streams to obtain a video frame mapping information set, which also includes:
[0079] S1, extracting frames from multiple video streams to obtain a set of video frames that match each video stream;
[0080] S2, when two consecutive video frames in the video frame set meet the target scene switching condition, determining the video frame as a key frame;
[0081] S3, matching key frames of multiple video streams according to natural timestamps to obtain a video frame mapping information set.
[0082] In the above steps S1-S3, multiple video streams are extracted to obtain a set of video frames that match each video stream; when two consecutive video frames in the video frame set meet the target scene switching condition, the video frame is determined to be a key frame; the key frames of the multiple video streams are matched according to the natural timestamp to obtain a set of video frame mapping information. The above scene switching conditions can be, but are not limited to, detecting the average brightness or brightness histogram of each frame. If the change exceeds a preset threshold, it is regarded as a scene switching point, or calculating the histogram difference between adjacent frames (such as using Euclidean distance, cross entropy and other metrics). When the difference exceeds a certain threshold, it is considered that the scene has changed, etc., and no specific restrictions are made here.
[0083] In an optional implementation, matching key frames of multiple video streams according to natural timestamps further includes:
[0084] S1, respectively obtain the duration of any two video streams and the number of key frames matching the video streams from multiple video streams;
[0085] S2, determining the time deviation between the two video streams according to the ratio of the difference in duration between the two video streams to the difference in the number of key frames;
[0086] S3, adjusting the duration of the multiple video streams according to the average value of the multiple time deviations.
[0087] As an optional implementation, assume that three camera streams are captured during a live broadcast, namely camera 1, camera 2 and camera 3. Camera 1 is the main viewing angle, and its video duration is 120 minutes, with a total of 800 key frames detected. The video duration of camera 2 is 119 minutes and 45 seconds, with a total of 794 key frames detected; the video duration of camera 3 is 120 minutes and 10 seconds, with a total of 805 key frames detected.
[0088] First, the duration and number of key frames are obtained from each video stream, and then the time deviation between position 2 and position 1 is calculated, which is 15 seconds / 6 key frames = 2.5 seconds deviation / key frame; the time deviation between position 3 and position 1 is calculated, which is 10 seconds / 5 key frames = 2 seconds deviation / key frame. The average deviation is further calculated, (2.5+2) / 2 = 2.25 seconds deviation / key frame.
[0089] For camera position 2, since the time deviation from camera position 1 is positive, the system can consider inserting a frame every 300 frames or so in the video of camera position 2 to correct the time deviation and ensure synchronization with the main view. For camera position 3, the time deviation is negative, and the system can consider deleting some non-key frames in the video stream of camera position 3, or correcting the time deviation by slightly accelerating the playback to maintain synchronization with the main view.
[0090] In an optional implementation, after obtaining the second video sequence matching the first video sequence, the method further includes:
[0091] S1, obtaining, at each time-aligned monitoring node, a first video frame of a first video sequence matching the host position player and a playback state matching the host position player;
[0092] S2, determining a second video frame of a second video sequence matched by a slave player according to a first video frame and a playback state matched by the master player at each time alignment monitoring node.
[0093] Optionally, the event alignment monitoring node can be collected every 5 seconds, or a fixed time can be predetermined, or the time node of the scene change, etc. Specifically, each camera video can use an independent player instance. When playing, the system designates the host player as the main player and the videos of other cameras as sub-players. The system synchronizes the progress of all sub-players in real time by monitoring the playback progress events of the main player (such as play, pause, fast forward, fast rewind, etc.).
[0094] The main player's playback timeline will be broadcast to all secondary players with millisecond accuracy. The secondary players will adjust the progress in real time according to the playback status of the main player to ensure the synchronous playback of each video stream. It is understandable that in the case of unstable network environment or large differences in device performance, the system will dynamically adjust the buffer and frame skipping compensation mechanism to ensure that the progress of each video player is always kept within the allowable error range.
[0095] The following is a complete description of the execution process of automatic video editing using a specific implementation method:
[0096] S1, key frame acquisition and natural timestamp matching:
[0097] During the live broadcast, the system will collect key frames of each camera's video stream in real time. The selection of key frames is based on the scene changes of the video content (such as scene switching points or I frame detection). Each collected key frame will be stamped with a high-precision natural timestamp, using NTP (Network Time Protocol) or other high-precision time synchronization mechanisms to ensure that each acquisition end has a consistent time base for the key frame collection of each camera.
[0098] Specifically, it includes: Natural timestamp marking: Each key frame of each video is bound to the corresponding natural timestamp, with a time accuracy of milliseconds, ensuring that videos from different camera positions can be strictly aligned. Key frame extraction: Using an I-frame extraction algorithm based on image change detection or video encoding, the system automatically detects the key points of scene changes and records them as key frames. Key frame storage: The key frames and timestamps of all camera positions will be synchronously stored in the system database as a basis for subsequent editing and synchronization.
[0099] like Figure 4 As shown, the collection starts, S402, task initialization;
[0100] S404, determining whether the live broadcast is finished; if the live broadcast is not finished, continue to execute S404-1 camera position 1, S404-2 camera position 2, S404-3 camera position n to record the live broadcast;
[0101] Then, S406 is executed to extract frames and capture and store information (including key frames and natural time), and the process is continuously looped and incremented to determine whether the process is finished.
[0102] S2, multi-camera synchronization mapping table generation:
[0103] The system compares the video key frames of each camera position through natural timestamps and generates a key frame synchronization mapping table between the host position and other camera positions. This mapping table records the corresponding relationship between the key frames of the host position and other camera positions on the timeline.
[0104] Specifically, it includes: Timestamp comparison: compare the timestamps of the key frames collected by all cameras to find the closest time point to ensure the accuracy of time alignment. Error control: In the case of errors in recording time, the system uses a linear interpolation algorithm or a nearest neighbor matching algorithm to correct the time error between different cameras so that the videos of each camera can be synchronized to the greatest extent. Mapping table generation: The generated video frame mapping information set contains the natural time of each key frame in the video of each camera, the corresponding frame number and scene switching information, providing data support for subsequent editing, for example: the main camera frame A corresponds to the frame B of the auxiliary camera 1 and the frame C of the auxiliary camera 2. The mapping table is stored in the database to provide basic data for subsequent automated editing and synchronous playback.
[0105] Optionally, for example, if the timestamp of a key frame of the host position is 10:00:00.500, the frames with corresponding frame timestamps of other positions within the range of 10:00:00.480 to 10:00:00.520 will be considered as the frames corresponding to the key frame.
[0106] S3, automated clip synchronization module:
[0107] During the editing process, the editor only needs to process the recorded video clips of the main camera, and the system will automatically synchronize the videos of other cameras based on the key frames edited by the main camera. Through the previously generated video frame mapping information set, the system can accurately calculate the corresponding editing points in the videos of other cameras and automatically synchronize the editing of these videos to ensure that the timeline of multi-camera content remains consistent.
[0108] Specifically, it includes: Host position key frame editing scanning: The system scans the host position video after editing and extracts the timestamps of the start and end key frames of each editing segment. Synchronous editing: Based on the timestamp after the host position is edited, the system calculates the corresponding editing points in other camera videos through the synchronization mapping table and performs synchronized editing operations on these camera videos. The automatic editing algorithm ensures that each video stream is synchronized at the millisecond level on the timeline.
[0109] Optionally, the start keyframe time of the main camera clip is 10:00:00, and the end keyframe time is 10:05:00. The system will find the corresponding clips of other cameras through the mapping table and automatically edit them. After the editing is completed, the videos of multiple cameras will keep the time synchronization to ensure that the time axis of all videos is consistent.
[0110] like Figure 5 As shown, the key frame sequence of the main camera position recorded and edited video is obtained, and the matched natural time sequence is obtained by matching the collected key frames and high-precision natural time according to the mapping table; further, according to the matched natural time, the key frame list of other camera positions is matched based on the mapping table;
[0111] Therefore, according to the high-precision natural time corresponding to the editing key frames of the main video, the key frames captured by other cameras are mapped to obtain a list of key frames for videos to be generated from other cameras, and then the videos recorded by other cameras are matched with the list of key frames to be generated, and the automatically edited videos from other cameras are output. In other words, the video frame sequence of key frame 1 to key frame n+2 after editing by the main camera corresponds to the video frame sequence of key frames a0 to a(n+2) of the slave camera, and the initial acquisition key frames of the slave video are key frames 1 to key frames n+4. Based on the key frame matching natural timestamps of the main video, the positions of the key frames in the initial acquisition key frames are automatically adjusted to obtain the edited video sequence.
[0112] Through the automatic editing mechanism based on natural timestamps, the system reduces manual synchronization operations, greatly improves editing efficiency, and ensures the time alignment accuracy of multi-camera video content.
[0113] S4, multi-player synchronous playback control module:
[0114] After editing is completed, the system saves the video files of each camera independently and generates large and small streams with different bit rates. During on-demand playback, the system uses a synchronization mechanism in which the main player controls the sub-player. The main player serves as the benchmark for progress control and controls the playback progress of other sub-players through time synchronization, ensuring that when users switch between multiple cameras, the playback progress of all video streams remains strictly consistent and that loading can be controlled; and based on the main and sub-player attributes, the main player loads a large stream with a high bit rate, and the sub-player loads a small stream with a low bit rate, so that while ensuring clarity and interactive experience, the network bandwidth for multiple video downloads can be reduced and playback stability can be improved.
[0115] Specifically, it includes: Multi-player architecture: Each camera video uses an independent player instance. When playing, the system designates the host player as the main player and the videos of other cameras as sub-players. The system synchronizes the progress of all sub-players in real time by monitoring the playback progress events of the main player (such as play, pause, fast forward, fast rewind, etc.). Master-slave synchronization mechanism: The playback timeline of the main player will be broadcast to all sub-players with millisecond accuracy. The sub-player adjusts the progress in real time according to the playback status of the main player to ensure the synchronous playback of each video stream. Network delay and frame skipping compensation: In the case of unstable network environment or large differences in device performance, the system dynamically adjusts the buffer and frame skipping compensation mechanism to ensure that the progress of each video player is always kept within the allowable error range. Playback of large and small streams of the main and sub-players: According to the main and sub-player attributes of the player, the corresponding large and small streams are loaded to ensure clarity while reducing the traffic per unit time and guaranteeing the playback jam rate.
[0116] This system uses the master-slave control architecture of independent players and combines network time synchronization technology to achieve synchronous playback of multi-camera videos in on-demand scenarios, ensuring that the content of all perspectives remains synchronized and smooth when users switch between multiple perspectives. In on-demand scenarios, users can use the multi-player synchronization function to watch videos from different cameras, just like the cloud director function in live broadcasts. The master player controls the overall playback rhythm, and users can switch between different camera perspectives through the interface. The video of each camera will be played synchronously with the video of the master. When switching perspectives, there will be no video asynchrony, providing a smooth multi-perspective viewing experience.
[0117] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0118] According to another aspect of the embodiment of the present application, there is also provided an automatic video editing device for implementing the above-mentioned automatic video editing method. Figure 6 As shown, the device comprises:
[0119] An acquisition unit 602 acquires multiple video streams associated with a target scene, wherein the multiple video streams are acquired by multiple camera devices respectively capturing the target scene;
[0120] The matching unit 604 performs timestamp matching on video frames included in each of the multiple video streams according to the key frame sequences corresponding to each of the multiple video streams to obtain a video frame mapping information set, wherein the video frame mapping information set includes multiple natural timestamps and multiple video frames respectively matched with the multiple natural timestamps, and the multiple video frames respectively correspond to a video stream;
[0121] The editing unit 606, when obtaining a first video sequence by editing a first video stream among multiple video streams, synchronously edits at least one second video stream among the multiple video streams according to a video frame mapping information set to obtain a second video sequence matching the first video sequence.
[0122] Optionally, the above-mentioned editing unit includes: a determination module for obtaining the starting key frame and the ending key frame that respectively match multiple target editing video sequences in the first video sequence, wherein the target editing video sequence is a video sequence on which the editing operation has been performed; and determining the starting natural timestamp that matches the starting key frame of each target editing video sequence and the ending natural timestamp that matches the ending key frame of each target editing video sequence according to the video frame mapping information set.
[0123] Optionally, the above-mentioned determination module includes: a first acquisition module, used to obtain a natural timestamp matching each key frame in the first video sequence; obtain key frames corresponding to the natural timestamps that meet the continuous time condition to obtain a key frame set, wherein the continuous time condition is that the difference results between any two natural timestamps have the same sign; determine the video sequence matching the key frame set as the target clip video sequence; and respectively determine the starting key frame and the ending key frame matching each target clip video sequence.
[0124] Optionally, the above-mentioned determination module includes: a first determination module, used to determine multiple video sequences to be edited that match at least one second video stream based on a video frame mapping information set, wherein the starting natural timestamp and the ending natural timestamp of the video sequences to be edited and the target editing video sequences to match them are the same; and respectively determine the editing start key frame that matches the starting natural timestamp of each video sequence to be edited in at least one second video stream, and the editing end key frame that matches the ending natural timestamp of each video sequence to be edited.
[0125] Optionally, the above-mentioned first determination module also includes a second determination module, which is used to determine the target editing interval matching each target editing video sequence in the first video sequence according to the current editing timeline, wherein the target editing interval is the interval between the current start timestamp and the current end timestamp matching the target editing video sequence; move the editing start key frame of each video sequence to be edited to the corresponding position of the current start timestamp of the target editing video sequence that matches it respectively, move the editing end key frame of each video sequence to be edited to the corresponding position of the current end timestamp of the target editing video sequence that matches it respectively, and fill the video sequence between the editing start key frame and the editing end key frame into the target editing interval to obtain a second video sequence.
[0126] Optionally, the above-mentioned matching unit includes: a second acquisition module, used to extract frames from multiple video streams to obtain a set of video frames that match each video stream respectively; when two consecutive video frames in the video frame set meet the target scene switching condition, determine that the video frame is a key frame; match the key frames of multiple videos according to natural timestamps to obtain a video frame mapping information set.
[0127] Optionally, the above-mentioned second acquisition module includes: a third acquisition module, used to respectively obtain the duration of any two video streams and the number of key frames matching the video streams from multiple video streams; determine the time deviation between the two video streams based on the ratio of the difference in duration between the two video streams to the difference in the number of key frames; and adjust the duration of the multiple video streams based on the average value of multiple time deviations.
[0128] Optionally, the above-mentioned matching unit includes: a third determination module, which is used to obtain the first video frame of the first video sequence that matches the host position player and the playback status that matches the host position player at each time-aligned monitoring node; and determine the second video frame of the second video sequence that matches the slave position player based on the first video frame and the playback status that match the host position player at each time-aligned monitoring node.
[0129] According to another aspect of the embodiment of the present application, an electronic device for implementing the above-mentioned automatic video editing method is also provided. The electronic device may be Figure 1 The terminal device or server shown in the figure. This embodiment is described by taking the electronic device as a mobile phone or a computer as an example. Figure 7 As shown, the electronic device includes a memory 702 and a processor 704. The memory 702 stores a computer program, and the processor 704 is configured to execute the steps in any of the above method embodiments through the computer program.
[0130] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.
[0131] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0132] S1, obtaining multiple video streams associated with a target scene, wherein the multiple video streams are obtained by capturing the target scene by multiple camera devices respectively;
[0133] S2, performing timestamp matching on video frames included in each of the multiple video streams according to key frame sequences corresponding to each of the multiple video streams, to obtain a video frame mapping information set, wherein the video frame mapping information set includes multiple natural timestamps and multiple video frames respectively matched with the multiple natural timestamps, and the multiple video frames respectively correspond to a video stream;
[0134] S3, when a first video sequence is obtained by clipping a first video stream from multiple video streams, at least one second video stream from the multiple video streams is synchronously clipped according to a video frame mapping information set to obtain a second video sequence matching the first video sequence.
[0135] Alternatively, a person skilled in the art may understand that: Figure 7 The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, or other terminal devices. Figure 7 The structure of the electronic device is not limited. Figure 7 More or fewer components (such as network interfaces, etc.) as shown in, or with Figure 7 Different configurations are shown.
[0136] Among them, the memory 702 can be used to store software programs and modules, such as the program instructions / modules corresponding to the method and device for automated video editing in the embodiments of the present application. The processor 704 executes various functional applications and data processing by running the software programs and modules stored in the memory 702, that is, to implement the above-mentioned method for automated video editing. The memory 702 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 702 may further include a memory remotely located relative to the processor 704, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. As an example, if Figure 7 As shown, the memory 702 may include, but is not limited to, the acquisition unit 602, the matching unit 604, and the editing unit 606 in the automatic video editing device. In addition, it may also include, but is not limited to, other module units in the automatic video editing device, which will not be repeated in this example.
[0137] Optionally, the transmission device 706 is used to receive or send data via a network. Specific examples of the network may include a wired network and a wireless network. In one example, the transmission device 706 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 706 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0138] In addition, the electronic device mentioned above further includes: a display 708 and a connection bus 710, which is used to connect various module components in the electronic device mentioned above.
[0139] In other embodiments, the terminal device or server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes through network communication. The nodes may form a point-to-point network, and any form of computing device, such as a server, terminal or other electronic device, may become a node in the blockchain system by joining the point-to-point network.
[0140] According to one aspect of the present application, a computer-readable storage medium is provided, and a processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method provided in the above various optional implementations;
[0141] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0142] S1, obtaining multiple video streams associated with a target scene, wherein the multiple video streams are obtained by capturing the target scene by multiple camera devices respectively;
[0143] S2, performing timestamp matching on video frames included in each of the multiple video streams according to key frame sequences corresponding to each of the multiple video streams, to obtain a video frame mapping information set, wherein the video frame mapping information set includes multiple natural timestamps and multiple video frames respectively matched with the multiple natural timestamps, and the multiple video frames respectively correspond to a video stream;
[0144] S3, when a first video sequence is obtained by clipping a first video stream from multiple video streams, at least one second video stream from the multiple video streams is synchronously clipped according to a video frame mapping information set to obtain a second video sequence matching the first video sequence.
[0145] Optionally, in the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0146] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0147] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or 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 enabling one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
[0148] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0149] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only 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 interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0150] 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.
[0151] In addition, each functional unit in each embodiment of the present application 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. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0152] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for automatic video editing, characterized in that: include: Acquire multiple video streams associated with a target scene, wherein the multiple video streams are acquired by multiple camera devices respectively capturing the target scene; According to the key frame sequences corresponding to the multiple video streams, timestamp matching is performed on the video frames included in the multiple video streams to obtain a video frame mapping information set, wherein the video frame mapping information set includes multiple natural timestamps and multiple video frames respectively matched with the multiple natural timestamps, and the multiple video frames respectively correspond to one of the video streams; When a first video sequence is obtained by clipping a first video stream from multiple video streams, at least one second video stream from the multiple video streams is synchronously clipped according to the video frame mapping information set to obtain a second video sequence matching the first video sequence.
2. The method according to claim 1, characterized in that: Before synchronously editing at least one second video stream in the multiple video streams according to the video frame mapping information set, the method includes: Acquire a start key frame and an end key frame that respectively match a plurality of target clipping video sequences in the first video sequence, wherein the target clipping video sequence is a video sequence on which a clipping operation is performed; A start natural timestamp matching the start key frame of each target clip video sequence and an end natural timestamp matching the end key frame of each target clip video sequence are determined respectively according to the video frame mapping information set.
3. The method according to claim 2, characterized in that The obtaining of the start key frame and the end key frame respectively matching the plurality of target clip video sequences in the first video sequence comprises: Obtaining the natural timestamp matched with each key frame in the first video sequence; Acquire key frames corresponding to the natural time stamps that meet a continuous time condition to obtain a key frame set, wherein the continuous time condition is that the difference results between any two natural time stamps have the same sign; Determine the video sequence matching the key frame set as the target clip video sequence; The start key frame and the end key frame matching each of the target clip video sequences are determined respectively.
4. The method according to claim 2, characterized in that: After respectively determining the start natural timestamps matching the start key frames of the target clip video sequences and the end natural timestamps matching the end key frames of the target clip video sequences according to the video frame mapping information set, the method further comprises: Determine, according to the video frame mapping information set, a plurality of to-be-edited video sequences that match at least one of the second video streams, wherein the starting natural timestamp and the ending natural timestamp of the to-be-edited video sequences and the target editing video sequences that match them are the same; A clip start key frame matching the start natural timestamp of each of the to-be-cut video sequences in at least one of the second video streams and a clip end key frame matching the end natural timestamp of each of the to-be-cut video sequences are determined respectively.
5. The method according to claim 4, characterized in that The step of synchronously editing at least one second video stream in the multiple video streams according to the video frame mapping information set to obtain a second video sequence matching the first video sequence includes: Determine, according to the current editing timeline, a target editing interval that matches each of the target editing video sequences in the first video sequence, wherein the target editing interval is an interval between a current start timestamp and a current end timestamp that matches the target editing video sequence; The clip start key frame of each video sequence to be clipped is moved to the corresponding position of the current start timestamp of the target clip video sequence that matches it, and the clip end key frame of each video sequence to be clipped is moved to the corresponding position of the current end timestamp of the target clip video sequence that matches it, and the video sequence between the clip start key frame and the clip end key frame is filled into the target clip interval to obtain the second video sequence.
6. The method according to claim 1, characterized in that The method further comprises: performing timestamp matching on video frames included in each of the multiple video streams according to the key frame sequences corresponding to each of the multiple video streams to obtain a video frame mapping information set; Extracting frames from the multiple video streams to obtain a set of video frames that matches each video stream; When two consecutive video frames in the video frame set meet a target scene switching condition, determining the video frame as a key frame; The key frames of the multiple video streams are matched according to the natural timestamps to obtain the video frame mapping information set.
7. The method according to claim 6, characterized in that The matching of the key frames of the multiple video streams according to the natural timestamps further includes: Obtaining the duration of any two video streams and the number of key frames matching the video streams from the multiple video streams respectively; Determine the time deviation between the two video streams according to the ratio of the difference in duration between the two video streams to the difference in the number of key frames; The durations of the multiple video streams are adjusted according to an average value of the multiple time deviations.
8. The method according to claim 1, characterized in that After obtaining the second video sequence matching the first video sequence, the method further includes: Acquire, at each time alignment monitoring node, a first video frame of the first video sequence that matches the host position player and a playback state that matches the host position player; According to the first video frame matched by the host position player at each of the time-aligned monitoring nodes and the playback status, a second video frame of the second video sequence matched by the slave position player is determined.
9. An automatic video editing device, characterized in that: include: An acquisition unit is configured to acquire multiple video streams associated with a target scene, wherein the multiple video streams are acquired by multiple camera devices respectively capturing the target scene; A matching unit, performing timestamp matching on video frames included in each of the multiple video streams according to key frame sequences corresponding to each of the multiple video streams, to obtain a video frame mapping information set, wherein the video frame mapping information set includes multiple natural timestamps and multiple video frames respectively matched with the multiple natural timestamps, and the multiple video frames respectively correspond to one of the video streams; The editing unit, when obtaining a first video sequence by editing a first video stream from multiple video streams, synchronously edits at least one second video stream from the multiple video streams according to the video frame mapping information set to obtain a second video sequence matching the first video sequence.
10. An electronic device, comprising: A memory and a processor, wherein the memory is used to store a computer program, and wherein the processor is used to execute the steps of the method according to any one of claims 1 to 8 when calling the computer program.
Citation Information
Cited By
Short video editing method
CN120390120A
Intelligent video creation method and system based on AI drive
CN120730142A