A video transcoding method, device, apparatus and storage medium

By establishing a multi-dimensional mapping relationship and a priori reuse mechanism between video encoding formats, the problems of computational redundancy and high energy consumption in existing video transcoding methods are solved, and an efficient video transcoding process is achieved.

CN121099058BActive Publication Date: 2026-04-21MALANSHAN AUDIO & VIDEO LABORATORY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
MALANSHAN AUDIO & VIDEO LABORATORY
Filing Date
2025-11-05
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing video transcoding methods suffer from high computational redundancy, high time overhead, high energy consumption, and are prone to introducing cumulative distortion, failing to effectively improve transcoding efficiency and reduce computational resource consumption.

Method used

By establishing a multidimensional mapping relationship between different encoding formats, using a target mapping model and neural network, prior information of the video is obtained, and transcoding is performed based on a preset encoder, skipping or simplifying computationally intensive steps, and using a prior reuse mechanism for video transcoding.

Benefits of technology

It significantly improves transcoding efficiency, reduces computational complexity and resource consumption, while maintaining video quality and reducing redundant computation and information loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121099058B_ABST
    Figure CN121099058B_ABST
Patent Text Reader

Abstract

This application discloses a video transcoding method, apparatus, device, and storage medium, relating to the field of video encoding and transcoding. The method includes: obtaining an initial encoding format of the video to be transcoded, determining a target encoding format based on preset transcoding requirements, and establishing a target mapping relationship between the initial encoding format and the target encoding format according to a target mapping model; parsing the video to be transcoded to obtain corresponding target global parameters, performing recursive parsing operations on the encoding units of the video to be transcoded based on the target global parameters to generate first prior information corresponding to the video to be transcoded; mapping the first prior information to second prior information of the target encoding format using the target mapping relationship, and transcoding the video to be transcoded using a preset encoder based on the second prior information to generate a target video of the target encoding format. In this way, this application improves transcoding efficiency and reduces computational resource consumption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of video encoding and transcoding, and particularly to a video transcoding method, apparatus, device, and storage medium. Background Technology

[0002] With the widespread adoption of multi-terminal, multi-platform video services, the same video often needs to be converted between different encoding formats to adapt to multi-terminal playback and network environments. Existing video transcoding methods typically employ a "decode-reencode" process, where the source video stream is first decoded into raw pixel data, and then the target encoder performs a complete re-encoding process on the video frames to ultimately generate a video stream conforming to the target encoding standard. This process involves a large amount of repetitive computation, leading to significant computational redundancy, high time consumption, and high energy costs. Furthermore, it is prone to introducing cumulative distortion during multiple transcoding processes. Currently, mainstream video encoding standards share certain similarities in their encoding architecture and many core tools. Therefore, if a multi-dimensional mapping relationship can be established between different encoding formats, and some intermediate results from the source encoding process can be migrated to the target encoding process, it is possible to significantly reduce redundant computation, improve transcoding efficiency, and reduce information loss during transcoding.

[0003] In conclusion, improving transcoding efficiency and reducing computational resource consumption are urgent problems that need to be solved. Summary of the Invention

[0004] In view of this, the purpose of this invention is to provide a video transcoding method, apparatus, device, and storage medium that can improve transcoding efficiency and reduce computational resource consumption. The specific solution is as follows:

[0005] Firstly, this application provides a video transcoding method, including:

[0006] Obtain the initial encoding format of the video to be transcoded, determine the target encoding format based on preset transcoding requirements, and establish a target mapping relationship between the initial encoding format and the target encoding format according to the target mapping model;

[0007] The video to be transcoded is parsed to obtain the corresponding target global parameters. Based on the target global parameters, the encoding unit of the video to be transcoded is recursively parsed to generate the first prior information corresponding to the video to be transcoded.

[0008] The first prior information is mapped to the second prior information of the target encoding format using the target mapping relationship. The video to be transcoded is then transcoded using a preset encoder based on the second prior information to generate the target video of the target encoding format.

[0009] Optionally, the target mapping model includes a preset rule base and a target neural network;

[0010] Accordingly, establishing the target mapping relationship between the initial encoding format and the target encoding format based on the target mapping model includes:

[0011] The mapping rules are determined according to the preset transcoding scenario and stored in the preset rule library; wherein, the mapping rules include any one or more of the following: block partitioning mapping rules, motion vector mapping rules, prediction mode mapping rules, and residual domain transformation mapping rules;

[0012] Obtain the initial neural network and the encoding mapping data sample set;

[0013] The initial neural network is trained using the encoded mapping data sample set to obtain the target neural network;

[0014] The target mapping model is determined based on the preset rule base and the target neural network;

[0015] The target mapping relationship between the initial encoding format and the target encoding format is determined based on the target mapping model.

[0016] Optionally, training the initial neural network using the encoded mapping data sample set to obtain the target neural network includes:

