Multimedia data coding method and related device
By segmenting the multimedia data and determining the target encoding method, and using encoders with different encoding thread attributes for encoding, the performance problem of dual-thread parallel processing under high encoding occupancy is solved, and the data export speed and overall encoding efficiency are improved. .
Patent Information
- Application Number
- CN202410869078.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-09-24
AI Technical Summary
When the engineering file encoding occupancy rate of dual-threaded parallel processing is high, the data export speed is lower than the single-threaded serial method, and the encoding efficiency cannot be effectively improved.
By dividing the multimedia data to be processed into multiple segments, and determining the target encoding method for each segment, using encoders with different encoding thread attributes for encoding, the number of threads is determined based on the attributes of the segments and the encoder occupancy rate, and a single thread is used Or multi-threaded encoding to achieve targeted encoding processing.
It improves the overall efficiency of multimedia data encoding, avoids the performance degradation of dual-thread parallel processing under high encoding occupancy, and achieves faster data export speed.
Smart Images

Figure CN118695028A
Abstract
Description
Technical Field
[0001] The present application relates to the field of information processing, and in particular to a multimedia data encoding method and related devices. Background Art
[0002] Currently, there are two methods for multimedia data encoding processing: single-thread serial and dual-thread parallel.
[0003] like Figure 1 The figure shows a schematic diagram of the single-thread serial and dual-thread parallel processing process. The single-thread serial includes the following steps: importing data, encoding frame by frame, encoding (encode) 1, exporting data, and the dual-thread parallel includes the following steps: importing data, task slicing, encode1 and two tasks parallel processing, exporting data.
[0004] When dual-thread parallel processing is performed, video A is divided into two segments, video A-1 and video A-2, and then the two segments are processed in parallel.
[0005] Dual-thread parallelism is a new method to solve the slow speed of single-thread serial processing. However, the defect of this method is that it can only optimize engineering files with low encoding occupancy rate. When the encoding occupancy rate of engineering files is above 80%, the data export speed is worse than that of the single-thread serial method. Summary of the invention
[0006] The first aspect of the present application provides a multimedia data encoding method, comprising:
[0007] Obtaining multimedia data to be processed;
[0008] Dividing the to-be-processed multimedia data into at least two multimedia data segments;
[0009] sequentially determining a target encoding mode corresponding to each of the at least two multimedia data segments, so as to control an encoder to encode the corresponding multimedia data segment based on the target encoding mode to obtain a target multimedia data segment, wherein the target encoding mode is one of at least two encoding modes of the encoder, and encoding thread attributes used by any two encoding modes are different;
[0010] At least two target multimedia data segments are spliced together to obtain target multimedia data.
[0011] In a possible implementation, dividing the to-be-processed multimedia data into at least two multimedia data segments includes:
[0012] Determining a degree of overlap between first multimedia data and second multimedia data on a time axis, wherein the multimedia data to be processed includes the first multimedia data and the second multimedia data;
[0013] According to the overlap, a division position of at least one of the first multimedia data and the second multimedia data is determined to obtain at least two multimedia data segments.
[0014] In a possible implementation, sequentially determining a target encoding mode corresponding to each of the at least two multimedia data segments includes at least one of the following:
[0015] Determining a target encoding method corresponding to each multimedia data segment according to the attribute of each multimedia data segment;
[0016] or
[0017] According to the derived parameters of the multimedia data to be processed, a target encoding method corresponding to the corresponding multimedia data segment is determined.
[0018] In a possible implementation, sequentially determining a target encoding mode corresponding to each of the at least two multimedia data segments includes:
[0019] determining an encoder occupancy of a multimedia data segment;
[0020] According to the encoder occupancy rate of each multimedia data segment, a target encoding mode corresponding to the corresponding multimedia data segment is determined.
[0021] In a possible implementation, determining the target encoding mode corresponding to the corresponding multimedia data segment according to the attribute of each multimedia data segment includes:
[0022] Determining, based on the amount of pixel data of each video frame in the target sub-segment in each multimedia data segment, an encoder occupancy rate of each processor in at least two processors corresponding to the multimedia data segment;
[0023] According to the encoder occupancy rate of each processor of the multimedia data segment, the encoder of the target processor and the target encoding method are determined to control the encoder of the target processor to encode the multimedia data segment in the target encoding method.
[0024] In a possible implementation, determining the target encoding mode corresponding to the corresponding multimedia data segment according to the encoder occupancy of each multimedia data segment includes:
[0025] Determining a first encoding mode based on an encoder occupancy rate of the multimedia data segment being greater than a first preset threshold, controlling the encoder to process the multimedia data segment in the first encoding mode to obtain a target multimedia data segment, wherein the first encoding mode includes one encoding thread;
[0026] Based on the fact that the encoder occupancy rate of the multimedia data segment is not greater than a first preset threshold, a second encoding method is determined, and the encoder is controlled to process the multimedia data segment in the second encoding method to obtain a target multimedia data segment, wherein the second encoding method includes at least two parallel encoding threads.
[0027] In a possible implementation, controlling the encoder to process the multimedia data segment in a second encoding mode to obtain a target multimedia data segment includes:
[0028] Splitting the first multimedia data segment along the time axis to obtain at least two sub-segments;
[0029] At least two encoding threads in the encoder are controlled to process the at least two sub-segments in parallel to obtain at least two target multimedia data segments.
[0030] In a possible implementation, controlling the encoder to process the multimedia data segment in a second encoding mode to obtain a target multimedia data segment includes:
[0031] Determining at least two sub-segments overlapping on the time axis in the second multimedia data segment;
[0032] At least two encoding threads in the encoder are controlled to process the at least two sub-segments in parallel to obtain at least two target multimedia data segments.
[0033] In a possible implementation, sequentially determining a target encoding mode corresponding to each of the at least two multimedia data segments to control an encoder to encode the corresponding multimedia data segment based on the target encoding mode to obtain a target multimedia data segment includes:
[0034] Based on the third multimedia data segment including at least two types of multimedia data, determining in sequence a target encoding mode corresponding to each type of multimedia data segment;
[0035] The encoder corresponding to each type of multimedia data segment is respectively controlled to encode the multimedia data segment using a corresponding target encoding method to obtain at least two target multimedia data, where one target multimedia data corresponds to one type of multimedia data segment.
[0036] A second aspect of the present application provides a multimedia data encoding device, comprising:
[0037] An acquisition module, used for acquiring multimedia data to be processed;
[0038] A segmentation module, used for segmenting the to-be-processed multimedia data into at least two multimedia data segments;
[0039] a determination module, configured to sequentially determine a target encoding mode corresponding to each of the at least two multimedia data segments, so as to control the encoder to encode the corresponding multimedia data segment based on the target encoding mode to obtain a target multimedia data segment, wherein the target encoding mode is one of at least two encoding modes of the encoder, and encoding thread attributes adopted by any two encoding modes are different;
[0040] The splicing module is used to splice at least two target multimedia data segments to obtain target multimedia data.
[0041] The third aspect of the present application provides a computer program product, including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements the multimedia data encoding method of the first aspect or any implementation of the first aspect.
[0042] A fourth aspect of the present application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:
[0043] The memory is used to store computer programs;
[0044] The processor is used to execute the computer program so that the electronic device can implement the multimedia data encoding method of the above-mentioned first aspect or any implementation manner of the first aspect.
[0045] A fifth aspect of the present application provides a computer storage medium, which carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement the multimedia data encoding method of the first aspect or any implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0047] Figure 1 It is a schematic diagram of single-thread serial and dual-thread parallel processing;
[0048] Figure 2 It is a flowchart of a multimedia data encoding method provided by an embodiment of the present application;
[0049] Figure 3 is a flow chart of dividing the multimedia data to be processed into at least two multimedia data segments provided by an embodiment of the present application;
[0050] Figure 4 is a schematic diagram of multimedia data to be processed provided by an embodiment of the present application;
[0051] Figure 5 is another schematic diagram of multimedia data to be processed provided by an embodiment of the present application;
[0052] Figure 6 is a flowchart of sequentially determining a target encoding method corresponding to each of the at least two multimedia data segments provided by an embodiment of the present application;
[0053] Figure 7 It is a flowchart of determining a target encoding method corresponding to a corresponding multimedia data segment according to an attribute in each multimedia data segment provided by an embodiment of the present application;
[0054] Figure 8 It is a flowchart of determining a target encoding method corresponding to a corresponding multimedia data segment according to an encoder occupancy rate of each multimedia data segment provided by an embodiment of the present application;
[0055] Fig. 9 is a flowchart of controlling an encoder to process the multimedia data segment in a second encoding manner to obtain a target multimedia data segment provided by an embodiment of the present application;
[0056] Fig.10 is a flowchart of controlling an encoder to process the multimedia data segment in a second encoding manner to obtain a target multimedia data segment provided by an embodiment of the present application;
[0057] Fig.11 is a schematic diagram of a second multimedia data segment provided in an embodiment of the present application;
[0058] Fig.12 A flowchart of sequentially determining a target encoding mode corresponding to each of the at least two multimedia data segments, so as to control an encoder to encode the corresponding multimedia data segment based on the target encoding mode to obtain a target multimedia data segment, provided by an embodiment of the present application;
[0059] Fig.13 is a structural schematic diagram of a multimedia data encoding device provided in an embodiment of the present application;
[0060] Fig.14 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0061] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.
[0062] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0063] 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 need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0064] Reference Figure 2 , Figure 2 is a flowchart of a multimedia data encoding method provided by an embodiment of the present application, such as Figure 2 As shown, a multimedia data encoding method provided in an embodiment of the present application may include steps 201 to 203, and these steps are described in detail below.
[0065] 201. Obtain multimedia data to be processed;
[0066] The multimedia data to be processed may be two or even multiple segments of multimedia data, and the multimedia data may be of the same type or of different types.
[0067] The type of the multimedia data to be processed may be audio, video, picture, etc.
[0068] As an example, the multimedia data to be processed may include two or more different types of data, such as audio and video, audio and pictures, video and pictures, audio, video and pictures, etc.
[0069] As an example, the multimedia data to be processed may include only audio, only video, only multiple frames of pictures, etc.
[0070] 202. Divide the to-be-processed multimedia data into at least two multimedia data segments;
[0071] The multimedia data to be processed is divided into a plurality of multimedia data segments so as to perform segment encoding on the multimedia data.
[0072] The purpose of encoding the multimedia data to be processed is to encode and merge two or even multiple multimedia data segments to encode their information into the same segment of data.
[0073] Furthermore, since the encoding capability of the encoder is limited, the multimedia data to be processed may be first divided into a plurality of multimedia data segments, and then each multimedia data segment may be encoded separately.
[0074] In a possible implementation, the division of the multimedia data to be processed may be determined by combining a prediction algorithm and the division of historical multimedia data to be processed.
[0075] Among them, according to a preset algorithm, combined with the data volume of historical multimedia data to be processed and the length of divided segments, the occupancy rate of the encoder when the encoder encodes the corresponding segment in the historical multimedia data to be processed of the segmented length can be obtained.
[0076] Among them, if the occupancy rate situation meets the current demand, the segmentation duration of the current multimedia data to be processed can be determined based on the relationship between the data volume of the current multimedia data to be processed and the data volume of the historical multimedia data to be processed, so that the occupancy rate situation meets the demand when the subsequent encoder encodes the current multimedia data to be processed; if the occupancy rate situation does not meet the current demand, the segmentation duration of the historical multimedia data can be adjusted based on the gap between the current demand and the occupancy rate situation to determine the segmentation duration of the current multimedia data to be processed, so that the occupancy rate situation meets the demand when the subsequent encoder encodes the current multimedia data to be processed.
[0077] In a possible implementation, two multimedia data can be segmented according to the overlap on the time axis to obtain multimedia data segments. Figure 3 The process of dividing the multimedia data to be processed into at least two multimedia data segments is described in detail.
[0078] 203. Determine in sequence a target encoding mode corresponding to each of the at least two multimedia data segments, and control the encoder to encode the corresponding multimedia data segment based on the target encoding mode to obtain a target multimedia data segment, wherein the target encoding mode is one of at least two encoding modes of the encoder, and encoding thread attributes adopted by any two encoding modes are different;
[0079] For each multimedia data segment, a corresponding target encoding method is determined to control the encoder to encode the multimedia data segment based on the corresponding target encoding method to obtain the target multimedia data segment.
[0080] The encoder can execute multiple encoding methods, and different encoding methods use different encoding thread properties.
[0081] The encoding thread attribute may include the number of encoding threads, or a processor of an encoder to which the encoding thread belongs.
[0082] Among them, electronic devices include multiple processors, such as CPU (central processing unit), GPU (Graphics Processing Unit), NPU (Neural-network Processing Unit), etc. The encoding capabilities of encoders in different processors are different.
[0083] In some possible implementations, a target encoding method corresponding to each multimedia data segment is determined according to an attribute of the multimedia data segment.
[0084] The attributes of the multimedia data segment include data volume, time length of the data segment, etc.
[0085] The larger the amount of data contained in the multimedia data segment, the larger the encoder load it will occupy; and the longer the time length of the data segment, the larger the encoder load it will occupy.
[0086] As an example, different encoding methods use different numbers of encoding threads. For multimedia data segments with larger data volumes, the corresponding target encoding method is to use a larger number of encoding threads; for multimedia data segments with smaller data volumes, the corresponding target encoding method is to use a smaller number of encoding threads.
[0087] In some possible implementations, the multimedia data is video data, and accordingly, the data amount may be the pixel data amount of each video frame. Then, the target encoding method may be determined according to the pixel data amount of the video frame. Figure 7 The process of determining the target encoding method corresponding to the corresponding multimedia data segment based on the attributes in each multimedia data segment is described in detail.
[0088] In some possible implementations, a target encoding method corresponding to a corresponding multimedia data segment is determined according to the derived parameters of the multimedia data to be processed.
[0089] The export parameters may include file format, export file resolution, export file frame rate, etc. Different export parameters correspond to different encoding methods.
[0090] As an example, different encoding methods use different numbers of encoding threads. The higher the resolution of the exported file, the lower the encoding efficiency, and the more encoding threads the corresponding target encoding method uses.
[0091] In some possible implementations, the corresponding target encoding method can be determined according to the encoder occupancy rate of the multimedia data segment, and then Figure 6 The specific process of sequentially determining the target encoding mode corresponding to each multimedia data segment in at least two multimedia data segments is shown in FIG.
[0092] 204. Splice at least two target multimedia data segments to obtain target multimedia data.
[0093] Among them, the multiple target multimedia data segments obtained by encoding can be spliced to obtain the target multimedia data.
[0094] The target multimedia data is encoded multimedia data to be processed.
[0095] Among them, the target multimedia data may be obtained by sequentially splicing multiple target media data segments in chronological order according to the time axis.
[0096] In this embodiment, the obtained multimedia data to be processed is divided into multiple multimedia data segments, and a target encoding method corresponding to each multimedia data segment is determined. The target encoding method is one of at least two encoding methods of the encoder, and the encoding thread properties adopted by any two encoding methods are different. The encoder is controlled to encode the corresponding multimedia data segment based on the target encoding method to obtain the target multimedia data segment, and the target multimedia data segments are spliced to obtain the target multimedia data. By dividing the multimedia data to be processed into multiple segments and encoding each segment using a corresponding encoding method, a targeted encoding process is implemented, thereby improving the overall encoding efficiency.
[0097] Figure 3 It is a flowchart of dividing the multimedia data to be processed into at least two multimedia data segments provided by an embodiment of the present application, which may include steps 301 to 302, and these steps are described in detail below.
[0098] 301. Determine the overlap between first multimedia data and second multimedia data on a time axis, where the multimedia data to be processed includes the first multimedia data and the second multimedia data;
[0099] In this embodiment, the multimedia data to be processed includes two multimedia data, namely, first multimedia data and second multimedia data.
[0100] The first multimedia data and the second multimedia data may be multimedia data of the same type, such as both are audio data, both are video data, etc.
[0101] The first multimedia data and the second multimedia data may also be different types of multimedia data, such as audio and video, image and video, etc.
[0102] The first multimedia data and the second multimedia data may be data on different tracks, such as audio, video, etc.
[0103] The first multimedia data and the second multimedia data are arranged along the time axis, and the overlap between the two on the time axis is determined. The overlap includes the intersection area of the first multimedia data and the second multimedia data along the time axis.
[0104] 302. Determine a division position of at least one of the first multimedia data and the second multimedia data according to the overlap, and obtain at least two multimedia data segments.
[0105] The first multimedia data and the second multimedia data overlap, and the overlapping parts need to be encoded and merged to obtain target multimedia data of the corresponding time period.
[0106] The higher the overlap between the first multimedia data and the second multimedia data, the larger the range of encoding and fusion of the two data is required.
[0107] In a possible implementation, the start and end positions of the overlapping parts of the first multimedia data and the second multimedia data are used as division positions, and at least one of the first multimedia data and the second multimedia data is divided into multimedia data segments.
[0108] Figure 4 is a schematic diagram of multimedia data to be processed provided by an embodiment of the present application, including video 401 and video 402, wherein video 401 and video 402 are arranged along the time axis, and there is an overlap between the two. The division position is determined to be Figure 4 As shown in point A and point B, video 401 is divided into two video segments 4011 and 4012, and video 402 is also divided into two video segments 4021 and 4022.
[0109] Figure 5 is another schematic diagram of the multimedia data to be processed provided by the embodiment of the present application, including videos 501-504, wherein video 501 and video 503 are continuous along the time axis, video 502 has overlapping time axis portions with video 501 and video 503 respectively, and video 503 has overlapping time axis portions with video 504. Determining the division position is Figure 5 As shown in the figure, the points E, F, G and H divide the video 501 into two video segments, divide the video 503 into three video segments, and divide the video 504 into two video segments.
[0110] When determining the corresponding target encoding method for each multimedia data segment subsequently, since the multimedia data of the overlapping part of the time axis is encoded as a whole, the multimedia data segments of the overlapping part of the time axis can be regarded as a whole to determine the corresponding target encoding method.
[0111] Among them, Figure 4 In the process, the target encoding method corresponding to the video segment 4011, the target encoding methods corresponding to the video segments 4012 and 4021, and the target encoding method corresponding to the video segment 4022 are determined respectively to control the encoder to encode the corresponding video segment using the corresponding target encoding method to obtain the corresponding target multimedia data segment.
[0112] After the subsequent encoding is completed, the target multimedia data segments corresponding to the various multimedia data segments are spliced according to the time sequence on the time axis.
[0113] In this embodiment, the multimedia data to be processed includes first multimedia data and second multimedia data, and the overlap between the first multimedia data and the second multimedia data on the time axis is determined. Based on the overlap, the division position of at least one of the first multimedia data and the second multimedia data is determined to obtain at least two multimedia data fragments. The division position of the multimedia data is determined through the overlap of the two multimedia data on the time axis to realize the division of the multimedia data fragments that intersect, thereby realizing the division of the multimedia data according to the situations of different parts, and providing a basis for subsequently determining the target encoding method for different multimedia data fragments.
[0114] Figure 6 It is a flowchart for sequentially determining the target encoding method corresponding to each of the at least two multimedia data fragments provided by an embodiment of the present application, which may include steps 601 to 602, and these steps are described in detail below.
[0115] 601. Determine an encoder occupancy rate of a multimedia data segment;
[0116] The prediction algorithm or the set first encoding method may be used to predict the encoder occupancy rate of each multimedia data segment.
[0117] When determining the encoder occupancy of a multimedia data segment, not only the attributes of the multimedia data segment need to be considered, but also the derived parameters need to be considered.
[0118] The first encoding method may be to use a single thread to encode the multimedia data segment.
[0119] The first encoding method is used to encode the beginning part of the multimedia data segment to obtain its encoder occupancy rate.
[0120] As an example, the multimedia data segment is a video segment, the first few frames of the video segment are input into the encoder, the encoder is controlled to encode the frames in a first encoding mode according to the derived parameters, and the encoder occupancy rate during the encoding process is used as the encoder occupancy rate of the multimedia data segment.
[0121] As an example, the multimedia data segment is an audio segment, and a preset time length segment of the audio segment from the starting moment is input into the encoder, and the encoder is controlled to encode the preset time length segment using the first encoding method according to the exported parameters. The encoder occupancy rate during the encoding process is used as the encoder occupancy rate of the multimedia data segment.
[0122] 602. Determine a target encoding mode corresponding to the corresponding multimedia data segment according to the encoder occupancy rate of each multimedia data segment.
[0123] After the encoder occupancy rate of the multimedia data segment is determined, the corresponding target encoding mode can be determined.
[0124] In one possible implementation, during the process of segmenting multimedia data, the encoder occupancy rate corresponding to the multimedia data segments obtained by segmentation can be determined, and then the corresponding target encoding method can be determined. When virtual multimedia data is received at a subsequent moment, the process is continued until the encoding of all the multimedia data to be processed is completed.
[0125] After determining the target encoding method corresponding to the multimedia data segment, the encoder can be controlled to encode the multimedia data segment according to the target encoding method to obtain the corresponding target multimedia data segment.
[0126] As an example, if the encoder occupancy rate of the multimedia data segment is low, the target encoding method can be a multi-threaded parallel processing method; if the encoder occupancy rate of the multimedia data is high, the target encoding method can be a single-threaded serial processing method.
[0127] In a possible implementation, a threshold may be set, and different encoding methods may be determined based on the relationship between the encoder occupancy rate of the multimedia data segment and the threshold. Figure 8 The specific process of determining the target encoding method corresponding to the corresponding multimedia data segment based on the encoder occupancy of each multimedia data segment is described in detail.
[0128] In this embodiment, the encoder occupancy of the multimedia data segment is determined; based on the encoder occupancy of each multimedia data segment, the target encoding method corresponding to the corresponding multimedia data segment is determined. The corresponding target encoding method can be determined based on the predicted encoder occupancy of the multimedia data segment, and the appropriate encoding method can be determined based on the occupancy of the encoder when encoding the multimedia data segment, which can ultimately improve the encoding efficiency of the encoder.
[0129] Figure 7 This is a flowchart provided by an embodiment of the present application for determining a target encoding method corresponding to a corresponding multimedia data segment based on the attributes in each multimedia data segment, which may include steps 701 to 702, and these steps are described in detail below.
[0130] 701. Determine, according to the amount of pixel data of each video frame in the target sub-segment in each multimedia data segment, an encoder occupancy rate of each processor in at least two processors corresponding to the multimedia data segment;
[0131] The target sub-segment is a segment of the multimedia data segment that includes a start time.
[0132] In this embodiment, the multimedia data is described by taking video as an example, but the multimedia data is not limited thereto.
[0133] In a possible implementation, the multimedia data is audio, and the target sub-segment may be an audio segment of a preset duration from a start time.
[0134] In a possible implementation, if the multimedia data is audio and video, the target sub-segment may include an audio segment of a preset duration from the start time and a plurality of video frames corresponding to the corresponding duration.
[0135] The target sub-segment is the beginning of the multimedia data segment, which is used as a representative of the multimedia data segment, and the encoding occupancy of the corresponding multimedia data segment is determined based on the target sub-segment.
[0136] The size of the pixel data amount of each video frame in the target sub-segment is an important factor affecting the occupancy rate of the encoder.
[0137] If the pixel data volume of the video frame is large, the occupancy rate of the encoder is large when encoding the target sub-segment; otherwise, the occupancy rate of the encoder is small.
[0138] The electronic device is provided with a plurality of processors, each of which has an encoder. For the encoder in each processor, the encoder occupancy rate of the encoder in each processor encoding the same multimedia data segment can be determined.
[0139] As an example, for the same video clip, it is determined that the encoder occupancy rate is 60% when the CPU encodes the video clip, and the encoder occupancy rate is 80% when the GPU encodes the video clip.
[0140] 702. Determine an encoder and a target encoding method of a target processor according to an encoder occupancy rate of the multimedia data segment in each processor, so as to control the encoder of the target processor to encode the multimedia data segment using the target encoding method.
[0141] The encoder of the target processor and the target encoding method may be determined according to the encoder occupancy rate of each processor corresponding to the multimedia data segment.
[0142] Among them, based on the relationship between the upper limit value of the encoding occupancy rate in each processor and the encoder occupancy rate corresponding to each multimedia data segment, it can be determined which processor's encoder encodes the multimedia data segment, and the encoding method used by the processor's encoder can also be determined.
[0143] As an example, for a video clip, the CPU encoder occupancy is 40% and the GPU encoder occupancy is 75%. The GPU target processor can be determined and the target encoding method is single-thread encoding; the CPU can also be determined as the target processor and the target encoding method is dual-thread encoding.
[0144] During the implementation process, other factors can also be combined to determine the target processor and target encoding method. For example, the CPU encoder uses dual-thread encoding, which requires a first duration, while the GPU encoder uses single-thread encoding, which requires a second duration. When the second duration is greater than the first duration, the CPU can be determined as the target processor and the target encoding method is dual-thread encoding. If the first duration is greater than the second duration, the GPU can be determined as the target processor and the target encoding method is single-thread encoding.
[0145] In this embodiment, a target sub-segment is determined in each multimedia data segment. The target sub-segment is a small part of the multimedia data segment. Based on the pixel data amount of each video frame in the target sub-segment, the encoder occupancy rate of each processor of the multimedia data segment to which it belongs is determined, and the encoder and target encoding method of the target processor are determined according to each encoder occupancy rate to control the encoder of the target processor to encode the corresponding multimedia data segment using the target encoding method. The encoder occupancy rate of the encoder of each processor when encoding the multimedia data segment to which the video frame belongs is estimated according to the pixel data amount of the video frame, and a target encoding method adopted by the encoder in the processor is selected from multiple processors according to the encoder occupancy rate. The target encoding method adopted by the encoder in the selected processor is used to encode the corresponding multimedia data, thereby realizing the process of determining the encoder and the target encoding method according to the attributes of the multimedia data segment. The determined encoder and target encoding method are closely related to the multimedia data segment, thereby improving the encoding efficiency.
[0146] Figure 8 This is a flowchart for determining the target encoding method corresponding to the corresponding multimedia data segment based on the encoder occupancy of each multimedia data segment provided by an embodiment of the present application, which may include steps 801 to 802, and these steps are described in detail below.
[0147] 801. Determine a first encoding mode based on an encoder occupancy rate of the multimedia data segment being greater than a first preset threshold, control the encoder to process the multimedia data segment in the first encoding mode to obtain a target multimedia data segment, wherein the first encoding mode includes one encoding thread;
[0148] The first preset threshold is a threshold condition that only single-thread processing can be performed.
[0149] As an example, the first preset threshold may be a relatively large value, such as 80%, 70%, etc. The present application does not limit the value of the first preset threshold.
[0150] If the encoder occupancy rate of the multimedia data segment is greater than the first preset threshold, it is determined to adopt the first encoding method.
[0151] The first encoding method is single-thread processing, and the encoder uses one encoding thread to encode the input multimedia data segment.
[0152] If it is determined to adopt the first encoding method, the encoder is controlled to encode the multimedia data segment with one encoding thread to obtain the target multimedia data segment.
[0153] A task may be generated according to the multimedia data segment, and the task is put into the task queue of the encoder. The encoding thread of the encoder processes the tasks in the task queue in sequence, completes the encoding process, and obtains the target multimedia data segment.
[0154] 802. Based on the fact that the encoder occupancy rate of the multimedia data segment is not greater than a first preset threshold, determine a second encoding mode, control the encoder to process the multimedia data segment in the second encoding mode, and obtain a target multimedia data segment, wherein the second encoding mode includes at least two parallel encoding threads.
[0155] If the encoder occupancy rate of the multimedia data segment is not greater than the first preset threshold, it is determined to adopt the second encoding method.
[0156] The second encoding method is multi-threaded parallel processing, and the encoder uses multiple parallel encoding threads to perform parallel encoding on the input multimedia data segments.
[0157] A second preset threshold may also be set, and the second preset threshold is smaller than the first preset threshold. If the encoder occupancy rate of the multimedia data segment is smaller than the second preset threshold, it is determined to adopt the second encoding method.
[0158] If the encoder occupancy rate of the multimedia data segment is less than a first preset threshold and greater than a second preset threshold, either the first encoding method or the second encoding method may be used.
[0159] As an example, the first preset threshold may be 80%, and the second preset threshold may be 50%.
[0160] After the encoding of each multimedia data segment is completed, the encoding of the next multimedia data segment is continued until the encoding of each segment of the multimedia data is completed.
[0161] Among them, multiple tasks can be generated according to the multimedia data segment, and the multiple tasks are put into the task queue of the encoder. The multiple encoding threads of the encoder process the tasks in the task queue in turn, complete the encoding process, and obtain the corresponding target multimedia data segment.
[0162] In a possible implementation, the multimedia data segment can be further divided to achieve parallel processing of the multimedia data segment. Fig. 9 The process of the encoder processing the multimedia data segment in the second encoding mode is described in detail.
[0163] In this embodiment, an encoding mode is determined based on a set first preset threshold and a relationship with an encoder occupancy rate of the multimedia data segment, wherein if the encoder occupancy rate of the multimedia data segment is greater than the first preset threshold, a first encoding mode is determined, and the encoder is controlled to process the multimedia data segment in the first encoding mode to obtain a target multimedia data segment, and the first encoding mode includes one encoding thread; if the encoder occupancy rate of the multimedia data segment is not greater than the first preset threshold, a second encoding mode is determined, and the encoder is controlled to process the multimedia data segment in the second encoding mode to obtain a target multimedia data segment, and the second encoding mode includes at least two parallel encoding threads, and the division of the encoding modes corresponding to the multimedia data segment can be achieved by only performing numerical comparison by setting a threshold, and the implementation process is simple.
[0164] Fig. 9 The flowchart of controlling the encoder to process the multimedia data segment in the second encoding mode to obtain the target multimedia data segment provided by the embodiment of the present application may include steps 901 to 902, and these steps are described in detail below.
[0165] 901. Divide a first multimedia data segment along a time axis to obtain at least two sub-segments;
[0166] When it is determined that the second encoding method can be used for a certain multimedia data segment, the multimedia data segment can be divided into a plurality of sub-segments to implement encoding using the second encoding method.
[0167] The first multimedia data segment may be divided into a plurality of sub-segments along the time axis.
[0168] In a possible implementation, the number of sub-segments of the target segmentation may be determined according to the number of encoding threads used in the second encoding method.
[0169] As an example, if there are two encoding threads in the encoder that can implement parallel processing of the first multimedia data segment, the first multimedia data segment can be divided into two sub-segments.
[0170] As an example, if there are three encoding threads in the encoder that can implement parallel processing of the first multimedia data, then the first multimedia data segment can be divided into three sub-segments.
[0171] 902. Control at least two encoding threads in an encoder to process the at least two sub-segments in parallel to obtain at least two target multimedia data segments.
[0172] The encoder has a plurality of encoding threads, each encoding thread can be processed in parallel, and each encoding thread processes the plurality of sub-segments obtained by segmentation in parallel to obtain a corresponding number of target multimedia data segments.
[0173] A corresponding task may be generated for each sub-slice, and the corresponding encoding thread in the encoder may be used to process the corresponding task, thereby realizing parallel processing.
[0174] Among them, after obtaining multiple target multimedia data fragments, the multiple target multimedia data fragments corresponding to the same multimedia data fragment can be spliced together according to the timeline to obtain the target multimedia data fragment corresponding to the multimedia data fragment, and then the target multimedia data fragments corresponding to each multimedia data fragment can be spliced together to obtain the target multimedia data corresponding to the multimedia data to be processed.
[0175] In this embodiment, if the first multimedia data needs to be encoded using the second encoding method, the first multimedia data segment can be first divided along the time axis to obtain at least two sub-segments, and then at least two encoding threads in the encoder can be controlled to process the at least two sub-segments in parallel to obtain at least two target multimedia data segments, thereby realizing a multi-threaded parallel encoding processing process and improving encoding efficiency.
[0176] Fig.10 The flowchart of controlling the encoder to process the multimedia data segment in the second encoding mode to obtain the target multimedia data segment provided by the embodiment of the present application may include steps 1001 to 1002, and these steps are described in detail below.
[0177] 1001. Determine at least two sub-segments overlapping on a time axis in a second multimedia data segment;
[0178] If the multimedia data segment includes a plurality of sub-segments overlapping on the time axis, the plurality of sub-segments overlapping on the time axis are determined.
[0179] Among them, after the aforementioned step 202, when the multimedia data is divided into multiple multimedia data segments, the overlapping part on the time axis can be divided into one multimedia data segment. This embodiment explains the process of encoding this part of the multimedia data segment using the second encoding method.
[0180] The sub-segments in the second multimedia data segment are of the same type, such as all are audio or all are video.
[0181] Fig.11 This is a schematic diagram of the second multimedia data segment provided in an embodiment of the present application. The second multimedia data segment includes sub-segment 1101 and sub-segment 1102. The left and right directions represent the directions of the time axis. The start and end times of the two segments are the same on the time axis, and the two segments overlap on the time axis.
[0182] 1002. Control at least two encoding threads in an encoder to process the at least two sub-segments in parallel to obtain at least two target multimedia data segments.
[0183] The number of encoding threads in the controlled encoder can be based on the aforementioned Figure 7 The target encoding method may be determined in the process of determining the parallel processing number, or it may be determined according to the number of sub-segments in the second multimedia data.
[0184] The encoder calls a plurality of encoding threads so that the encoding threads can respectively perform parallel processing encoding on the plurality of sub-segments to obtain corresponding target multimedia data segments.
[0185] As an example, the second multimedia data segment includes two sub-segments overlapping on the time axis, and two encoding threads in the encoder are called to encode the two sub-segments respectively to obtain two corresponding target multimedia data segments.
[0186] In this embodiment, at least two sub-segments overlapping on the time axis in the second multimedia data segment are first determined, and then at least two encoding threads in the encoder are controlled to process the at least two sub-segments in parallel to obtain at least two target multimedia data segments, thereby realizing multi-threaded parallel encoding processing for sub-segments overlapping on multiple time axes and improving encoding efficiency.
[0187] Fig.12 A flowchart of determining the target encoding method corresponding to each of the at least two multimedia data fragments in sequence, and controlling the encoder to encode the corresponding multimedia data fragment based on the target encoding method to obtain the target multimedia data fragment, provided by an embodiment of the present application, may include steps 1201 to 202, and these steps are described in detail below.
[0188] 1201. Based on the fact that the third multimedia data segment includes at least two types of multimedia data, determine in sequence a target encoding mode corresponding to each type of multimedia data segment;
[0189] The multimedia data segment includes different types of multimedia data, such as at least two of audio, video and image.
[0190] Among them, different encoding methods can be used for different types of multimedia data.
[0191] In a possible implementation, a correspondence between multimedia data types and processors to which encoders belong may be preset. After the multimedia data type in the multimedia data segment is determined, the processor to which the corresponding encoder belongs may be determined based on the correspondence.
[0192] The difference in the encoding method may include different processors to which the encoder belongs, different numbers of encoding threads used by the encoder, etc.
[0193] As an example, for video encoding, the encoding efficiency of the encoder in the GPU is better, and for audio encoding, the encoding efficiency of the encoder in the CPU is better.
[0194] 1202. Control the encoder corresponding to each type of multimedia data segment to encode the multimedia data segment using the corresponding target encoding method to obtain at least two target multimedia data, where one target multimedia data corresponds to one type of multimedia data segment.
[0195] For each type of multimedia data segment, the encoder corresponding to the controller uses the corresponding target encoding method to encode and obtain the corresponding target multimedia data.
[0196] After the coding is completed for each type of multimedia data, the time-overlapping target multimedia data segments may be merged according to the time axis to obtain a segment that merges two types of multimedia data.
[0197] In this embodiment, based on the fact that the third multimedia data segment includes at least two types of multimedia data, the target encoding method corresponding to each type of multimedia data segment is determined in turn; the encoder corresponding to each type of multimedia data segment is controlled to encode the multimedia data segment using the corresponding target encoding method to obtain at least two target multimedia data, one target multimedia data corresponds to one type of multimedia data segment, thereby realizing a multi-threaded parallel encoding process for different types of multimedia data and improving encoding efficiency.
[0198] A multimedia data encoding method provided in an embodiment of the present application is introduced above, and a device for executing the multimedia data encoding method is introduced below.
[0199] See also Fig.13 , Fig.13 Schematic diagram of the structure of a multimedia data encoding device provided in an embodiment of the present application. Fig.13 As shown, the multimedia data encoding device 1300 includes: an acquisition module 1301, a segmentation module 1302, a determination module 1303 and a splicing module 1304;
[0200] The obtaining module 1301 is used to obtain the multimedia data to be processed;
[0201] The segmentation module 1302 is used to segment the multimedia data to be processed into at least two multimedia data segments;
[0202] The determining module 1303 is used to sequentially determine a target encoding mode corresponding to each of the at least two multimedia data segments, so as to control the encoder to encode the corresponding multimedia data segment based on the target encoding mode to obtain a target multimedia data segment, wherein the target encoding mode is one of at least two encoding modes of the encoder, and encoding thread attributes adopted by any two encoding modes are different;
[0203] The splicing module 1304 is used to splice at least two target multimedia data segments to obtain target multimedia data.
[0204] In a possible implementation, the segmentation module includes:
[0205] A first determining unit, configured to determine a degree of overlap between first multimedia data and second multimedia data on a time axis, wherein the multimedia data to be processed includes the first multimedia data and the second multimedia data;
[0206] The second determining unit is used to determine a division position of at least one of the first multimedia data and the second multimedia data according to the overlap degree, so as to obtain at least two multimedia data segments.
[0207] In a possible implementation, the determining module includes at least one of the following:
[0208] A third determining unit, configured to determine a target encoding method corresponding to each multimedia data segment according to an attribute of each multimedia data segment;
[0209] or
[0210] The fourth determining unit is used to determine a target encoding method corresponding to a corresponding multimedia data segment according to the derived parameters of the multimedia data to be processed.
[0211] In a possible implementation, the determining module includes:
[0212] a fifth determining unit, configured to determine an encoder occupancy rate of the multimedia data segment;
[0213] The sixth determination unit is used to determine the target encoding mode corresponding to the corresponding multimedia data segment according to the encoder occupancy rate of each multimedia data segment.
[0214] In a possible implementation, the third determining unit includes:
[0215] A first determining subunit, configured to determine an encoder occupancy rate of each of the at least two processors for the corresponding multimedia data segment according to the amount of pixel data of each video frame in the target subsegment in each multimedia data segment;
[0216] The second determination subunit is used to determine the encoder of the target processor and the target encoding method according to the encoder occupancy rate of the multimedia data segment in each processor, so as to control the encoder of the target processor to encode the multimedia data segment in the target encoding method.
[0217] In a possible implementation, the sixth determining unit includes:
[0218] A third determining subunit, configured to determine a first encoding mode based on an encoder occupancy rate of the multimedia data segment being greater than a first preset threshold;
[0219] A first control subunit, configured to control the encoder to process the multimedia data segment in a first encoding mode to obtain a target multimedia data segment, wherein the first encoding mode includes an encoding thread;
[0220] A fourth determining subunit, configured to determine a second encoding mode based on that an encoder occupancy rate of the multimedia data segment is not greater than a first preset threshold;
[0221] The second control subunit is used to control the encoder to process the multimedia data segment in a second encoding mode to obtain a target multimedia data segment, and the second encoding mode includes at least two parallel encoding threads.
[0222] In a possible implementation, the second control subunit is specifically configured to:
[0223] Splitting the first multimedia data segment along the time axis to obtain at least two sub-segments;
[0224] At least two encoding threads in the encoder are controlled to process the at least two sub-segments in parallel to obtain at least two target multimedia data segments.
[0225] In a possible implementation, the second control subunit is specifically configured to:
[0226] Determining at least two sub-segments overlapping on the time axis in the second multimedia data segment;
[0227] At least two encoding threads in the encoder are controlled to process the at least two sub-segments in parallel to obtain at least two target multimedia data segments.
[0228] In a possible implementation, the determining module includes:
[0229] A seventh determining unit, configured to determine, based on the third multimedia data segment including at least two types of multimedia data, a target encoding mode corresponding to each type of multimedia data segment in sequence;
[0230] The control unit is used to control the encoder corresponding to each type of multimedia data segment to encode the multimedia data segment using the corresponding target encoding method to obtain at least two target multimedia data, one target multimedia data corresponding to one type of multimedia data segment.
[0231] It should be noted that, for the functional explanation of each component structure in a multimedia data encoding device provided in this embodiment, please refer to the explanation in the aforementioned method embodiment, and it will not be repeated in this embodiment.
[0232] In this embodiment, the obtained multimedia data to be processed is divided into multiple multimedia data segments, and a target encoding method corresponding to each multimedia data segment is determined. The target encoding method is one of at least two encoding methods of the encoder, and the encoding thread properties adopted by any two encoding methods are different. The encoder is controlled to encode the corresponding multimedia data segment based on the target encoding method to obtain the target multimedia data segment, and the target multimedia data segments are spliced to obtain the target multimedia data. By dividing the multimedia data to be processed into multiple segments and encoding each segment using a corresponding encoding method, a targeted encoding process is implemented, thereby improving the overall encoding efficiency.
[0233] The present application also provides an electronic device in an embodiment. Fig.14 As shown, it shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present application. The electronic device in the embodiments of the present application may include but is not limited to fixed terminals such as mobile phones, notebook computers, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Fig.14 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0234] like Fig.14 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1402 or a program loaded from a storage device 1408 to a random access memory (RAM) 1403. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 1403. The processing device 1401, the ROM 1402, and the RAM 1403 are connected to each other via a bus 1404. An input / output (I / O) interface 1405 is also connected to the bus 1404.
[0235] Typically, the following devices may be connected to the I / O interface 1405: an input device 1406 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1408 including, for example, a memory card, a hard disk, etc.; and a communication device 1409. The communication device 1409 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0236] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any multimedia data encoding method provided in the embodiment of the present application.
[0237] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any multimedia data encoding method provided in the embodiment of the present application.
[0238] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0239] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0240] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0241] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
Claims
1. A multimedia data encoding method, include: Obtaining multimedia data to be processed; Dividing the to-be-processed multimedia data into at least two multimedia data segments; sequentially determining a target encoding mode corresponding to each of the at least two multimedia data segments, so as to control an encoder to encode the corresponding multimedia data segment based on the target encoding mode to obtain a target multimedia data segment, wherein the target encoding mode is one of at least two encoding modes of the encoder, and encoding thread attributes used by any two encoding modes are different; At least two target multimedia data segments are spliced together to obtain target multimedia data.
2. The multimedia data encoding method according to claim 1, wherein the multimedia data to be processed is divided into at least two multimedia data segments. include: Determining a degree of overlap between first multimedia data and second multimedia data on a time axis, wherein the multimedia data to be processed includes the first multimedia data and the second multimedia data; According to the overlap, a division position of at least one of the first multimedia data and the second multimedia data is determined to obtain at least two multimedia data segments.
3. The multimedia data encoding method according to claim 1, wherein the step of sequentially determining a target encoding mode corresponding to each of the at least two multimedia data segments comprises at least one of the following: Determining a target encoding method corresponding to each multimedia data segment according to the attribute of each multimedia data segment; or According to the derived parameters of the multimedia data to be processed, a target encoding method corresponding to the corresponding multimedia data segment is determined.
4. The multimedia data encoding method according to claim 1 or 3, wherein the target encoding mode corresponding to each of the at least two multimedia data segments is determined in sequence, include: determining an encoder occupancy of a multimedia data segment; According to the encoder occupancy rate of each multimedia data segment, a target encoding mode corresponding to the corresponding multimedia data segment is determined.
5. The multimedia data encoding method according to claim 3, wherein the target encoding method corresponding to the multimedia data segment is determined according to the attribute of each multimedia data segment, include: Determining, based on the amount of pixel data of each video frame in the target sub-segment in each multimedia data segment, an encoder occupancy rate of each processor in at least two processors corresponding to the multimedia data segment; According to the encoder occupancy rate of each processor of the multimedia data segment, the encoder of the target processor and the target encoding method are determined to control the encoder of the target processor to encode the multimedia data segment in the target encoding method.
6. The multimedia data encoding method according to claim 5, wherein the target encoding mode corresponding to the corresponding multimedia data segment is determined according to the encoder occupancy rate of each multimedia data segment, include: Determining a first encoding mode based on an encoder occupancy rate of the multimedia data segment being greater than a first preset threshold, controlling the encoder to process the multimedia data segment in the first encoding mode to obtain a target multimedia data segment, wherein the first encoding mode includes one encoding thread; Based on the encoder occupancy rate of the multimedia data segment being no greater than a first preset threshold, a second encoding method is determined, and the encoder is controlled to process the multimedia data segment in the second encoding method to obtain a target multimedia data segment, wherein the second encoding method includes at least two parallel encoding threads.
7. The multimedia data encoding method according to claim 6, wherein the control encoder processes the multimedia data segment in a second encoding mode to obtain a target multimedia data segment, include: Splitting the first multimedia data segment along the time axis to obtain at least two sub-segments; At least two encoding threads in the encoder are controlled to process the at least two sub-segments in parallel to obtain at least two target multimedia data segments.
8. The multimedia data encoding method according to claim 6, wherein the control encoder processes the multimedia data segment in a second encoding mode to obtain a target multimedia data segment, include: Determining at least two sub-segments overlapping on the time axis in the second multimedia data segment; At least two encoding threads in the encoder are controlled to process the at least two sub-segments in parallel to obtain at least two target multimedia data segments.
9. The multimedia data encoding method according to claim 1, wherein the target encoding mode corresponding to each of the at least two multimedia data segments is determined in sequence, so as to control the encoder to encode the corresponding multimedia data segment based on the target encoding mode to obtain the target multimedia data segment, include: Based on the third multimedia data segment including at least two types of multimedia data, determining in sequence a target encoding mode corresponding to each type of multimedia data segment; The encoder corresponding to each type of multimedia data segment is respectively controlled to encode the multimedia data segment using a corresponding target encoding method to obtain at least two target multimedia data, where one target multimedia data corresponds to one type of multimedia data segment.
10. A multimedia data encoding device, include: An acquisition module, used for acquiring multimedia data to be processed; A segmentation module, used for segmenting the to-be-processed multimedia data into at least two multimedia data segments; a determination module, configured to sequentially determine a target encoding mode corresponding to each of the at least two multimedia data segments, so as to control the encoder to encode the corresponding multimedia data segment based on the target encoding mode to obtain a target multimedia data segment, wherein the target encoding mode is one of at least two encoding modes of the encoder, and encoding thread attributes adopted by any two encoding modes are different; The splicing module is used to splice at least two target multimedia data segments to obtain target multimedia data.
