Editing material processing method and device, storage medium and electronic device
Through audio data decoding and automatic time code recognition, video editing materials are dynamically managed, which solves the problem of low processing efficiency of multi-camera materials and realizes an efficient video editing process.
Patent Information
- Application Number
- CN202411624454.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-04-04
AI Technical Summary
During the video editing process, the processing efficiency of editing materials shot by multiple cameras is low, and a lot of manual time is required to acquire time information and arrange editing clips.
By obtaining audio data in the material file for decoding, automatically identifying and processing time codes, dynamically manage editing materials, and automatically align the materials according to shooting time.
It improves the processing efficiency of editing materials, simplifies the video editing process, and improves convenience and flexibility.
Smart Images

Figure CN119767075A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and in particular to a method and device for processing clipping materials, a storage medium, and an electronic device. Background Art
[0002] The video editing process usually involves material collection, material management, trimming, synthesis, color grading and other steps, among which material management is one of the key links, mainly including material storage, classification, sorting, etc. In related technologies, the time information of shooting each editing material is mainly obtained manually, and the editing clips corresponding to a group of editing materials shot by one camera are arranged on a single track according to the time information, so as to facilitate the reference and synchronization of the editing clips in the subsequent editing process.
[0003] However, when the amount of editing materials is large and includes multiple groups of editing materials shot from multiple camera positions, if the above-mentioned method of manually obtaining time information is still used to arrange the editing clips for multiple camera positions one by one, it will consume a lot of time and labor costs, thereby causing technical problems of low efficiency in the processing of editing materials.
[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 and device for processing clipping materials, a storage medium, and an electronic device, so as to at least solve the technical problem of low efficiency that occurs during the processing of clipping materials.
[0006] According to one aspect of an embodiment of the present application, a method for processing clipping materials is provided, including: obtaining a group of material files, wherein one material file in the group of material files includes media information of a clipping material shot from a target camera position; decoding the group of material files for the first time to obtain a group of audio data corresponding to the group of material files; determining a group of time codes corresponding to the group of material files based on the group of audio data, wherein one time code in the group of time codes is used to reference and synchronize one material file in the group of material files during video clipping; determining a starting position and an ending position of each clip in a group of clips in a preset clipping track based on the group of time codes, wherein there is a one-to-one correspondence between a group of clips and a group of material files; and arranging a group of clips on a preset clipping track in a timeline area of a target editing tool based on the starting position and the ending position.
[0007] Optionally, the above-mentioned determining a group of time codes corresponding to a group of material files based on a group of audio data includes: parsing an audio signal corresponding to a group of audio data to obtain a simulated linear time code; converting the format of the linear time code into a readable time code format to obtain a first subgroup time code corresponding to a first subgroup material file; in a case where the time code corresponding to the second subgroup material file is not obtained based on the group of audio data, decoding the second subgroup material file for a second time to obtain container information for storing the second subgroup material file, wherein the container information is used to describe format information of the second subgroup material file, and a group of material files includes a first subgroup material file and a second subgroup material file; obtaining a second subgroup time code based on the container information, wherein a group of time codes includes the first subgroup time code and the second subgroup time code.
[0008] Optionally, the above-mentioned obtaining the second sub-group time code based on the container information includes: performing the following processing on the i-th material file in the second sub-group material file, where i is a positive integer greater than or equal to 1: obtaining the i-th container information by decoding the i-th material file for a second time, wherein the i-th container information is used to describe the format information and status information of the i-th material file; in case the i-th time code is obtained based on the i-th container information, updating the time code field in the i-th material file, wherein the second sub-group time code includes the i-th time code; in case the i-th time code is not obtained based on the i-th container information, obtaining the i-th time code by using the file name of the i-th material file.
[0009] Optionally, in the case where the i-th time code is obtained based on the i-th container information, updating the time code field in the i-th material file includes: updating the time code field in the i-th material file from a null value to the i-th time code.
[0010] Optionally, when the i-th time code is not obtained based on the i-th container information, the i-th time code is obtained by using the file name of the i-th material file, including: when the i-th time code is not obtained based on the i-th container information, obtaining source data of the container in the i-th material file; obtaining label data from the source data of the container, and querying the i-th time code based on the label data; when the i-th time code is not queried based on the label data, obtaining the i-th time code by using the file name of the i-th material file.
[0011] Optionally, in the case where the i-th time code is not found based on the tag data, the i-th time code is obtained by using the file name of the i-th material file, including: performing string segmentation on the file name of the i-th material file to determine the position where the last target character appears in the file name; obtaining the initial time code at the position, wherein the initial time code is the system default time when the i-th video material is shot from the target camera position; and obtaining the i-th time code by correcting the initial time code.
[0012] Optionally, the above method also includes: when the time codes of some material files in a group of material files are not obtained based on a group of audio data, creating an undefined camera directory name and an undefined array; based on the undefined camera directory name, removing the elements storing some material files from the original array, wherein the original array is an array generated when some material files are obtained by shooting with a target camera.
[0013] Optionally, the above-mentioned determining the starting position and ending position of each clip in a set of clips in a preset clip track based on a set of time codes includes: arranging the set of time codes in ascending order to obtain a sorted set of time codes; obtaining a minimum time code from the sorted set of time codes; and determining the starting position and ending position of each clip in a set of clips in the preset clip track based on the minimum time code.
[0014] Optionally, the above-mentioned determining the starting position and ending position of each clip in a group of clips in a preset clip track based on the minimum time code includes: determining the j-th starting position and the j-th ending position of the j-th clip in a group of clips in the preset clip track through the following steps, where j is a positive integer greater than or equal to 2; creating a preset clip track in the timeline area based on the camera directory name field of the target camera; obtaining the j-th time code of the j-th material file corresponding to the j-th clip; determining the difference between the j-th time code and the minimum time code as the j-th starting position; and adding the j-th starting position to the media duration in the media information in the j-th material file to obtain the j-th ending position.
[0015] Optionally, the above-mentioned acquisition of a group of material files includes: in response to the time directory path received in the timeline area, scanning the time directory path and the subdirectories under the time directory path level by level; based on the camera directory name and array in the target key-value pair, saving the material files under the time directory path, wherein the elements in the array store material file description information and media information; based on the target camera directory name, searching for a group of material files from the material files under the time directory path.
[0016] According to another aspect of the embodiment of the present application, a processing device for editing materials is also provided, including: a first acquisition unit, used to acquire a group of material files, wherein one material file in the group of material files includes media information of an editing material shot from a target camera position; a first decoding unit, used to perform a first decoding on a group of material files to obtain a group of audio data corresponding to the group of material files; a first processing unit, used to determine a group of time codes corresponding to the group of material files based on the group of audio data, wherein one time code in the group of time codes is used to reference and synchronize one material file in the group of material files during video editing; a second processing unit, used to determine the starting position and ending position of each editing clip in a group of editing clips in a preset editing track based on the group of time codes, wherein there is a one-to-one correspondence between a group of editing clips and a group of material files; a third processing unit, used to arrange a group of editing clips on a preset editing track in the timeline area of a target editing tool based on the starting position and the ending position.
[0017] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is used to execute the above-mentioned processing method of the clipping material when executed by an electronic device.
[0018] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program that implements the steps of the above method when the computer program is executed by a processor.
[0019] According to another aspect of the embodiments of the present application, there is further 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 processing method of the clipping material through the computer program.
[0020] By adopting the above-mentioned embodiment provided by the present application, a group of acquired material files are decoded to obtain a group of audio data corresponding thereto, and then based on the group of audio data, the time code of each material file is automatically identified and processed. The acquired time code is used to dynamically manage the editing material, and all camera positions shoot the material automatically aligned according to the shooting time, which facilitates the video editor to quickly confirm the material shot by different camera positions at a certain time point in the same time period, improves the processing efficiency of the editing material, and enhances the convenience and flexibility of video editing. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The drawings described herein are used to provide 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 improper limitations on the present application.
[0022] Figure 1 is a schematic diagram of an application scenario of an optional method for processing clipping materials according to an embodiment of the present application;
[0023] Figure 2 is a flowchart of an optional method for processing clipping materials according to an embodiment of the present application;
[0024] Figure 3 is a schematic diagram of an optional file directory structure according to an embodiment of the present application;
[0025] Figure 4 is an optional arrangement result of clips in the timeline area according to an embodiment of the present application (I);
[0026] Figure 5 is an optional overall flow chart of obtaining a time code according to an embodiment of the present application;
[0027] Figure 6 is an optional arrangement result of clips in the timeline area according to an embodiment of the present application (II);
[0028] Figure 7 is an optional arrangement result of clips in the timeline area according to an embodiment of the present application (III);
[0029] Figure 8 is an optional arrangement result of clips in the timeline area according to an embodiment of the present application (IV);
[0030] Fig. 9 is a schematic diagram of the structure of an optional editing material processing device according to an embodiment of the present application;
[0031] Fig.10 It is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0032] In order to enable those skilled in the art to better understand the scheme of the present application, the technical scheme 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 embodiments of a part of the present application, not all embodiments.
[0033] 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.
[0034] According to one aspect of the embodiments of the present application, a method for processing a clipping material is provided. As an optional implementation, the method for processing the clipping material can be but is not limited to being applied to: Figure 1 The application scenario shown in Figure 1 In the application scenario shown, the target terminal 102 may, but is not limited to, communicate with the server 106 via the network 104, and the server 106 may, but is not limited to, perform operations on the database 108, such as write data operations or read data operations. The above-mentioned target terminal 102 may, but is not limited to, include a human-computer interaction screen, a processor, and a memory. The above-mentioned human-computer interaction screen may, but is not limited to, be used to display the clip material shot from the target camera position on the target terminal 102 and a group of clips arranged in the timeline area. The above-mentioned processor may, but is not limited to, be used to respond to the above-mentioned human-computer interaction operation, perform corresponding operations, or generate corresponding instructions, and send the generated instructions to the server 106. The above-mentioned memory is used to store related processing data, such as a group of audio data, a group of time codes, and a group of material files.
[0035] Optionally, in this embodiment, the target terminal may be a terminal configured with a target client, which may include but is not limited to at least one of the following: a mobile phone, 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.
[0036] In order to solve the problem of low efficiency in the processing of clipping materials, a method for processing clipping materials is proposed in an embodiment of the present application. Figure 2 4 is a flowchart of a method for processing clipping materials according to an embodiment of the present application, and the flow includes the following steps S202 to S210.
[0037] It should be noted that the processing method of the clipping material shown in step S202 to step S210 can be executed by, but not limited to, an electronic device, wherein the electronic device can be, but not limited to, Figure 1 The target terminal or server is shown.
[0038] Step S202, obtaining a group of material files, wherein one material file in the group of material files includes media information of a clip material shot from a target camera position;
[0039] Step S204, performing a first decoding on a group of material files to obtain a group of audio data corresponding to the group of material files;
[0040] Step S206, determining a group of time codes corresponding to a group of material files based on a group of audio data, wherein a time code in the group of time codes is used to reference and synchronize a material file in the group of material files during the video editing process;
[0041] Step S208, based on a set of time codes, determining a start position and an end position of each clip in a set of clips in a preset clip track, wherein there is a one-to-one correspondence between a set of clips and a set of material files;
[0042] Step S210, arranging a group of clips on a preset clip track in the timeline area of the target clipping tool based on the start position and the end position.
[0043] The technical solution in the embodiment of the present application can be applied to, but not limited to, the video editing merging scene, where merging includes but is not limited to merging multiple different video, audio or image materials into a continuous file in a certain order and logic, and the process includes operations such as cutting, transition, adding special effects, and audio synchronization. The purpose of merging is to combine the original material files into a completed work for the final output and display.
[0044] Specifically, the merging of materials usually means merging and editing multiple different material files, such as video clips, audio tracks, pictures, etc., according to the editor's ideas through editing tools to form a coherent narrative or presentation. These materials may come from different shooting angles, different times or different sources, and the merging process needs to ensure that they are smoothly connected and transitioned in the final video.
[0045] For ease of understanding, the embodiment of the present application takes the video editing of a variety show as an example to explain the processing method of the above-mentioned editing material. In a variety show, in order to shoot program videos or program pictures from different angles, multiple camera positions are usually set up, and multiple camera positions are used to shoot at multiple different time periods to obtain multiple groups of media information, and each group of media information is saved in a group of material files, where a group of material files corresponds to multiple media information captured by one camera position. The specific implementation method of obtaining a group of material files will be described in detail below in conjunction with specific embodiments.
[0046] In this embodiment, by scanning the time directory path and all subdirectories and files under the path, a set of material files corresponding to a set of editing materials shot by the target camera position can be obtained. For details, please refer to Figure 3 The file directory structure shown in the figure, in which the directory name "0830" is found through the time directory path, and the camera directory is Figure 3 It can be seen intuitively that B001 can represent but is not limited to the device model of the camera, for example, the model of a camera or a camera head, and A001 can represent but is not limited to the camera name or camera number.
[0047] Among them, a camera position represents a unique camera setting position used to capture a specific scene or perspective. Each camera position provides a specific perspective, which can be a light angle, medium shot, close-up or any other camera position. In addition, the camera position determines the type of shooting lens. Different camera positions can produce different visual effects and narrative emotions. After obtaining a set of material files, first use the ffmpeg decoding library to decode a set of material files to obtain audio decoded PCM audio data, and then obtain a set of time codes corresponding to a set of material files based on a set of PCM audio data.
[0048] It should be noted that PCM (Pulse Code Modulation) audio data is an uncompressed audio format, which is a digital audio waveform representation method. In PCM encoding, analog audio signals are converted into continuous digital values, which are usually represented in integer form and sampled at fixed time intervals.
[0049] The characteristics of PCM audio data include: 1) Lossless: PCM is a lossless encoding format that does not lose any audio information during the encoding process, so it can provide very high sound quality; 2) Uncompressed: PCM audio data is not compressed, so the file size is relatively large and is usually used for high-quality audio storage and processing; 3) High fidelity: Since PCM audio data retains all the details of the original audio, it can provide very high audio fidelity; 4) Wide application: PCM audio data is widely used in various audio devices and formats, including CDs, DVDs, Blu-ray discs and some high-quality digital audio interfaces.
[0050] Decoding the source file information to obtain PCM audio data generally refers to converting the audio file from its original compression or encapsulation format to an uncompressed pulse code modulation (PCM) format. The process includes the following steps:
[0051] 1. Encapsulation format: Audio files are usually stored in containers or encapsulation formats, such as MP3, AAC, etc. These formats may contain audio data and other metadata, such as cover images, track information, etc.
[0052] 2. Decoding process: It is the process of converting the encoded audio data stream back to its original form;
[0053] In audio processing, decoding usually involves converting compressed audio data into PCM format.
[0054] 3. PCM audio data: It is an uncompressed audio format that directly represents the sample value of the audio waveform. PCM data is usually stored in the form of 16-bit or 24-bit integers, which correspond to the amplitude of the audio signal at the sampling moment;
[0055] 4. Sampling rate: PCM data also includes sampling rate information, which refers to the number of times audio samples are collected per second;
[0056] 5. Channel: PCM data also contains channel information, such as mono, stereo or surround sound;
[0057] 6. Bit depth: The bit depth of PCM data determines the accuracy of each sample. Common bit depths are 16 bits, 24 bits, or 32 bits.
[0058] The purpose of the decoding process is to convert the audio file into a format that can be directly processed and analyzed. Because the audio data in PCM format is not compressed, the file size is relatively large, but they provide the highest audio quality and provide the greatest flexibility in post-production.
[0059] Based on the above analysis, a group of PCM audio data is obtained by first decoding a group of material files, the purpose of which is to obtain high-precision time information from the uncompressed audio data, for example, to obtain the time code.
[0060] For example, suppose a set of clips shot by the target camera includes two clip files, such as Figure 3 The two mp4 files under A001 shown above are decoded to obtain PCM audio data, and the time codes corresponding to the two files are obtained based on the PCM audio data.
[0061] After obtaining the above time code, by creating a track in the timeline area of the editing tool, by dragging and dropping the material file onto the timeline, you can create a clip (also known as a clip or clip) corresponding to each material file, such as Figure 4 At the same time, the starting position and ending position of each clip in the track are determined according to the time code, and all clips are automatically arranged on the track in the timeline area according to the starting position and ending position.
[0062] It should be noted that, for a running video editing tool, its timeline area includes but is not limited to at least one editing track, a blank area, a ruler for displaying duration, header information of each editing track (used to distinguish between video tracks or audio tracks), a toolbar, etc.
[0063] By adopting the above method, a group of acquired material files are decoded to obtain a group of audio data corresponding thereto, and then the time code of each material file is automatically identified and processed based on the group of audio data. The acquired time code is used to dynamically manage the editing material, and all the camera positions are automatically aligned to the material according to the shooting time, which facilitates the video editor to quickly confirm the material shot by different camera positions at a certain time point in the same time period, improves the processing efficiency of the editing material, and enhances the convenience and flexibility of video editing.
[0064] As an optional implementation, the above-mentioned determining a group of time codes corresponding to a group of material files based on a group of audio data includes:
[0065] Parsing an audio signal corresponding to a set of audio data to obtain a simulated linear time code;
[0066] Convert the linear time code format into a readable time code format to obtain a first subgroup time code corresponding to the first subgroup material file;
[0067] In a case where a time code corresponding to the second subgroup material file is not obtained based on a group of audio data, the second subgroup material file is decoded for a second time to obtain container information storing the second subgroup material file, wherein the container information is used to describe format information of the second subgroup material file, and a group of material files includes the first subgroup material file and the second subgroup material file;
[0068] Based on the container information, a second subgroup time code is obtained, wherein a group of time codes includes the first subgroup time code and the second subgroup time code.
[0069] After obtaining the PCM audio data, perform LTC analysis on it to obtain the simulated linear time code, including:
[0070] In the field of video editing and audio processing, timecode is a coding system used to synchronize audio and video. It assigns a unique number to each frame, usually expressed in the format of hours, minutes, seconds and frames, such as 01:00:00:00. Timecode can exist in different frame rates, such as 24 frames / second, 25 frames / second or 30 frames / second, depending on the production standard or project requirements.
[0071] PCM audio data usually does not contain any time code information. If you want to extract the time code from PCM audio data, additional processing steps are often required, which usually involves parsing the encoded time code in the audio signal. This encoded time code can be an analog linear time code (LTC), which represents the time code information through a specific pattern of the audio signal. LTC is an analog signal that transmits the time code information as a series of modulated audio frequency modulation (FM) tones. To parse LTC time code from PCM data, you need to use specialized hardware or software to decode these FM tones and convert them into a readable time code format. For example, you can use the libltc library to decode LTC signals.
[0072] In summary, PCM audio data itself does not contain time code information, but time code can be encoded in the audio signal through technologies such as LTC. By decoding these encoded signals, time code can be extracted from PCM audio data for synchronization of video and audio.
[0073] In addition, it should be noted that, assuming that a group of material files contains a total of 3 material files, among which the media information contained in 2 material files is video content, and the media information contained in 1 material file is a picture, then the audio data obtained after the above-mentioned first decoding only contains the PCM audio data obtained from the video content of the 2 material files, because the third material file containing the picture does not itself contain audio data.
[0074] Assume that a group of material files includes 3 material files in total, wherein the media information included in the 3 material files is all video content, then the audio data obtained after the above-mentioned first decoding includes PCM audio data obtained from the video content of the 3 material files.
[0075] For the example in which the media information contained in the above three material files is all video content, suppose that the time codes of the first two material files (first sub-group material files) are directly obtained by using PCM audio data, but the time code of the third material file (second sub-group material file) is not obtained. In this case, the second sub-group material file needs to be decoded again and its time information is obtained based on the decoded data.
[0076] Obviously, the purpose of using the above uncompressed PCM audio data and obtaining the time code of the material file therefrom is to ensure that the obtained time code has a high precision and improve the accuracy of the obtained time code.
[0077] As an optional example, the obtaining of the second subgroup time code based on the container information includes:
[0078] The following processing is performed on the i-th material file in the second subgroup material file, where i is a positive integer greater than or equal to 1:
[0079] By performing a second decoding on the i-th material file, an i-th container information is obtained, wherein the i-th container information is used to describe the format information and status information of the i-th material file;
[0080] When the i-th time code is obtained based on the i-th container information, the time code field in the i-th material file is updated, wherein the second subgroup time code includes the i-th time code;
[0081] When the i-th time code is not obtained based on the i-th container information, the i-th time code is obtained using the file name of the i-th source file.
[0082] As can be seen from the description in the above embodiment, when the time code of the second subgroup material file is not obtained from the above PCM audio data, the material file itself is decoded for the second time through the ffmpeg decoding library to obtain the container information.
[0083] The container information includes but is not limited to data describing the characteristics and status of the container itself, such as the container ID, creation time, running status, IP address, image used, etc. This information helps users understand the current status and history of the container, which is very useful for managing and monitoring containers.
[0084] In the embodiments of the present application, the container may refer to, but is not limited to, a media container format, which may also be understood as an encapsulation format or container format, which is a file format used to encapsulate video, audio, and other data streams into a single file. The container format determines how these different data streams are stored and how they are read and parsed by a player or other software.
[0085] Common container formats include the following: 1) MP4 (MPEG-4 Part 14): supports multiple encoding formats and is commonly used in online videos and mobile devices; 2) MOV (QuickTime File Format): commonly used in video editing and network streaming; 3) MKV (Matroska Video): an open standard container format; 4) FLV (Flash Video): mainly used for online video streaming.
[0086] By performing a second decoding process on the i-th material file, the i-th container information is obtained. According to the i-th container information, it is respectively obtained whether there is a data track and a video track. If there is a data track and a video track, the tag data in the data track or the video track is obtained, and then the time code data is obtained from the tag data, that is, the i-th time code is obtained.
[0087] When the i-th time code is obtained, the time code field in the i-th material file is updated. In other words, the value of the time code field is updated to the i-th time code.
[0088] As an optional example, in the case where the i-th time code is obtained based on the i-th container information, the time code field in the i-th material file is updated, including: updating the time code field in the i-th material file from a null value to the i-th time code.
[0089] This is because the material file information contains time information, but the time code field in the material file information is empty. Therefore, after obtaining the time code in the above method, the obtained time code needs to be backfilled into the time code field in the material file or the material file information.
[0090] Through the above method, the time code of the material file is obtained and the time code is updated to the time code field of the material file. The purpose is to identify the material file, facilitate the sorting of the material files by time code, and automatically create and arrange tracks in the video editing tool according to the camera classification and time code information, thereby improving the efficiency of organizing and editing materials and saving editing time.
[0091] As an optional method, when the i-th time code is not obtained based on the i-th container information, the i-th time code is obtained by using the file name of the i-th material file, including:
[0092] If the i-th time code is not obtained based on the i-th container information, the source data of the container in the i-th material file is obtained;
[0093] Obtain label data from the container source data, and query the i-th time code based on the label data;
[0094] When the i-th time code is not found based on the tag data, the i-th time code is obtained by using the file name of the i-th material file.
[0095] For the above-mentioned i-th material file, if the i-th time code cannot be obtained from the data track and the video, the source data (matedata) of the container (format) in the i-th material file is obtained, the tag (tags) data is obtained from the source data, and finally the i-th time code is obtained from the tag.
[0096] The source data of the container includes but is not limited to the original data or template used to create the container, such as a Docker image. An image is a read-only template that contains everything needed to run the container (code, runtime, libraries, environment variables, and configuration files). The source data of the container is the basis of the containerization process, which defines the entire environment and application when the container is running.
[0097] In short, container information focuses more on the runtime status and properties of the container instance, while the source data of the container refers to the image or template data used when creating the container. Together, they support the lifecycle management of the container, from creation, operation to monitoring and maintenance.
[0098] Get the tag data from the source data of the container, and then query the i-th time code based on the tag data. If the i-th time code is found, update the value of the time code field in the i-th material file. Otherwise, consider using other methods to obtain the i-th time code.
[0099] As another optional implementation, when the i-th time code is not found based on the tag data, the i-th time code is obtained by using the file name of the i-th source file, including:
[0100] Perform string segmentation on the file name of the i-th material file to determine the position where the last target character appears in the file name;
[0101] Get the initial time code at the position, where the initial time code is the system default time when the i-th video material is shot from the target camera position;
[0102] By correcting the initial time code, the i-th time code is obtained.
[0103] Assume that the file name (or file name) of the i-th material file is Figure 3 For example, 0830_B001_A001_C000001-10:30:22:19.mp4 under the camera position A001 is split based on the character "-" and the last "-" position is obtained, that is, the character "-" in the split C000001-10:30:22:19.mp4 is obtained.
[0104] The time at the last "-" position can be determined as the time code of the i-th material file, and based on the obtained time code, the time code field in the i-th material file is updated to update the value of the time code field to the i-th time code.
[0105] In another optional example, considering that the time information in the file name of the i-th material file may be randomly generated or may be an accurate time without correction, its accuracy is low.
[0106] In order to solve the above problem, the i-th time code (assuming it is the initial time code) obtained directly from the file name can also be corrected. Specifically, the editing and production staff consults the shooting staff according to the material content to obtain the accurate shooting time, thereby adjusting the initial time code and determining the adjusted time code as the i-th time code.
[0107] In summary, the technical solution of the present application obtains the time code of the material file through multiple methods such as audio data, container information, container source data, file naming, etc., and dynamically adjusts it when the time code information is inaccurate or lost, so as to ensure the correct sorting and camera classification of the material files, reduce the manpower and time consumed by manual adjustment and management of the time code, and improve editing efficiency and editing quality.
[0108] In order to more clearly understand the implementation process of obtaining the time code of the material file one by one in different ways, the following Figure 5 The flowchart shown describes the specific steps of obtaining the time code.
[0109] S502, drag and drop the directory path to the timeline area;
[0110] Drag and drop a time directory from the file manager of the operating system to the timeline area of the video editing tool. The timeline area receives the dragged and dropped time directory path.
[0111] S504, scanning the time directory path to obtain a set of material files;
[0112] In response to the drag-and-drop operation of the video editing producer, the program in the video editing tool is started, and the time directory path and all the subdirectories and files below are scanned, and the dictionary (key, value) is used in the code to save the camera directory and the material files below, where the key is the camera directory name (such as Figure 3 As shown in A001), value is an array (list), the array contains elements (item), and the elements store the material file information.
[0113] According to the dictionary method, the material files or material file information of all camera positions in the time directory are obtained, and an array under a camera position is obtained from the dictionary in a loop, and the material file information of this camera position is obtained from the array, and the material file information includes media information (such as the duration of the material file, etc.). S506, a group of material files are decoded for the first time to obtain a group of PCM audio data;
[0114] The specific decoding process and the meaning of the PCM audio data can be referred to the description in the above embodiment, which will not be repeated here.
[0115] S508, performing LTC analysis on the PCM audio data to obtain the time code in the audio;
[0116] S510, determining whether the time code cannot be obtained from the audio;
[0117] If yes, execute step S524; otherwise, execute step S512.
[0118] S512, decoding the source file for the second time through the ffmpeg decoding library to obtain whether there is a data track and a video track respectively;
[0119] S514, if there is a data track or a video track, obtain tag data in the data track or the video track, and obtain a time code from the tag data;
[0120] S516, determining whether the time code can be obtained from the tag data;
[0121] If yes, execute step S524; otherwise, execute step S518.
[0122] S518, segment the name of the source file, obtain the time information at the last "-" position, and determine the time information as the time code of the source file;
[0123] It should be noted that no matter which method is used to obtain the time code, the time code field in the source file needs to be updated according to the time code, that is, the value of the time code field in the source file is updated to the obtained time code.
[0124] S520, determining whether to obtain the time code from the material file name;
[0125] If the time code can be obtained, execute step S524; otherwise, execute step S522.
[0126] S522, create a key of undefined and remove the value array from the corresponding key.
[0127] S524, updating the time code field corresponding to the material file information in the element.
[0128] That is, the value of the time code field in the material file is updated to the obtained time code, so as to facilitate the subsequent sorting and classification of the material files.
[0129] By using the above-mentioned embodiment, time codes can be obtained from material files in a variety of ways, for example, time codes can be parsed from file names, media information, audio data, data track labels and container metadata; material files can be classified according to camera positions based on time codes, and material files without time codes can be specially marked; material files can be sorted according to time codes, and tracks and clips can be automatically created and arranged in video editing tools based on camera position classification and time code information.
[0130] In addition, for material files without timecode, the function of manual position adjustment in specific tracks is provided to ensure that all material files can be used reasonably in video editing tools.
[0131] As an optional example, the above method further includes:
[0132] When time codes of some material files in a set of material files are not obtained based on a set of audio data, an undefined camera directory name and an undefined array are created;
[0133] Based on the undefined camera directory name, the elements storing some material files are removed from the original array, wherein the original array is an array generated when some material files are obtained by shooting with the target camera.
[0134] If the time code is not obtained through the above methods, a key of undefined is created in the dictionary, and the value stores the material file (or material file information) of the element (item) for which the time code is not obtained, and the material file information is removed from the value array under the corresponding key.
[0135] Assumptions Figure 3The clip material shot by camera position A001 is corresponding to the material file 0830_B001_A001_C000001-10:30:22:19.mp4. Figure 3 Remove the original location shown and move it to the camera directory name path with key undefined.
[0136] From the perspective of the UI, this article explains how to remove the element that stores some material files from the original array. Assume that the clip corresponding to the material file 0830_B001_A001_C000001-10:30:22:19.mp4 is Figure 4 If the time code of the material file is not obtained through the above methods, clip1 is moved from A004 to the track named undifined in the camera directory.
[0137] It should be noted that in the video editing scene, using a dictionary (key-value) structure to save the directory and the underlying material files is an effective data management method. A dictionary is a data structure that stores key-value pairs, where each key is unique and is associated with a value.
[0138] In the process of video editing, the above dictionary structure can be used to achieve the following purposes:
[0139] (1) Organizing materials: Dictionaries can be used to organize and manage different material files; for example, the key can be the name of a directory, and the value can be a list of all material files under the directory.
[0140] (2) Quick search: You can quickly search for the corresponding material file list through a key (such as a directory name), improving efficiency;
[0141] (3) Structured data: Dictionaries can store information in a structured way, making the reading and writing of data clearer and more organized;
[0142] (4) Flexibility: The dictionary allows entries to be added, deleted, and modified dynamically, which enables flexible processing of material during the editing process;
[0143] (5) Multi-level directory support: If the project contains multiple levels of directory structures, dictionaries can be nested, that is, the value of a dictionary can be another dictionary, thus realizing the management of multi-level directories;
[0144] (6) Metadata storage: In addition to the file name and path, the dictionary value can also contain metadata about the source file, such as resolution, duration, format, creation date, etc.
[0145] (7) Cross-platform compatibility: As a universal data structure, dictionaries can be easily serialized and deserialized between different programming languages and platforms, facilitating project migration and sharing.
[0146] For material files without time codes, video editing and production personnel need to consult the shooting personnel according to the content of the material to obtain the approximate time and determine the time as the time code.
[0147] In addition, clips (clip) need to be created for material files without time codes, where the start position 1 (start) of the first material file without time codes is 0, and the end position 1 (end) is the duration in the media information. The start position 2 of the second material file without time codes is the end position 1 plus 1, and the end position 2 is determined by the start position 2 plus the duration in the media information. By analogy, for material files without time codes, the end position of the previous material file plus 1 is used as the start position of the current material file, and the start position of the current material file is added to the duration of the media information (e.g., the duration of the video) to obtain the end position of the current material file.
[0148] The above-mentioned adding 1 operation refers to adding 1 to the frame number of the video frame at the end position, or adding 1 to the number of frames. By adding 1, Figure 4 The multiple clips in the unfined track shown will not overlap.
[0149] As an optional example, the above-mentioned determining the starting position of each clip in a set of clips in a preset clip track based on a set of time codes includes:
[0150] Arrange a group of time codes in ascending order to obtain a sorted group of time codes;
[0151] Get the minimum time code from the sorted set of time codes;
[0152] Based on a minimum time code, a start position and an end position of each clip in a set of clips in a preset clip track are determined.
[0153] Loop through the dictionary to get all the value arrays, then convert the time codes in the array into milliseconds or frames, and arrange the converted time codes in ascending order to determine the minimum time code.
[0154] According to the dictionary key, create a track in the timeline area of the video editing tool, loop the value array, get the material file information, get the time code from the current material file information, and then determine the start and end positions of the current material file based on the minimum time code and the time code of the current material file. Specifically include:
[0155] Determine the jth starting position and the jth ending position of the jth clip in a set of clips in a preset clip track by the following steps, where j is a positive integer greater than or equal to 2;
[0156] Create a preset clip track in the timeline area based on the camera directory name field of the target camera;
[0157] Get the jth time code of the jth material file corresponding to the jth clip;
[0158] The difference between the jth time code and the minimum time code is determined as the jth starting position;
[0159] The jth starting position is added to the media duration in the media information in the jth material file to obtain the jth ending position.
[0160] Specifically, loop through the value array to get the material file information. Figure 5 The flowchart shown obtains the current time code from the current material file information.
[0161] Subtract the minimum time code (minTimecoded) from the current time code to get the starting position (start) of the current material file. Add the starting position (start) to the duration in the media information to get the ending position (end).
[0162] Then create a clip according to the material file path in the current material file information, set the start of the clip to the starting position (start) obtained above, set the end of the clip to the ending position (end) obtained above, set the length of the clip to the duration in the media information, and put the current clip into the corresponding track.
[0163] By converting all time codes into a unified format of frames or milliseconds, the problem of inaccurate or lost time information due to inconsistent time code formats is avoided, ensuring the correct sorting of material files and classification of camera positions.
[0164] As an optional example, the above-mentioned obtaining of a set of material files includes:
[0165] In response to the time directory path received in the timeline area, scanning the time directory path and the subdirectories under the time directory path level by level;
[0166] Based on the camera directory name and array in the target key-value pair, save the material files under the time directory path, where the elements in the array store material file description information and media information;
[0167] Based on the target camera directory name, a group of material files are found from the material files under the time directory path.
[0168] Combined with the description in the above embodiment, it can be known that in the video editing scene, using a dictionary (key-value) structure to save the directory and the following material files is an effective data management method. A dictionary is a data structure that stores key-value pairs, where each key is unique and is associated with a value.
[0169] When the timeline area receives the time directory path, the video editing tool is started, and the time directory path and the subdirectories under the time directory path are scanned level by level, and according to the camera directory name (key) and array (value) in the target key-value pair, a set of material files corresponding to a set of editing materials shot by the target camera are obtained.
[0170] The elements in the array value store the material file information. For example, an element in an array stores Figure 3 The material file information corresponding to the two material files under A001 shown in the figure, the elements in another array store the following Figure 3 The material file information corresponding to the two material files under A002 is shown.
[0171] A001 in the above embodiment may, but is not limited to, represent a shooting position, and B001 represents the model of the shooting device on the position. By combining the device model with the position name, a set of material files of the target position can be scanned from the dictionary.
[0172] Through the above dictionary structure, multiple camera positions can be scanned separately and the material files under each camera position can be obtained, thereby achieving accurate and orderly material collection and improving the accuracy of material classification results.
[0173] After the implementation methods in the above embodiments have been used to obtain the time code of the material file under each camera position and the starting position and ending position of the clip corresponding to each material file in the track, a group of clips corresponding to each camera position can be automatically arranged on a track in the timeline area.
[0174] In a specific embodiment, the specific process of arranging the clips corresponding to the material files of multiple camera positions can be referred to Figure 6 to Figure 8 , among which, Figure 6 As shown, the first set of time codes is obtained based on the material file of the first scanned camera position A004, and then the second set of time codes is obtained based on the material file of the scanned camera position A003, and finally the third set of time codes is obtained based on the material file of the scanned camera position A002.
[0175] The minimum time code is determined from the first group of time codes, the second group of time codes and the third group of time codes, and the time code of the current material file is subtracted from the minimum time code to obtain the current starting position of the current clip corresponding to the current material file in the track, and then the current starting position is added to the duration in the media information to obtain the end position of the current clip.
[0176] Create a clip based on the material file path in the current material file information, set the start of the clip to the current starting position, and set the end of the clip to the current ending position. And automatically put the current clip into the corresponding track.
[0177] like Figure 6 As shown, place the two clips corresponding to camera position A004 in the corresponding tracks, such as Figure 7 As shown, put the two clips corresponding to camera position A003 into the corresponding track, and finally put the two clips corresponding to camera position A002 into the corresponding track. Figure 8 .
[0178] Since the minimum time code is determined from all time codes obtained from the material files based on all camera positions, Figure 8 The clips on each track in the timeline area shown can be aligned according to the shooting time, so that video producers can quickly know which materials are shot at different time points in the same time period, thereby realizing the automated management of video clip materials and improving the editing quality and efficiency.
[0179] In addition, compared with the prior art method of directly storing the clips corresponding to multiple material files shot by one camera position continuously on one track (there may be no interval between each clip), the arrangement of the clips in the embodiment of the present application is neater, thereby improving the visual experience of video editing.
[0180] 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.
[0181] According to another aspect of the embodiment of the present application, there is also provided Fig. 9 A processing device for editing materials shown, the device comprising:
[0182] A first acquisition unit 902 is used to acquire a group of material files, wherein one material file in the group of material files includes media information of a clip material shot from a target camera position;
[0183] A first decoding unit 904, configured to perform a first decoding on a group of material files to obtain a group of audio data corresponding to the group of material files;
[0184] A first processing unit 906 is used to determine a set of time codes corresponding to a set of material files based on a set of audio data, wherein a time code in the set of time codes is used to reference and synchronize a material file in the set of material files during video editing;
[0185] A second processing unit 908 is used to determine a start position and an end position of each clip in a set of clips in a preset clip track based on a set of time codes, wherein there is a one-to-one correspondence between the set of clips and the set of material files;
[0186] The third processing unit 910 is used to arrange a group of clips on a preset clip track in the timeline area of the target clip tool based on the start position and the end position.
[0187] Optionally, the first processing unit 906 includes:
[0188] A parsing module, used for parsing an audio signal corresponding to a set of audio data to obtain a simulated linear time code;
[0189] A conversion module, used for converting the format of the linear time code into a readable time code format, to obtain a first subgroup time code corresponding to the first subgroup material file;
[0190] a decoding module, configured to, if a time code corresponding to the second sub-group material file is not obtained based on a group of audio data, decode the second sub-group material file for a second time to obtain container information storing the second sub-group material file, wherein the container information is used to describe format information of the second sub-group material file, and a group of material files includes the first sub-group material file and the second sub-group material file;
[0191] The first processing module is used to obtain a second subgroup time code based on the container information, wherein a group of time codes includes a first subgroup time code and a second subgroup time code.
[0192] Optionally, the first processing module includes:
[0193] The first processing submodule is used to perform the following processing on the i-th material file in the second subgroup material files, where i is a positive integer greater than or equal to 1:
[0194] By performing a second decoding on the i-th material file, an i-th container information is obtained, wherein the i-th container information is used to describe the format information and status information of the i-th material file;
[0195] When the i-th time code is obtained based on the i-th container information, the time code field in the i-th material file is updated, wherein the second subgroup time code includes the i-th time code;
[0196] When the i-th time code is not obtained based on the i-th container information, the i-th time code is obtained using the file name of the i-th source file.
[0197] Optionally, the first processing module includes:
[0198] The update submodule is used to update the time code field in the i-th material file from a null value to the i-th time code.
[0199] Optionally, the first processing module includes:
[0200] A first acquisition submodule is used to acquire source data of a container in an i-th material file when an i-th time code is not acquired based on the i-th container information;
[0201] The second acquisition submodule is used to acquire label data from the source data of the container, and query the i-th time code based on the label data;
[0202] The third acquisition submodule is used to acquire the i-th time code by using the file name of the i-th material file when the i-th time code is not found based on the tag data.
[0203] Optionally, the first processing module includes:
[0204] The segmentation submodule is used to perform character string segmentation on the file name of the i-th material file and determine the position where the last target character appears in the file name;
[0205] A fourth acquisition submodule is used to acquire an initial time code at a position, wherein the initial time code is a system default time when the i-th video material is shot from the target camera position;
[0206] The correction submodule is used to obtain the i-th time code by correcting the initial time code.
[0207] Optionally, the above device further includes:
[0208] A creation unit, used for creating an undefined camera directory name and an undefined array when time codes of some material files in a group of material files are not obtained based on a group of audio data;
[0209] The removal unit is used to remove the elements storing some material files from the original array based on the undefined camera directory name, wherein the original array is an array generated when some material files are obtained by shooting at the target camera.
[0210] Optionally, the second processing unit 908 includes:
[0211] The second processing module arranges the set of time codes in ascending order to obtain a set of sorted time codes;
[0212] A first acquisition module, used for acquiring a minimum time code from a group of sorted time codes;
[0213] The third processing module is used to determine the starting position and the ending position of each clip in a group of clips in a preset clip track based on the minimum time code.
[0214] Optionally, the third processing module includes:
[0215] The second processing submodule is used to determine the jth starting position and the jth ending position of the jth clip in the set of clips in the preset clip track through the following steps, where j is a positive integer greater than or equal to 2;
[0216] Create a preset clip track in the timeline area based on the camera directory name field of the target camera;
[0217] Get the jth time code of the jth material file corresponding to the jth clip;
[0218] The difference between the jth time code and the minimum time code is determined as the jth starting position;
[0219] The jth starting position is added to the media duration in the media information in the jth material file to obtain the jth ending position.
[0220] Optionally, the first obtaining unit 902 includes:
[0221] A scanning module, configured to respond to the time directory path received in the timeline area and scan the time directory path and the subdirectories under the time directory path level by level;
[0222] The fourth processing module is used to save the material files under the time directory path based on the camera directory name and the array in the target key-value pair, wherein the elements in the array store material file description information and media information;
[0223] The search module is used to search for a group of material files from the material files under the time directory path based on the target camera directory name.
[0224] By applying the above device to decode a set of acquired material files, a set of audio data corresponding thereto is obtained, and then based on the set of audio data, the time code of each material file is automatically identified and processed. The acquired time code is used to dynamically manage the editing material, and all the materials shot by all camera positions are automatically aligned according to the shooting time, which facilitates video editors to quickly confirm the materials shot by different camera positions in the same time period at a certain time point, improves the processing efficiency of the editing material, and enhances the convenience and flexibility of video editing. It should be noted that the embodiment of the processing device of the editing material here can refer to the embodiment of the processing method of the editing material above, which will not be repeated here.
[0225] According to another aspect of the embodiment of the present application, an electronic device for implementing the above-mentioned editing material processing method is also provided. The electronic device may be Figure 1 The target terminal or server shown in FIG. This embodiment is described by taking the electronic device as the target terminal as an example. Fig.10 As shown, the electronic device includes a memory 1002 and a processor 1004. The memory 1002 stores a computer program, and the processor 1004 is configured to execute the steps in any of the above method embodiments through the computer program.
[0226] 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.
[0227] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0228] S1, obtaining a group of material files, wherein one material file in the group of material files includes media information of a clip material shot from a target camera position;
[0229] S2, performing a first decoding on a group of material files to obtain a group of audio data corresponding to the group of material files;
[0230] S3, determining a group of time codes corresponding to a group of material files based on a group of audio data, wherein one time code in the group of time codes is used to reference and synchronize one of the material files in the group of material files during video editing;
[0231] S4, based on a set of time codes, determining a start position and an end position of each clip in a set of clips in a preset clip track, wherein there is a one-to-one correspondence between the set of clips and the set of material files;
[0232] S5, arranging a group of clips on a preset clip track in a timeline area of a target clipping tool based on the start position and the end position.
[0233] Alternatively, a person skilled in the art may understand that: Fig.10 The structure shown is for illustration only. Fig.10 The electronic device and the electronic equipment described above are not limited in structure. Fig.10 More or fewer components (such as network interfaces, etc.) as shown in, or with Fig.10 Different configurations are shown.
[0234] Among them, the memory 1002 can be used to store software programs and modules, such as the program instructions / modules corresponding to the processing method and device of the editing material in the embodiment of the present application. The processor 1004 executes various functional applications and data processing by running the software programs and modules stored in the memory 1002, that is, realizing the above-mentioned processing method of the editing material. The memory 1002 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 1002 may further include a memory remotely arranged relative to the processor 1004, 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. Among them, the memory 1002 can be specifically, but not limited to, used to store a group of material files, a group of audio data, and a group of time codes, etc. As an example, such as Fig.10As shown, the memory 1002 may include, but is not limited to, the first acquisition unit 902, the first decoding unit 904, the first processing unit 906, the second processing unit 908, and the third processing unit 910 in the processing device for the clipping material. In addition, other module units in the processing device for the clipping material may also be included but are not limited to, which will not be described in detail in this example.
[0235] Optionally, the transmission device 1006 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 1006 includes a network adapter (NIC), which can be connected to other network devices and a router via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 1006 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0236] In addition, the electronic device further includes: a display 1008 for displaying the editing materials under the target camera position and the picture after the editing segments are arranged; and a connection bus 1010 for connecting the various module components in the electronic device.
[0237] In other embodiments, the target terminal 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, a target terminal or other electronic device, may become a node in the blockchain system by joining the point-to-point network.
[0238] According to another aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the processing method of the clip material provided in various optional implementations of the above-mentioned server verification processing and other aspects, wherein the computer program is configured to execute the steps of any of the above-mentioned method embodiments when running.
[0239] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0240] S1, obtaining a group of material files, wherein one material file in the group of material files includes media information of a clip material shot from a target camera position;
[0241] S2, performing a first decoding on a group of material files to obtain a group of audio data corresponding to the group of material files;
[0242] S3, determining a group of time codes corresponding to a group of material files based on a group of audio data, wherein one time code in the group of time codes is used to reference and synchronize one of the material files in the group of material files during video editing;
[0243] S4, based on a set of time codes, determining a start position and an end position of each clip in a set of clips in a preset clip track, wherein there is a one-to-one correspondence between the set of clips and the set of material files;
[0244] S5, arranging a group of clips on a preset clip track in a timeline area of a target clipping tool based on the start position and the end position.
[0245] 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.
[0246] 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 the hardware related to the target terminal 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, etc.
[0247] 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 one or more computer devices to execute all or part of the steps of the methods of each embodiment of the present application.
[0248] In the several embodiments provided in this 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 units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or integrated into another system, etc. 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.
[0249] 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 may be distributed on multiple network units, etc. In addition, the functional units in various embodiments 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, etc.
[0250] The above are only preferred implementations 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 processing clipping material, characterized in that: include: Acquire a group of material files, wherein one material file in the group of material files includes media information of a clip material shot from a target camera position; Decoding the set of material files for the first time to obtain a set of audio data corresponding to the set of material files; Based on the set of audio data, determining a set of time codes corresponding to the set of material files, wherein one of the time codes is used to reference and synchronize one of the material files in the set of material files during video editing; Based on the set of time codes, determining a start position and an end position of each clip in a set of clips in a preset clip track, wherein there is a one-to-one correspondence between the set of clips and the set of material files; Based on the start position and the end position, the group of editing segments are arranged on the preset editing track in the timeline area of the target editing tool.
2. The method according to claim 1, characterized in that The step of determining a set of time codes corresponding to the set of material files based on the set of audio data comprises: Parsing the audio signal corresponding to the set of audio data to obtain a simulated linear time code; Convert the linear time code format into a readable time code format to obtain a first subgroup time code corresponding to the first subgroup material file; If a time code corresponding to the second sub-group material file is not obtained based on the group of audio data, the second sub-group material file is decoded for the second time to obtain container information storing the second sub-group material file, wherein the container information is used to describe format information of the second sub-group material file, and the group of material files includes the first sub-group material file and the second sub-group material file; Based on the container information, a second subgroup time code is obtained, wherein the group of time codes includes the first subgroup time code and the second subgroup time code.
3. The method according to claim 2, characterized in that The obtaining a second subgroup time code based on the container information includes: The following processing is performed on the i-th material file in the second subgroup material files, where i is a positive integer greater than or equal to 1: By performing a second decoding on the i-th material file, an i-th container information is obtained, wherein the i-th container information is used to describe the format information and status information of the i-th material file; In a case where an i-th time code is acquired based on the i-th container information, updating the time code field in the i-th material file, wherein the second subgroup time code includes the i-th time code; In the case that the i-th time code is not obtained based on the i-th container information, the i-th time code is obtained by using the file name of the i-th material file.
4. The method according to claim 3, characterized in that In the case where the i-th time code is acquired based on the i-th container information, updating the time code field in the i-th material file includes: Update the time code field in the i-th material file from a null value to the i-th time code.
5. The method according to claim 3, characterized in that: The obtaining of the i-th time code by using the file name of the i-th source file when the i-th time code is not obtained based on the i-th container information includes: If the i-th time code is not obtained based on the i-th container information, obtaining source data of the container in the i-th material file; Acquire tag data from source data of the container, and query the i-th time code based on the tag data; When the i-th time code is not found based on the tag data, the i-th time code is obtained by using the file name of the i-th material file.
6. The method according to claim 5, characterized in that In the case that the i-th time code is not found based on the tag data, obtaining the i-th time code by using the file name of the i-th material file includes: Performing character string segmentation on the file name of the i-th material file to determine the position where the last target character in the file name appears; Obtaining an initial time code at the position, wherein the initial time code is a system default time when the i-th video material is shot from the target camera position; The i-th time code is obtained by correcting the initial time code.
7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: If time codes of some of the material files in the group of material files are not obtained based on the group of audio data, an undefined camera directory name and an undefined array are created; Based on the undefined camera directory name, the element storing the part of the material files is removed from the original array, wherein the original array is an array generated when the part of the material files is obtained by shooting with the target camera.
8. The method according to claim 1, characterized in that The step of determining the starting position and the ending position of each clip in a set of clips in a preset clip track based on the set of time codes includes: Arranging the set of time codes in ascending order to obtain a sorted set of time codes; Obtaining a minimum time code from the sorted set of time codes; Based on the minimum time code, a starting position and an ending position of each clip in the group of clips in the preset clip track are determined.
9. The method according to claim 8, characterized in that The step of determining the starting position and the ending position of each clip in the set of clips in the preset clip track based on the minimum time code includes: Determine the jth starting position and the jth ending position of the jth clip in the set of clips in the preset clip track by the following steps, where j is a positive integer greater than or equal to 2; Based on the camera directory name field of the target camera, create the preset clip track in the timeline area; Obtaining the jth time code of the jth material file corresponding to the jth clip; Determine the difference between the j-th time code and the minimum time code as the j-th starting position; The j-th starting position is added to the media duration in the media information in the j-th material file to obtain the j-th ending position.
10. The method according to claim 1, characterized in that The step of obtaining a set of material files includes: In response to the time directory path received by the timeline area, scanning the time directory path and the subdirectories under the time directory path level by level; Based on the camera directory name and array in the target key-value pair, the material files under the time directory path are saved, wherein the elements in the array store material file description information and media information; Based on the target camera directory name, the group of material files is searched from the material files under the time directory path.
11. A processing device for editing material, characterized in that: include: A first acquisition unit is used to acquire a group of material files, wherein one material file in the group of material files includes media information of a clip material shot from a target camera position; A first decoding unit, configured to perform a first decoding on the group of material files to obtain a group of audio data corresponding to the group of material files; A first processing unit is configured to determine a set of time codes corresponding to the set of material files based on the set of audio data, wherein one time code in the set of time codes is used to reference and synchronize one of the material files in the set of material files during video editing; A second processing unit is used to determine, based on the set of time codes, a starting position and an ending position of each clip in a set of clips in a preset clip track, wherein there is a one-to-one correspondence between the set of clips and the set of material files; The third processing unit is used to arrange the group of editing segments on the preset editing track in the timeline area of the target editing tool based on the starting position and the ending position.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program can be executed by a terminal device or a computer to execute the method as claimed in any one of claims 1 to 10.
13. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 10 through the computer program.
Citation Information
Cited By
Automatic endowing management method and system for field lens time information of shooting material
CN121462852A