[0017] The encoded mapping data sample set is divided into a training set and a validation set;

[0018] The network parameters in the initial neural network are iteratively updated using the parameters of each encoding format in the training set to obtain the trained neural network;

[0019] Based on the validation set, determine whether the trained neural network has reached the preset convergence condition;

[0020] If the trained neural network reaches the preset convergence condition, then the trained neural network is determined as the target neural network.

[0021] Optionally, parsing the video to be transcoded to obtain the corresponding target global parameters includes:

[0022] The bitstream header information of the video to be transcoded is parsed to obtain the corresponding target global parameters; wherein the target global parameters include any one or more of resolution, frame rate and color space.

[0023] Optionally, the recursive parsing operation on the encoding units of the video to be transcoded based on the target global parameters to generate the first prior information corresponding to the video to be transcoded includes:

[0024] Based on the target global parameters, a recursive parsing operation is performed on the encoding units of the video to be transcoded to obtain the block partitioning structure, prediction mode, motion vector and residual in the video to be transcoded.

[0025] The block partitioning structure, prediction mode, motion vector, and residual in the video to be transcoded are integrated into the first prior information.

[0026] Optionally, the step of transcoding the video to be transcoded based on the second prior information using a preset encoder to generate a target video in the target encoding format includes:

[0027] The block partitioning structure, prediction mode, motion vector and residual in the video to be transcoded are transcoded by a preset encoder based on the second prior information to obtain the first transcoded information;

[0028] The non-block partitioning structure, prediction mode, motion vector and residual information in the video to be transcoded are transcoded by a preset encoder according to a preset fast search or local optimization strategy to obtain the second transcoded information.

[0029] The target video is determined based on the first transcoded information and the second transcoded information.

[0030] Optionally, the step of transcoding the block partitioning structure, prediction mode, motion vector, and residual in the video to be transcoded using a preset encoder based on the second prior information to obtain the first transcoded information includes:

[0031] Based on the block partitioning method in the second prior information, the block partitioning structure in the video to be transcoded is transcoded to obtain the transcoded block partitioning structure.

[0032] The motion vector in the second prior information is determined as the initial search point. Based on the initial search point, a preset fast search algorithm is used to transcode the video to be transcoded to obtain the transcoded motion estimate.

[0033] Based on the prediction pattern in the second prior information, the preset pattern in the video to be transcoded is transcoded to obtain the transcoded prediction pattern.

[0034] The residual in the video to be transcoded is transcoded based on the residual in the second prior information to obtain the transcoded residual;

[0035] The transcoded block partitioning structure, the transcoded motion estimation, the transcoded prediction mode, and the transcoded residual are integrated to generate the first transcoded information.

[0036] Secondly, this application provides a video transcoding apparatus, comprising:

[0037] The relationship establishment module is used to obtain the initial encoding format of the video to be transcoded, determine the target encoding format based on the preset transcoding requirements, and establish a target mapping relationship between the initial encoding format and the target encoding format according to the target mapping model.

[0038] The prior information generation module is used to parse the video to be transcoded to obtain the corresponding target global parameters, and to perform recursive parsing operations on the encoding units of the video to be transcoded based on the target global parameters to generate the first prior information corresponding to the video to be transcoded.

[0039] The video transcoding module is used to map the first prior information to the second prior information of the target encoding format using the target mapping relationship, and to transcode the video to be transcoded based on the second prior information using a preset encoder to generate the target video of the target encoding format.

[0040] Thirdly, this application provides an electronic device, comprising:

[0041] Memory, used to store computer programs;

[0042] A processor is used to execute the computer program to implement the video transcoding method as described above.

[0043] Fourthly, this application provides a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the video transcoding method described above.

[0044] In summary, this application first obtains the initial encoding format of the video to be transcoded, and determines the target encoding format based on preset transcoding requirements. It then establishes a target mapping relationship between the initial encoding format and the target encoding format according to a target mapping model. Next, it parses the video to be transcoded to obtain corresponding target global parameters. Based on these target global parameters, it performs recursive parsing operations on the encoding units of the video to be transcoded to generate first prior information corresponding to the video to be transcoded. Finally, it uses the target mapping relationship to map the first prior information to second prior information of the target encoding format. A preset encoder then transcodes the video to be transcoded based on the second prior information to generate a target video in the target encoding format. As described above, this application first obtains the initial encoding format of the video to be transcoded, and determines the target encoding format based on preset transcoding requirements. Then, it establishes a target mapping relationship between the initial encoding format and the target encoding format according to a target mapping model. Next, it parses the video to be transcoded to obtain the corresponding target global parameters. Based on the target global parameters, it performs recursive parsing operations on the encoding units of the video to be transcoded, thereby generating the first prior information corresponding to the video to be transcoded. Finally, it uses the established target mapping relationship to map the first prior information to the second prior information of the target encoding format. With the help of a preset encoder, it transcodes the video to be transcoded based on the second prior information, ultimately generating the target video in the target encoding format. In this way, by establishing a mapping relationship and employing a priori reuse mechanism from multiple aspects, it skips or simplifies some computationally intensive encoding steps, significantly reduces the search space, reduces redundant calculations, and significantly improves the encoding speed of the target encoder. At the same time, while ensuring video quality, it effectively reduces the computational complexity of the transcoding process. Attached Figure Description

