Distributed video transcoding processing method and device, electronic equipment and storage medium
By using segmented transcoding and adaptive concurrent processing of audio and video files, the problems of audio stuttering and insufficient resources are solved, achieving efficient and seamless video transcoding results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGZHOU KUAIZI INFORMATION TECH CO LTD
- Filing Date
- 2025-12-03
- Publication Date
- 2026-07-31
AI Technical Summary
Existing distributed video transcoding systems suffer from audio stuttering issues and transcoding failures due to insufficient resources when transcoding high-resolution videos.
By analyzing the keyframe parameters of audio and video files, the files are segmented, transcoded, and spliced together. The audio files are processed using a combination of fast transcoding speed and low-resolution parameters to ensure audio-video synchronization. The number of concurrent transcoding operations is adaptively adjusted according to the complexity of the video.
It effectively solves the problem of audio stuttering at the audio-video splicing point and avoids insufficient resources when transcoding high-resolution videos, achieving seamless splicing and efficient transcoding.
Smart Images

Figure CN121262402B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of video transcoding technology, and in particular to a distributed video transcoding processing method, apparatus, electronic device, and storage medium. Background Technology
[0002] To speed up the transcoding process, many audio and video transcoding systems currently use distributed transcoding. This means that an audio or video file is divided into multiple segments based on keyframes. For example, a 10-minute audio or video file can be divided into 30 segments, each 20 seconds long, and distributed to various transcoding servers for transcoding. After each transcoding server has completed its transcoding, the segments are then assembled in chronological order to form a 10-minute video file.
[0003] However, this method has a significant drawback: audio stuttering occurs at the junctions of audio and video segments. This is due to audio encoder latency, introduced during audio-video transcoding. Typically, each segment begins with tens of milliseconds of silent data, a requirement stipulated by audio coding standards, including AAC and MP3. This stuttering at junctions is audibly unacceptable, especially when it occurs in the middle of a continuous piece of music or speech.
[0004] Furthermore, existing distributed transcoding systems cannot adaptively adjust the number of concurrent transcoding units based on the complexity of the video being transcoded and resource requirements. For example, transcoding 720P and 1080P videos has relatively low resource requirements (such as CPU and memory) for the transcoding unit, allowing a single transcoding unit to transcode multiple video streams concurrently. However, 4K videos have much higher resource requirements for the transcoding unit. If multiple 4K videos are transcoded simultaneously at the same concurrent rate as 720P and 1080P, it will lead to insufficient system resources and transcoding failures. Summary of the Invention
[0005] This application provides a distributed video transcoding processing method, apparatus, electronic device, and storage medium to solve the problems of audio stuttering in audio and video files and transcoding failures for high-resolution videos.
[0006] The embodiments of this application adopt the following technical solutions:
[0007] In a first aspect, embodiments of this application provide a distributed video transcoding processing method, wherein the method includes:
[0008] In response to a transcoding request for an audio / video file, the video data of the audio / video file is analyzed to obtain keyframe parameters of the video file;
[0009] Based on the keyframe parameters, the audio and video files are segmented, transcoded, and then concatenated to obtain a first audio and video file. Simultaneously, a second audio and video file is obtained by transcoding the entire audio and video file. This second audio and video file is used to separate and obtain a complete audio file.
[0010] The complete audio file is mixed with the first audio / video file to obtain the target audio / video file.
[0011] In some embodiments, the step of segmenting and transcoding the audio / video file according to the keyframe parameters and then concatenating them to obtain the first audio / video file includes:
[0012] The audio and video file is segmented and transcoded into multiple video segments based on the keyframe parameters;
[0013] The multiple video segments are divided into segments according to key frames, and each segment is assigned to multiple transcoding units for transcoding according to a preset time.
[0014] After each transcoding unit has completed its transcoding process, the data is then concatenated in chronological order to form the first audio and video file.
[0015] In some embodiments, the complete audio file is mixed with the first audio / video file to obtain a target audio / video file, including:
[0016] The second audio and video file is obtained by using fast video transcoding speed and low video resolution parameters, and the complete audio file is extracted from the second audio and video file;
[0017] The complete audio file is combined with the segmented video data extracted from the first audio and video file to obtain a complete transcoded audio and video file, which is then used as the target audio and video file.
[0018] In some embodiments, the transcoding request for the audio / video file includes at least one of the following: a unique transcoding request number, the audio / video file name, the absolute path where the audio / video file is stored, the start time and duration of the audio / video file, the video resolution parameters, and a flag indicating whether it is a fast transcoding of the entire file. The flag for the second audio / video file indicating whether it is a fast transcoding of the entire file is yes, while the flag for the first audio / video file indicating whether it is a fast transcoding of the entire file is no. The unique transcoding request number of the second audio / video file is the same as the unique request number of each segment of the first audio / video file.
[0019] In some embodiments, the method further includes
[0020] If the flag indicating whether the entire file is being quickly transcoded is not present, then the audio and video file is transcoded using high-definition transcoding parameters.
[0021] Meanwhile, if the flag indicating whether the entire file is to be quickly transcoded is yes, then the audio and video file is transcoded using the fastest transcoding and lowest resolution parameters.
[0022] In some embodiments, the method further includes
[0023] If the resolution parameter of the video is not less than the preset resolution, then high-resolution transcoding will be performed after the transcoding process is completed, and no new transcoding request will be obtained when transcoding audio and video files with a resolution not less than the preset resolution.
[0024] In some embodiments, the method further includes
[0025] First, determine whether all transcoding requests in the audio and video file have been processed. If all transcoding is completed, then process the flag indicating whether the entire file is being quickly transcoded.
[0026] Secondly, embodiments of this application also provide a distributed video transcoding processing apparatus, wherein the apparatus includes:
[0027] The response processing module is used to respond to the transcoding request of the audio and video file and analyze the video data of the audio and video file to obtain the key frame parameters of the video file.
[0028] The transcoding module is used to transcode and concatenate the audio and video files in segments according to the keyframe parameters to obtain a first audio and video file, and simultaneously transcode the entire audio and video file to obtain a second audio and video file, which is used to separate a complete audio file; and
[0029] The mixing module is used to mix the complete audio file with the first audio / video file to obtain the target audio / video file.
[0030] Thirdly, embodiments of this application also provide an electronic device, including: a processor; and a memory arranged to store computer-executable instructions, which, when executed, cause the processor to perform the above-described method.
[0031] Fourthly, embodiments of this application also provide a computer-readable storage medium that stores one or more programs, which, when executed by an electronic device including multiple applications, cause the electronic device to perform the above-described method.
[0032] The at least one technical solution adopted in this application embodiment can achieve the following beneficial effects: In response to the transcoding request of an audio / video file, the video data of the audio / video file is analyzed to obtain keyframe parameters of the video file; based on the keyframe parameters, the audio / video file is segmented, transcoded, and then spliced to obtain a first audio / video file; simultaneously, a second audio / video file is obtained by transcoding the entire segment of the audio / video file, and the second audio / video file is used to separate a complete audio file; the complete audio file is mixed with the first audio / video file to obtain a target audio / video file. Thus, the above method not only solves the problem of audio stuttering at the splicing points of each segment during transcoding, but also adaptively increases the concurrent transcoding rate to avoid transcoding failures when transcoding videos of different complexities. Attached Figure Description
[0033] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0034] Figure 1 This is a flowchart illustrating the distributed video transcoding processing method in an embodiment of this application.
[0035] Figure 2 This is a schematic diagram of the structure of the distributed video transcoding processing device in the embodiments of this application;
[0036] Figure 3 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application;
[0037] Figure 4 This is a schematic diagram illustrating the principle implementation of the distributed video transcoding processing method in the embodiments of this application; Detailed Implementation
[0038] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0039] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.
[0040] like Figure 4 As shown, the distributed video transcoding processing method in this application embodiment is applicable to a system including a distributed storage system, a distributed transcoding management center, a transcoding task queue, a transcoding result queue, and a transcoding unit, etc., and specifically includes the following steps:
[0041] Step S1, File upload and storage
[0042] Audio and video files are uploaded over the network and stored in a distributed storage system.
[0043] Step S2, Initiate transcoding request
[0044] The distributed storage system sends a transcoding request to the distributed transcoding management center.
[0045] Step S3, Task Enlistment
[0046] The distributed transcoding management center writes the "segmented transcoding task" into the transcoding task queue.
[0047] Step S4, the transcoding unit performs the task.
[0048] Multiple transcoding units read segmented tasks from the transcoding task queue via HTTP and perform transcoding operations.
[0049] Step S5: Write the result back to the queue
[0050] After completing the transcoding, the transcoding unit writes the "transcoding processing result" into the transcoding result queue.
[0051] Step 6, obtain the transcoding result
[0052] The distributed transcoding management center reads the transcoding processing results from the transcoding result queue, and the process ends.
[0053] This application provides a distributed video transcoding processing method, such as... Figure 1 The diagram illustrates a distributed video transcoding processing method according to an embodiment of this application. The method includes at least the following steps S110 to S130:
[0054] Step S110: In response to the transcoding request of the audio and video file, analyze the video data of the audio and video file to obtain the keyframe parameters of the video file.
[0055] To speed up transcoding, distributed transcoding is used, which divides a video file into multiple video segments based on video keyframes.
[0056] For example, a 10-minute video file can be divided into 30 segments of 20 seconds each by the distributed transcoding management center according to key frames and distributed to various transcoding units for transcoding. After each transcoding unit has completed its transcoding, the distributed transcoding management center splices them together in chronological order to form a 10-minute video file.
[0057] Step S120: Based on the keyframe parameters, the audio and video file is segmented, transcoded, and then concatenated to obtain a first audio and video file. At the same time, the entire audio and video file is transcoded to obtain a second audio and video file. The second audio and video file is used to separate and obtain a complete audio file.
[0058] "The first audio / video file" refers to the audio / video file obtained through segmented transcoding. "The second audio / video file" is the audio / video file obtained through whole-segment transcoding. This means that the entire video file is transcoded using the fastest transcoding speed and the lowest resolution parameters. In this case, the time taken to transcode the entire audio / video file is very short, even shorter than the time taken to transcode each segment.
[0059] Step S130: Mix the complete audio file with the first audio / video file to obtain the target audio / video file.
[0060] The audio data is extracted from this video file and then combined with the video data extracted from the segmented transcoded and spliced audio-video file to obtain the complete transcoded audio-video file. This avoids audio stuttering at the splicing points of each segment and ensures that the audio and video are synchronized, achieving seamless splicing of both audio and video.
[0061] The above method effectively avoids audio stuttering at the splicing points of different segments. It encodes the entire video file simultaneously, using transcoding parameters that are mostly the same as those used in the transcoding unit for each video segment (e.g., video frame rate, audio sampling rate, etc.). Then, the audio data extracted from this video file is combined with the video data extracted from the spliced audio-video file after segmented transcoding to obtain the complete transcoded audio-video file. This avoids audio stuttering at the splicing points of different segments and ensures that the audio and video are synchronized, achieving seamless splicing of both audio and video.
[0062] The following will use examples such as a distributed storage system, a distributed transcoding management center, a transcoding task queue, a transcoding result queue, and a transcoding unit to further explain and illustrate this application in detail.
[0063] In one embodiment of this application, the step of segmenting and transcoding the audio and video file according to the keyframe parameters and then concatenating them to obtain the first audio and video file includes: segmenting and transcoding the audio and video file into multiple video segments according to the keyframe parameters; dividing the multiple video segments into segments according to the keyframes, and allocating each segment to multiple transcoding units for transcoding according to a preset time; and concatenating them in chronological order after each transcoding unit has completed transcoding to form the first audio and video file.
[0064] Specifically, the audio and video transcoding management center analyzes the video data of the audio and video files, extracting keyframe parameters and video resolution parameters. It analyzes and evaluates the time within the keyframe parameters to obtain the duration of each segment. Then, it searches for the time point closest to that duration keyframe from the keyframe parameters. Using the keyframe time point as the basis for segmented transcoding of the audio and video file, it obtains the start time and duration of each segment. The parameters of each segment are saved to the transcoding task queue. The transcoding parameters for each segment include a transcoding request number (unique identifier), the audio and video file name, the absolute path of the audio and video file storage, the start time and duration of the audio and video file segment, the video resolution parameters, and a flag indicating whether it is a fast transcoding of the entire file. The flag indicating whether it is a fast transcoding of the entire file is used to quickly transcode to obtain smooth audio data; the flag for each segment must be negative.
[0065] In one embodiment of this application, mixing the complete audio file with the first audio / video file to obtain a target audio / video file includes: using a fast video transcoding speed and low video resolution parameters to obtain a second audio / video file, and extracting the complete audio file from the second audio / video file; combining the complete audio file with the segmented video data extracted from the first audio / video file to obtain a complete transcoded audio / video file as the target audio / video file.
[0066] Understandably, in order to transcode the entire audio and video file to obtain smooth audio data, the audio and video transcoding management center saves the transcoding of the entire audio and video file as a transcoding request in the transcoding task queue. The transcoding parameters include the transcoding request number (unique identifier), the audio and video file name, the absolute path of the audio and video file storage, the start time and duration of the audio and video file segments, the video resolution parameters, and a flag indicating whether it is a fast transcoding of the entire file. The flag indicating whether it is a fast transcoding of the entire file must be yes, and the request number of this request is the same as the request number of each segment.
[0067] In one embodiment of this application, the transcoding request for the audio / video file includes at least one of the following: a unique transcoding request number, the audio / video file name, the absolute path where the audio / video file is stored, the start time and duration of the audio / video file, the video resolution parameters, and a flag indicating whether it is a fast transcoding of the entire file. The flag for the second audio / video file indicating whether it is a fast transcoding of the entire file is yes, while the flag for the first audio / video file indicating whether it is a fast transcoding of the entire file is no. The unique transcoding request number of the second audio / video file is the same as the unique request number of each segment of the first audio / video file.
[0068] Log in to the local upload transcoding system, then select the audio / video file to upload. The audio / video file is transmitted over the network and saved to the distributed storage system. After the upload is complete, the distributed transcoding management center receives the audio / video file transcoding request. The transcoding request parameters include the transcoding request number (unique), the audio / video file name, the absolute path of the audio / video file storage, the start time and duration of the audio / video file, etc.
[0069] In one embodiment of this application, the method further includes transcoding the audio and video file using high-definition transcoding parameters if the flag indicating whether it is a fast transcoding of the entire file is not present; and transcoding the audio and video file using the fastest transcoding and lowest definition parameters if the flag indicating whether it is a fast transcoding of the entire file is present.
[0070] When a transcoding task is available, the distributed transcoding management center returns a transcoding task request to the transcoding unit. After receiving the transcoding task request, the transcoding unit analyzes the transcoding parameters. If the flag indicating whether it is a fast transcoding of the entire file is set, otherwise, high-definition transcoding parameters are used to transcode the audio and video file. If the flag indicating whether it is a fast transcoding of the entire file is set, otherwise, the fastest transcoding and lowest-definition parameters are used to transcode the audio and video file.
[0071] In one embodiment of this application, the method further includes waiting for the transcoding process to be completed before performing high-resolution transcoding if the resolution parameter of the video is not less than a preset resolution, and not obtaining new transcoding requests when transcoding audio and video files with a resolution not less than the preset resolution.
[0072] In this embodiment, a single transcoding unit (8-core CPU and 8GB memory) can handle a relatively high number of concurrent transcodings of 720P and 1080P videos (4 channels simultaneously with 8-core CPU and 8GB memory). However, when transcoding 4K videos, the number of concurrent transcodings will be adaptively controlled (only one channel of 4K video will be transcoded with 8-core CPU and 8GB memory) to avoid transcoding failure due to insufficient resources.
[0073] It is understood that the CPU, memory, and resolution information described above are merely examples and are not intended to limit the scope of protection of this application.
[0074] After the transcoding unit completes the transcoding, it stores the transcoded audio and video files in the distributed storage system. The processing results are written to the transcoding result queue. The transcoding result parameters include the transcoding request number (unique), the audio and video file name, the absolute path of the transcoded audio and video file storage, the start time and duration of the audio and video file segments, the video resolution parameters, and a flag indicating whether the entire file is quickly transcoded.
[0075] Each transcoding unit constitutes a distributed transcoding system, which can manage the number of concurrent transcoding tasks based on its own resource availability, with a maximum concurrent transcoding count of half the number of CPU cores in the unit. At regular intervals, it queries the distributed transcoding management center via HTTP requests to check for transcoding tasks.
[0076] If the resolution exceeds 1080P, the current unit needs to wait for the transcoding process to complete before performing the high-resolution transcoding. Furthermore, when transcoding audio and video files with resolutions exceeding 1080P, no new transcoding requests will be obtained from the distributed transcoding management center. This avoids the problem of insufficient system resources (such as CPU and memory resources) leading to transcoding failure when transcoding multiple audio and video files exceeding 1080P concurrently.
[0077] In one embodiment of this application, the method further includes first determining whether each transcoding request in the audio and video file has been processed, and when all transcoding is completed, processing the flag indicating whether the entire file is being quickly transcoded.
[0078] The distributed transcoding center reads the transcoding results from the transcoding result queue, analyzes the parameters of the transcoding results, and determines whether all transcoding requests for a certain audio or video file have been processed by using the request number and the transcoding requests stored in the transcoding task queue. When all transcoding is completed, it processes the flag indicating whether the entire file has been quickly transcoded.
[0079] If the flag indicating whether to quickly transcode the entire file is not present, the audio and video files are spliced together in chronological order according to time periods. The spliced file is a complete audio and video file, but it has audio stuttering issues at the splicing points. If the flag indicating whether to quickly transcode the entire file is not present, the transcoded audio and video file is obtained from the transcoding result parameters. The entire audio data is then extracted from this file and mixed with the video data from the spliced audio and video file to obtain a complete audio and video file with smooth audio. This audio and video file is then saved to a distributed storage system, and the transcoding result is returned to the distributed storage system.
[0080] This application also provides a distributed video transcoding processing device 200, such as... Figure 2 As shown, a schematic diagram of the structure of a distributed video transcoding processing device in an embodiment of this application is provided. The distributed video transcoding processing device 200 includes at least: a response processing module 210, a transcoding processing module 220, and a hybrid processing module 230, wherein:
[0081] In one embodiment of this application, the response processing module 210 is specifically used to: in response to a transcoding request of an audio / video file, analyze the video data of the audio / video file to obtain keyframe parameters of the video file.
[0082] To speed up transcoding, distributed transcoding is used, which divides a video file into multiple video segments based on video keyframes.
[0083] For example, a 10-minute video file can be divided into 30 segments of 20 seconds each by the distributed transcoding management center according to key frames and distributed to various transcoding units for transcoding. After each transcoding unit has completed its transcoding, the distributed transcoding management center splices them together in chronological order to form a 10-minute video file.
[0084] In one embodiment of this application, the transcoding processing module 220 is specifically used to: transcode the audio and video file into segments and then concatenate them to obtain a first audio and video file according to the keyframe parameters, and at the same time transcode the entire audio and video file to obtain a second audio and video file, the second audio and video file being used to separate and obtain a complete audio file.
[0085] "The first audio / video file" refers to the audio / video file obtained through segmented transcoding. "The second audio / video file" is the audio / video file obtained through whole-segment transcoding. This means that the entire video file is transcoded using the fastest transcoding speed and the lowest resolution parameters. In this case, the time taken to transcode the entire audio / video file is very short, even shorter than the time taken to transcode each segment.
[0086] In one embodiment of this application, the mixing processing module 230 is specifically used to: mix the complete audio file with the first audio and video file to obtain a target audio and video file.
[0087] The audio data is extracted from this video file and then combined with the video data extracted from the segmented transcoded and spliced audio-video file to obtain the complete transcoded audio-video file. This avoids audio stuttering at the splicing points of each segment and ensures that the audio and video are synchronized, achieving seamless splicing of both audio and video.
[0088] In one embodiment of this application, the transcoding module 220 is further configured to:
[0089] The audio and video file is segmented and transcoded into multiple video segments based on the keyframe parameters;
[0090] The multiple video segments are divided into segments according to key frames, and each segment is assigned to multiple transcoding units for transcoding according to a preset time.
[0091] After each transcoding unit has completed its transcoding process, the data is then concatenated in chronological order to form the first audio and video file.
[0092] In one embodiment of this application, the mixing processing module 230 is further configured to:
[0093] The second audio and video file is obtained by using fast video transcoding speed and low video resolution parameters, and the complete audio file is extracted from the second audio and video file;
[0094] The complete audio file is combined with the segmented video data extracted from the first audio and video file to obtain a complete transcoded audio and video file, which is then used as the target audio and video file.
[0095] In one embodiment of this application, the transcoding request for the audio / video file includes at least one of the following: a unique transcoding request number, the audio / video file name, the absolute path where the audio / video file is stored, the start time and duration of the audio / video file, the video resolution parameters, and a flag indicating whether it is a fast transcoding of the entire file. The flag for the second audio / video file indicating whether it is a fast transcoding of the entire file is yes, while the flag for the first audio / video file indicating whether it is a fast transcoding of the entire file is no. The unique transcoding request number of the second audio / video file is the same as the unique request number of each segment of the first audio / video file.
[0096] In one embodiment of this application, an adaptive adjustment module is further included, for:
[0097] If the flag indicating whether the entire file is being quickly transcoded is not present, then the audio and video file is transcoded using high-definition transcoding parameters.
[0098] Meanwhile, if the flag indicating whether the entire file is to be quickly transcoded is yes, then the audio and video file is transcoded using the fastest transcoding and lowest resolution parameters.
[0099] In one embodiment of this application, an adaptive adjustment module is further included, for:
[0100] If the resolution parameter of the video is not less than the preset resolution, then high-resolution transcoding will be performed after the transcoding process is completed, and no new transcoding request will be obtained when transcoding audio and video files with a resolution not less than the preset resolution.
[0101] In one embodiment of this application, an adaptive adjustment module is further included, for:
[0102] First, determine whether all transcoding requests in the audio and video file have been processed. If all transcoding is completed, then process the flag indicating whether the entire file is being quickly transcoded.
[0103] It is understood that the above-described distributed video transcoding processing device can implement each step of the distributed video transcoding processing method provided in the foregoing embodiments. The relevant explanations of the distributed video transcoding processing method are applicable to the distributed video transcoding processing device, and will not be repeated here.
[0104] Figure 3 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Please refer to it. Figure 3 At the hardware level, the electronic device includes a processor, and optionally also an internal bus, network interface, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for other business operations.
[0105] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 3 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0106] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.
[0107] The processor reads the corresponding computer program from non-volatile memory into main memory and then executes it, forming a distributed video transcoding processing device at the logical level. The processor executes the program stored in memory and specifically performs the following operations:
[0108] In response to a transcoding request for an audio / video file, the video data of the audio / video file is analyzed to obtain keyframe parameters of the video file;
[0109] Based on the keyframe parameters, the audio and video files are segmented, transcoded, and then concatenated to obtain a first audio and video file. Simultaneously, a second audio and video file is obtained by transcoding the entire audio and video file. This second audio and video file is used to separate and obtain a complete audio file.
[0110] The complete audio file is mixed with the first audio / video file to obtain the target audio / video file.
[0111] The above is as stated in this application. Figure 1 The method executed by the distributed video transcoding processing device disclosed in the illustrated embodiments can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0112] The electronic device can also perform Figure 1 The method for executing a distributed video transcoding processing device, and the implementation of the distributed video transcoding processing device in... Figure 1 The functions of the embodiments shown are not described in detail here.
[0113] This application also proposes a computer-readable storage medium that stores one or more programs, the programs including instructions that, when executed by an electronic device including multiple applications, enable the electronic device to perform... Figure 1 The method executed by the distributed video transcoding processing device in the illustrated embodiment is specifically used to perform:
[0114] In response to a transcoding request for an audio / video file, the video data of the audio / video file is analyzed to obtain keyframe parameters of the video file;
[0115] Based on the keyframe parameters, the audio and video files are segmented, transcoded, and then concatenated to obtain a first audio and video file. Simultaneously, a second audio and video file is obtained by transcoding the entire audio and video file. This second audio and video file is used to separate and obtain a complete audio file.
[0116] The complete audio file is mixed with the first audio / video file to obtain the target audio / video file.
[0117] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0118] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0119] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0120] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0121] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0122] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0123] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0124] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0125] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0126] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method for distributed video transcoding processing, the method comprising: The method includes: In response to a transcoding request for an audio or video file, the video data of the audio or video file is analyzed to obtain keyframe parameters of the video file; Based on the keyframe parameters, the audio and video files are segmented, transcoded, and then concatenated to obtain a first audio and video file. This first audio and video file is obtained through high-definition transcoding parameters. Simultaneously, a second audio and video file is obtained by transcoding the entire audio and video file. This second audio and video file is used to separate and obtain a complete audio file. The complete audio file is mixed with the first audio / video file to obtain the target audio / video file; The complete audio file is mixed with the first audio / video file to obtain the target audio / video file, including: The second audio and video file is obtained by using fast video transcoding speed and low video resolution parameters, and the complete audio file is extracted from the second audio and video file; The complete audio file is combined with the segmented video data extracted from the first audio and video file to obtain a complete transcoded audio and video file, which is then used as the target audio and video file.
2. The method of claim 1, wherein, The step of segmenting, transcoding, and then concatenating the audio and video files according to the keyframe parameters to obtain the first audio and video file includes: The audio and video file is segmented and transcoded into multiple video segments based on the keyframe parameters; The multiple video segments are divided into segments according to key frames, and each segment is assigned to multiple transcoding units for transcoding according to a preset time. After each transcoding unit has completed its transcoding, the audio and video files are then assembled in chronological order to form the first audio and video file.
3. The method of claim 1, wherein, The method further includes: If the resolution parameter of the video is not less than the preset resolution, the unit will wait for the current transcoding to be completed before performing this high-resolution transcoding, and will not obtain new transcoding requests while transcoding audio and video files with a resolution not less than the preset resolution.
4. A distributed video transcoding processing device, characterized in that, The device includes: The response processing module is used to respond to the transcoding request of the audio and video file and analyze the video data of the audio and video file to obtain the key frame parameters of the video file. The transcoding module is used to transcode and then concatenate the audio and video files in segments according to the keyframe parameters to obtain a first audio and video file. The first audio and video file is obtained by transcoding using high-definition transcoding parameters. Simultaneously, a second audio and video file is obtained by transcoding the entire audio and video file. The second audio and video file is used to separate and obtain a complete audio file. A mixing module is used to mix the complete audio file with the first audio / video file to obtain a target audio / video file; The complete audio file is mixed with the first audio / video file to obtain the target audio / video file, including: The second audio and video file is obtained by using fast video transcoding speed and low video resolution parameters, and the complete audio file is extracted from the second audio and video file; The complete audio file is combined with the segmented video data extracted from the first audio and video file to obtain a complete transcoded audio and video file, which is then used as the target audio and video file.
5. An electronic device, characterized in that, include: processor; as well as, A memory configured to store computer-executable instructions, which, when executed, cause the processor to perform the method of any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs that, when executed by an electronic device including multiple applications, cause the electronic device to perform the method of any one of claims 1 to 3.