Method for processing metadata in video transcoding, video transcoding device and electronic device
By automatically processing and adjusting HDR metadata in video transcoding, the problem of metadata loss during video transcoding is solved, and the automated transcoding of HDR video and adaptive adjustment of metadata is realized, which simplifies the process and improves efficiency .
Patent Information
- Application Number
- CN202110968111.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-23
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2041-08-23
AI Technical Summary
During the video transcoding process, HDR metadata is easily lost, resulting in the transcoding bitstream that cannot be played back correctly. Users need to manually add metadata, which is cumbersome and inefficient.
A metadata processing method in video transcoding is proposed. By decoding the video stream and adjusting the corresponding metadata, it is embedded in the encoded video stream, and the automatic processing of static and dynamic metadata is supported, including the size, position, and scaling of the pixel size of the picture. , crop, rotate and mirror operations to ensure that the metadata remains consistent during the transcoding process.
Implements automatic transcoding of HDR videos, retaining the metadata information that HDR media must contain, and the metadata is automatically adjusted to adapt to the modification of images during the transcoding process, simplifying the process and improving efficiency, so that users do not need to access the main file multiple times. .
Smart Images

Figure CN114095733B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of video transcoding, and in particular to a method for processing metadata in video transcoding, a video transcoding device and an electronic device. Background Art
[0002] HDR (High Dynamic Range) video uses metadata during the encoding process to more accurately define the information needed for display, using standards such as HDR10, HLG, HDR10+, and Dolby Vision (DoVi). The information contained in this metadata can be static information such as the color system used for the entire video, maximum and maximum average light levels, and master display capabilities, or dynamic information that can optimize video display frame by frame.
[0003] When using common transcoding tools (such as FFmpeg) to transcode videos (such as using X265 for H.265 encoding), HDR metadata is usually lost during the transcoding process, and users must manually add the metadata back to the transcoded video, otherwise the resulting transcoded bitstream cannot be played back correctly. Currently, H.265 is the most common HDR codec, and X265 is by far the most popular H.265 encoder. Other codecs, such as VP9, AV1, and H.264 can also be used for HDR encoding and may have the same problems. Summary of the invention
[0004] The technical problem to be solved by the present invention is how to automatically process metadata in video transcoding. The present invention proposes a method for processing metadata in video transcoding, a video transcoding device and an electronic device.
[0005] The method for processing metadata in video transcoding according to an embodiment of the present invention includes:
[0006] Decode the source video stream to obtain a decoded video stream and corresponding metadata;
[0007] Based on the processing operation of the decoded video stream, adjusting the corresponding metadata;
[0008] The decoded video stream is encoded, and the metadata is embedded in the encoded video stream.
[0009] According to some embodiments of the present invention, the processing operation of the decoded video stream includes: changing the size or position of pixels in the picture, and scaling, cropping, rotating and mirroring the image, and adjusting the corresponding metadata based on the operation of the video stream.
[0010] In some embodiments of the present invention, if no processing operation is performed on the decoded video stream, the metadata is directly embedded into the encoded video stream.
[0011] According to some embodiments of the present invention, the metadata includes static metadata and dynamic metadata.
[0012] In some embodiments of the present invention, embedding the metadata into the encoded video stream comprises:
[0013] For Dolby Vision, modify the DolbyVision descriptor according to the picture size and bit rate settings of the encoded video stream, write the encoded video stream into the container, insert the Dolby configuration record into the container, and select the corresponding Dolby codec type for the Dolby configuration in the container;
[0014] For static metadata, all static metadata are first cached in the encoder, and the static metadata is inserted into the video frames encoded as I frames of the encoded video stream;
[0015] For dynamic metadata, the dynamic metadata is added to the corresponding coded frame.
[0016] According to some embodiments of the present invention, the static metadata includes: color description metadata, CLL metadata, MDCV metadata and Dolby Video configuration;
[0017] The dynamic metadata includes: HDR10+ dynamic metadata and Dolby Vision dynamic metadata.
[0018] A video transcoding device according to an embodiment of the present invention includes:
[0019] A decoding module, used for decoding the source video stream to obtain a decoded video stream and corresponding metadata;
[0020] A metadata processing module, configured to adjust the corresponding metadata based on a processing operation on the decoded video stream;
[0021] The encoding module is used to encode the decoded video stream and embed the metadata into the encoded video stream.
[0022] According to some embodiments of the present invention, the processing operation of the decoded video stream includes: changing the size or position of pixels in the picture, and scaling, cropping, rotating and mirroring the image, and the metadata processing module makes corresponding adjustments to the corresponding metadata based on the operation of the video stream.
[0023] According to an electronic device of an embodiment of the present invention, the electronic device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the following method steps when executed by the processor:
[0024] The decoded video stream and corresponding metadata obtained by receiving the decoder decoding the source video stream;
[0025] Based on the processing operation of the decoded video stream, adjusting the corresponding metadata;
[0026] The metadata is sent to an encoder to encode the decoded video stream, and the metadata is embedded in the encoded video stream.
[0027] According to some embodiments of the present invention, the processing operation of the decoded video stream includes: changing the size or position of pixels in the picture, and scaling, cropping, rotating and mirroring the image, and adjusting the corresponding metadata based on the operation of the video stream.
[0028] The method for processing metadata in video transcoding, the video transcoding device and the electronic device proposed in the present invention have the following beneficial effects:
[0029] The present invention automatically transmits any HDR-related metadata when transcoding from decoded input to encoded output. If the video stream is converted during transcoding, the metadata is converted in the same way so that any area affected by the metadata remains the same in the transcoded image. In this way, the transcoding of HDR video is automated, the metadata information that HDR media must contain is retained, and the metadata is automatically adjusted to accommodate modifications to the image during the transcoding process. Streaming services and other media users are allowed to transcode HDR media in a simple manner without having to access the master file multiple times, which simplifies the process and improves efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 A flowchart of a method for processing metadata in video transcoding according to an embodiment of the present invention;
[0031] Figure 2 This is an example diagram of decoding HDR10 color information in H.265 VUI according to an embodiment of the present invention;
[0032] Figure 3 This is a decoding example diagram of CLL and MDCV SEI of H.265 according to an embodiment of the present invention;
[0033] Figure 4 is an example diagram of an MP4 file containing Dolby profile 5 according to an embodiment of the present invention;
[0034] Figure 5 is an example diagram of HDR10+ dynamic metadata according to an embodiment of the present invention;
[0035] Figure 6Schematic diagram of ST 2094-10 processing window parameters according to an embodiment of the present invention;
[0036] Figure 7 A schematic diagram of an activity area described in the ST2094-10 standard according to an embodiment of the present invention;
[0037] Figure 8 A schematic diagram of an FFmpeg command of an example in the prior art;
[0038] Fig. 9 A schematic diagram of metadata processing when scaling is required during HDR transcoding according to an embodiment of the present invention;
[0039] Fig.10 It is a schematic diagram of scaling, mirroring, rotating and cropping an image read according to an embodiment of the present invention. DETAILED DESCRIPTION
[0040] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined purpose, the present invention is described in detail below in conjunction with the accompanying drawings and preferred embodiments.
[0041] The description of the method flow in the specification of the present invention and the steps of the flowchart in the drawings of the specification of the present invention do not have to be strictly executed according to the step numbers, and the method steps can be executed in a different order. Moreover, some steps can be omitted, multiple steps can be combined into one step, and / or one step can be decomposed into multiple steps.
[0042] The present invention discloses a method for retaining metadata during HDR video transcoding. The core problem solved is to automatically transfer HDR metadata from an input bitstream to a transcoded bitstream during the transcoding process, and automatically modify the metadata according to any video transformation (such as scaling, cropping, mirroring or rotation) during the process.
[0043] For example, the HDR 10+ dynamic metadata specified in the SMPTE ST2094-40 standard and the Dolby Vision dynamic metadata specified in the SMPTE ST2094-10 standard can specify processing windows or active regions. If these metadata features are used in the input bitstream, then these HDR10+ processing windows or Dolby Vision active regions also need to be similarly transformed when transcoding in order to map to the correct region in the output window.
[0044] HDR metadata contains tone mapping information, which is used to map a set of colors in a higher dynamic range to a lower dynamic range while ensuring that they look similar. This tone mapping can be static, which means that for the entire video, the mapping is optimized for the brightest scene. This mapping can also be dynamic and can be updated frame by frame. Both mappings can provide better visual effects for some special scenes (e.g., snow, low light).
[0045] In order to facilitate the understanding of the present invention, the HDR metadata involved in the present invention is explained as follows:
[0046] HDR metadata includes: static metadata and dynamic metadata.
[0047] Static metadata is usually kept constant for the entire video data stream. In some special cases, it can also be updated when the scene changes. In order to ensure random access to video files or allow terminals to dynamically join the video stream being played, static metadata is usually sent on each I frame regardless of whether the metadata has changed.
[0048] Static metadata includes: HDR color description metadata, content brightness level information (CLL) and master display color volume (MDCV). Dolby Vision has a set of self-defined static metadata, called dvcC or dvvC, which is Dolby Vision configuration record.
[0049] The following is an explanation of several types of static metadata:
[0050] 1. Color description metadata.
[0051] For H.264 and H.265, which follow the ITU codec standard, HDR color metadata is stored in VUI. For AV1 and VP9, according to the specifications of these codecs, their HDR color metadata is stored in the color_config of the sequence header OBU (metadataopen bitstream unit). So, no matter what the codec is, VUI and color_config carry the same information. Figure 2 The following is an example of decoding HDR10 color information in H.265 VUI. It is worth noting that different HDR standards will have different color settings.
[0052] 2. CLL and MDCV metadata.
[0053] CLL (Content Luminance Level Information) contains information about the maximum and average luminance; MDCV (Master Display Color Volume) contains information about the master display calibration. By interpreting these two types of information, the best viewing experience can be reproduced as much as possible during playback. For the definition of CLL, refer to CTA 861.G; for the definition of MDCV, refer to SMPTE 2086.
[0054] For H.264 and H.265, CLL and MDCV metadata are stored in SEI (Supplemental Enhancement Information). For AV1, they are stored in metadata_obu. VP9 does not support storing these metadata in the bitstream, it relies on a proper container format such as MKV or WebM. Figure 3 The following is an example of decoding CLL and MDCV SEI of H.265. The formats of other codecs are similar.
[0055] 3. Dolby Vision configuration record.
[0056] Dolby defines a configuration record called dvcC or dvvC, which stores a lot of information, including the DolbyVision configuration and level, dynamic metadata (Dolby calls it RPU: Reference Processing Unit), and the presence of up to 2 coding layers: base layer (bl) and enhancement layer (el). dvcC is stored in a container, usually an ISO-based format such as mp4 or QuickTime or a transport stream. These records must be passed from the input container to the output container and update the Dolby Level according to the encoder settings, while all other settings should remain unchanged.
[0057] Dolby levels work similarly to H.265 or H.264 levels and increase with picture size and bitrate. Depending on the profile, Dolby also uses its own codec identifier, for example, dvh1 or dvhe is used in profile 5. Profile 8, which includes many backwards-compatible modes such as HDR10, HLG, and SDR, uses the standard ISO-formatted H.265 codec hev1 or hcv1 names.
[0058] Figure 4 Showing an mp4 file containing Dolby profile 5, dvcC shows profile 5, level 9, the bitstream contains dynamic metadata (rpu), and only contains the base layer. Some Dolby Vision profiles, such as profile 4 and profile 7 support enhanced encoding, which can further increase the dynamic range.
[0059] For complete information about Dolby Vision configurations and levels, information about using Dolby Vision based ISO formats and Dolby configuration records, and about transport streams, please refer to existing technical documents and will not be repeated here.
[0060] Dynamic HDR metadata is usually updated on a frame-by-frame basis. As mentioned earlier, the 2 HDR standards that use dynamic metadata are HDR10+ and Dolby Vision, but SMPTE has standardized 4 schemes:
[0061] SMPTE ST 2094-10–Dolby Vision;
[0062] SMPTE ST 2094-20–Philips SL-HDR1;
[0063] SMPTE ST 2094-30–Technicolor SL-HDR1;
[0064] SMPTE ST-2094-40 – HDR10+;
[0065] The following are two types of standard dynamic metadata:
[0066] 1. HDR10+ dynamic metadata.
[0067] Figure 5 is an example of HDR10+ dynamic metadata. For H.264 and H.265, it is stored in T.35SEI. AV1 stores it in a T.35meta_obu, and VP9 also relies on containers to store this metadata.
[0068] ST 2094-10 contains processing window parameters that specify pixel coordinates that need to be updated if any image transformations that change pixel positions are performed (such as scaling, rotation, mirroring, and cropping), such as Figure 6 As shown, the current version of the standard limits the value of num_windows to 1, so these parameters are not yet enabled for HDR10+.
[0069] 2.Dolby Vision dynamic metadata (RPU).
[0070] Dolby Vision dynamic metadata is defined in SMPTE 2094-10. For H.265, this metadata is stored in reserved type 62 NAL units (network abstraction layer). Currently Dolby only supports H.265.
[0071] The metadata of ST2094-10 level 5 specifies the pixel coordinates of the active area of the image. When the active area needs to undergo any image transformation (such as scaling, cropping, rotating, mirroring, etc.), the corresponding metadata also needs to be modified and corrected. Since the definition of the active area is limited to a rectangle, only transformations that maintain a rectangular active area are supported. For example, only rotations of 90 degrees and multiples thereof are supported. Figure 7 This is the activity area described in the standard.
[0072] Existing technologies usually use FFmpeg or similar tools for transcoding. Taking X265 as an encoder as an example, X265 requires all HDR metadata to be entered as parameters in the FFmpeg command line. Users must use their own software or common tools (such as media info, ffprobe, bitstream analyzers, etc.) to extract this information.
[0073] Figure 8 Shown is a sample FFmpeg command to transcode an HDR10 bitstream (hdrinbit.mp4) to hdr-output.mp4 using the X265 encoder. The HDR metadata is highlighted in light grey. The first 3 parameters are the HDR color information. The fourth and fifth parameters are CLL and MDCV.
[0074] The above example only specifies static HDR metadata. X265 has two additional parameters for dynamic HDR metadata, as shown below. The first specifies the file name containing HDR10+ dynamic metadata, and the second specifies the file name containing Dolby Vision dynamic metadata. Each file must contain an entry with metadata for each frame in the input bitstream.
[0075] HDR10+ dynamic metadata: dhdr10-info= <filename>;
[0076] Dolby Vision dynamic metadata: dolby-vision-rpu= <filename>.
[0077] In the prior art, FFmpeg+X265 is used to implement HDR transcoding. This implementation requires users to manually extract HDR metadata during transcoding and specify it on the command line. This requires each user to develop their own method to extract HDR metadata. If the video needs to be scaled / rotated during the transcoding process, the metadata needs to be manually converted as necessary. In the case of Dolby Vision, the Dolby level (DolbyLevel) needs to be manually adjusted based on the new image size and bitrate, which is cumbersome and inconvenient.
[0078] like Figure 1 As shown, the method for processing metadata in video transcoding according to an embodiment of the present invention includes:
[0079] S110, decoding the source video stream to obtain a decoded video stream and corresponding metadata;
[0080] It should be noted that metadata includes static metadata and dynamic metadata. Static metadata includes: color description metadata, CLL metadata, MDCV metadata and Dolby Video configuration; dynamic metadata includes: HDR10+ dynamic metadata and Dolby Vision dynamic metadata.
[0081] S120, adjusting corresponding metadata based on the processing operation on the decoded video stream;
[0082] For example, the processing operation on the decoded video stream may include: changing the size or position of pixels in the picture, and scaling, cropping, rotating and mirroring the image, and adjusting the corresponding metadata based on the operation of the video stream. It is understandable that if the decoded video stream is not processed, the metadata can be directly embedded in the encoded video stream.
[0083] S130, encoding the decoded video stream, and embedding metadata into the encoded video stream.
[0084] In some embodiments of the present invention, metadata is embedded in an encoded video stream, including:
[0085] For Dolby Vision, modify the DolbyVision descriptor according to the picture size and bit rate settings of the encoded video stream, write the encoded video stream into the container, insert the Dolby configuration record into the container, and select the corresponding Dolby codec type for the Dolby configuration in the container;
[0086] For static metadata, all static metadata are first cached in the encoder, and the static metadata is inserted into the video frames encoded as I frames of the encoded video stream;
[0087] For dynamic metadata, the dynamic metadata is added to the corresponding coded frame.
[0088] According to the method for processing metadata in video transcoding of an embodiment of the present invention, any metadata related to HDR is automatically transmitted when transcoding from decoding input to encoding output. If the video stream is converted during transcoding, the metadata is converted in the same way so that any area affected by the metadata remains the same in the transcoded image. In this way, the transcoding of HDR video is automatically achieved, the metadata information that HDR media must contain is retained, and the metadata is automatically adjusted to adapt to the modification of the image during the transcoding process. Streaming services and other media users are allowed to transcode HDR media in a simple way without having to access the main file multiple times, which simplifies the process and improves efficiency.
[0089] A video transcoding device according to an embodiment of the present invention includes: a decoding module, a metadata processing module and an encoding module.
[0090] The decoding module is used to decode the source video stream to obtain a decoded video stream and corresponding metadata;
[0091] The metadata processing module is used to adjust the corresponding metadata based on the processing operation of the decoded video stream;
[0092] For example, the processing operations on the decoded video stream include: changing the size or position of pixels in the picture, and scaling, cropping, rotating and mirroring the image. The metadata processing module adjusts the corresponding metadata based on the operation of the video stream.
[0093] The encoding module is used to encode the decoded video stream and embed metadata into the encoded video stream.
[0094] The device for processing metadata in video transcoding according to the embodiment of the present invention integrates decoding, metadata processing and encoding functions, automatically realizes the transcoding of HDR video, retains the metadata information that must be contained in HDR media, and automatically adjusts the metadata to adapt to the modification of the image during the transcoding process. Thus, streaming services and other media users are allowed to transcode HDR media in a simple way without having to access the main file multiple times, which simplifies the process and improves efficiency.
[0095] According to an embodiment of the present invention, the electronic device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. For example, the electronic device may be a computer, and the above method steps are implemented by connecting the computer to a Netint transcoder.
[0096] When the computer program is executed by a processor, the following steps are implemented:
[0097] S110, receiving a decoded video stream and corresponding metadata obtained by decoding a source video stream by a decoder;
[0098] S120, adjusting corresponding metadata based on the processing operation on the decoded video stream;
[0099] For example, the processing operations on the decoded video stream include: changing the size or position of pixels in the picture, and scaling, cropping, rotating and mirroring the image. Based on the operation of the video stream, the corresponding metadata is adjusted accordingly.
[0100] S130, sending the metadata to an encoder to encode the decoded video stream, and embedding the metadata into the encoded video stream.
[0101] The following describes the method for processing metadata in video transcoding according to the present invention in conjunction with the accompanying drawings. It is worth noting that the following description is only an exemplary description and should not be construed as a specific limitation on the present invention.
[0102] When the present invention is used with the Netint transcoder, there is no need to manually extract / modify HDR metadata. All HDR parameters are handled automatically, and only the encoding parameters need to be specified. The same command applies to all HDR formats. For example, if the input is profile 5 Dolby Vision, the output is profile 5 Dolby Vision. The same is true for HDR10, HDR10+, HLG, etc.
[0103] like Fig. 9 As shown in the figure, for an example of HDR transcoding that requires scaling, the input bitstream is input from the left and decoded. The decoded image is output, then scaled and finally sent to the video encoder normally. The HDR metadata is removed from the decoded bitstream and modified in accordance with the image scaling operation. The modified metadata is finally input to the video encoder, where it is inserted into the newly encoded bitstream.
[0104] It should be noted that the process is not limited to image scaling, and can also be used for other operations, including changing the size or position of pixels in the image, as well as scaling, cropping, rotating (90, 180, 270), mirroring, etc. If no operation is performed to change the image, the metadata does not need to be modified and can be directly embedded in the new bitstream.
[0105] Fig.10 This shows how to modify the active region in Dolby Vision HDR metadata to support scaling, mirroring, n*90 degree rotation, or image cropping. Any image operation that changes the X, Y coordinates of the active region requires modifying the active region in the metadata. Note that since the active region in Dolby Vision must be a rectangular box with sides parallel to the image, only image operations on rectangular boxes with sides parallel to the image are supported, and 45 degree rotation is not supported losslessly (in actual applications, there are few such operations, such as 45 degree rotation).
[0106] The steps of HDR transcoding in the present invention are as follows:
[0107] A100, decodes the image and finds all static (color description, CLL and MDCV, Dolby Video configuration, etc.) and dynamic (HDR10+ and Dolby Vision) HDR metadata that can be attached to the decoded image. (It may be necessary to find the corresponding I frame).
[0108] A200, performs equivalent conversions on dynamic metadata when performing any supported conversions on the entire image or selected areas. If an unsupported image conversion needs to be performed, if the dynamic metadata includes the selected area, the dynamic metadata is deleted to reduce the distortion of the image when the dynamic metadata is applied to the wrong area, and a warning message is output. The user is informed of the changes in image display quality during the HDR transcoding process based on the warning message.
[0109] A300, for encoding.
[0110] A310, For Dolby Vision, modify the Dolby Vision descriptor based on the encoder picture size and bitrate settings. If writing the encoded bitstream to a container, insert a Dolby Configuration record in the container and use the appropriate Dolby codec type for the Dolby Configuration in the container.
[0111] A320, for static metadata, all static metadata are first cached in the encoder and inserted into any video frame encoded as an I frame. If the static metadata is found to be updated on any incoming frame, the updated metadata will be used on the next I frame.
[0112] A330, for dynamic metadata, adds any dynamic metadata to the coded frames that carry it. Note that these frames may be out of order during the encoding process, but the dynamic metadata must remain consistent with the frame to which it belongs.
[0113] In summary, the present invention automatically transmits any HDR-related metadata when transcoding from decoded input to encoded output. If the video stream is converted during transcoding, the metadata is converted the same way so that any areas where the metadata affects remain the same in the transcoded image.
[0114] In the prior art, the original video files are accessed and multiple tools are used to manually extract and modify metadata before inserting the new video stream. This method requires access rights, is very complex, and cannot be applied on a large scale. Moreover, in many cases, the transcoding process has no access rights to the original video files (only the video stream).
[0115] The present invention can automatically transcode HDR videos, retaining the metadata information that HDR media must contain, and automatically adjusting the metadata to accommodate image modifications during the transcoding process. This allows streaming services and other media users to transcode HDR media in a simple way without having to access the master file multiple times, simplifying the process and improving efficiency.
[0116] Through the description of the specific implementation methods, a deeper and more specific understanding of the technical means and effects adopted by the present invention to achieve the predetermined purpose should be obtained. However, the accompanying drawings are only for reference and illustration purposes and are not intended to limit the present invention.< / filename> < / filename>
Claims
1. A method for processing metadata in video transcoding, characterized in that: include: Decoding the source video stream of the HDR media to obtain a decoded video stream; Searching for a decoded image corresponding to a preset frame of the decoded video stream, and obtaining metadata attached to the decoded image, wherein the metadata includes static metadata and dynamic metadata, wherein the static metadata includes color description metadata, CLL metadata, MDCV metadata, and Dolby Video configuration, and the dynamic metadata includes HDR10+ dynamic metadata and Dolby Vision dynamic metadata; Based on a processing operation on the decoded video stream, in a case where the processing operation is an image transformation that changes pixel positions on the entire decoded image or a selected area of the decoded image, adjusting the corresponding metadata according to an operation consistent with the processing operation, the metadata specifying pixel coordinates of an image frame of the decoded video stream; in a case where the processing operation is an unsupported picture conversion and the metadata includes a selected area, deleting the metadata and outputting a warning message, the warning message including information on changes in image display quality during HDR transcoding, the warning message being used to indicate reducing distortion of the image caused by applying dynamic metadata to an erroneous area; Encoding the decoded video stream and embedding the metadata into the encoded video stream; The metadata corresponding to the adjustment includes: The processing window parameters of the metadata are updated to modify and correct the metadata.
2. The method for processing metadata in video transcoding according to claim 1, characterized in that: The processing operations on the decoded video stream include: changing the size or position of pixels in the picture, and scaling, cropping, rotating and mirroring the image. Based on the processing operations on the decoded video stream, the corresponding metadata is adjusted accordingly.
3. The method for processing metadata in video transcoding according to claim 1, characterized in that: The step of embedding the metadata into the encoded video stream comprises: For Dolby Vision, modify the Dolby Vision descriptor according to the picture size and bit rate settings of the encoded video stream, write the encoded video stream to the container, insert the Dolby configuration record in the container, and select the corresponding Dolby codec type for the Dolby configuration in the container; For static metadata, all static metadata are first cached in the encoder, and the static metadata is inserted into the video frames encoded as I frames of the encoded video stream; For dynamic metadata, the dynamic metadata is added to the corresponding coded frame.
4. A video transcoding device, characterized in that: include: A decoding module, used for decoding a source video stream of HDR media to obtain a decoded video stream; Searching for a decoded image corresponding to a preset frame of the decoded video stream, and obtaining metadata attached to the decoded image, wherein the metadata includes static metadata and dynamic metadata, wherein the static metadata includes color description metadata, CLL metadata, MDCV metadata, and Dolby Video configuration, and the dynamic metadata includes HDR10+ dynamic metadata and Dolby Vision dynamic metadata; a metadata processing module, configured to adjust the corresponding metadata according to an operation consistent with the processing operation based on the processing operation of the decoded video stream, when the processing operation is an image transformation for changing pixel positions of the entire decoded image or a selected area of the decoded image; and to delete the metadata and output a warning message when the processing operation is an unsupported picture conversion and the metadata includes a selected area, wherein the warning message includes information on changes in image display quality during HDR transcoding, and the warning message is used to indicate a reduction in distortion of the image caused by applying dynamic metadata to an erroneous area; An encoding module, used for encoding the decoded video stream and embedding the metadata into the encoded video stream; The metadata processing module is specifically used to update the processing window parameters of the metadata to modify and correct the metadata.
5. The video transcoding device according to claim 4, characterized in that: The processing operations on the decoded video stream include: changing the size or position of pixels in the picture, and scaling, cropping, rotating and mirroring the image. The metadata processing module adjusts the corresponding metadata based on the processing operations on the decoded video stream.
6. An electronic device, characterized in that: The electronic device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the following method steps when executed by the processor: A decoded video stream and corresponding metadata obtained by receiving a decoder decoding a source video stream, wherein the receiving decoded video stream and corresponding metadata obtained by decoding a source video stream by the decoder includes: decoding a source video stream of HDR media to obtain a decoded video stream; searching for a decoded image corresponding to a preset frame of the decoded video stream to obtain metadata attached to the decoded image, wherein the metadata includes static metadata and dynamic metadata, wherein the static metadata includes color description metadata, CLL metadata, MDCV metadata, and Dolby Video configuration, and the dynamic metadata includes HDR10+ dynamic metadata and Dolby Vision dynamic metadata; Based on a processing operation on the decoded video stream, in a case where the processing operation is an image transformation that changes pixel positions on the entire decoded image or a selected area of the decoded image, adjusting the corresponding metadata according to an operation consistent with the processing operation, the metadata specifying pixel coordinates of an image frame of the decoded video stream; in a case where the processing operation is an unsupported picture conversion and the metadata includes a selected area, deleting the metadata and outputting a warning message, the warning message including information on changes in image display quality during HDR transcoding, the warning message being used to indicate reducing distortion of the image caused by applying dynamic metadata to an erroneous area; Sending the metadata to an encoder to encode the decoded video stream, embedding the metadata into the encoded video stream; The metadata corresponding to the adjustment includes: The processing window parameters of the metadata are updated to modify and correct the metadata.
7. The electronic device according to claim 6, characterized in that: The processing operations on the decoded video stream include: changing the size or position of pixels in the picture, and scaling, cropping, rotating and mirroring the image. Based on the processing operations on the decoded video stream, the corresponding metadata is adjusted accordingly.