[0045] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0046] Figure 1 This is a flowchart of a video transcoding method disclosed in this application;

[0047] Figure 2 This is a flowchart of a specific video transcoding method disclosed in this application;

[0048] Figure 3 This is a schematic diagram of the structure of a video transcoding device disclosed in this application;

[0049] Figure 4 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation

[0050] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0051] Currently, with the widespread adoption of multi-terminal and multi-platform video services, the same video often needs to be converted between different encoding formats to adapt to multi-terminal playback and network environments. Existing video transcoding methods typically employ a "decode-reencode" process, where the source video stream is first decoded into raw pixel data, and then the target encoder performs a complete re-encoding process on the video frames to ultimately generate a video stream conforming to the target encoding standard. This process involves a large amount of repetitive computation, leading to high computational redundancy, high time consumption, and high energy costs. Furthermore, it easily introduces cumulative distortion during multiple transcoding processes. Mainstream video encoding standards share certain similarities in their encoding architecture and many core tools. Therefore, if a multi-dimensional mapping relationship can be established between different encoding formats, and some intermediate results from the source encoding process can be migrated to the target encoding process, it is possible to significantly reduce redundant computation, improve transcoding efficiency, and reduce information loss during transcoding. To address the aforementioned technical problems, this application discloses a video transcoding method, apparatus, device, and storage medium that can improve transcoding efficiency and reduce computational resource consumption.

[0052] See Figure 1 As shown, this embodiment of the invention discloses a video transcoding method, including:

[0053] Step S11: Obtain the initial encoding format of the video to be transcoded, determine the target encoding format based on the preset transcoding requirements, and establish the target mapping relationship between the initial encoding format and the target encoding format according to the target mapping model.

[0054] In this embodiment, a standardized interface is designed for different encoding standards, such as H.264 and H.265, so that the encoded information of the video to be transcoded can be represented as a unified intermediate representation through the standardized interface, such as a unified block partition description and a unified motion vector coordinate system. Next, the initial encoding format of the video to be transcoded is obtained, and the target encoding format is determined based on preset transcoding requirements. For example, to adapt to different playback terminals, it is necessary to convert the high bitrate H.265 video to the low bitrate H.264 format to improve the loading speed of the video to be transcoded.

[0055] Understandably, after determining the initial encoding format and the target encoding format, a target mapping model is needed to establish a target mapping relationship between the initial encoding format and the target encoding format. This target mapping model includes a preset rule base and a target neural network. Mapping rules can be determined based on a preset transcoding scenario and stored in the preset rule base. These mapping rules include any one or more of block partitioning mapping rules, motion vector mapping rules, prediction mode mapping rules, and residual domain transformation mapping rules. The process involves obtaining an initial neural network and an encoding mapping data sample set; training the initial neural network using the encoding mapping data sample set to obtain a target neural network; determining the target mapping model based on the preset rule base and the target neural network; and determining the target mapping relationship between the initial encoding format and the target encoding format based on the target mapping model. Specifically, the preset rule base and the target neural network need to work together when constructing the target mapping model. The rule base provides deterministic mapping logic: In terms of block partitioning, it establishes the correspondence between macroblock / CTU (collect transfer unit) / block partitioning rules under different coding standards, such as splitting or merging 16×16 macroblocks of H.264 into H.265 CTU (Coding Tree Unit) structures according to rules; In terms of motion vectors, it performs proportional scaling and precision adjustment on motion vectors based on the differences in resolution and sampling accuracy between the source coding format and the target coding format. For example, when upscaling from a 1080p source video to a target 4K video, the motion vector values ​​are scaled by a factor of 2; H.264's 1 / 4 pixel precision is mapped to H.265's 1 / 8 pixel precision, etc.; a prediction mode mapping table is established to map the source-coded inter-frame / intra-frame prediction modes to the target-coded mode set, for example, the 9 intra-frame modes of H.264 are mapped to the most similar mode in H.265's 35-mode set; in terms of residuals, the source residual signal is transformed to the target-coded transform domain, for example, from integer DCT (Discrete Cosine Transform) to DST (Discrete Sine Transform) or a higher-order transform. The domain transformation is achieved through operations based on the differences in the transform matrix.

[0056] Furthermore, the target neural network can handle complex scenes. Its training relies on a sample set containing a large number of encoding pairs, covering multiple types of video clips and ideal mapping results of key parameters. This can be achieved by selecting video materials containing various content types and encoding the same original video sequence using both the source and target encoding standards. During the encoding process, the source end's block partitioning information, motion vectors, prediction modes, and other encoding parameters, as well as the corresponding parameters of the target end, are extracted and saved. Based on pixel coordinate mapping, the block-level units of the source and target ends are aligned to generate paired sample data for training, i.e., the encoding mapping data sample set. This encoding mapping data sample set is divided into a training set and a validation set. The network parameters in the initial neural network are iteratively updated using the parameters of each encoding format in the training set to obtain the trained neural network. The validation set is used to determine whether the trained neural network has reached a preset convergence condition. If the trained neural network reaches the preset convergence condition, it is identified as the target neural network. Specifically, when generating the encoding mapping data sample set, it is necessary to ensure the diversity of video materials, covering high-intensity sports events, complex natural landscapes, and low-dynamic-range meeting scenes, to guarantee the generalization ability of the sample set. When using the initial encoding format and the target encoding format for the same video, the basic parameters such as resolution and frame rate must be kept consistent, only the encoding standard should be changed, and interference from irrelevant variables should be avoided. When extracting parameters, fine-grained data such as the block partitioning tree structure, motion vector coordinates, and intra / inter-frame prediction mode markers of the source and target ends are captured by encoding log parsing tools and aligned by timestamps to form frame-level samples. The encoding mapping data sample set can be divided into training and validation sets in a 7:3 ratio to ensure consistent content distribution between the two sets. During the training phase, the initial encoding format of the videos in the training set is used as the input of the initial neural network, and the target encoding format of the videos is used as the expected output. The network weights are iteratively optimized through the backpropagation algorithm until convergence on the validation set. Once the model is deemed to have reached the convergence condition, training is stopped, and the current network parameters are saved, which is the target neural network.

[0057] Furthermore, the target neural network employs a multi-task learning architecture, including a shared feature extraction backbone and multiple output branches. The shared backbone for feature extraction facilitates knowledge transfer between different tasks, enhancing overall robustness.

[0058] Step S12: Parse the video to be transcoded to obtain the corresponding target global parameters, and perform recursive parsing operation on the encoding unit of the video to be transcoded based on the target global parameters to generate the first prior information corresponding to the video to be transcoded.

[0059] In this embodiment, the video to be transcoded needs to be decoded. A structured parsing method is used to analyze the bitstream layer by layer and extract the first prior information generated during the encoding process. First, the bitstream header information of the video to be transcoded is parsed to obtain the corresponding target global parameters; these target global parameters include any one or more of resolution, frame rate, and color space. Specifically, when parsing the bitstream header information, the target global parameters need to be extracted layer by layer according to the syntax structure of the video to be transcoded. For example, for an H.264 bitstream, the sequence parameter set and image parameter set are first located to extract the target global parameters; for an H.265 bitstream, the parsing process needs to focus on the video parameter set, locate the sequence parameter set, and image parameter set to extract the target global parameters. Color space parameters are usually defined in the image parameter set or VUI (Video Usability Information).

[0060] It is important to understand that after completing the bitstream header parsing, a recursive parsing operation is performed on the coding units of the video to be transcoded based on the target global parameters to obtain the block partitioning structure, prediction mode, motion vectors, and residuals in the video to be transcoded. These block partitioning structure, prediction mode, motion vectors, and residuals are then integrated into first prior information. Specifically, the coding units of each frame of the video to be transcoded are recursively parsed according to the target global parameters to extract information such as the block partitioning structure, prediction mode, motion vectors, and residuals at each level. The obtained information from each level of blocks is then organized and stored in the form of structured data to obtain the first prior information.

[0061] Step S13: Using the target mapping relationship, the first prior information is mapped to the second prior information of the target encoding format. Based on the second prior information, the video to be transcoded is transcoded by a preset encoder to generate the target video of the target encoding format.

[0062] In this embodiment, in view of the differences between the initial encoding format and the target encoding format in terms of encoding structure and parameter definition, the extracted first prior information is mapped and transformed using a pre-established target mapping relationship to generate the second prior information of the target encoding format, providing a multi-dimensional data foundation and compatibility guarantee for subsequent prior reuse and fast encoding.

[0063] Understandably, during the transcoding process of the video to be transcoded, a priori information input interface is first added to the target encoder. This interface receives second priori information, which serves as a crucial reference for encoding decisions. Next, a preset encoder transcodes the block partitioning structure, prediction mode, motion vectors, and residuals in the video to be transcoded based on the second priori information, obtaining first transcoded information. Then, the preset encoder transcodes the non-block partitioning structure, prediction mode, motion vectors, and residuals in the video to be transcoded according to a preset fast search or local optimization strategy, obtaining second transcoded information. Finally, the target video is determined based on the first and second transcoded information. Specifically, in key coding stages such as motion estimation, block partitioning, and prediction mode selection, the extracted motion vectors, block partitioning structure, and prediction mode are preferentially used or referenced as second prior information as initial values ​​or candidate schemes to obtain the first transcoded information. For regions where the prediction accuracy of prior parameters is insufficient, local correction is performed through fast search or local optimization strategies to obtain the second transcoded information. At the same time, quality optimization modules such as adaptive loop filtering are retained to ensure video quality. Finally, the first and second transcoded information are integrated to complete the output of a video bitstream that conforms to the target coding format, i.e., the target video.

[0064] In this embodiment, to obtain the first transcoded information, the block partitioning structure in the video to be transcoded needs to be transcoded based on the block partitioning method in the second prior information to obtain the transcoded block partitioning structure. The motion vector in the second prior information is determined as the initial search point, and a preset fast search algorithm is used to transcode the video to be transcoded to obtain the transcoded motion estimate. A preset pattern in the video to be transcoded is transcoded based on the prediction pattern in the second prior information to obtain the transcoded prediction pattern. The residual in the video to be transcoded is transcoded according to the residual in the second prior information to obtain the transcoded residual. The transcoded block partitioning structure, the transcoded motion estimate, the transcoded prediction pattern, and the transcoded residual are integrated to generate the first transcoded information. Specifically, during block partitioning structure transcoding, the rules of the target encoding standard in the second prior information are prioritized to reduce the number of traversals. For regions with simple structures or flat textures, the prior partitioning results are directly used; for complex regions or regions with rich textures, adaptive adjustment can be used. Motion vector transcoding centers on the initial search point of the second prior information and employs a fast search algorithm for local optimization, skipping the traditional global search process. If the motion vector error in the second prior information is within a configurable threshold, it is directly adopted without recalculation. Prediction mode transcoding establishes a mapping between source and target modes through a mapping table. If the rate-distortion cost of using the second prior information mode meets the requirements, it is directly adopted, further reducing coding complexity. For cases where using prior information is ineffective, the candidate set is automatically expanded to ensure coding quality. Residual transcoding performs inverse and retransformation on the residuals in the prior information for the target coding transform matrix, transforming them to the target transform domain. The amplitude is then adjusted according to the target quantization parameters to balance efficiency and quality. Finally, the transcoded block structure, motion estimation, prediction mode, and residuals are encapsulated into corresponding data units according to the target coding syntax, entropy-encoded into code stream segments, and integrated into the first transcoded information.

[0065] As described above, this embodiment first obtains the initial encoding format of the video to be transcoded, and determines the target encoding format based on preset transcoding requirements. Then, it establishes a target mapping relationship between the initial encoding format and the target encoding format according to a target mapping model. Next, it parses the video to be transcoded to obtain the corresponding target global parameters. Based on the target global parameters, it performs recursive parsing operations on the encoding units of the video to be transcoded, thereby generating the first prior information corresponding to the video to be transcoded. Finally, it uses the established target mapping relationship to map the first prior information to the second prior information of the target encoding format. With the help of a preset encoder, it transcodes the video to be transcoded based on the second prior information, ultimately generating the target video in the target encoding format. In this way, by establishing a mapping relationship and employing a priori reuse mechanism from multiple aspects, it skips or simplifies some computationally intensive encoding steps, significantly reduces the search space, reduces redundant calculations, and significantly improves the encoding speed of the target encoder. At the same time, while ensuring video quality, it effectively reduces the computational complexity of the transcoding process.

[0066] Based on the previous embodiment, this application discloses a video transcoding method, including a source stream parsing module, a mapping relationship generation module, a parameter conversion module, a priori multiplexing encoding module, and an adaptive correction module, which can improve transcoding efficiency and reduce computational resource consumption. Next, we will address... Figure 2 The video transcoding method shown is explained in detail.

[0067] First, the source stream parsing module parses the video to be transcoded. On the one hand, it extracts the encoding parameters of the multi-dimensional source format, and on the other hand, it obtains YUV (Luminance Chrominance) data. At the same time, it completes the extraction of global parameters of the target and the recursive parsing of the encoding units to generate the first prior information.

[0068] Next, the mapping relationship generation module generates mapping rules / models and passes them to the parameter conversion module. The parameter conversion module uses the mapping rules / models to establish a target mapping relationship between the initial encoding format and the target encoding format, and maps the first prior information to the second prior information of the target encoding format according to the target mapping relationship.

[0069] Finally, the prior multiplexing encoding module uses the second prior information from the parameter conversion module and the YUV data provided by the source stream parsing module to transcode the video to be transcoded with the help of a preset encoder. The adaptive correction module will optimize the transcoding process according to the actual situation and finally generate the target format bitstream to obtain the target video in the target encoding format.

[0070] See Figure 3 As shown, an embodiment of the present invention discloses a video transcoding device, comprising:

[0071] The relationship establishment module 11 is used to obtain the initial encoding format of the video to be transcoded, determine the target encoding format based on the preset transcoding requirements, and establish a target mapping relationship between the initial encoding format and the target encoding format according to the target mapping model.

[0072] The prior information generation module 12 is used to parse the video to be transcoded to obtain the corresponding target global parameters, and to perform recursive parsing operation on the encoding unit of the video to be transcoded based on the target global parameters to generate the first prior information corresponding to the video to be transcoded.

[0073] The video transcoding module 13 is used to map the first prior information to the second prior information of the target encoding format using the target mapping relationship, and to transcode the video to be transcoded based on the second prior information by a preset encoder to generate the target video of the target encoding format.

[0074] As described above, this application first obtains the initial encoding format of the video to be transcoded, and determines the target encoding format based on preset transcoding requirements. Then, it establishes a target mapping relationship between the initial encoding format and the target encoding format according to a target mapping model. Next, it parses the video to be transcoded to obtain the corresponding target global parameters. Based on the target global parameters, it performs recursive parsing operations on the encoding units of the video to be transcoded, thereby generating the first prior information corresponding to the video to be transcoded. Finally, it uses the established target mapping relationship to map the first prior information to the second prior information of the target encoding format. With the help of a preset encoder, it transcodes the video to be transcoded based on the second prior information, ultimately generating the target video in the target encoding format. In this way, by establishing a mapping relationship and employing a priori reuse mechanism from multiple aspects, it skips or simplifies some computationally intensive encoding steps, significantly reduces the search space, reduces redundant calculations, and significantly improves the encoding speed of the target encoder. At the same time, while ensuring video quality, it effectively reduces the computational complexity of the transcoding process.

[0075] In some specific implementations, the target mapping model includes a preset rule base and a target neural network;

[0076] Accordingly, the relationship establishment module 11 may specifically include:

[0077] The rule storage unit is used to determine the mapping rules according to the preset transcoding scenario and store the mapping rules in the preset rule library; wherein, the mapping rules include any one or more of the following: block partitioning mapping rules, motion vector mapping rules, prediction mode mapping rules, and residual domain transformation mapping rules;

[0078] The neural network and sample acquisition unit is used to acquire the initial neural network and the encoded mapping data sample set;

[0079] A target neural network acquisition unit is used to train the initial neural network using the encoded mapping data sample set to obtain a target neural network.

[0080] The model determination unit is used to determine the target mapping model based on the preset rule base and the target neural network.

[0081] The mapping relationship determination unit is used to determine the target mapping relationship between the initial encoding format and the target encoding format according to the target mapping model.

[0082] In some specific implementations, the target neural network acquisition unit may specifically include:

[0083] The sample set partitioning subunit is used to divide the encoded mapping data sample set into a training set and a validation set;

[0084] The neural network acquisition sub-unit is used to iteratively update the network parameters in the initial neural network using the parameters of each encoding format in the training set, so as to obtain the trained neural network.

[0085] The neural network judgment subunit is used to determine whether the trained neural network has reached a preset convergence condition based on the validation set.

[0086] The neural network determination subunit is used to determine the trained neural network as the target neural network if the trained neural network reaches a preset convergence condition.

[0087] In some specific implementations, the prior information generation module 12 may specifically include:

[0088] The global parameter acquisition unit is used to parse the bitstream header information of the video to be transcoded in order to obtain the corresponding target global parameters; wherein the target global parameters include any one or more of resolution, frame rate and color space.

[0089] In some specific implementations, the prior information generation module 12 may specifically include:

[0090] The encoding unit parsing unit is used to perform recursive parsing operations on the encoding units of the video to be transcoded based on the target global parameters, so as to obtain the block partitioning structure, prediction mode, motion vector and residual in the video to be transcoded;

[0091] The first prior information acquisition unit is used to integrate the block partitioning structure, prediction mode, motion vector and residual in the video to be transcoded into the first prior information.

[0092] In some specific implementations, the video transcoding module 13 may specifically include:

[0093] The first transcoded information acquisition unit is used to transcode the block partitioning structure, prediction mode, motion vector and residual in the video to be transcoded based on the second prior information by a preset encoder, so as to obtain the first transcoded information.

[0094] The second transcoded information acquisition unit is used to transcode the information of non-block partitioning structure, prediction mode, motion vector and residual in the video to be transcoded by a preset encoder according to a preset fast search or local optimization strategy, so as to obtain the second transcoded information.

[0095] The target video determination unit is used to determine the target video based on the first transcoded information and the second transcoded information.

[0096] In some specific implementations, the first transcoded information acquisition unit may specifically include:

[0097] The transcoded block partitioning structure acquisition subunit is used to transcode the block partitioning structure in the video to be transcoded based on the block partitioning method in the second prior information, so as to obtain the transcoded block partitioning structure.

[0098] The transcoded motion estimation acquisition subunit is used to determine the motion vector in the second prior information as the initial search point, and to transcode the video to be transcoded using a preset fast search algorithm based on the initial search point to obtain the transcoded motion estimation.

[0099] The transcoded prediction mode acquisition subunit is used to transcode the preset mode in the video to be transcoded based on the prediction mode in the second prior information to obtain the transcoded prediction mode.

[0100] The residual acquisition subunit after transcoding is used to transcode the residual in the video to be transcoded according to the residual in the second prior information, so as to obtain the residual after transcoding.

[0101] The first post-transcoding information generation subunit is used to integrate the post-transcoding block partitioning structure, the post-transcoding motion estimation, the post-transcoding prediction mode, and the post-transcoding residual to generate the first post-transcoding information.

[0102] Furthermore, embodiments of this application also disclose an electronic device, Figure 4 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.

[0103] Figure 4This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the video transcoding method disclosed in any of the foregoing embodiments. Alternatively, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0104] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0105] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0106] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the video transcoding method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program capable of performing other specific tasks.

[0107] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned disclosed video transcoding method. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.

[0108] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0109] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0110] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0111] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, 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 limitations, 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.

[0112] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A video transcoding method, characterized in that, include: Obtain the initial encoding format of the video to be transcoded, determine the target encoding format based on preset transcoding requirements, and establish a target mapping relationship between the initial encoding format and the target encoding format according to the target mapping model; The video to be transcoded is parsed to obtain the corresponding target global parameters. Based on the target global parameters, the encoding unit of the video to be transcoded is recursively parsed to generate the first prior information corresponding to the video to be transcoded. The first prior information is mapped to the second prior information of the target encoding format using the target mapping relationship. The video to be transcoded is then transcoded using a preset encoder based on the second prior information to generate the target video of the target encoding format. The target mapping model includes a preset rule base and a target neural network; Accordingly, establishing the target mapping relationship between the initial encoding format and the target encoding format based on the target mapping model includes: The mapping rules are determined according to the preset transcoding scenario and stored in the preset rule library; wherein, the mapping rules include any one or more of the following: block partitioning mapping rules, motion vector mapping rules, prediction mode mapping rules, and residual domain transformation mapping rules; Obtain the initial neural network and the encoding mapping data sample set; The initial neural network is trained using the encoded mapping data sample set to obtain the target neural network; The target mapping model is determined based on the preset rule base and the target neural network; The target mapping relationship between the initial encoding format and the target encoding format is determined based on the target mapping model. The recursive parsing operation on the encoding units of the video to be transcoded based on the target global parameters to generate the first prior information corresponding to the video to be transcoded includes: Based on the target global parameters, the coding units of each frame of the video to be transcoded are recursively parsed to extract information such as the partitioning structure, prediction mode, motion vector, and residual of each block level; The information obtained from each level of blocks is organized and stored in the form of structured data to obtain the first prior information; The step of transcoding the video to be transcoded based on the second prior information using a preset encoder to generate a target video in the target encoding format includes: The block partitioning structure, prediction mode, motion vector and residual in the video to be transcoded are transcoded by a preset encoder based on the second prior information to obtain the first transcoded information; The non-block partitioning structure, prediction mode, motion vector and residual information in the video to be transcoded are transcoded by a preset encoder according to a preset fast search or local optimization strategy to obtain the second transcoded information. The target video is determined based on the first transcoded information and the second transcoded information; The step of transcoding the block partitioning structure, prediction mode, motion vectors, and residuals in the video to be transcoded using a preset encoder based on the second prior information to obtain the first transcoded information includes: Based on the block partitioning method in the second prior information, the block partitioning structure in the video to be transcoded is transcoded to obtain the transcoded block partitioning structure. The motion vector in the second prior information is determined as the initial search point. Based on the initial search point, a preset fast search algorithm is used to transcode the video to be transcoded to obtain the transcoded motion estimate. Based on the prediction pattern in the second prior information, the preset pattern in the video to be transcoded is transcoded to obtain the transcoded prediction pattern. The residual in the video to be transcoded is transcoded based on the residual in the second prior information to obtain the transcoded residual; The transcoded block partitioning structure, the transcoded motion estimation, the transcoded prediction mode, and the transcoded residual are integrated to generate the first transcoded information; The video transcoding method further includes: A target neural network is determined using a multi-task learning architecture; the multi-task learning architecture includes a shared feature extraction backbone and multiple output branches.

2. The video transcoding method according to claim 1, characterized in that, The step of training the initial neural network using the encoded mapping data sample set to obtain the target neural network includes: The encoded mapping data sample set is divided into a training set and a validation set; The network parameters in the initial neural network are iteratively updated using the parameters of each encoding format in the training set to obtain the trained neural network; Based on the validation set, determine whether the trained neural network has reached the preset convergence condition; If the trained neural network reaches the preset convergence condition, then the trained neural network is determined as the target neural network.

3. The video transcoding method according to claim 1, characterized in that, The step of parsing the video to be transcoded to obtain the corresponding target global parameters includes: The bitstream header information of the video to be transcoded is parsed to obtain the corresponding target global parameters; wherein the target global parameters include any one or more of resolution, frame rate and color space.

4. The video transcoding method according to any one of claims 1 to 3, characterized in that, The recursive parsing operation on the encoding units of the video to be transcoded based on the target global parameters to generate the first prior information corresponding to the video to be transcoded includes: Based on the target global parameters, a recursive parsing operation is performed on the encoding units of the video to be transcoded to obtain the block partitioning structure, prediction mode, motion vector and residual in the video to be transcoded. The block partitioning structure, prediction mode, motion vector, and residual in the video to be transcoded are integrated into the first prior information.

5. A video transcoding device, characterized in that, include: The relationship establishment module is used to obtain the initial encoding format of the video to be transcoded, determine the target encoding format based on the preset transcoding requirements, and establish a target mapping relationship between the initial encoding format and the target encoding format according to the target mapping model. The prior information generation module is used to parse the video to be transcoded to obtain the corresponding target global parameters, and to perform recursive parsing operations on the encoding units of the video to be transcoded based on the target global parameters to generate the first prior information corresponding to the video to be transcoded. The video transcoding module is used to map the first prior information to the second prior information of the target encoding format using the target mapping relationship, and to transcode the video to be transcoded based on the second prior information using a preset encoder to generate the target video of the target encoding format. The target mapping model includes a preset rule base and a target neural network; Accordingly, the relationship establishment module includes: The rule storage unit is used to determine the mapping rules according to the preset transcoding scenario and store the mapping rules in the preset rule library; wherein, the mapping rules include any one or more of the following: block partitioning mapping rules, motion vector mapping rules, prediction mode mapping rules, and residual domain transformation mapping rules; The neural network and sample acquisition unit is used to acquire the initial neural network and the encoded mapping data sample set; A target neural network acquisition unit is used to train the initial neural network using the encoded mapping data sample set to obtain a target neural network. The model determination unit is used to determine the target mapping model based on the preset rule base and the target neural network. A mapping relationship determination unit is used to determine the target mapping relationship between the initial encoding format and the target encoding format based on the target mapping model; Specifically, the video transcoding device is used to recursively parse the encoding units of each frame of the video to be transcoded according to the target global parameters, and extract information such as the partitioning structure, prediction mode, motion vector, and residual of each level of block; and organize and store the information of each level of block in the form of structured data to obtain the first prior information. Specifically, the video transcoding module may include: The first transcoded information acquisition unit is used to transcode the block partitioning structure, prediction mode, motion vector and residual in the video to be transcoded based on the second prior information by a preset encoder, so as to obtain the first transcoded information. The second transcoded information acquisition unit is used to transcode the information of non-block partitioning structure, prediction mode, motion vector and residual in the video to be transcoded by a preset encoder according to a preset fast search or local optimization strategy, so as to obtain the second transcoded information. A target video determination unit is used to determine a target video based on the first transcoded information and the second transcoded information; Specifically, the first transcoded information acquisition unit may include: The transcoded block partitioning structure acquisition subunit is used to transcode the block partitioning structure in the video to be transcoded based on the block partitioning method in the second prior information, so as to obtain the transcoded block partitioning structure. The transcoded motion estimation acquisition subunit is used to determine the motion vector in the second prior information as the initial search point, and to transcode the video to be transcoded using a preset fast search algorithm based on the initial search point to obtain the transcoded motion estimation. The transcoded prediction mode acquisition subunit is used to transcode the preset mode in the video to be transcoded based on the prediction mode in the second prior information to obtain the transcoded prediction mode. The residual acquisition subunit after transcoding is used to transcode the residual in the video to be transcoded according to the residual in the second prior information, so as to obtain the residual after transcoding. The first transcoding information generation subunit is used to integrate the transcoding block partitioning structure, the transcoding motion estimation, the transcoding prediction mode, and the transcoding residual to generate the first transcoding information. Specifically, the video transcoding device is used to determine the target neural network using a multi-task learning architecture; the multi-task learning architecture includes a shared feature extraction backbone and multiple output branches.

6. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the video transcoding method as described in any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that, Used to store a computer program; wherein, when the computer program is executed by a processor, it implements the video transcoding method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • H.264-to-H.265 video transcoding method and transcoder

    CN104038764A

  • Coding method, coding device, electronic equipment and storage medium

    CN118540487A